From 69adf73f4fde841ec74b14e2f130cf70d7f278de Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 22 Apr 2018 19:27:37 +0200 Subject: [PATCH] Clean code from $var = True --- .travis.yml | 32 +++++-------------- htdocs/admin/facture.php | 12 +------ htdocs/admin/system/dbtable.php | 5 ++- htdocs/admin/system/filecheck.php | 2 +- htdocs/admin/tools/listsessions.php | 4 --- htdocs/admin/triggers.php | 2 -- htdocs/bookmarks/list.php | 2 -- htdocs/comm/contact.php | 3 -- htdocs/comm/mailing/index.php | 12 ++----- htdocs/compta/bank/categ.php | 5 ++- htdocs/compta/bank/releve.php | 2 -- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/compta/paiement/tovalidate.php | 1 - htdocs/compta/payment_sc/card.php | 3 -- htdocs/compta/prelevement/create.php | 2 -- htdocs/core/lib/sendings.lib.php | 3 +- htdocs/core/modules/export/modules_export.php | 3 +- .../modules/facture/doc/pdf_crabe.modules.php | 2 +- htdocs/core/modules/import/modules_import.php | 19 ++++++----- .../modules/rapport/pdf_paiement.class.php | 2 -- htdocs/don/payment/card.php | 3 -- htdocs/fourn/contact.php | 3 -- htdocs/fourn/facture/impayees.php | 1 - htdocs/fourn/facture/paiement.php | 2 -- htdocs/fourn/paiement/card.php | 2 -- htdocs/fourn/product/list.php | 2 +- htdocs/loan/card.php | 1 - htdocs/loan/payment/card.php | 11 +++---- htdocs/loan/payment/payment.php | 3 -- htdocs/margin/customerMargins.php | 4 --- htdocs/margin/productMargins.php | 4 --- htdocs/margin/tabs/productMargins.php | 2 -- htdocs/margin/tabs/thirdpartyMargins.php | 3 -- .../product/canvas/service/tpl/list.tpl.php | 3 +- htdocs/product/index.php | 4 +-- htdocs/product/stats/commande.php | 2 -- htdocs/product/stats/contrat.php | 1 - htdocs/product/stats/facture.php | 1 - htdocs/product/stock/card.php | 3 +- htdocs/product/stock/index.php | 1 - htdocs/public/donations/donateurs_code.php | 4 --- htdocs/public/members/public_list.php | 1 - htdocs/societe/notify/index.php | 4 +-- htdocs/societe/societecontact.php | 2 -- .../admin/supplier_proposal_extrafields.php | 2 -- .../supplier_proposaldet_extrafields.php | 2 -- 46 files changed, 39 insertions(+), 150 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1541ffd4871..c66a338e9c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -248,40 +248,24 @@ before_script: - sudo apt-get install apache2 libapache2-mod-fastcgi # enable php-fpm - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf - - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf + if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then + # Copy the included pool + sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf + fi - sudo a2enmod rewrite actions fastcgi alias - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars - sudo chown -R travis:travis /var/lib/apache2/fastcgi - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm - # configure apache virtual hosts + # configure apache virtual hosts for precise + - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$TRAVIS_BUILD_DIR?g" --in-place /etc/apache2/sites-available/default + - sudo cat /etc/apache2/sites-available/default + # configure apache virtual hosts for trusty - sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/000-default.conf - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf - sudo cat /etc/apache2/sites-available/000-default.conf - sudo service apache2 restart - - - | - echo "Setting up Apache + FPM (old)" - # enable php-fpm - cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf - if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then - # Copy the included pool - cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf - fi - if [ "$DEBUG" = true ]; then - cat ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf - fi - sudo a2enmod rewrite actions fastcgi alias - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini - if [ "$DEBUG" = true ]; then - cat ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini - fi - ~/.phpenv/versions/$PHP_VERSION_NAME/sbin/php-fpm - # configure apache virtual hosts - sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/default - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$TRAVIS_BUILD_DIR?g" --in-place /etc/apache2/sites-available/default - sudo cat /etc/apache2/sites-available/default sudo service apache2 restart echo diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 9ffe45dec40..4fab390a4cc 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -284,8 +284,6 @@ foreach ($dirmodels as $reldir) $handle = opendir($dir); if (is_resource($handle)) { - $var=true; - while (($file = readdir($handle))!==false) { if (! is_dir($dir.$file) || (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')) @@ -316,7 +314,6 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { - $var = !$var; print ''; echo preg_replace('/\-.*$/','',preg_replace('/mod_facture_/','',preg_replace('/\.php$/','',$file))); print "\n"; @@ -470,7 +467,6 @@ print "\n"; clearstatcache(); -$var=true; foreach ($dirmodels as $reldir) { foreach (array('','/doc') as $valdir) @@ -507,7 +503,6 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { - $var = !$var; print ''; print (empty($module->name)?$name:$module->name); print "\n"; @@ -598,7 +593,6 @@ print '
'; print ''; print ''; -$var=True; print ''; print ''; print ''; print ''; print "\n"; -$var=true; // Force date validation -$var=! $var; print ''; print ''; print ''; @@ -717,7 +708,6 @@ $htmltext = ''.$langs->trans("AvailableVariables").':
'; foreach($substitutionarray as $key => $val) $htmltext.=$key.'
'; $htmltext.='
'; -$var=! $var; print ''; print ''; print ''; diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php index d6e05ed2e72..cef493c95f8 100644 --- a/htdocs/admin/system/dbtable.php +++ b/htdocs/admin/system/dbtable.php @@ -66,7 +66,6 @@ else if ($resql) { $num = $db->num_rows($resql); - $var=True; $i=0; while ($i < $num) { @@ -109,7 +108,7 @@ else //$sql = "DESCRIBE ".$table; $sql = "SHOW FULL COLUMNS IN ".$db->escape($table); - + $resql = $db->query($sql); if ($resql) { @@ -129,7 +128,7 @@ else print ""; - + print ''; print ''; $i++; diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 6fd623bf1bb..597569abcb1 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -86,7 +86,7 @@ if (empty($xmlremote)) $xmlremote = 'https://www.dolibarr.org/files/stable/signa // Test if remote test is ok -$enableremotecheck = True; +$enableremotecheck = true; if (preg_match('/beta|alpha|rc/i', DOL_VERSION) || ! empty($conf->global->MAIN_ALLOW_INTEGRITY_CHECK_ON_UNSTABLE)) $enableremotecheck=False; $enableremotecheck = true; diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index 76f7debf3e7..70b0987732b 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -137,12 +137,8 @@ if ($savehandler == 'files') print_liste_field_titre(''); print "\n"; - $var=True; - foreach ($listofsessions as $key => $sessionentry) { - - print ''; // Login diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index 58ca4e0eded..ca14869cb2e 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -65,10 +65,8 @@ print getTitleFieldOfList($langs->trans("Active"), 0, $_SERVER["PHP_SELF"], 'act print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], 'none', "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder, '', 1)."\n"; print ''; -$var=True; foreach ($triggers as $trigger) { - print ''; print ''; print ''; diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 0253efb3a3d..fa46f683e50 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -125,12 +125,10 @@ if ($resql) print_liste_field_titre(''); print "\n"; - $var=True; while ($i < $num) { $obj = $db->fetch_object($resql); - print ''; // Id diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index 5fe55c2da21..1460abe9823 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -144,14 +144,11 @@ if ($resql) print ''; print "\n"; - $var=True; $i = 0; while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); - - print ''; print ''; diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 52eacf6c115..4175c4e4446 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -52,7 +52,6 @@ print '
'; //if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo //{ // Recherche emails - $var=false; print ''; print ''; print '
'; @@ -662,7 +656,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql.= " WHERE clos = 0"; $sql.= " AND courant = 1"; $sql.= " AND entity IN (".getEntity('bank_account').")"; -$var=True; + $resql=$db->query($sql); if ($resql) { @@ -670,7 +664,6 @@ if ($resql) $i = 0; while ($i < $num) { - $row = $db->fetch_row($resql); print ''.$langs->trans("Value").' 
".(isset($link[$row[0]][0])?$link[$row[0]][0]:'')."."; print (isset($link[$row[0]][1])?$link[$row[0]][1]:'')."
'.$trigger['picto'].''.$trigger['file'].'
'.img_object($langs->trans("ShowContact"),"contact"); print ' '.$obj->name.'
'; @@ -62,7 +61,7 @@ print '
'; print '
'; print ''; - + print "
'; print $langs->trans("Other").':

\n"; //} @@ -74,7 +73,6 @@ print ''.$langs->trans("TargetsStatistic $dir=DOL_DOCUMENT_ROOT."/core/modules/mailings"; $handle=opendir($dir); -$var=True; if (is_resource($handle)) { while (($file = readdir($handle))!==false) @@ -106,8 +104,6 @@ if (is_resource($handle)) // Si le module mailing est qualifi� if ($qualified) { - $var = !$var; - foreach ($mailmodule->getSqlArrayForStats() as $sql) { print ''; @@ -169,14 +165,12 @@ if ($result) $num = $db->num_rows($result); if ($num > 0) - { - $var = true; + { $i = 0; - while ($i < $num ) + while ($i < $num ) { $obj = $db->fetch_object($result); - print ''; print ''.img_object($langs->trans("ShowEMail"),"email").' '.$obj->rowid.''; diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index 83e1f15ef36..fb514120d57 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -101,11 +101,10 @@ if ($result) $num = $db->num_rows($result); $i = 0; $total = 0; - $var=True; while ($i < $num) { $objp = $db->fetch_object($result); - + print ''; print ''.$objp->rowid.''; if (GETPOST('action','aZ09') == 'edit' && GETPOST("categid")== $objp->rowid) @@ -136,7 +135,7 @@ if ($result) */ if ($action != 'edit') { - + print ''; print ' '; print ''; diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 3acbb1e0ca7..5e9f98be02d 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -395,7 +395,6 @@ if (empty($numref)) $result = $db->query($sql); if ($result) { - $var=True; $numrows = $db->num_rows($result); $i = 0; @@ -572,7 +571,6 @@ else $result = $db->query($sql); if ($result) { - $var=False; $numrows = $db->num_rows($result); $i = 0; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 89f9055a776..84461ab0493 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2363,7 +2363,7 @@ class Facture extends CommonInvoice if (!empty($conf->global->INVOICE_USE_SITUATION)) { - $final = True; + $final = true; $nboflines = count($this->lines); while (($i < $nboflines) && $final) { $final = ($this->lines[$i]->situation_percent == 100); diff --git a/htdocs/compta/paiement/tovalidate.php b/htdocs/compta/paiement/tovalidate.php index f8c369f0887..43fa2e48212 100644 --- a/htdocs/compta/paiement/tovalidate.php +++ b/htdocs/compta/paiement/tovalidate.php @@ -94,7 +94,6 @@ if ($resql) { $num = $db->num_rows($resql); $i = 0; - $var=True; print_barre_liste($langs->trans("ReceivedCustomersPaymentsToValid"), $page, $_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num); diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index ea9bc5af42a..8e76a219c3d 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -245,13 +245,10 @@ if ($resql) if ($num > 0) { - $var=True; - while ($i < $num) { $objp = $db->fetch_object($resql); - print ''; // Ref print ''; diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index c94a786917f..c1d87a4c1b5 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -298,8 +298,6 @@ if ($result) print ''.$langs->trans("Date").''.$langs->trans("Amount").''; print ''; - $var=True; - while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 2a9f79b8399..71c287f7119 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -241,11 +241,10 @@ function show_list_sending_receive($origin,$origin_id,$filter='') } print "\n"; - $var=True; while ($i < $num) { - $objp = $db->fetch_object($resql); + print ''; // Sending id diff --git a/htdocs/core/modules/export/modules_export.php b/htdocs/core/modules/export/modules_export.php index 8cbb3850c2b..5d7e0ecac84 100644 --- a/htdocs/core/modules/export/modules_export.php +++ b/htdocs/core/modules/export/modules_export.php @@ -54,7 +54,6 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac $handle=opendir($dir); // Recherche des fichiers drivers exports disponibles - $var=True; $i=0; if (is_resource($handle)) { @@ -72,7 +71,7 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac if (class_exists($classname)) { $module = new $classname($db); - + // Picto $this->picto[$module->id]=$module->picto; // Driver properties diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index b5ee2fba63b..05a832fc716 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -342,7 +342,7 @@ class pdf_crabe extends ModelePDFFactures // Situation invoice handling if ($object->situation_cycle_ref) { - $this->situationinvoice = True; + $this->situationinvoice = true; $progress_width = 18; $this->posxtva -= $progress_width; $this->posxup -= $progress_width; diff --git a/htdocs/core/modules/import/modules_import.php b/htdocs/core/modules/import/modules_import.php index cd70a3456bb..548bb128193 100644 --- a/htdocs/core/modules/import/modules_import.php +++ b/htdocs/core/modules/import/modules_import.php @@ -59,7 +59,7 @@ class ModeleImports { } - + /** * getDriverId * @@ -69,7 +69,7 @@ class ModeleImports { return $this->id; } - + /** * getDriverLabel * @@ -79,7 +79,7 @@ class ModeleImports { return $this->label; } - + /** * getDriverDesc * @@ -89,7 +89,7 @@ class ModeleImports { return $this->desc; } - + /** * getDriverExtension * @@ -99,7 +99,7 @@ class ModeleImports { return $this->extension; } - + /** * getDriverVersion * @@ -109,7 +109,7 @@ class ModeleImports { return $this->version; } - + /** * getDriverLabel * @@ -119,7 +119,7 @@ class ModeleImports { return $this->label_lib; } - + /** * getLibVersion * @@ -129,8 +129,8 @@ class ModeleImports { return $this->version_lib; } - - + + /** * Charge en memoire et renvoie la liste des modeles actifs * @@ -146,7 +146,6 @@ class ModeleImports $handle=opendir($dir); // Recherche des fichiers drivers imports disponibles - $var=True; $i=0; if (is_resource($handle)) { diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 2594a4a0b6a..a645b105610 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -248,13 +248,11 @@ class pdf_paiement { $num = $this->db->num_rows($result); $i = 0; - $var=True; while ($i < $num) { $objp = $this->db->fetch_object($result); - $lines[$i][0] = $objp->facnumber; $lines[$i][1] = dol_print_date($this->db->jdate($objp->dp),"day",false,$outputlangs,true); $lines[$i][2] = $langs->transnoentities("PaymentTypeShort".$objp->paiement_code); diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php index 68d29fe3dc1..e4a7ef5c5d4 100644 --- a/htdocs/don/payment/card.php +++ b/htdocs/don/payment/card.php @@ -226,13 +226,10 @@ if ($resql) if ($num > 0) { - $var=True; - while ($i < $num) { $objp = $db->fetch_object($resql); - print ''; // Ref print ''; diff --git a/htdocs/fourn/contact.php b/htdocs/fourn/contact.php index abc4528039d..a334442e9ab 100644 --- a/htdocs/fourn/contact.php +++ b/htdocs/fourn/contact.php @@ -105,14 +105,11 @@ if ($result) print_liste_field_titre("Phone"); print "\n"; - $var=True; $i = 0; while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); - - print ''; print ''.img_object($langs->trans("ShowContact"),"contact").' '.$obj->lastname.''; diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php index fd081d5616d..c1c4be9fb76 100644 --- a/htdocs/fourn/facture/impayees.php +++ b/htdocs/fourn/facture/impayees.php @@ -223,7 +223,6 @@ if ($user->rights->fournisseur->facture->lire) if ($num > 0) { - $var=True; $total_ht=0; $total_ttc=0; $total_paid=0; diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 94c9f14153c..ca8983b8c92 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -524,7 +524,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('MulticurrencyPaymentAmount').''; print ''; - $var=True; $total=0; $total_ttc=0; $totalrecu=0; @@ -794,7 +793,6 @@ if (empty($action)) { $num = $db->num_rows($resql); $i = 0; - $var=True; $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index 529feb86897..daa452d0c29 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -288,8 +288,6 @@ if ($result > 0) if ($num > 0) { - $var=True; - $facturestatic=new FactureFournisseur($db); while ($i < $num) diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index c71825eda0f..9348a2a8b70 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -253,7 +253,7 @@ if ($resql) print "\n"; $oldid = ''; - $var=True; + while ($i < min($num,$limit)) { $objp = $db->fetch_object($resql); diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 59b4da544db..53cf9e7cb82 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -702,7 +702,6 @@ if ($id > 0) print ''.$langs->trans("LoanCapital").''; print ''; - $var=True; while ($i < $num) { $objp = $db->fetch_object($resql); diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index 206e3e64de7..47efb9c8cde 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -40,7 +40,7 @@ if ($user->societe_id) $socid=$user->societe_id; //$result = restrictedArea($user, 'facture', $id,''); $payment = new PaymentLoan($db); -if ($id > 0) +if ($id > 0) { $result=$payment->fetch($id); if (! $result) dol_print_error($db,'Failed to get payment id '.$id); @@ -76,7 +76,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->loan->wri $db->begin(); $result=$payment->valide(); - + if ($result > 0) { $db->commit(); @@ -141,7 +141,7 @@ if ($action == 'delete') if ($action == 'valide') { $facid = $_GET['facid']; - print $form->formconfirm('card.php?id='.$payment->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2); + print $form->formconfirm('card.php?id='.$payment->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2); } @@ -220,13 +220,10 @@ if ($resql) if ($num > 0) { - $var=True; - while ($i < $num) { $objp = $db->fetch_object($resql); - print ''; // Ref print ''; @@ -250,7 +247,7 @@ if ($resql) $i++; } } - + print "\n"; $db->free($resql); diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index bea15f288a0..8faac08fb60 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -245,9 +245,6 @@ if ($action == 'create') print ''.$langs->trans("Amount").''; print "\n"; - $var=True; - - print ''; if ($loan->datestart > 0) diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index b216db9d430..dfa97bd7536 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -283,8 +283,6 @@ if ($result) if ($num > 0) { - $var=True; - while ($i < $num /*&& $i < $conf->liste_limit*/) { $objp = $db->fetch_object($result); @@ -304,8 +302,6 @@ if ($result) $markRate = ($pv != 0)?(100 * $marge / $pv):'' ; } - - print ''; if ($client) { print ''; diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index ef99e593b82..ad1fc773bd3 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -258,8 +258,6 @@ if ($result) if ($num > 0) { - $var=True; - while ($i < $num /*&& $i < $conf->liste_limit*/) { $objp = $db->fetch_object($result); @@ -278,8 +276,6 @@ if ($result) $markRate = ($pv != 0)?(100 * $marge / $pv):'' ; } - - print ''; if ($id > 0) { print ''; diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 605a4272081..94eff1911e7 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -193,11 +193,9 @@ if ($id > 0 || ! empty($ref)) $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); if ($num > 0) { - $var=True; while ($i < $num /*&& $i < $conf->liste_limit*/) { $objp = $db->fetch_object($result); - $marginRate = ($objp->buying_price != 0)?(100 * $objp->marge / $objp->buying_price):'' ; $markRate = ($objp->selling_price != 0)?(100 * $objp->marge / $objp->selling_price):'' ; diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 5d80814099d..eb61e4ec41f 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -199,7 +199,6 @@ if ($socid > 0) if ($num > 0) { - $var=True; while ($i < $num /*&& $i < $conf->liste_limit*/) { $objp = $db->fetch_object($result); @@ -207,8 +206,6 @@ if ($socid > 0) $marginRate = ($objp->buying_price != 0)?(100 * $objp->marge / $objp->buying_price):'' ; $markRate = ($objp->selling_price != 0)?(100 * $objp->marge / $objp->selling_price):'' ; - - print ''; print ''; $invoicestatic->id=$objp->facid; diff --git a/htdocs/product/canvas/service/tpl/list.tpl.php b/htdocs/product/canvas/service/tpl/list.tpl.php index 9951c71fcc3..ef6d461fc5c 100644 --- a/htdocs/product/canvas/service/tpl/list.tpl.php +++ b/htdocs/product/canvas/service/tpl/list.tpl.php @@ -89,10 +89,9 @@ if (empty($conf) || ! is_object($conf)) - > + $value) { foreach($fieldlist as $field) { diff --git a/htdocs/product/index.php b/htdocs/product/index.php index fd29143613a..1254af2213b 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -307,8 +307,6 @@ if ($result) print ''.$transRecordedType.''; - $var=True; - while ($i < $num) { $objp = $db->fetch_object($result); @@ -337,7 +335,7 @@ if ($result) $product_static->label = $objp->label; $product_static->type=$objp->fk_product_type; $product_static->entity = $objp->entity; - $product_static->status_batch = $objp->tobatch; + $product_static->status_batch = $objp->tobatch; print $product_static->getNomUrl(1,'',16); print "\n"; print ''.dol_trunc($objp->label,32).''; diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index dc3d9a9b7d6..2d01a2f6e9c 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -211,12 +211,10 @@ if ($id > 0 || ! empty($ref)) if ($num > 0) { - $var=True; while ($i < $num && $i < $conf->liste_limit) { $objp = $db->fetch_object($result); - print ''; print ''; $orderstatic->id=$objp->commandeid; diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index ef3723e2e55..ed4d989011e 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -177,7 +177,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/facture.php b/htdocs/product/stats/facture.php index 794d939bc6e..47abbee30a0 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -234,7 +234,6 @@ if ($id > 0 || ! empty($ref)) if ($num > 0) { - $var=True; while ($i < min($num,$conf->liste_limit)) { $objp = $db->fetch_object($result); diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 1566e5d36c0..4fccbf4622f 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -460,7 +460,6 @@ else { $num = $db->num_rows($resql); $i = 0; - $var=True; while ($i < $num) { $objp = $db->fetch_object($resql); @@ -491,7 +490,7 @@ else $productstatic->label = $objp->produit; $productstatic->type=$objp->type; $productstatic->entity=$objp->entity; - $productstatic->status_batch=$objp->tobatch; + $productstatic->status_batch=$objp->tobatch; print $productstatic->getNomUrl(1,'stock',16); print ''; diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index 36f9e1a7f7c..a1414ab06ac 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -86,7 +86,6 @@ if ($result) { $entrepot=new Entrepot($db); - $var=True; while ($i < $num) { $objp = $db->fetch_object($result); diff --git a/htdocs/public/donations/donateurs_code.php b/htdocs/public/donations/donateurs_code.php index 3780481e23c..3d8057cbe85 100644 --- a/htdocs/public/donations/donateurs_code.php +++ b/htdocs/public/donations/donateurs_code.php @@ -73,14 +73,10 @@ if ($resql) print "".$langs->trans("Amount").""; print "\n"; - $var=True; - $bc[1]='bgcolor="#f5f5f5"'; - $bc[0]='bgcolor="#f0f0f0"'; while ($i < $num) { $objp = $db->fetch_object($resql); - print ''; if ($objp->public) { diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index 03bf1ae5c98..b3438e8be02 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -139,7 +139,6 @@ if ($result) print_liste_field_titre("Photo", $_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder,'public_'); print "\n"; - $var=True; while ($i < $num && $i < $conf->liste_limit) { $objp = $db->fetch_object($result); diff --git a/htdocs/societe/notify/index.php b/htdocs/societe/notify/index.php index 1a46f62d202..3326e431178 100644 --- a/htdocs/societe/notify/index.php +++ b/htdocs/societe/notify/index.php @@ -85,13 +85,11 @@ if ($result) print_liste_field_titre("Contact",$_SERVER["PHP_SELF"],"c.lastname","","",'valign="center"',$sortfield,$sortorder); print_liste_field_titre("Action",$_SERVER["PHP_SELF"],"a.titre","","",'valign="center"',$sortfield,$sortorder); print "\n"; - $var=True; + while ($i < $num) { $obj = $db->fetch_object($result); - - print ''; print "socid."\">".$obj->name."\n"; print "".dolGetFirstLastname($obj->firstname, $obj->lastname)."\n"; diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index 6b3e833abb0..dfe78041f8a 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -253,7 +253,6 @@ if ($id > 0 || ! empty($ref)) print_liste_field_titre("EndSubscription",$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder); print "\n"; - $var=True; $i=0; while ($i < $num && $i < $conf->liste_limit) { @@ -269,7 +268,6 @@ if ($id > 0 || ! empty($ref)) $companyname=$objp->company; - print ''; // Ref diff --git a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php index 8d9429051f8..cea668cfae2 100644 --- a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php +++ b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php @@ -87,10 +87,8 @@ print ''.$langs->trans("Required").''; print ' '; print "\n"; -$var=True; foreach($extrafields->attribute_type as $key => $value) { - print ''; print "".$extrafields->attribute_pos[$key]."\n"; print "".$extrafields->attribute_label[$key]."\n"; diff --git a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php index 75a0374a14c..41101ec7759 100644 --- a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php +++ b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php @@ -91,10 +91,8 @@ print ''.$langs->trans("Required").''; print ' '; print "\n"; -$var=True; foreach($extrafields->attribute_type as $key => $value) { - print ''; print "".$extrafields->attribute_label[$key]."\n"; print "".$key."\n";