clean and update code

This commit is contained in:
Philippe GRAND 2018-06-20 12:09:47 +02:00
parent a73296e212
commit 4f554ab52a
9 changed files with 7 additions and 27 deletions

View File

@ -76,8 +76,6 @@ if ($action == 'add')
$module=GETPOST("module");
$result=-1;
$var=true;
foreach ($modulesdir as $dir)
{
// Load modules attributes in arrays (name, numero, orders) from dir directory
@ -278,8 +276,6 @@ if ($object->fetch($id) >= 0)
clearstatcache();
$var = true;
foreach ($modulesdir as $dir)
{
$modulenames=array();
@ -332,16 +328,15 @@ if ($object->fetch($id) >= 0)
// Si le module mailing est qualifie
if ($qualified)
{
$var = !$var;
if ($allowaddtarget)
{
print '<form '.$bctag[$var].' name="'.$modulename.'" action="'.$_SERVER['PHP_SELF'].'?action=add&id='.$object->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';
print '<form class="oddeven" name="'.$modulename.'" action="'.$_SERVER['PHP_SELF'].'?action=add&id='.$object->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
}
else
{
print '<div '.$bctag[$var].'>';
print '<div class="oddeven">';
}
print '<div class="tagtd">';

View File

@ -92,8 +92,6 @@ print "<td>".$langs->trans("Value")."</td>";
print "<td>".$langs->trans("Examples")."</td>";
print "</tr>";
$var=true;
print '<tr class="oddeven">';
print '<td class="fieldrequired">'.$langs->trans("Label")."</td>";

View File

@ -1403,7 +1403,6 @@ else if ($id > 0 || ! empty($ref))
print '<td class="liste_titre">&nbsp;</td>';
print "</tr>\n";
}
$var=true;
while ($i < $num)
{
$objp = $db->fetch_object($resql);

View File

@ -143,13 +143,11 @@ if ($resql)
print '</td></tr>';
}
$var=true;
$bool=false;
foreach ($listofstatus as $status)
{
if (! $conf->use_javascript_ajax)
{
print '<tr class="oddeven">';
print '<td>'.$fichinterstatic->LibStatut($status,$bool,0).'</td>';
print '<td align="right"><a href="list.php?viewstatut='.$status.'">'.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' ';
@ -198,10 +196,8 @@ if (! empty($conf->ficheinter->enabled))
if ($num)
{
$i = 0;
$var = true;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td class="nowrap">';
@ -248,7 +244,6 @@ if ($resql)
if ($num)
{
$i = 0;
$var = true;
while ($i < $num)
{
@ -319,10 +314,8 @@ if (! empty($conf->ficheinter->enabled))
if ($num)
{
$i = 0;
$var = true;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td class="nowrap" width="20%">';

View File

@ -285,7 +285,7 @@ print '<td align="right">%</td>';
print '</tr>';
$oldyear=0;
$var=true;
foreach ($data as $val)
{
$year = $val['year'];
@ -293,7 +293,7 @@ foreach ($data as $val)
{ // If we have empty year
$oldyear--;
print '<tr '.$bc[$var].' height="24">';
print '<tr class="oddeven" height="24">';
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&amp;mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
print '<td align="right">0</td>';
@ -306,7 +306,7 @@ foreach ($data as $val)
}
print '<tr '.$bc[$var].' height="24">';
print '<tr class="oddeven" height="24">';
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&amp;mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
print '<td align="right">'.$val['nb'].'</td>';
print '<td align="right" style="'.(($val['nb_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['nb_diff']).'</td>';

View File

@ -935,13 +935,11 @@ if ($resql)
$projectstatic=new Project($db);
$i=0;
$var=true;
$totalarray=array();
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($resql);
$objectstatic->id=$obj->rowid;
$objectstatic->ref=$obj->ref;
$objectstatic->ref_supplier = $obj->ref_supplier;

View File

@ -822,8 +822,6 @@ if ($resql)
if ($num > 0)
{
$i=0;
$var=true;
$totalarray=array();
while ($i < min($num,$limit))
{

View File

@ -146,7 +146,7 @@ if ($year)
print '<td align="right">'.$langs->trans("Size").'</td>';
print '<td align="right">'.$langs->trans("Date").'</td>';
print '</tr>';
$var=true;
if (is_resource($handle))
{
while (($file = readdir($handle))!==false)
@ -156,7 +156,7 @@ if ($year)
$tfile = $dir . '/'.$year.'/'.$file;
$relativepath = $year.'/'.$file;
print "<tr ".$bc[$var].">".'<td><a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart=facture_fournisseur&amp;file=payments/'.urlencode($relativepath).'">'.img_pdf().' '.$file.'</a></td>';
print '<tr class="oddeven">'.'<td><a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart=facture_fournisseur&amp;file=payments/'.urlencode($relativepath).'">'.img_pdf().' '.$file.'</a></td>';
print '<td align="right">'.dol_print_size(dol_filesize($tfile)).'</td>';
print '<td align="right">'.dol_print_date(dol_filemtime($tfile),"dayhour").'</td></tr>';
}

View File

@ -82,7 +82,6 @@ if ($socid > 0)
$resql=$db->query($sql);
if ($resql)
{
$var=true;
$num = $db->num_rows($resql);
print '<tr class="liste_titre">';