Fix: Restore a broken feature.

This commit is contained in:
Laurent Destailleur 2011-05-25 21:56:35 +00:00
parent 91ccc73180
commit a918f3bf11

View File

@ -143,7 +143,7 @@ if ($account || $_GET["ref"])
} }
else else
{ {
$viewline = 20; $viewline = empty($conf->global->MAIN_SIZE_LISTE_LIMIT)?20:$conf->global->MAIN_SIZE_LISTE_LIMIT;
} }
$acct = new Account($db); $acct = new Account($db);
if ($account) if ($account)
@ -212,7 +212,7 @@ if ($account || $_GET["ref"])
} }
if ($thirdparty) if ($thirdparty)
{ {
$sql_rech.=" AND (COALESCE(s.nom,'') LIKE '%".$db->escape($thirdparty)."%')"; $sql_rech.=" AND s.nom LIKE '%".$db->escape($thirdparty)."%')";
$param.='&thirdparty='.urlencode($thirdparty); $param.='&thirdparty='.urlencode($thirdparty);
$mode_search = 1; $mode_search = 1;
} }
@ -273,6 +273,7 @@ if ($account || $_GET["ref"])
$page = 0; $page = 0;
$limitsql = $nbline; $limitsql = $nbline;
} }
//print $limitsql.'-'.$page.'-'.$viewline;
// Onglets // Onglets
$head=bank_prepare_head($acct); $head=bank_prepare_head($acct);
@ -307,6 +308,7 @@ if ($account || $_GET["ref"])
$navig=''; $navig='';
$navig.='<form action="'.$_SERVER["PHP_SELF"].'" name="newpage" method="GET">'; $navig.='<form action="'.$_SERVER["PHP_SELF"].'" name="newpage" method="GET">';
$nbpage=floor($total_lines/$viewline)+($total_lines % $viewline > 0?1:0); // Nombre de page total $nbpage=floor($total_lines/$viewline)+($total_lines % $viewline > 0?1:0); // Nombre de page total
//print 'nbpage='.$nbpage.' viewline='.$viewline.' limitsql='.$limitsql;
if ($limitsql > $viewline) if ($limitsql > $viewline)
{ {
$navig.='<a href="account.php?'.$param.'&amp;page='.($page+1).'">'.img_previous().'</a>'; $navig.='<a href="account.php?'.$param.'&amp;page='.($page+1).'">'.img_previous().'</a>';
@ -326,7 +328,7 @@ if ($account || $_GET["ref"])
$navig.= '<a href="account.php?'.$param.'&amp;page='.($page-1).'">'.img_next().'</a>'; $navig.= '<a href="account.php?'.$param.'&amp;page='.($page-1).'">'.img_next().'</a>';
} }
$navig.='</form>'; $navig.='</form>';
//var_dump($navig);
// Confirmation delete // Confirmation delete
if ($action == 'delete') if ($action == 'delete')
@ -340,7 +342,7 @@ if ($account || $_GET["ref"])
print '<table class="notopnoleftnoright" width="100%">'; print '<table class="notopnoleftnoright" width="100%">';
// Show title // Show title
if ($action != 'addline' && $action =='delete') if ($action != 'addline' && $action != 'delete')
{ {
print '<tr><td colspan="9" align="right">'.$navig.'</td></tr>'; print '<tr><td colspan="9" align="right">'.$navig.'</td></tr>';
} }
@ -742,11 +744,11 @@ if ($account || $_GET["ref"])
/* /*
* Boutons actions * Boutons actions
*/ */
if ($action != 'delete') if ($action != 'delete')
{ {
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if ($acct->type != 2 && $acct->rappro) // If not cash account and can be reconciliate if ($acct->type != 2 && $acct->rappro) // If not cash account and can be reconciliate
{ {
if ($user->rights->banque->consolidate) if ($user->rights->banque->consolidate)
@ -758,7 +760,7 @@ if ($account || $_GET["ref"])
print "<a class=\"butActionRefused\" title=\"".$langs->trans("NotEnoughPermissions")."\" href=\"#\">".$langs->trans("Conciliate")."</a>"; print "<a class=\"butActionRefused\" title=\"".$langs->trans("NotEnoughPermissions")."\" href=\"#\">".$langs->trans("Conciliate")."</a>";
} }
} }
if ($action != 'addline') if ($action != 'addline')
{ {
if ($user->rights->banque->modifier) if ($user->rights->banque->modifier)
@ -770,10 +772,10 @@ if ($account || $_GET["ref"])
print "<a class=\"butActionRefused\" title=\"".$langs->trans("NotEnoughPermissions")."\" href=\"#\">".$langs->trans("AddBankRecord")."</a>"; print "<a class=\"butActionRefused\" title=\"".$langs->trans("NotEnoughPermissions")."\" href=\"#\">".$langs->trans("AddBankRecord")."</a>";
} }
} }
print '</div>'; print '</div>';
} }
print '<br>'; print '<br>';
} }