Fix navigation

This commit is contained in:
Laurent Destailleur 2023-03-11 11:39:08 +01:00
parent 5f1a1e62e6
commit e7192e9814
2 changed files with 6 additions and 4 deletions

View File

@ -5435,6 +5435,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '',
if ($limit < 0) {
$limit = $conf->liste_limit;
}
if ($savlimit != 0 && (($num > $limit) || ($num == -1) || ($limit == 0))) {
$nextpage = 1;
} else {
@ -5475,7 +5476,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '',
}
// Show navigation bar
$pagelist = '';
if ($savlimit != 0 && ($page > 0 || $num > $limit)) {
if ($savlimit != 0 && ((int) $page > 0 || $num > $limit)) {
if ($totalnboflines) { // If we know total nb of lines
// Define nb of extra page links before and after selected page + ... + first or last
$maxnbofpage = (empty($conf->dol_optimize_smallscreen) ? 4 : 0);
@ -5535,8 +5536,8 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '',
}
}
if ($savlimit || $morehtmlright || $morehtmlrightbeforearrow) {
print_fleche_navigation($page, $file, $options, $nextpage, $pagelist, $morehtmlright, $savlimit, $totalnboflines, $hideselectlimit, $morehtmlrightbeforearrow); // output the div and ul for previous/last completed with page numbers into $pagelist
if (($savlimit || $morehtmlright || $morehtmlrightbeforearrow) && empty($hidenavigation)) {
print_fleche_navigation((int) $page, $file, $options, $nextpage, $pagelist, $morehtmlright, $savlimit, $totalnboflines, $hideselectlimit, $morehtmlrightbeforearrow); // output the div and ul for previous/last completed with page numbers into $pagelist
}
// js to autoselect page field on focus

View File

@ -50,7 +50,8 @@ function report_header($reportname, $notused, $period, $periodlink, $description
$title = $langs->trans("Report");
print_barre_liste($title, '', '');
print_barre_liste($title, 0, '', '', '', '', '', -1, '', 'generic', 0, '', '', -1, 1, 1);
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].$varlink.'">'."\n";
print '<input type="hidden" name="token" value="'.newToken().'">'."\n";