diff --git a/ChangeLog b/ChangeLog index 0483767ac50..6f48691d299 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,7 +8,10 @@ For Users: NEW: Module MO (Manufacturing Order) is available as stable module. For Developers or integrators: - +* A new way to navigate between pages in list is available. To use it, you must + - replace $page = GETPOST('page', 'int') with $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); + - remove input field in form '';' + - add parameter $pagenavastextinput to value 1 when calling print_barre_liste WARNING: diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 0335e203049..d7a8d025e21 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -108,7 +108,7 @@ $userid = GETPOST('userid', 'int'); $begin = GETPOST('begin'); if (!$sortorder) $sortorder = "ASC"; if (!$sortfield) $sortfield = "p.lastname"; -if (empty($page) || $page < 0) { $page = 0; } +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } $offset = $limit * $page; $titre = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("ListOfContacts") : $langs->trans("ListOfContactsAddresses")); @@ -497,11 +497,11 @@ print ''; print ''; print ''; print ''; -print ''; +//print ''; print ''; print ''; -print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'address', 0, $newcardbutton, '', $limit); +print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'address', 0, $newcardbutton, '', $limit, 0, 0, 1); $topicmail = "Information"; $modelmail = "contact"; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8434755bef1..d544ffd6949 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4361,7 +4361,8 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', if ($cpt == $page) { $pagelist .= ''; - if (($cpt + 1) < $nbpages) $pagelist .= '/'; + $pagelist .= '/'; + //if (($cpt + 1) < $nbpages) $pagelist .= '/'; } } else { if ($cpt == $page) @@ -4386,9 +4387,9 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', } } else { //var_dump($page.' '.$cpt.' '.$nbpages); - if (($page + 1) < $nbpages) { + //if (($page + 1) < $nbpages) { $pagelist .= ''; - } + //} } } else diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index bf261a8076e..04ad577bff9 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -111,7 +111,7 @@ $sortorder = GETPOST("sortorder", 'alpha'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (!$sortorder) $sortorder = "ASC"; if (!$sortfield) $sortfield = "s.nom"; -if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1;