Fix pagination on account list page

This commit is contained in:
Laurent Destailleur 2017-09-06 19:53:28 +02:00
parent b4abb7151f
commit 7c2c496823
3 changed files with 15 additions and 11 deletions

View File

@ -190,13 +190,14 @@ if ($resql)
{
$num = $db->num_rows($resql);
$params='';
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($search_account) $params.= '&search_account='.urlencode($search_account);
if ($search_label) $params.= '&search_label='.urlencode($search_label);
if ($search_accountparent) $params.= '&search_accountparent='.urlencode($search_accountparent);
if ($search_pcgtype) $params.= '&search_pcgtype='.urlencode($search_pcgtype);
if ($search_pcgsubtype) $params.= '&search_pcgsubtype='.urlencode($search_pcgsubtype);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_account) $param.= '&search_account='.urlencode($search_account);
if ($search_label) $param.= '&search_label='.urlencode($search_label);
if ($search_accountparent) $param.= '&search_accountparent='.urlencode($search_accountparent);
if ($search_pcgtype) $param.= '&search_pcgtype='.urlencode($search_pcgtype);
if ($search_pcgsubtype) $param.= '&search_pcgsubtype='.urlencode($search_pcgsubtype);
if ($optioncss != '') $param.='&optioncss='.$optioncss;
@ -212,7 +213,7 @@ if ($resql)
$htmlbuttonadd = '<a class="butAction" href="./card.php?action=create">' . $langs->trans("Addanaccount") . '</a>';
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $htmlbuttonadd);
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $htmlbuttonadd, '', $limit);
// Box to select active chart of account
print $langs->trans("Selectchartofaccounts") . " : ";

View File

@ -201,9 +201,10 @@ function journalHead($nom,$variante,$period,$periodlink,$description,$builddate,
$head[$h][1] = $langs->trans("Journalization");
$head[$h][2] = 'journal';
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].$varlink.'">';
dol_fiche_head($head, 'journal');
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].$varlink.'">';
foreach($moreparam as $key => $value)
{
print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
@ -251,12 +252,12 @@ function journalHead($nom,$variante,$period,$periodlink,$description,$builddate,
print '</table>';
print '<br><div class="center"><input type="submit" class="button" name="submit" value="'.$langs->trans("Refresh").'"></div>';
dol_fiche_end();
print '<div class="center"><input type="submit" class="button" name="submit" value="'.$langs->trans("Refresh").'"></div>';
print '</form>';
dol_fiche_end();
print "\n<!-- fin cartouche journal -->\n\n";
}

View File

@ -3595,7 +3595,9 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
$pagelist.= '<li'.(($conf->dol_use_jmobile != 4)?' class="pagination"':'').'><span '.(($conf->dol_use_jmobile != 4)?'class="active"':'').'>'.($page+1)."</li>";
}
}
print_fleche_navigation($page, $file, $options, $nextpage, $pagelist, $morehtml, $savlimit, $totalnboflines, $hideselectlimit); // output the div and ul for previous/last completed with page numbers into $pagelist
print '</td>';
print '</tr></table>'."\n";