clean and update code

This commit is contained in:
Philippe GRAND 2018-06-27 12:37:31 +02:00
parent 30c1b20eea
commit a952b46d8b
15 changed files with 2 additions and 47 deletions

View File

@ -648,7 +648,6 @@ if ($ok && GETPOST('clean_orphelin_dir','alpha'))
$object_instance=new ChargeSociales($db);
}
$var=true;
foreach($filearray as $key => $file)
{
if (!is_dir($file['name'])

View File

@ -604,11 +604,8 @@ else
print '<td align="center">'.$langs->trans("QtyReceived").'</td>';
print "</tr>\n";
}
$var=true;
while ($i < $num_prod)
{
print '<tr class="oddeven">';
if ($object->lines[$i]->fk_product > 0)
{

View File

@ -104,7 +104,6 @@ if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
$var=true;
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
@ -167,7 +166,6 @@ if ($resql)
$loan_static->ref = $obj->rowid;
$loan_static->label = $obj->label;
$var = !$var;
print '<tr class="oddeven">';
// Ref

View File

@ -129,11 +129,9 @@ print '<td colspan="2" align="center">'.$langs->trans("Value").'</td>'."\n";
print '<td align="left">'.$langs->trans("Description").'</td>'."\n";
print '</tr>';
$var=true;
$form = new Form($db);
// GLOBAL DISCOUNT MANAGEMENT
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"typemarges\">";
@ -165,7 +163,6 @@ print '</tr>';
print '</form>';
// DISPLAY MARGIN RATES
print '<tr class="oddeven">';
print '<td>'.$langs->trans("DisplayMarginRates").'</td>';
print '<td colspan="2" align="center">';
@ -189,7 +186,6 @@ print '<td>'.$langs->trans('MarginRate').' = '.$langs->trans('Margin').' / '.$la
print '</tr>';
// DISPLAY MARK RATES
print '<tr class="oddeven">';
print '<td>'.$langs->trans("DisplayMarkRates").'</td>';
print '<td colspan="2" align="center">';
@ -259,7 +255,6 @@ print '</tr>';
print '</form>';
// INTERNAL CONTACT TYPE USED AS COMMERCIAL AGENT
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"contact\">";

View File

@ -208,7 +208,6 @@ if ($result)
if ($num > 0)
{
$var=true;
while ($i < $num /*&& $i < $conf->liste_limit*/)
{
@ -229,8 +228,6 @@ if ($result)
$markRate = ($pv != 0)?(100 * $marge / $pv):'' ;
}
print '<tr class="oddeven">';
if ($agentid > 0) {
$companystatic->id=$objp->socid;

View File

@ -127,7 +127,6 @@ if ($mode == 'setup' && $user->admin)
print $langs->trans("PrintingDriverDesc".$driver)."<br><br>\n";
print '<table class="noborder" width="100%">'."\n";
$var=true;
print '<tr class="liste_titre">';
print '<th>'.$langs->trans("Parameters").'</th>';
print '<th>'.$langs->trans("Value").'</th>';
@ -146,7 +145,6 @@ if ($mode == 'setup' && $user->admin)
$submit_enabled=0;
foreach ($printer->conf as $key)
{
switch ($key['type']) {
case "text":
case "password":
@ -248,7 +246,6 @@ if ($mode == 'config' && $user->admin)
print '<table class="noborder" width="100%">'."\n";
$var=true;
print '<tr class="liste_titre">';
print '<th>'.$langs->trans("Description").'</th>';
print '<th class="center">'.$langs->trans("Active").'</th>';
@ -333,7 +330,6 @@ if ($mode == 'userconf' && $user->admin)
print $langs->trans('PrintUserConfDesc'.$driver)."<br><br>\n";
print '<table class="noborder" width="100%">';
$var=true;
print '<tr class="liste_titre">';
print '<th>'.$langs->trans("User").'</th>';
print '<th>'.$langs->trans("PrintModule").'</th>';

View File

@ -401,7 +401,6 @@ print "</tr>\n";
clearstatcache();
$var=true;
foreach ($dirmodels as $reldir)
{
foreach (array('','/doc') as $valdir)
@ -438,7 +437,6 @@ foreach ($dirmodels as $reldir)
if ($modulequalified)
{
$var = !$var;
print '<tr class="oddeven"><td width="100">';
print (empty($module->name)?$name:$module->name);
print "</td><td>\n";
@ -524,12 +522,10 @@ print "<br>";
print load_fiche_titre($langs->trans("ProductOtherConf"), '', '');
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="other">';
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
@ -569,7 +565,6 @@ print '</tr>';
// multiprix nombre de prix a proposer
if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))
{
print '<tr class="oddeven">';
print '<td>'.$langs->trans("MultiPricesNumPrices").'</td>';
print '<td align="right"><input size="3" type="text" class="flat" name="value_PRODUIT_MULTIPRICES_LIMIT" value="'.$conf->global->PRODUIT_MULTIPRICES_LIMIT.'"></td>';
@ -611,7 +606,6 @@ print '</tr>';
if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT))
{
print '<tr class="oddeven">';
print '<td>'.$langs->trans("NumberOfProductShowInSelect").'</td>';
print '<td align="right"><input size="3" type="text" class="flat" name="value_PRODUIT_LIMIT_SIZE" value="'.$conf->global->PRODUIT_LIMIT_SIZE.'"></td>';
@ -619,7 +613,6 @@ if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT))
}
// Visualiser description produit dans les formulaires activation/desactivation
print '<tr class="oddeven">';
print '<td>'.$langs->trans("ViewProductDescInFormAbility").'</td>';
print '<td width="60" align="right">';
@ -652,7 +645,6 @@ print '</tr>';
// View product description in thirdparty language
if (! empty($conf->global->MAIN_MULTILANGS))
{
print '<tr class="oddeven">';
print '<td>'.$langs->trans("ViewProductDescInThirdpartyLanguageAbility").'</td>';
print '<td width="60" align="right">';

View File

@ -294,8 +294,6 @@ if (empty($mysoc->country_code))
else
{
$var=true;
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
print '<input type="hidden" name="action" value="convert" />';

View File

@ -89,10 +89,9 @@ if (empty($conf) || ! is_object($conf))
<!-- FIELDS DATA -->
<?php
$var=true;
foreach($datas as $line) {
?>
<tr <?php echo $bc[$var]; ?>>
<tr class="oddeven">
<?php
foreach($line as $key => $value) {
foreach($fieldlist as $field) {

View File

@ -551,7 +551,6 @@ if ($id > 0 || ! empty($ref))
{
$num = $db->num_rows($resql);
$i=0;
$var=true;
if($num == 0) print '<tr><td colspan="4">'.$langs->trans("NoMatchFound").'</td></tr>';
@ -655,7 +654,6 @@ if ($id > 0 || ! empty($ref))
print '</form>';
}
}
}

View File

@ -759,12 +759,9 @@ SCRIPT;
if (is_array($product_fourn_list))
{
$var=true;
foreach($product_fourn_list as $productfourn)
{
print '<tr class="oddeven">';
// Supplier

View File

@ -457,8 +457,6 @@ function activitytrim($product_type)
}
$i = 0;
$var=true;
while ($i < $num)
{
$objp = $db->fetch_object($result);
@ -466,7 +464,6 @@ function activitytrim($product_type)
{
if ($trim1+$trim2+$trim3+$trim4 > 0)
{
print '<tr class="oddeven"><td align=left>'.$tmpyear.'</td>';
print '<td align=right>'.price($trim1).'</td>';
print '<td align=right>'.price($trim2).'</td>';
@ -500,7 +497,6 @@ function activitytrim($product_type)
}
if ($trim1+$trim2+$trim3+$trim4 > 0)
{
print '<tr class="oddeven"><td align=left>'.$tmpyear.'</td>';
print '<td align=right>'.price($trim1).'</td>';
print '<td align=right>'.price($trim2).'</td>';

View File

@ -334,8 +334,6 @@ $buttonrecordnoent=$langs->transnoentitiesnoconv("RecordMovement");
print '<span class="opacitymedium">'.$langs->trans("SelectProductInAndOutWareHouse",$titletoaddnoent,$buttonrecordnoent).'</span><br>';
print '<br>'."\n";
$var=true;
// Form to add a line
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formulaire">';
print '<input type="hidden" name="token" value="' .$_SESSION['newtoken'] . '">';
@ -402,8 +400,6 @@ print '</tr>';
foreach($listofdata as $key => $val)
{
$productstatic->fetch($val['id_product']);
$warehousestatics->fetch($val['id_sw']);
$warehousestatict->fetch($val['id_tw']);

View File

@ -396,14 +396,12 @@ if ($resql)
$productlot = new Productlot($db);
$i=0;
$var=true;
$totalarray=array();
while ($i < min($num, $limit))
{
$obj = $db->fetch_object($resql);
if ($obj)
{
$var = !$var;
$productlot->id = $obj->rowid;
$productlot->batch = $obj->batch;

View File

@ -36,12 +36,11 @@ $langs = $GLOBALS['langs'];
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
$total=0; $ilink=0;
$var=true;
foreach($linkedObjectBlock as $key => $objectlink)
{
$ilink++;
$trclass=($var?'pair':'impair');
$trclass='oddeven';
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?>
<tr class="<?php echo $trclass; ?>">