diff --git a/htdocs/product/list.php b/htdocs/product/list.php index c25c4c1ce0a..f69adcfc8dd 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -270,14 +270,13 @@ else $reshook=$hookmanager->executeHooks('printFieldSelect',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; //if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet - $nbtotalofrecords = 0; + $sql.= $db->order($sortfield,$sortorder); + $nbtotalofrecords = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); } - - $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index bebfc87b528..58f95625d94 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -37,13 +37,13 @@ $search_label=GETPOST("snom","alpha")?GETPOST("snom","alpha"):GETPOST("search_la $sall=GETPOST("sall","alpha"); $search_status=GETPOST("search_status","int"); +$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield"); $sortorder = GETPOST("sortorder"); if (! $sortfield) $sortfield="e.label"; if (! $sortorder) $sortorder="ASC"; $page = GETPOST("page"); if ($page < 0) $page = 0; -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page; $year = strftime("%Y",time()); @@ -107,14 +107,17 @@ if ($result) $help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; llxHeader("",$langs->trans("ListOfWarehouses"),$help_url); - print_barre_liste($langs->trans("ListOfWarehouses"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num, $totalnboflines); - - print '