From a952b46d8b58c312ab3b39adb78d89dd9cb3b450 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 27 Jun 2018 12:37:31 +0200 Subject: [PATCH] clean and update code --- htdocs/install/repair.php | 1 - htdocs/livraison/card.php | 3 --- htdocs/loan/index.php | 2 -- htdocs/margin/admin/margin.php | 5 ----- htdocs/margin/agentMargins.php | 3 --- htdocs/printing/admin/printing.php | 4 ---- htdocs/product/admin/product.php | 8 -------- htdocs/product/admin/product_tools.php | 2 -- htdocs/product/canvas/product/tpl/list.tpl.php | 3 +-- htdocs/product/composition/card.php | 2 -- htdocs/product/fournisseurs.php | 3 --- htdocs/product/index.php | 4 ---- htdocs/product/stock/massstockmove.php | 4 ---- htdocs/product/stock/productlot_list.php | 2 -- htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php | 3 +-- 15 files changed, 2 insertions(+), 47 deletions(-) diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 896d6964bdd..97f9a71bb87 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -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']) diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php index d6cefb24d83..072c53aa3cb 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -604,11 +604,8 @@ else print ''.$langs->trans("QtyReceived").''; print "\n"; } - $var=true; while ($i < $num_prod) { - - print ''; if ($object->lines[$i]->fk_product > 0) { diff --git a/htdocs/loan/index.php b/htdocs/loan/index.php index 03e3ab482f4..660189fbc9d 100644 --- a/htdocs/loan/index.php +++ b/htdocs/loan/index.php @@ -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 ''; // Ref diff --git a/htdocs/margin/admin/margin.php b/htdocs/margin/admin/margin.php index d37dfe0c83b..eaa53aa8490 100644 --- a/htdocs/margin/admin/margin.php +++ b/htdocs/margin/admin/margin.php @@ -129,11 +129,9 @@ print ''.$langs->trans("Value").''."\n"; print ''.$langs->trans("Description").''."\n"; print ''; -$var=true; $form = new Form($db); // GLOBAL DISCOUNT MANAGEMENT - print '
'; print ''; print ""; @@ -165,7 +163,6 @@ print ''; print '
'; // DISPLAY MARGIN RATES - print ''; print ''.$langs->trans("DisplayMarginRates").''; print ''; @@ -189,7 +186,6 @@ print ''.$langs->trans('MarginRate').' = '.$langs->trans('Margin').' / '.$la print ''; // DISPLAY MARK RATES - print ''; print ''.$langs->trans("DisplayMarkRates").''; print ''; @@ -259,7 +255,6 @@ print ''; print ''; // INTERNAL CONTACT TYPE USED AS COMMERCIAL AGENT - print '
'; print ''; print ""; diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 2e80fe5ced2..8c62b4dd6fe 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -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 ''; if ($agentid > 0) { $companystatic->id=$objp->socid; diff --git a/htdocs/printing/admin/printing.php b/htdocs/printing/admin/printing.php index 96b9cad3849..96dd916290e 100644 --- a/htdocs/printing/admin/printing.php +++ b/htdocs/printing/admin/printing.php @@ -127,7 +127,6 @@ if ($mode == 'setup' && $user->admin) print $langs->trans("PrintingDriverDesc".$driver)."

\n"; print ''."\n"; - $var=true; print ''; print ''; print ''; @@ -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 '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'."\n"; - $var=true; print ''; print ''; print ''; @@ -333,7 +330,6 @@ if ($mode == 'userconf' && $user->admin) print $langs->trans('PrintUserConfDesc'.$driver)."

\n"; print '
'.$langs->trans("Description").''.$langs->trans("Active").'
'; - $var=true; print ''; print ''; print ''; diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index bb214ffc06a..2e57e452928 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -401,7 +401,6 @@ print "\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 '
'.$langs->trans("User").''.$langs->trans("PrintModule").'
'; print (empty($module->name)?$name:$module->name); print "\n"; @@ -524,12 +522,10 @@ print "
"; print load_fiche_titre($langs->trans("ProductOtherConf"), '', ''); - print ''; print ''; print ''; -$var=true; print ''; print ''; print ''."\n"; @@ -569,7 +565,6 @@ print ''; // multiprix nombre de prix a proposer if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { - print ''; print ''; print ''; @@ -611,7 +606,6 @@ print ''; if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) { - print ''; print ''; print ''; @@ -619,7 +613,6 @@ if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) } // Visualiser description produit dans les formulaires activation/desactivation - print ''; print ''; print ''; // View product description in thirdparty language if (! empty($conf->global->MAIN_MULTILANGS)) { - print ''; print ''; print '> + $value) { foreach($fieldlist as $field) { diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index a1cd63eea12..c3f568a958c 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -551,7 +551,6 @@ if ($id > 0 || ! empty($ref)) { $num = $db->num_rows($resql); $i=0; - $var=true; if($num == 0) print ''; @@ -655,7 +654,6 @@ if ($id > 0 || ! empty($ref)) print ''; } - } } diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index b2713d65304..ddda73d0add 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -759,12 +759,9 @@ SCRIPT; if (is_array($product_fourn_list)) { - $var=true; foreach($product_fourn_list as $productfourn) { - - print ''; // Supplier diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 9f11813fdee..89330618879 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -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 ''; print ''; print ''; @@ -500,7 +497,6 @@ function activitytrim($product_type) } if ($trim1+$trim2+$trim3+$trim4 > 0) { - print ''; print ''; print ''; diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index eae89aca648..51692a3e9a1 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -334,8 +334,6 @@ $buttonrecordnoent=$langs->transnoentitiesnoconv("RecordMovement"); print ''.$langs->trans("SelectProductInAndOutWareHouse",$titletoaddnoent,$buttonrecordnoent).'
'; print '
'."\n"; -$var=true; - // Form to add a line print ''; print ''; @@ -402,8 +400,6 @@ print ''; foreach($listofdata as $key => $val) { - - $productstatic->fetch($val['id_product']); $warehousestatics->fetch($val['id_sw']); $warehousestatict->fetch($val['id_tw']); diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 7c15b3fa7c5..08289ec11e4 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -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; diff --git a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php index ca604e61fcc..794ed96f3ec 100644 --- a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php @@ -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'; ?>
'.$langs->trans("Parameters").'
'.$langs->trans("MultiPricesNumPrices").'
'.$langs->trans("NumberOfProductShowInSelect").'
'.$langs->trans("ViewProductDescInFormAbility").''; @@ -652,7 +645,6 @@ print '
'.$langs->trans("ViewProductDescInThirdpartyLanguageAbility").''; diff --git a/htdocs/product/admin/product_tools.php b/htdocs/product/admin/product_tools.php index 291aba9bcf1..ed4480aeaa2 100644 --- a/htdocs/product/admin/product_tools.php +++ b/htdocs/product/admin/product_tools.php @@ -294,8 +294,6 @@ if (empty($mysoc->country_code)) else { - $var=true; - print ''; print ''; print ''; diff --git a/htdocs/product/canvas/product/tpl/list.tpl.php b/htdocs/product/canvas/product/tpl/list.tpl.php index e5c315e8148..070f58dd481 100644 --- a/htdocs/product/canvas/product/tpl/list.tpl.php +++ b/htdocs/product/canvas/product/tpl/list.tpl.php @@ -89,10 +89,9 @@ if (empty($conf) || ! is_object($conf)) -
'.$langs->trans("NoMatchFound").'
'.$tmpyear.''.price($trim1).''.price($trim2).'
'.$tmpyear.''.price($trim1).''.price($trim2).'