diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 099d65f7f95..6d31fbc52f6 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1088,7 +1088,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu } if (! empty($conf->propal->enabled)) { - $newmenu->add("/product/popuprop.php?leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire && $user->rights->propale->lire); + $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire && $user->rights->propale->lire); } } @@ -1100,7 +1100,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/product/list.php?leftmenu=service&type=1", $langs->trans("List"), 1, $user->rights->service->lire); if (! empty($conf->propal->enabled)) { - $newmenu->add("/product/popuprop.php?leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->rights->service->lire && $user->rights->propale->lire); + $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->rights->service->lire && $user->rights->propale->lire); } } diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index c8da665dd98..aad606627cb 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -38,18 +38,16 @@ $type=GETPOST("type","int"); if (! empty($user->societe_id)) $socid=$user->societe_id; $result=restrictedArea($user,'produit|service'); +$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page < 0) $page = 0; +if ($page == -1) { $page = 0; } if (! $sortfield) $sortfield="c"; if (! $sortorder) $sortorder="DESC"; - -$conf->liste_limit = 3; - -if ($page == -1) $page = 0; -$limit = $conf->liste_limit; $offset = $limit * $page ; +$pageprev = $page - 1; +$pagenext = $page + 1; $staticproduct=new Product($db); @@ -69,7 +67,13 @@ if ($type == '0') else if ($type == '1') { $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; - $title=$langs->trans("StatisticsOfServices"); + //$title=$langs->trans("StatisticsOfServices"); + $title=$langs->trans("Statistics"); +} +else +{ + $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; + //$title=$langs->trans("StatisticsOfProductsOrServices"); $title=$langs->trans("Statistics"); } @@ -80,24 +84,30 @@ print load_fiche_titre($title, $mesg,'title_products.png'); $param = ''; $title = $langs->trans("ListProductServiceByPopularity"); -if ($type != '') { - $param = '&type='.$type; - - if ($type == 1) { - $title = $langs->trans("ListServiceByPopularity"); - } else { - $title = $langs->trans("ListProductByPopularity"); - } +if ((string) $type == '1') { + $title = $langs->trans("ListServiceByPopularity"); } +if ((string) $type == '0') { + $title = $langs->trans("ListProductByPopularity"); +} + +if ($type != '') $param .= '&type='.$type; + $h=0; $head = array(); -$head[$h][0] = $_SERVER['PHP_SELF']; -$head[$h][1] = $title; -$head[$h][2] = 'product'; + +$head[$h][0] = DOL_URL_ROOT.'/product/stats/card.php?id=all'; +$head[$h][1] = $langs->trans("Chart"); +$head[$h][2] = 'chart'; $h++; -dol_fiche_head($head,'product',$langs->trans("Statistics")); +$head[$h][0] = $_SERVER['PHP_SELF']; +$head[$h][1] = $title; +$head[$h][2] = 'popularityprop'; +$h++; + +dol_fiche_head($head,'popularityprop',$langs->trans("Statistics")); @@ -127,15 +137,15 @@ if ($result) $num = $db->num_rows($result); $i = 0; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,"",$num, $totalnboflines, ''); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $totalnboflines, ''); print '