Merge pull request #3454 from hregis/3.7_bug3

Fix: problem with pagination
This commit is contained in:
Juanjo Menent 2015-09-04 18:22:23 +02:00
commit ecf80249d1

View File

@ -57,6 +57,9 @@ $texte = '';
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
if ($page == -1) { $page = 0; }
$limit = $conf->liste_limit;
$offset = $limit * $page ;
if (!$sortfield) {
$sortfield = 'p.ref';
@ -65,11 +68,6 @@ if (!$sortfield) {
if (!$sortorder) {
$sortorder = 'ASC';
}
$limit = $conf->liste_limit;
$offset = $limit * $page ;
// Force limit to no (currently solution to solve loosing selection when using pagination. No pagination on this page)
$limit = 0;
/*
@ -309,7 +307,7 @@ if ($usevirtualstock)
}
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit, $offset);
$sql.= $db->plimit($limit + 1, $offset);
//print $sql;
$resql = $db->query($sql);