Fix: Add a limit into list to avoid browser to hang when database is too

large.
This commit is contained in:
Laurent Destailleur 2014-01-09 14:28:32 +01:00
parent d4db5916f0
commit 2b4f0bd4b1
5 changed files with 24 additions and 7 deletions

View File

@ -4,7 +4,8 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.4.3 compared to 3.4.2 *****
Fix: Bad get of localtaxes into contracts add lines
Fix: Bad get of localtaxes into contracts add lines.
Fix: Add a limit into list to avoid browser to hang when database is too large.
***** ChangeLog for 3.4.2 compared to 3.4.1 *****
Fix: field's problem into company's page (RIB).

View File

@ -473,8 +473,10 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("ProposalsOpened").'</td></tr>';
while ($i < $num)
print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal.php?viewstatut=1">('.$num.')</td></tr>';
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?1000:$conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop)
{
$obj = $db->fetch_object($result);
$var=!$var;
@ -511,7 +513,12 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
$i++;
$total += $obj->total_ttc;
}
if ($total>0) {
if ($num > $nbofloop)
{
print '<tr class="liste_total"><td colspan="5">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
}
else if ($total>0)
{
print '<tr class="liste_total"><td colspan="3">'.$langs->trans("Total")."</td><td align=\"right\">".price($total)."</td><td>&nbsp;</td></tr>";
}
print "</table><br>";

View File

@ -301,7 +301,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND s.rowid = ".$socid;
$sql.= " ORDER BY p.rowid DESC";
$result=$db->query($sql);
if ($result)
{
@ -314,7 +314,9 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal.php?viewstatut=1">('.$num.')</a></td></tr>';
while ($i < $num)
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?1000:$conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop)
{
$obj = $db->fetch_object($result);
$var=!$var;
@ -356,7 +358,12 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
$i++;
$total += $obj->total_ttc;
}
if ($total>0) {
if ($num > $nbofloop)
{
print '<tr class="liste_total"><td colspan="5">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
}
else if ($total>0)
{
print '<tr class="liste_total"><td colspan="3">'.$langs->trans("Total")."</td><td align=\"right\">".price($total)."</td><td>&nbsp;</td></tr>";
}
print "</table><br>";

View File

@ -659,6 +659,7 @@ from=from
toward=toward
Access=Access
SetDemandReason=Set source
XMoreLines=%s line(s) hidden
# Week day
Monday=Monday

View File

@ -657,6 +657,7 @@ from=de
toward=vers
Access=Accès
SetDemandReason=Définir l'origine
XMoreLines=%s ligne(s) non affichée(s)
# Week day
Monday=Lundi