From abcbc5c0dab9a49daea3430b370a744fc27e1224 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Mar 2016 10:45:14 +0200 Subject: [PATCH] Fix limit management --- htdocs/fourn/commande/list.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index b2d6668266f..799766c5775 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -62,6 +62,17 @@ $orderid = GETPOST('orderid'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'fournisseur', $orderid, '', 'commande'); +$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page",'int'); +if ($page == -1) { $page = 0; } +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortfield) $sortfield='cf.ref'; +if (! $sortorder) $sortorder='DESC'; + // Purge search criteria if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers {