From fec9303d18532c6bd60dcc0531217c23d706888f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 22 Apr 2018 18:51:03 +0200 Subject: [PATCH] Remove useless $var --- htdocs/compta/prelevement/demandes.php | 2 -- htdocs/compta/prelevement/index.php | 3 --- htdocs/compta/stats/index.php | 2 -- htdocs/core/modules/printing/printgcp.modules.php | 5 ++--- htdocs/core/modules/printing/printipp.modules.php | 5 ++--- htdocs/don/index.php | 3 --- htdocs/expensereport/payment/card.php | 8 +++----- htdocs/fourn/card.php | 8 +------- htdocs/fourn/commande/index.php | 14 ++------------ htdocs/fourn/commande/orderstoinvoice.php | 7 +++---- htdocs/fourn/index.php | 13 +++---------- htdocs/product/stats/commande_fournisseur.php | 5 ++--- htdocs/product/stats/facture_fournisseur.php | 1 - htdocs/product/stats/propal.php | 4 +--- htdocs/product/stats/supplier_proposal.php | 4 +--- htdocs/societe/price.php | 8 ++------ htdocs/supplier_proposal/index.php | 5 +---- 17 files changed, 23 insertions(+), 74 deletions(-) diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 04ec746d7f6..765e0cf4fa8 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -129,8 +129,6 @@ if ($resql) print ''; print ''; - $var = True; - $users = array(); while ($i < min($num,$limit)) diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index 271ce4da7fe..64e1991064d 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -71,7 +71,6 @@ print '
'; $thirdpartystatic=new Societe($db); $invoicestatic=new Facture($db); $bprev = new BonPrelevement($db); -$var=true; print ''; print ''; @@ -117,7 +116,6 @@ if ($resql) print ''; if ($num) { - $var = True; while ($i < $num && $i < 20) { $obj = $db->fetch_object($resql); @@ -184,7 +182,6 @@ if ($result) { $num = $db->num_rows($result); $i = 0; - $var=True; print"\n\n"; print '
'.$langs->trans("Statistics").'
'.$langs->trans("InvoiceWaitingWithdraw").' ('.$num.')
'; diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 598de2ba490..a4c32302a47 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -551,7 +551,6 @@ print ''; if ($num) { - $var = True; $total_ttc_Rac = $totalam_Rac = $total_Rac = 0; while ($i < $num) { @@ -602,7 +601,6 @@ print ''; if ($num) { - $var = True; $total_pr = 0; while ($i < $num) { diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index 6e007b22b55..d2db656a6f2 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -461,15 +461,14 @@ class printing_printgcp extends PrintingDriver $html .= ''; $html .= ''; $html .= ''."\n"; - $var = True; + $jobs = $responsedata['jobs']; //$html .= '
'.print_r($jobs['0'],true).'
'; if (is_array($jobs)) { foreach ($jobs as $value) { - $var = !$var; - $html .= ''; + $html .= ''; $html .= ''; $dates=dol_print_date((int) substr($value['createTime'], 0, 10), 'dayhour'); $html .= ''; diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index 2c7a3cb2a05..3fc0d505e70 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -287,12 +287,11 @@ class printing_printipp extends PrintingDriver $html .= ''; $html .= ''."\n"; $jobs = $ipp->jobs_attributes; - $var = True; + //$html .= '
'.print_r($jobs,true).'
'; foreach ($jobs as $value ) { - $var = !$var; - $html .= ''; + $html .= ''; $html .= ''; $html .= ''; $html .= ''; diff --git a/htdocs/don/index.php b/htdocs/don/index.php index b72e63f7797..d9bee39723c 100644 --- a/htdocs/don/index.php +++ b/htdocs/don/index.php @@ -150,7 +150,6 @@ print ''; $total=0; $totalnb=0; -$var=true; foreach ($listofstatus as $status) { @@ -200,10 +199,8 @@ if ($resql) if ($num) { $i = 0; - $var = True; while ($i < $num) { - $obj = $db->fetch_object($resql); print ''; diff --git a/htdocs/expensereport/payment/card.php b/htdocs/expensereport/payment/card.php index d2f3a4c3567..871805564c5 100644 --- a/htdocs/expensereport/payment/card.php +++ b/htdocs/expensereport/payment/card.php @@ -73,7 +73,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->expensere $db->begin(); $result=$object->valide(); - + if ($result > 0) { $db->commit(); @@ -112,7 +112,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->expensere llxHeader('', $langs->trans("ExpenseReportPayment")); -if ($id > 0) +if ($id > 0) { $result=$object->fetch($id); if (! $result) dol_print_error($db,'Failed to get payment id '.$id); @@ -240,8 +240,6 @@ if ($resql) if ($num > 0) { - $var=True; - while ($i < $num) { $objp = $db->fetch_object($resql); @@ -277,7 +275,7 @@ if ($resql) $i++; } } - + print "
'.$langs->trans("Status").''.$langs->trans("Cancel").'
'.$value['id'].''.$dates.'Cancel
'.$value->job_id->_value0.''.$value->job_originating_user_name->_value0.''.$value->printer_uri->_value0.'
\n"; print '
'; diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 14b9a490da9..6dff84c5742 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -430,8 +430,6 @@ if ($object->id > 0) print $boxstat; - $var=true; - $MAXLIST=$conf->global->MAIN_SIZE_SHORTLIST_LIMIT; // Lien recap @@ -549,12 +547,10 @@ if ($object->id > 0) print ''; } - $var = True; while ($i < $num && $i <= $MAXLIST) { $obj = $db->fetch_object($resql); - print ''; print ''; $proposalstatic->id = $obj->rowid; @@ -654,12 +650,10 @@ if ($object->id > 0) print ''; } - $var = True; while ($i < $num && $i < $MAXLIST) { $obj = $db->fetch_object($resql); - print ''; print ''; $orderstatic->id = $obj->rowid; @@ -727,7 +721,7 @@ if ($object->id > 0) print ''; print ''; } - $var=True; + while ($i < min($num,$MAXLIST)) { $obj = $db->fetch_object($resql); diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 412f0c94b09..4eead48abf4 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -55,7 +55,6 @@ print '
'; if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo { - $var=false; print '
'; print ''; print ''; @@ -86,8 +85,6 @@ if ($resql) $num = $db->num_rows($resql); $i = 0; - $var=True; - $total=0; $totalinprocess=0; $dataseries=array(); @@ -181,7 +178,6 @@ if ($resql) print ''; print ''; print "\n"; - $var=True; while ($i < $num) { @@ -230,11 +226,10 @@ if (! empty($conf->fournisseur->enabled)) if ($num) { $i = 0; - $var = True; while ($i < $num) { - $obj = $db->fetch_object($resql); + print ''; print '"; @@ -271,13 +266,11 @@ if ($resql) print '
'.$langs->trans("Status").''.$langs->trans("Nb").'
'; print "rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."
'; print ''; print "\n"; - $var=True; while ($i < $num) { $obj = $db->fetch_object($resql); - print ''; print ''; @@ -398,11 +389,10 @@ print ''; - $var = True; $generic_commande = new CommandeFournisseur($db); - while ( $i < $num ) { + while ($i < $num) { $objp = $db->fetch_object($resql); - $var = ! $var; - print ''; + + print ''; print ''; $i = 0; - $var = true; while ($i < $num) { - $obj = $db->fetch_object($resql); + print ''; $i = 0; $tot_ttc = 0; - $var = True; + while ($i < $num && $i < 20) { $obj = $db->fetch_object($resql); @@ -256,12 +255,8 @@ if ($resql) print '\n"; print "\n"; - $var=True; - while ($obj = $db->fetch_object($resql) ) { - - print ''; print '\n"; @@ -293,12 +288,10 @@ if (count($companystatic->SupplierCategories)) print '\n"; - $var=True; foreach ($companystatic->SupplierCategories as $rowid => $label) { - - print "\n"; + print ''."\n"; print '\n"; if ($num > 0) { - $var = True; + while ( $i < $num && $i < $conf->liste_limit ) { $objp = $db->fetch_object($result); - $var = ! $var; - print ''; + print ''; print ''; + print ''; print ''; + print ''; print ''; print ''; - $var = True; - foreach ( $prodcustprice->lines as $line ) { - print ''; + print ''; $staticprod = new Product($db); $staticprod->fetch($line->fk_product); @@ -558,11 +556,9 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { if (count($prodcustprice->lines) > 0) { - $var = False; - foreach ($prodcustprice->lines as $line) { - print ""; + print ''; $staticprod = new Product($db); $staticprod->fetch($line->fk_product); diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php index 68a575c5df8..17565e7f140 100644 --- a/htdocs/supplier_proposal/index.php +++ b/htdocs/supplier_proposal/index.php @@ -184,11 +184,10 @@ if (! empty($conf->supplier_proposal->enabled)) if ($num) { $i = 0; - $var = True; while ($i < $num) { - $obj = $db->fetch_object($resql); + print ''; $supplier_proposalstatic->id=$obj->rowid; @@ -242,10 +241,8 @@ if ($resql) if ($num) { $i = 0; - $var = True; while ($i < $num) { - $obj = $db->fetch_object($resql); print '';
'.$langs->trans("UserWithApproveOrderGrant").'
'; $userstatic->id=$obj->rowid; @@ -329,10 +322,8 @@ if ($resql) if ($num) { $i = 0; - $var = True; while ($i < $num) { - $obj = $db->fetch_object($resql); print '
'.$langs->trans("OrdersToProcess").' '; print ''; diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index 13a40d9fe64..4c229518eba 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -542,13 +542,12 @@ if (($action != 'create' && $action != 'add') && !$error) { print '
'; $generic_commande->id = $objp->rowid; diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php index e353739790d..033bcc63a2a 100644 --- a/htdocs/fourn/index.php +++ b/htdocs/fourn/index.php @@ -126,11 +126,10 @@ if (! empty($conf->fournisseur->enabled)) print ''.$langs->trans("DraftOrders").' '.$num.'
'; $commandestatic->id=$obj->rowid; $commandestatic->ref=$obj->ref; @@ -183,7 +182,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- print ''.$langs->trans("DraftBills").' '.$num.'
'.$langs->trans("DateModification")."
'.img_object($langs->trans("ShowSupplier"),"company").''; print " socid."\">".$obj->name."
'; print $langs->trans("Category"); print "
'; $categstatic->id=$rowid; $categstatic->ref=$label; diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index 4526af86f96..63bb9028a4e 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -220,12 +220,11 @@ if ($id > 0 || ! empty($ref)) { print "
'; $supplierorderstatic->id = $objp->commandeid; $supplierorderstatic->ref = $objp->ref; diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 47ca357b0cd..e17d03fe7e9 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -213,7 +213,6 @@ if ($id > 0 || ! empty($ref)) if ($num > 0) { - $var = True; while ($i < $num && $i < $conf->liste_limit) { $objp = $db->fetch_object($result); diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 3173a04ee55..36dcc945fe1 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -216,13 +216,11 @@ if ($id > 0 || ! empty($ref)) if ($num > 0) { - $var = True; while ($i < $num && $i < $conf->liste_limit) { $objp = $db->fetch_object($result); - $var = ! $var; - print '
'; $propalstatic->id=$objp->propalid; $propalstatic->ref=$objp->ref; diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index a580685c768..587d024b4c4 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -216,13 +216,11 @@ if ($id > 0 || ! empty($ref)) if ($num > 0) { - $var = True; while ($i < $num && $i < $conf->liste_limit) { $objp = $db->fetch_object($result); - $var = ! $var; - print '
'; $propalstatic->id=$objp->propalid; $propalstatic->ref=$objp->ref; diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index f1b6b572b35..e35cf186ae3 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -452,11 +452,9 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print '