Skip to content
Snippets Groups Projects
Commit 1a08f659 authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: problem with pagination

parent 5ef3c517
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment