Skip to content

Commit

Permalink
Fix: problem with pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
hregis committed Sep 2, 2015
1 parent 5ef3c51 commit 1a08f65
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions htdocs/product/stock/replenish.php
Expand Up @@ -57,6 +57,9 @@
$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';
Expand All @@ -65,11 +68,6 @@
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;


/*
Expand Down Expand Up @@ -309,7 +307,7 @@
}

$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit, $offset);
$sql.= $db->plimit($limit + 1, $offset);

//print $sql;
$resql = $db->query($sql);
Expand Down

0 comments on commit 1a08f65

Please sign in to comment.