Skip to content

Commit

Permalink
harmonize propal index pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe Battarel committed Mar 11, 2019
1 parent 519672c commit be612a1
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 34 deletions.
62 changes: 39 additions & 23 deletions htdocs/comm/index.php
Expand Up @@ -159,12 +159,13 @@
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<th colspan="3">'.$langs->trans("ProposalsDraft").($num?' <span class="badge">'.$num.'</span>':'').'</th></tr>';
print '<th colspan="3">'.$langs->trans("ProposalsDraft").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=0"><span class="badge">'.$num.'</span></a></th></tr>';

if ($num > 0)
{
$i = 0;
while ($i < $num)
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?5:$conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop)
{
$obj = $db->fetch_object($resql);

Expand All @@ -190,10 +191,13 @@
$i++;
$total += $obj->total_ht;
}
if ($total>0)
if ($num > $nbofloop)
{

print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" class="right">'.price($total)."</td></tr>";
print '<tr class="liste_total"><td colspan="3" align="right">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
}
elseif ($total>0)
{
print '<tr class="liste_total"><td colspan="2" align="right">'.$langs->trans("Total").'</td><td class="right">'.price($total)."</td></tr>";
}
}
else
Expand Down Expand Up @@ -245,7 +249,8 @@
if ($num > 0)
{
$i = 0;
while ($i < $num)
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?5:$conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop)
{
$obj = $db->fetch_object($resql);

Expand All @@ -270,9 +275,13 @@
$i++;
$total += $obj->total_ht;
}
if ($total>0)
if ($num > $nbofloop)
{
print '<tr class="liste_total"><td colspan="3" align="right">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
}
elseif ($total>0)
{
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" class="right">'.price($total)."</td></tr>";
print '<tr class="liste_total"><td align="right">'.$langs->trans("Total").'</td><td colspan="2" class="right">'.price($total)."</td></tr>";
}
}
else
Expand Down Expand Up @@ -322,9 +331,9 @@
if ($num > 0)
{
$i = 0;
while ($i < $num)
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?5:$conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop)
{

$obj = $db->fetch_object($resql);
print '<tr class="oddeven"><td class="nowrap">';
$orderstatic->id=$obj->rowid;
Expand Down Expand Up @@ -353,10 +362,13 @@
$i++;
$total += $obj->total_ttc;
}
if ($total>0)
if ($num > $nbofloop)
{

print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" class="right">'.price($total)."</td></tr>";
print '<tr class="liste_total"><td colspan="3" align="right">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
}
elseif ($total>0)
{
print '<tr class="liste_total"><td align="right">'.$langs->trans("Total").'</td><td colspan="2" class="right">'.price($total)."</td></tr>";
}
}
else
Expand Down Expand Up @@ -409,7 +421,8 @@
if ($num > 0)
{
$i = 0;
while ($i < $num)
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?5:$conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop)
{

$obj = $db->fetch_object($resql);
Expand Down Expand Up @@ -440,10 +453,13 @@
$i++;
$total += $obj->total_ttc;
}
if ($total>0)
if ($num > $nbofloop)
{
print '<tr class="liste_total"><td colspan="3" align="right">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
}
elseif ($total>0)
{

print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" class="right">'.price($total)."</td></tr>";
print '<tr class="liste_total"><td align="right">'.$langs->trans("Total").'</td><td colspan="2" class="right">'.price($total)."</td></tr>";
}
}
else
Expand Down Expand Up @@ -700,7 +716,7 @@
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><th colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=1"><span class="badge">'.$num.'</span></th></tr>';

$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD));
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?5:$conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop)
{
$obj = $db->fetch_object($result);
Expand Down Expand Up @@ -757,11 +773,11 @@
}
if ($num > $nbofloop)
{
print '<tr class="liste_total"><td colspan="5">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
print '<tr class="liste_total"><td colspan="5" align="right">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
}
elseif ($total>0)
{
print '<tr class="liste_total"><td colspan="3">'.$langs->trans("Total")."</td><td class=\"right\">".price($total)."</td><td>&nbsp;</td></tr>";
print '<tr class="liste_total"><td colspan="3" align="right">'.$langs->trans("Total")."</td><td class=\"right\">".price($total)."</td><td>&nbsp;</td></tr>";
}
print "</table>";
print "</div><br>";
Expand Down Expand Up @@ -804,7 +820,7 @@
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><th class="liste_titre" colspan="5">'.$langs->trans("OrdersOpened").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=1"><span class="badge">'.$num.'</span></th></tr>';

$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD));
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?5:$conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop)
{
$obj = $db->fetch_object($result);
Expand Down Expand Up @@ -861,11 +877,11 @@
}
if ($num > $nbofloop)
{
print '<tr class="liste_total"><td colspan="5">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
print '<tr class="liste_total"><td colspan="5" align="right">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
}
elseif ($total>0)
{
print '<tr class="liste_total"><td colspan="3">'.$langs->trans("Total")."</td><td class=\"right\">".price($total)."</td><td>&nbsp;</td></tr>";
print '<tr class="liste_total"><td colspan="3" align="right">'.$langs->trans("Total")."</td><td class=\"right\">".price($total)."</td><td>&nbsp;</td></tr>";
}
print "</table>";
print "</div><br>";
Expand Down
32 changes: 21 additions & 11 deletions htdocs/comm/propal/index.php
Expand Up @@ -172,16 +172,18 @@
$resql=$db->query($sql);
if ($resql)
{
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("DraftPropals").'</td></tr>';
$langs->load("propal");
$num = $db->num_rows($resql);
if ($num)
{
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
$langs->load("propal");
print '<td colspan="2">'.$langs->trans("DraftPropals").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=0"><span class="badge">'.$num.'</span></a></td></tr>';

$i = 0;
while ($i < $num)
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?5:$conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop)
{
$obj = $db->fetch_object($resql);
print '<tr class="oddeven">';
Expand All @@ -199,9 +201,17 @@
print '</tr>';
$i++;
}
if ($num > $nbofloop)
{
print '<tr class="liste_total"><td colspan="2" align="right">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
}
elseif ($total>0)
{
print '<tr class="liste_total"><td align="right">'.$langs->trans("Total").'</td><td align="right">'.price($total)."</td></tr>";
}
print "</table>";
print "</div><br>";
}
print "</table>";
print "</div><br>";
}
}

Expand Down Expand Up @@ -320,7 +330,7 @@
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=1"><span class="badge">'.$num.'</span></a></td></tr>';

$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD));
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?5:$conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop)
{
$obj = $db->fetch_object($result);
Expand Down Expand Up @@ -365,11 +375,11 @@
}
if ($num > $nbofloop)
{
print '<tr class="liste_total"><td colspan="5">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
print '<tr class="liste_total"><td colspan="5" align="right">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
}
elseif ($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 '<tr class="liste_total"><td colspan="3" align="right">'.$langs->trans("Total")."</td><td align=\"right\">".price($total)."</td><td>&nbsp;</td></tr>";
}
print "</table>";
print "</div><br>";
Expand Down

0 comments on commit be612a1

Please sign in to comment.