From ebe30f7a0ed744dbb6668fc47396085fa1327d69 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Feb 2019 19:19:23 +0100 Subject: [PATCH 01/10] FIX error report not returned --- htdocs/comm/mailing/class/mailing.class.php | 1 + htdocs/comm/propal/class/propal.class.php | 7 ++++++- htdocs/core/class/commonobject.class.php | 2 +- htdocs/product/class/productbatch.class.php | 1 + htdocs/product/class/productcustomerprice.class.php | 3 ++- htdocs/product/class/propalmergepdfproduct.class.php | 1 + 6 files changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index b807ea23334..9df3a04a786 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -319,6 +319,7 @@ class Mailing extends CommonObject if ($result < 0) { $this->error=$object->error; + $this->errors=array_merge($this->errors, $object->errors); $error++; } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 511fb2087ec..647be1d0233 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1285,7 +1285,12 @@ class Propal extends CommonObject // Create clone $object->context['createfromclone']='createfromclone'; $result=$object->create($user); - if ($result < 0) $error++; + if ($result < 0) + { + $this->error = $object->error; + $this->errors = array_merge($this->errors, $object->errors); + $error++; + } if (! $error) { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 76b0ab6f247..5bb557cac2c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4951,7 +4951,7 @@ abstract class CommonObject if ($this->array_options[$key] === '') $mandatorypb=true; if ($mandatorypb) { - dol_syslog($this->error); + dol_syslog("Mandatory extra field ".$key." is empty"); $this->errors[]=$langs->trans('ErrorFieldRequired', $attributeLabel); return -1; } diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index d16c6ccc6ec..ab86a63b8e0 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -356,6 +356,7 @@ class Productbatch extends CommonObject if ($result < 0) { $this->error=$object->error; + $this->errors=array_merge($this->errors, $object->errors); $error++; } diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index d39849780c1..425b29080bf 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -924,7 +924,8 @@ class Productcustomerprice extends CommonObject // Other options if ($result < 0) { $this->error = $object->error; - $error ++; + $this->errors=array_merge($this->errors, $object->errors); + $error++; } if (! $error) { diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index 3aeae37249c..861b86ec257 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -589,6 +589,7 @@ class Propalmergepdfproduct extends CommonObject if ($result < 0) { $this->error=$object->error; + $this->errors=array_merge($this->errors, $object->errors); $error++; } From 25abceb11614cf6fc223565ec4e0c28511e87a80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 2 Feb 2019 08:59:37 +0100 Subject: [PATCH 02/10] remove psr2 warning for else if usage --- htdocs/core/lib/files.lib.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 848381d5b39..09a35b364c5 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -4,6 +4,7 @@ * Copyright (C) 2012-2016 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2016 Raphaël Doursenaud + * Copyright (C) 2019 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -2654,10 +2655,10 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if (! empty($conf->productbatch->enabled)) $original_file=$conf->productbatch->multidir_output[$entity].'/'.$original_file; } - // Wrapping pour les mouvements stocks - else if ($modulepart == 'movement' || $modulepart == 'mouvement' ) + // Wrapping for stock movements + elseif ($modulepart == 'movement' || $modulepart == 'mouvement') { - if (empty($entity) || (empty($conf->stock->multidir_output[$entity]) )) return array('accessallowed'=>0, 'error'=>'Value entity must be provided'); + if (empty($entity) || (empty($conf->stock->multidir_output[$entity]))) return array('accessallowed'=>0, 'error'=>'Value entity must be provided'); if (($fuser->rights->stock->{$lire} || $fuser->rights->stock->movement->{$lire} || $fuser->rights->stock->mouvement->{$lire}) || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; From 03701fa09106e27a170352e7777ab3068d7848a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 2 Feb 2019 18:25:01 +0100 Subject: [PATCH 03/10] psr2 --- dev/setup/codesniffer/ruleset.xml | 3 + dev/translation/autotranslator.class.php | 4 +- htdocs/accountancy/admin/categories.php | 4 +- htdocs/accountancy/admin/defaultaccounts.php | 4 +- htdocs/accountancy/admin/export.php | 8 +-- htdocs/accountancy/admin/fiscalyear.php | 2 +- htdocs/accountancy/admin/fiscalyear_card.php | 2 +- htdocs/accountancy/admin/importaccounts.php | 2 +- htdocs/accountancy/admin/productaccount.php | 2 +- .../class/accountancycategory.class.php | 4 +- .../class/accountancyexport.class.php | 18 +++--- .../class/accountingaccount.class.php | 2 +- .../class/accountingjournal.class.php | 2 +- .../accountancy/class/bookkeeping.class.php | 10 ++-- htdocs/accountancy/class/lettering.class.php | 4 +- htdocs/accountancy/expensereport/list.php | 2 +- htdocs/accountancy/journal/bankjournal.php | 24 ++++---- .../journal/expensereportsjournal.php | 22 ++++---- .../accountancy/journal/purchasesjournal.php | 26 ++++----- htdocs/accountancy/journal/sellsjournal.php | 12 ++-- htdocs/cashdesk/facturation.php | 4 +- htdocs/cashdesk/facturation_dhtml.php | 2 +- htdocs/cashdesk/facturation_verif.php | 2 +- htdocs/cashdesk/index_verif.php | 2 +- htdocs/categories/traduction.php | 2 +- htdocs/comm/mailing/advtargetemailing.php | 8 +-- htdocs/contrat/class/contrat.class.php | 2 +- htdocs/core/class/commonobject.class.php | 6 +- htdocs/core/class/extrafields.class.php | 6 +- htdocs/core/class/smtps.class.php | 22 ++++---- .../connectors/php/commands.php | 6 +- .../filemanagerdol/connectors/php/util.php | 4 +- htdocs/core/lib/company.lib.php | 2 +- .../commande/doc/pdf_einstein.modules.php | 16 +++--- .../commande/doc/pdf_eratosthene.modules.php | 16 +++--- .../modules/facture/doc/pdf_crabe.modules.php | 16 +++--- .../facture/doc/pdf_sponge.modules.php | 16 +++--- .../modules/printing/printipp.modules.php | 2 +- .../modules/propale/doc/pdf_azur.modules.php | 20 +++---- .../modules/propale/doc/pdf_cyan.modules.php | 20 +++---- .../pdf/pdf_canelle.modules.php | 6 +- .../pdf/pdf_muscadet.modules.php | 10 ++-- .../doc/pdf_aurore.modules.php | 16 +++--- htdocs/core/tpl/advtarget.tpl.php | 4 +- htdocs/fourn/commande/orderstoinvoice.php | 4 +- htdocs/hrm/admin/admin_hrm.php | 2 +- htdocs/hrm/class/establishment.class.php | 2 +- htdocs/margin/checkMargins.php | 2 +- .../class/productcustomerprice.class.php | 10 ++-- htdocs/product/document.php | 2 +- htdocs/product/traduction.php | 2 +- htdocs/projet/class/project.class.php | 55 +++++++------------ htdocs/resource/list.php | 2 +- htdocs/societe/price.php | 2 +- 54 files changed, 219 insertions(+), 231 deletions(-) diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index b5c1ae5b6a9..08a8234a680 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -190,6 +190,9 @@ + + + diff --git a/dev/translation/autotranslator.class.php b/dev/translation/autotranslator.class.php index 569bcc9dfd4..ae5919d318b 100644 --- a/dev/translation/autotranslator.class.php +++ b/dev/translation/autotranslator.class.php @@ -167,7 +167,7 @@ class autoTranslator fwrite($fp, "\n"); fwrite($fp, "// START - Lines generated via autotranslator.php tool (".$this->_time.").\n"); fwrite($fp, "// Reference language: ".$this->_refLang." -> ".$my_destlang."\n"); - foreach( $this->_translatedFiles[$file] as $line) { + foreach($this->_translatedFiles[$file] as $line) { fwrite($fp, $line . "\n"); } fwrite($fp, "// STOP - Lines generated via autotranslator.php tool (".$this->_time_end.").\n"); @@ -209,7 +209,7 @@ class autoTranslator { //print "key =".$key."\n"; - foreach( $content as $line ) { + foreach($content as $line) { $destKey = $this->getLineKey($line); $destValue = $this->getLineValue($line); // If translated return diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index 14eec9fa58a..a0664bc0b66 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -61,7 +61,7 @@ $accountingcategory = new AccountancyCategory($db); // si ajout de comptes if (! empty($selectcpt)) { $cpts = array (); - foreach ( $selectcpt as $selectedoption ) { + foreach ($selectcpt as $selectedoption) { if (! array_key_exists($selectedoption, $cpts)) $cpts[$selectedoption] = "'" . $selectedoption . "'"; } @@ -167,7 +167,7 @@ if ($action == 'display' || $action == 'delete') { } if (is_array($accountingcategory->lines_display) && count($accountingcategory->lines_display) > 0) { - foreach ( $accountingcategory->lines_display as $cpt ) { + foreach ($accountingcategory->lines_display as $cpt) { print ''; print '' . length_accountg($cpt->account_number) . ''; print '' . $cpt->label . ''; diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 1cd00627aa3..5b39a38657f 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -96,7 +96,7 @@ if (GETPOST('change_chart', 'alpha')) if ($action == 'update') { $error = 0; - foreach ( $list_account_main as $constname ) { + foreach ($list_account_main as $constname) { $constvalue = GETPOST($constname, 'alpha'); if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { @@ -104,7 +104,7 @@ if ($action == 'update') { } } - foreach ( $list_account as $constname ) { + foreach ($list_account as $constname) { $constvalue = GETPOST($constname, 'alpha'); if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index 21fef9a1930..15e455cf84c 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -96,7 +96,7 @@ if ($action == 'update') { $error ++; } - foreach ( $main_option as $constname ) { + foreach ($main_option as $constname) { $constvalue = GETPOST($constname, 'alpha'); if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { @@ -104,7 +104,7 @@ if ($action == 'update') { } } - foreach ($listparam[$modelcsv] as $key => $value ) { + foreach ($listparam[$modelcsv] as $key => $value) { $constante = $key; if (strpos($constante, 'ACCOUNTING')!==false) { @@ -198,7 +198,7 @@ print "\n"; $num = count($main_option); if ($num) { - foreach ( $main_option as $key ) { + foreach ($main_option as $key) { print ''; @@ -256,7 +256,7 @@ if ($num2) { print '' . $langs->trans('OtherOptions') . ''; print "\n"; - foreach ( $model_option as $key) { + foreach ($model_option as $key) { print ''; // Param diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 06641d7d0a9..2eb2bcdcfe9 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -58,7 +58,7 @@ static $tmpstatut2label = array ( $statut2label = array ( '' ); -foreach ( $tmpstatut2label as $key => $val ) +foreach ($tmpstatut2label as $key => $val) $statut2label[$key] = $langs->trans($val); $errors = array (); diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 19f6da0c922..6dff344a8cd 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -50,7 +50,7 @@ static $tmpstatut2label = array ( $statut2label = array ( '' ); -foreach ( $tmpstatut2label as $key => $val ) +foreach ($tmpstatut2label as $key => $val) $statut2label[$key] = $langs->trans($val); $object = new Fiscalyear($db); diff --git a/htdocs/accountancy/admin/importaccounts.php b/htdocs/accountancy/admin/importaccounts.php index 236ca09cfee..a5f2735eb81 100644 --- a/htdocs/accountancy/admin/importaccounts.php +++ b/htdocs/accountancy/admin/importaccounts.php @@ -68,7 +68,7 @@ if ($_POST["action"] == 'import') { $obj = $db->fetch_object($result); $cpt = 0; - foreach ( $to_import as $maLigneCochee ) { + foreach ($to_import as $maLigneCochee) { $accounting = new AccountingAccount($db); diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 78d2ac08e14..80b0667619b 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -134,7 +134,7 @@ if ($action == 'update') { $arrayofdifferentselectedvalues = array(); $cpt = 0; $ok = 0; $ko = 0; - foreach ( $chk_prod as $productid ) + foreach ($chk_prod as $productid) { $accounting_account_id = GETPOST('codeventil_' . $productid); diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 6885df63b61..bf425ffb992 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -605,7 +605,7 @@ class AccountancyCategory // extends CommonObject // Commit or rollback if ($error) { - foreach ( $this->errors as $errmsg ) { + foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__ . " " . $errmsg, LOG_ERR); $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); } @@ -644,7 +644,7 @@ class AccountancyCategory // extends CommonObject // Commit or rollback if ($error) { - foreach ( $this->errors as $errmsg ) { + foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__ . " " . $errmsg, LOG_ERR); $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); } diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index d61932884dc..c10cdd2d9a0 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -272,7 +272,7 @@ class AccountancyExport */ public function exportCegid($objectLines) { - foreach ( $objectLines as $line ) { + foreach ($objectLines as $line) { $date = dol_print_date($line->doc_date, '%d%m%Y'); $separator = ";"; $end_line = "\n"; @@ -298,7 +298,7 @@ class AccountancyExport */ public function exportCogilog($objectLines) { - foreach ( $objectLines as $line ) { + foreach ($objectLines as $line) { $date = dol_print_date($line->doc_date, '%d%m%Y'); $separator = ";"; $end_line = "\n"; @@ -336,7 +336,7 @@ class AccountancyExport $separator = ";"; $end_line = "\n"; - foreach ( $objectLines as $line ) { + foreach ($objectLines as $line) { $date = dol_print_date($line->doc_date, '%d/%m/%Y'); print $date . $separator; print $line->code_journal . $separator; @@ -365,7 +365,7 @@ class AccountancyExport $separator = ";"; $end_line = "\n"; - foreach ( $objectLines as $line ) { + foreach ($objectLines as $line) { print $line->piece_num . $separator; $date = dol_print_date($line->doc_date, '%d/%m/%Y'); print $date . $separator; @@ -405,7 +405,7 @@ class AccountancyExport $i = 1; $date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be yyyymmdd - foreach ( $TData as $data ) { + foreach ($TData as $data) { $code_compta = $data->numero_compte; if (! empty($data->subledger_account)) $code_compta = $data->subledger_account; @@ -447,7 +447,7 @@ class AccountancyExport //We should use dol_now function not time however this is wrong date to transfert in accounting //$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy //$date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy - foreach ( $TData as $data ) { + foreach ($TData as $data) { $code_compta = $data->numero_compte; if (! empty($data->subledger_account)) $code_compta = $data->subledger_account; @@ -528,7 +528,7 @@ class AccountancyExport $separator = ','; $end_line = "\n"; - foreach ( $objectLines as $line ) { + foreach ($objectLines as $line) { $date = dol_print_date($line->doc_date, '%d%m%Y'); @@ -561,7 +561,7 @@ class AccountancyExport $separator = ';'; $end_line = "\n"; - foreach ( $objectLines as $line ) { + foreach ($objectLines as $line) { $date = dol_print_date($line->doc_date, '%d%m%Y'); @@ -652,7 +652,7 @@ class AccountancyExport print "Idevise"; print $end_line; - foreach ( $objectLines as $line ) { + foreach ($objectLines as $line) { $date_creation = dol_print_date($line->date_creation, '%d%m%Y'); $date_doc = dol_print_date($line->doc_date, '%d%m%Y'); $date_valid = dol_print_date($line->date_validated, '%d%m%Y'); diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 681073332d7..54303610aeb 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -440,7 +440,7 @@ class AccountingAccount extends CommonObject // Commit or rollback if ($error) { - foreach ( $this->errors as $errmsg ) { + foreach ($this->errors as $errmsg) { dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR); $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); } diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index 2a2d050af7b..1a1dcde67a8 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -153,7 +153,7 @@ class AccountingJournal extends CommonObject // Manage filter $sqlwhere = array(); if (count($filter) > 0) { - foreach ( $filter as $key => $value ) { + foreach ($filter as $key => $value) { if ($key == 't.code' || $key == 't.label' || $key == 't.nature') { $sqlwhere[] = $key . '\'' . $this->db->escape($value) . '\''; } elseif ($key == 't.rowid' || $key == 't.active') { diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 2aaf918b197..b777d3792b6 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -777,7 +777,7 @@ class BookKeeping extends CommonObject // Manage filter $sqlwhere = array (); if (count($filter) > 0) { - foreach ( $filter as $key => $value ) { + foreach ($filter as $key => $value) { if ($key == 't.doc_date') { $sqlwhere[] = $key . '=\'' . $this->db->idate($value) . '\''; } elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=') { @@ -909,7 +909,7 @@ class BookKeeping extends CommonObject // Manage filter $sqlwhere = array (); if (count($filter) > 0) { - foreach ( $filter as $key => $value ) { + foreach ($filter as $key => $value) { if ($key == 't.doc_date') { $sqlwhere[] = $key . '=\'' . $this->db->idate($value) . '\''; } elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=') { @@ -1021,7 +1021,7 @@ class BookKeeping extends CommonObject // Manage filter $sqlwhere = array (); if (count($filter) > 0) { - foreach ( $filter as $key => $value ) { + foreach ($filter as $key => $value) { if ($key == 't.doc_date') { $sqlwhere[] = $key . '=\'' . $this->db->idate($value) . '\''; } elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=') { @@ -1360,7 +1360,7 @@ class BookKeeping extends CommonObject if (! $resql) { $this->errors[] = "Error " . $this->db->lasterror(); - foreach ( $this->errors as $errmsg ) { + foreach ($this->errors as $errmsg) { dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR); $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); } @@ -1394,7 +1394,7 @@ class BookKeeping extends CommonObject if (! $resql) { $this->errors[] = "Error " . $this->db->lasterror(); - foreach ( $this->errors as $errmsg ) { + foreach ($this->errors as $errmsg) { dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR); $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); } diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index 83a018a24cc..88dd5a8ada7 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -216,7 +216,7 @@ class Lettering extends BookKeeping } } if ($error) { - foreach ( $this->errors as $errmsg ) { + foreach ($this->errors as $errmsg) { dol_syslog(get_class($this) . "::" . __METHOD__ . $errmsg, LOG_ERR); $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); } @@ -302,7 +302,7 @@ class Lettering extends BookKeeping } // Commit or rollback if ($error) { - foreach ( $this->errors as $errmsg ) { + foreach ($this->errors as $errmsg) { dol_syslog(get_class($this) . "::update " . $errmsg, LOG_ERR); $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); } diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index bf6f597924d..346da91b94a 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -128,7 +128,7 @@ if ($massaction == 'ventil') { $ok=0; $ko=0; - foreach ( $mesCasesCochees as $maLigneCochee ) { + foreach ($mesCasesCochees as $maLigneCochee) { $maLigneCourante = explode("_", $maLigneCochee); $monId = $maLigneCourante[0]; $monCompte = GETPOST('codeventil'.$monId); diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index b6b5137fe34..6e25fb89d61 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -452,7 +452,7 @@ if (! $error && $action == 'writebookkeeping') { $now = dol_now(); $error = 0; - foreach ( $tabpay as $key => $val ) // $key is rowid into llx_bank + foreach ($tabpay as $key => $val) // $key is rowid into llx_bank { $date = dol_print_date($db->jdate($val["date"]), 'day'); @@ -474,7 +474,7 @@ if (! $error && $action == 'writebookkeeping') { if (! $errorforline && is_array($tabbq[$key])) { // Line into bank account - foreach ( $tabbq[$key] as $k => $mt ) + foreach ($tabbq[$key] as $k => $mt) { if ($mt) { @@ -537,7 +537,7 @@ if (! $error && $action == 'writebookkeeping') { if (is_array($tabtp[$key])) { // Line into thirdparty account - foreach ( $tabtp[$key] as $k => $mt ) { + foreach ($tabtp[$key] as $k => $mt) { if ($mt) { $reflabel = ''; @@ -672,7 +672,7 @@ if (! $error && $action == 'writebookkeeping') { } } else { // If thirdparty unkown, output the waiting account - foreach ( $tabbq[$key] as $k => $mt ) { + foreach ($tabbq[$key] as $k => $mt) { if ($mt) { $reflabel = ''; @@ -800,14 +800,14 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! print "\n"; - foreach ( $tabpay as $key => $val ) + foreach ($tabpay as $key => $val) { $date = dol_print_date($db->jdate($val["date"]), 'day'); $ref = getSourceDocRef($val, $tabtype[$key]); // Bank - foreach ( $tabbq[$key] as $k => $mt ) { + foreach ($tabbq[$key] as $k => $mt) { if ($mt) { $reflabel = ''; @@ -832,7 +832,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! // Third party if (is_array($tabtp[$key])) { - foreach ( $tabtp[$key] as $k => $mt ) { + foreach ($tabtp[$key] as $k => $mt) { if ($mt) { $reflabel = ''; @@ -864,7 +864,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! } } } else { // If thirdparty unkown, output the waiting account - foreach ( $tabbq[$key] as $k => $mt ) { + foreach ($tabbq[$key] as $k => $mt) { if ($mt) { $reflabel = ''; @@ -1000,14 +1000,14 @@ if (empty($action) || $action == 'view') { $r = ''; - foreach ( $tabpay as $key => $val ) // $key is rowid in llx_bank + foreach ($tabpay as $key => $val) // $key is rowid in llx_bank { $date = dol_print_date($db->jdate($val["date"]), 'day'); $ref = getSourceDocRef($val, $tabtype[$key]); // Bank - foreach ( $tabbq[$key] as $k => $mt ) + foreach ($tabbq[$key] as $k => $mt) { if ($mt) { @@ -1052,7 +1052,7 @@ if (empty($action) || $action == 'view') { // Third party if (is_array($tabtp[$key])) { - foreach ( $tabtp[$key] as $k => $mt ) { + foreach ($tabtp[$key] as $k => $mt) { if ($mt) { $reflabel = ''; @@ -1132,7 +1132,7 @@ if (empty($action) || $action == 'view') { } } } else { // Waiting account - foreach ( $tabbq[$key] as $k => $mt ) { + foreach ($tabbq[$key] as $k => $mt) { if ($mt) { $reflabel = ''; diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 34a8d219b90..9a35af731cf 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -200,7 +200,7 @@ if ($action == 'writebookkeeping') { // Thirdparty if (! $errorforline) { - foreach ( $tabttc[$key] as $k => $mt ) { + foreach ($tabttc[$key] as $k => $mt) { if ($mt) { $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; @@ -251,7 +251,7 @@ if ($action == 'writebookkeeping') { // Fees if (! $errorforline) { - foreach ( $tabht[$key] as $k => $mt ) { + foreach ($tabht[$key] as $k => $mt) { if ($mt) { // get compte id and label if ($accountingaccount->fetch(null, $k, true)) { @@ -309,7 +309,7 @@ if ($action == 'writebookkeeping') { if ($numtax == 1) $arrayofvat = $tablocaltax1; if ($numtax == 2) $arrayofvat = $tablocaltax2; - foreach ( $arrayofvat[$key] as $k => $mt ) { + foreach ($arrayofvat[$key] as $k => $mt) { if ($mt) { // get compte id and label $bookkeeping = new BookKeeping($db); @@ -442,14 +442,14 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! print '"' . $langs->transnoentitiesnoconv("Credit") . '"' . $sep; print "\n"; - foreach ( $taber as $key => $val ) { + foreach ($taber as $key => $val) { $date = dol_print_date($val["date"], 'day'); $userstatic->id = $tabuser[$key]['id']; $userstatic->name = $tabuser[$key]['name']; // Fees - foreach ( $tabht[$key] as $k => $mt ) { + foreach ($tabht[$key] as $k => $mt) { $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch(null, $k, true); if ($mt) { @@ -463,7 +463,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! } } // VAT - foreach ( $tabtva[$key] as $k => $mt ) { + foreach ($tabtva[$key] as $k => $mt) { if ($mt) { print '"' . $date . '"' . $sep; print '"' . $val["ref"] . '"' . $sep; @@ -476,7 +476,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! } // Third party - foreach ( $tabttc[$key] as $k => $mt ) { + foreach ($tabttc[$key] as $k => $mt) { print '"' . $date . '"' . $sep; print '"' . $val["ref"] . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; @@ -564,7 +564,7 @@ if (empty($action) || $action == 'view') { $expensereportstatic = new ExpenseReport($db); $expensereportlinestatic = new ExpenseReportLine($db); - foreach ( $taber as $key => $val ) { + foreach ($taber as $key => $val) { $expensereportstatic->id = $key; $expensereportstatic->ref = $val["ref"]; $expensereportlinestatic->comments = html_entity_decode(dol_trunc($val["comments"], 32)); @@ -572,7 +572,7 @@ if (empty($action) || $action == 'view') { $date = dol_print_date($val["date"], 'day'); // Fees - foreach ( $tabht[$key] as $k => $mt ) { + foreach ($tabht[$key] as $k => $mt) { $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch(null, $k, true); @@ -605,7 +605,7 @@ if (empty($action) || $action == 'view') { } // Third party - foreach ( $tabttc[$key] as $k => $mt ) { + foreach ($tabttc[$key] as $k => $mt) { print ''; print ""; print "" . $date . ""; @@ -643,7 +643,7 @@ if (empty($action) || $action == 'view') { if ($numtax == 1) $arrayofvat = $tablocaltax1; if ($numtax == 2) $arrayofvat = $tablocaltax2; - foreach ( $arrayofvat[$key] as $k => $mt ) { + foreach ($arrayofvat[$key] as $k => $mt) { if ($mt) { print ''; print ""; diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 54024fe6471..2d3db40ecdf 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -296,7 +296,7 @@ if ($action == 'writebookkeeping') { // Thirdparty if (! $errorforline) { - foreach ( $tabttc[$key] as $k => $mt ) { + foreach ($tabttc[$key] as $k => $mt) { //if ($mt) { $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; @@ -351,7 +351,7 @@ if ($action == 'writebookkeeping') { // Product / Service if (! $errorforline) { - foreach ( $tabht[$key] as $k => $mt ) { + foreach ($tabht[$key] as $k => $mt) { //if ($mt) { // get compte id and label if ($accountingaccount->fetch(null, $k, true)) { @@ -414,7 +414,7 @@ if ($action == 'writebookkeeping') { if ($numtax == 1) $arrayofvat = $tablocaltax1; if ($numtax == 2) $arrayofvat = $tablocaltax2; - foreach ( $arrayofvat[$key] as $k => $mt ) { + foreach ($arrayofvat[$key] as $k => $mt) { if ($mt) { $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; @@ -471,7 +471,7 @@ if ($action == 'writebookkeeping') { // var_dump($tabother); if (! $errorforline && is_array($tabother[$key])) { - foreach ( $tabother[$key] as $k => $mt ) { + foreach ($tabother[$key] as $k => $mt) { if ($mt) { $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; @@ -593,7 +593,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! $companystatic = new Fournisseur($db); $invoicestatic = new FactureFournisseur($db); - foreach ( $tabfac as $key => $val ) + foreach ($tabfac as $key => $val) { $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; @@ -628,7 +628,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! } // Third party - foreach ( $tabttc[$key] as $k => $mt ) { + foreach ($tabttc[$key] as $k => $mt) { //if ($mt) { print '"' . $key . '"' . $sep; print '"' . $date . '"' . $sep; @@ -647,7 +647,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! } // Product / Service - foreach ( $tabht[$key] as $k => $mt ) { + foreach ($tabht[$key] as $k => $mt) { $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch(null, $k, true); //if ($mt) { @@ -695,7 +695,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! // VAT counterpart for NPR if (is_array($tabother[$key])) { - foreach ( $tabother[$key] as $k => $mt ) { + foreach ($tabother[$key] as $k => $mt) { if ($mt) { print '"' . $key . '"' . $sep; print '"' . $date . '"' . $sep; @@ -797,7 +797,7 @@ if (empty($action) || $action == 'view') { $invoicestatic = new FactureFournisseur($db); $companystatic = new Fournisseur($db); - foreach ( $tabfac as $key => $val ) + foreach ($tabfac as $key => $val) { $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; @@ -868,7 +868,7 @@ if (empty($action) || $action == 'view') { } // Third party - foreach ( $tabttc[$key] as $k => $mt ) { + foreach ($tabttc[$key] as $k => $mt) { //if ($mt) { print ''; print ""; @@ -900,7 +900,7 @@ if (empty($action) || $action == 'view') { } // Product / Service - foreach ( $tabht[$key] as $k => $mt ) { + foreach ($tabht[$key] as $k => $mt) { $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch(null, $k, true); @@ -937,7 +937,7 @@ if (empty($action) || $action == 'view') { if ($numtax == 1) $arrayofvat = $tablocaltax1; if ($numtax == 2) $arrayofvat = $tablocaltax2; - foreach ( $arrayofvat[$key] as $k => $mt ) { + foreach ($arrayofvat[$key] as $k => $mt) { if ($mt) { print ''; print ""; @@ -968,7 +968,7 @@ if (empty($action) || $action == 'view') { // VAT counterpart for NPR if (is_array($tabother[$key])) { - foreach ( $tabother[$key] as $k => $mt ) { + foreach ($tabother[$key] as $k => $mt) { if ($mt) { print ''; print ""; diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 9526bc763ec..be430271e5f 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -307,7 +307,7 @@ if ($action == 'writebookkeeping') { // Thirdparty if (! $errorforline) { - foreach ( $tabttc[$key] as $k => $mt ) { + foreach ($tabttc[$key] as $k => $mt) { //if ($mt) { $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; @@ -362,7 +362,7 @@ if ($action == 'writebookkeeping') { // Product / Service if (! $errorforline) { - foreach ( $tabht[$key] as $k => $mt ) { + foreach ($tabht[$key] as $k => $mt) { //if ($mt) { // get compte id and label if ($accountingaccount->fetch(null, $k, true)) { @@ -424,7 +424,7 @@ if ($action == 'writebookkeeping') { if ($numtax == 1) $arrayofvat = $tablocaltax1; if ($numtax == 2) $arrayofvat = $tablocaltax2; - foreach ( $arrayofvat[$key] as $k => $mt ) { + foreach ($arrayofvat[$key] as $k => $mt) { if ($mt) { $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; @@ -553,7 +553,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! $companystatic = new Client($db); $invoicestatic = new Facture($db); - foreach ( $tabfac as $key => $val ) + foreach ($tabfac as $key => $val) { $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; @@ -734,7 +734,7 @@ if (empty($action) || $action == 'view') { $companystatic = new Client($db); $invoicestatic = new Facture($db); - foreach ( $tabfac as $key => $val ) + foreach ($tabfac as $key => $val) { $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; @@ -875,7 +875,7 @@ if (empty($action) || $action == 'view') { if ($numtax == 1) $arrayofvat = $tablocaltax1; if ($numtax == 2) $arrayofvat = $tablocaltax2; - foreach ( $arrayofvat[$key] as $k => $mt ) { + foreach ($arrayofvat[$key] as $k => $mt) { if ($mt) { print ''; print ""; diff --git a/htdocs/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php index ac78883bc4f..24af15b1e1f 100644 --- a/htdocs/cashdesk/facturation.php +++ b/htdocs/cashdesk/facturation.php @@ -74,7 +74,7 @@ if ( GETPOST('filtre','alpha') ) { while ($i < $conf_taille_listes && $tab = $db->fetch_array($resql) ) { - foreach ( $tab as $cle => $valeur ) + foreach ($tab as $cle => $valeur) { $ret[$i][$cle] = $valeur; } @@ -110,7 +110,7 @@ if ( GETPOST('filtre','alpha') ) { while ($i < $conf_taille_listes && $tab = $db->fetch_array($resql)) { - foreach ( $tab as $cle => $valeur ) + foreach ($tab as $cle => $valeur) { $ret[$i][$cle] = $valeur; } diff --git a/htdocs/cashdesk/facturation_dhtml.php b/htdocs/cashdesk/facturation_dhtml.php index c30b5654828..91b98b0923d 100644 --- a/htdocs/cashdesk/facturation_dhtml.php +++ b/htdocs/cashdesk/facturation_dhtml.php @@ -76,7 +76,7 @@ if (dol_strlen($search) >= 0) // If search criteria is on char length at least $ret=array(); $i=0; while ( $tab = $db->fetch_array($result) ) { - foreach ( $tab as $cle => $valeur ) + foreach ($tab as $cle => $valeur) { $ret[$i][$cle] = $valeur; } diff --git a/htdocs/cashdesk/facturation_verif.php b/htdocs/cashdesk/facturation_verif.php index a643a9197e2..1eea11ea917 100644 --- a/htdocs/cashdesk/facturation_verif.php +++ b/htdocs/cashdesk/facturation_verif.php @@ -64,7 +64,7 @@ switch($action) { $ret=array(); $tab = $db->fetch_array($result); - foreach ( $tab as $key => $value ) + foreach ($tab as $key => $value) { $ret[$key] = $value; } diff --git a/htdocs/cashdesk/index_verif.php b/htdocs/cashdesk/index_verif.php index 8976434b559..fb1c70de463 100644 --- a/htdocs/cashdesk/index_verif.php +++ b/htdocs/cashdesk/index_verif.php @@ -107,7 +107,7 @@ if ( $retour >= 0 ) { $tab = $db->fetch_array($res); - foreach ( $tab as $key => $value ) + foreach ($tab as $key => $value) { $return[$key] = $value; } diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index f683a791e72..cd94ac2ec10 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -110,7 +110,7 @@ $cancel != $langs->trans("Cancel") && $object->fetch($id); $current_lang = $langs->getDefaultLang(); - foreach ( $object->multilangs as $key => $value ) // enregistrement des nouvelles valeurs dans l'objet + foreach ($object->multilangs as $key => $value) // enregistrement des nouvelles valeurs dans l'objet { if ( $key == $current_lang ) { diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index 8aa14a45b85..9ec2cdc07a1 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -121,7 +121,7 @@ if ($action == 'add') { // Get extra fields - foreach ( $_POST as $key => $value ) { + foreach ($_POST as $key => $value) { // print '$key='.$key.' $value='.$value.'
'; if (preg_match("/^options_.*(? $value ) { + foreach ($_POST as $key => $value) { if (preg_match("/^options_.*(?lines as $line ) { + foreach ($this->lines as $line) { $result = $clonedObj->addline($line->desc, $line->subprice, $line->qty, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->fk_product, $line->remise_percent, $line->date_ouverture, $line->date_cloture, 'HT', 0, $line->info_bits, $line->fk_fournprice, $line->pa_ht, $line->array_options, $line->fk_unit); if ($result < 0) { $error ++; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4f1d1d21c02..c268c293e56 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5835,7 +5835,7 @@ abstract class CommonObject $fields_label = explode('|', $InfoFieldList[1]); if (is_array($fields_label)) { $notrans = true; - foreach ( $fields_label as $field_toshow ) { + foreach ($fields_label as $field_toshow) { $labeltoshow .= $obj->$field_toshow . ' '; } } else { @@ -5844,7 +5844,7 @@ abstract class CommonObject $labeltoshow = dol_trunc($labeltoshow, 45); if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) { - foreach ( $fields_label as $field_toshow ) { + foreach ($fields_label as $field_toshow) { $translabel = $langs->trans($obj->$field_toshow); if ($translabel != $obj->$field_toshow) { $labeltoshow = dol_trunc($translabel, 18) . ' '; @@ -6244,7 +6244,7 @@ abstract class CommonObject $fields_label = explode('|', $InfoFieldList[1]); if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) { if (is_array($fields_label) && count($fields_label) > 1) { - foreach ( $fields_label as $field_toshow ) { + foreach ($fields_label as $field_toshow) { $translabel = ''; if (! empty($obj->$field_toshow)) { $translabel = $langs->trans($obj->$field_toshow); diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 77ee805295d..93b56c111be 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1424,7 +1424,7 @@ class ExtraFields $fields_label = explode('|', $InfoFieldList[1]); if (is_array($fields_label)) { $notrans = true; - foreach ( $fields_label as $field_toshow ) { + foreach ($fields_label as $field_toshow) { $labeltoshow .= $obj->$field_toshow . ' '; } } else { @@ -1433,7 +1433,7 @@ class ExtraFields $labeltoshow = dol_trunc($labeltoshow, 45); if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) { - foreach ( $fields_label as $field_toshow ) { + foreach ($fields_label as $field_toshow) { $translabel = $langs->trans($obj->$field_toshow); if ($translabel != $obj->$field_toshow) { $labeltoshow = dol_trunc($translabel, 18) . ' '; @@ -1731,7 +1731,7 @@ class ExtraFields $fields_label = explode('|', $InfoFieldList[1]); if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) { if (is_array($fields_label) && count($fields_label) > 1) { - foreach ( $fields_label as $field_toshow ) { + foreach ($fields_label as $field_toshow) { $translabel = ''; if (! empty($obj->$field_toshow)) { $translabel = $langs->trans($obj->$field_toshow); diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index e83e83dde83..c88939e9563 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -580,7 +580,7 @@ class SMTPs // 'RCPT TO:' must be given a single address, so this has to loop // through the list of addresses, regardless of TO, CC or BCC // and send it out "single file" - foreach ( $this->get_RCPT_list() as $_address ) + foreach ($this->get_RCPT_list() as $_address) { /* Note: * BCC email addresses must be listed in the RCPT TO command list, @@ -1006,7 +1006,7 @@ class SMTPs } // take the array of addresses and split them further - foreach ( $_addrList as $_strAddr ) + foreach ($_addrList as $_strAddr) { // Strip off the end '>' $_strAddr = str_replace('>', '', $_strAddr); @@ -1110,11 +1110,11 @@ class SMTPs $_RCPT_list=array(); // walk down Recipients array and pull just email addresses - foreach ( $this->_msgRecipients as $_host => $_list ) + foreach ($this->_msgRecipients as $_host => $_list) { - foreach ( $_list as $_subList ) + foreach ($_list as $_subList) { - foreach ( $_subList as $_name => $_addr ) + foreach ($_subList as $_name => $_addr) { // build RCPT list $_RCPT_list[] = $_name . '@' . $_host; @@ -1143,11 +1143,11 @@ class SMTPs { $_RCPT_list=array(); // walk down Recipients array and pull just email addresses - foreach ( $this->_msgRecipients as $_host => $_list ) + foreach ($this->_msgRecipients as $_host => $_list) { if ( $this->_msgRecipients[$_host][$_which] ) { - foreach ( $this->_msgRecipients[$_host][$_which] as $_addr => $_realName ) + foreach ($this->_msgRecipients[$_host][$_which] as $_addr => $_realName) { if ( $_realName ) // @CHANGE LDR { @@ -1459,12 +1459,12 @@ class SMTPs // Loop through message content array - foreach ($this->_msgContent as $type => $_content ) + foreach ($this->_msgContent as $type => $_content) { if ( $type == 'attachment' ) { // loop through all attachments - foreach ( $_content as $_file => $_data ) + foreach ($_content as $_file => $_data) { $content .= "--" . $this->_getBoundary('mixed') . "\r\n" . 'Content-Disposition: attachment; filename="' . $_data['fileName'] . '"' . "\r\n" @@ -1482,7 +1482,7 @@ class SMTPs elseif ( $type == 'image' ) { // loop through all images - foreach ( $_content as $_image => $_data ) + foreach ($_content as $_image => $_data) { $content .= "--" . $this->_getBoundary('related') . "\r\n"; // always related for an inline image @@ -1847,7 +1847,7 @@ class SMTPs if (is_array($this->_smtpsErrors)) { - foreach ( $this->_smtpsErrors as $_err => $_info ) + foreach ($this->_smtpsErrors as $_err => $_info) { $_errMsg[] = 'Error [' . $_info['num'] .']: '. $_info['msg']; } diff --git a/htdocs/core/filemanagerdol/connectors/php/commands.php b/htdocs/core/filemanagerdol/connectors/php/commands.php index 1934c702dfb..cf7caa6dc2b 100644 --- a/htdocs/core/filemanagerdol/connectors/php/commands.php +++ b/htdocs/core/filemanagerdol/connectors/php/commands.php @@ -53,7 +53,7 @@ function GetFolders($resourceType, $currentFolder) echo "" ; natcasesort($aFolders); - foreach ( $aFolders as $sFolder ) + foreach ($aFolders as $sFolder) echo $sFolder ; // Close the "Folders" node. @@ -110,7 +110,7 @@ function GetFoldersAndFiles($resourceType, $currentFolder) natcasesort($aFolders); echo '' ; - foreach ( $aFolders as $sFolder ) + foreach ($aFolders as $sFolder) echo $sFolder ; echo '' ; @@ -119,7 +119,7 @@ function GetFoldersAndFiles($resourceType, $currentFolder) natcasesort($aFiles); echo '' ; - foreach ( $aFiles as $sFiles ) + foreach ($aFiles as $sFiles) echo $sFiles ; echo '' ; diff --git a/htdocs/core/filemanagerdol/connectors/php/util.php b/htdocs/core/filemanagerdol/connectors/php/util.php index 42a673516a4..1249a1ef555 100644 --- a/htdocs/core/filemanagerdol/connectors/php/util.php +++ b/htdocs/core/filemanagerdol/connectors/php/util.php @@ -117,7 +117,7 @@ function IsHtmlExtension($ext, $formExtensions) return false ; } $lcaseHtmlExtensions = array(); - foreach ( $formExtensions as $key => $val ) + foreach ($formExtensions as $key => $val) { $lcaseHtmlExtensions[$key] = strtolower($val); } @@ -162,7 +162,7 @@ function DetectHtml($filePath) $tags = array( 'getNomUrl(1,'',10).''; } elseif (isset($histo[$key]['socpeopleassigned']) && is_array($histo[$key]['socpeopleassigned']) && count($histo[$key]['socpeopleassigned']) > 0) { $out .= ''; - foreach ( $histo[$key]['socpeopleassigned'] as $cid => $Tab ) { + foreach ($histo[$key]['socpeopleassigned'] as $cid => $Tab) { $contact = new Contact($db); $result = $contact->fetch($cid); diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 879319db2b9..673f3a2ea93 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -911,10 +911,10 @@ class pdf_einstein extends ModelePDFCommandes //Local tax 1 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) + foreach($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1','3','5'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey!=0) // On affiche pas taux 0 { @@ -942,10 +942,10 @@ class pdf_einstein extends ModelePDFCommandes //Local tax 2 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) + foreach($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1','3','5'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey!=0) // On affiche pas taux 0 { @@ -1000,11 +1000,11 @@ class pdf_einstein extends ModelePDFCommandes //Local tax 1 after VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) + foreach($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey != 0) // On affiche pas taux 0 { @@ -1032,11 +1032,11 @@ class pdf_einstein extends ModelePDFCommandes //Local tax 2 after VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) + foreach($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey != 0) // On affiche pas taux 0 { diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index a67327fa249..36b80eea738 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -969,10 +969,10 @@ class pdf_eratosthene extends ModelePDFCommandes //Local tax 1 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) + foreach($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1','3','5'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey!=0) // On affiche pas taux 0 { @@ -1000,10 +1000,10 @@ class pdf_eratosthene extends ModelePDFCommandes //Local tax 2 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) + foreach($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1','3','5'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey!=0) // On affiche pas taux 0 { @@ -1058,11 +1058,11 @@ class pdf_eratosthene extends ModelePDFCommandes //Local tax 1 after VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) + foreach($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey != 0) // On affiche pas taux 0 { @@ -1090,11 +1090,11 @@ class pdf_eratosthene extends ModelePDFCommandes //Local tax 2 after VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) + foreach($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey != 0) // On affiche pas taux 0 { diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 8e2b5a8b198..4dcc909326f 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1143,11 +1143,11 @@ class pdf_crabe extends ModelePDFFactures //Local tax 1 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) + foreach($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1','3','5'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey!=0) // On affiche pas taux 0 { @@ -1176,11 +1176,11 @@ class pdf_crabe extends ModelePDFFactures //Local tax 2 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) + foreach($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1','3','5'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey!=0) // On affiche pas taux 0 { @@ -1254,11 +1254,11 @@ class pdf_crabe extends ModelePDFFactures //Local tax 1 after VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) + foreach($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey != 0) // On affiche pas taux 0 { @@ -1286,11 +1286,11 @@ class pdf_crabe extends ModelePDFFactures //Local tax 2 after VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) + foreach($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { // retrieve global local tax if ($tvakey != 0) // On affiche pas taux 0 diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 203711fc80f..a0503cdc090 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1205,11 +1205,11 @@ class pdf_sponge extends ModelePDFFactures //Local tax 1 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) + foreach($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1','3','5'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey!=0) // On affiche pas taux 0 { @@ -1238,11 +1238,11 @@ class pdf_sponge extends ModelePDFFactures //Local tax 2 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) + foreach($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1','3','5'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey!=0) // On affiche pas taux 0 { @@ -1316,11 +1316,11 @@ class pdf_sponge extends ModelePDFFactures //Local tax 1 after VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) + foreach($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey != 0) // On affiche pas taux 0 { @@ -1348,11 +1348,11 @@ class pdf_sponge extends ModelePDFFactures //Local tax 2 after VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) + foreach($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { // retrieve global local tax if ($tvakey != 0) // On affiche pas taux 0 diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index ddf07afe71c..e45e931c46b 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -296,7 +296,7 @@ class printing_printipp extends PrintingDriver $jobs = $ipp->jobs_attributes; //$html .= '
'.print_r($jobs,true).'
'; - foreach ($jobs as $value ) { + foreach ($jobs as $value) { $html .= ''; $html .= ''.$value->job_id->_value0.''; $html .= ''.$value->job_originating_user_name->_value0.''; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 4f7bedef51b..b47a12d99ac 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -734,7 +734,7 @@ class pdf_azur extends ModelePDFPropales require_once DOL_DOCUMENT_ROOT.'/product/class/propalmergepdfproduct.class.php'; $already_merged = array (); - foreach ( $object->lines as $line ) { + foreach ($object->lines as $line) { if (! empty($line->fk_product) && ! (in_array($line->fk_product, $already_merged))) { // Find the desire PDF $filetomerge = new Propalmergepdfproduct($this->db); @@ -758,7 +758,7 @@ class pdf_azur extends ModelePDFPropales // If PDF is selected and file is not empty if (count($filetomerge->lines) > 0) { - foreach ( $filetomerge->lines as $linefile ) { + foreach ($filetomerge->lines as $linefile) { if (! empty($linefile->id) && ! empty($linefile->file_name)) { @@ -1088,11 +1088,11 @@ class pdf_azur extends ModelePDFPropales //Local tax 1 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) + foreach($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1','3','5'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey!=0) // On affiche pas taux 0 { @@ -1120,11 +1120,11 @@ class pdf_azur extends ModelePDFPropales //Local tax 2 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) + foreach($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1','3','5'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey!=0) // On affiche pas taux 0 { @@ -1179,11 +1179,11 @@ class pdf_azur extends ModelePDFPropales //Local tax 1 after VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) + foreach($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey != 0) // On affiche pas taux 0 { @@ -1211,11 +1211,11 @@ class pdf_azur extends ModelePDFPropales //Local tax 2 after VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) + foreach($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { // retrieve global local tax if ($tvakey != 0) // On affiche pas taux 0 diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index b38dbf83740..c2bf571fcf5 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -775,7 +775,7 @@ class pdf_cyan extends ModelePDFPropales require_once DOL_DOCUMENT_ROOT.'/product/class/propalmergepdfproduct.class.php'; $already_merged = array (); - foreach ( $object->lines as $line ) { + foreach ($object->lines as $line) { if (! empty($line->fk_product) && ! (in_array($line->fk_product, $already_merged))) { // Find the desire PDF $filetomerge = new Propalmergepdfproduct($this->db); @@ -799,7 +799,7 @@ class pdf_cyan extends ModelePDFPropales // If PDF is selected and file is not empty if (count($filetomerge->lines) > 0) { - foreach ( $filetomerge->lines as $linefile ) { + foreach ($filetomerge->lines as $linefile) { if (! empty($linefile->id) && ! empty($linefile->file_name)) { @@ -1122,11 +1122,11 @@ class pdf_cyan extends ModelePDFPropales //Local tax 1 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) + foreach($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1','3','5'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey!=0) // On affiche pas taux 0 { @@ -1154,11 +1154,11 @@ class pdf_cyan extends ModelePDFPropales //Local tax 2 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) + foreach($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1','3','5'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey!=0) // On affiche pas taux 0 { @@ -1213,11 +1213,11 @@ class pdf_cyan extends ModelePDFPropales //Local tax 1 after VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) + foreach($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey != 0) // On affiche pas taux 0 { @@ -1245,11 +1245,11 @@ class pdf_cyan extends ModelePDFPropales //Local tax 2 after VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) + foreach($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { // retrieve global local tax if ($tvakey != 0) // On affiche pas taux 0 diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index c15ea6e5a0b..26026cbb704 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -656,7 +656,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Show VAT by rates and total $pdf->SetFillColor(248,248,248); - foreach( $this->tva as $tvakey => $tvaval ) + foreach($this->tva as $tvakey => $tvaval) { if ($tvakey > 0) // On affiche pas taux 0 { @@ -714,7 +714,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ //Local tax 1 - foreach( $this->localtax1 as $tvakey => $tvaval ) + foreach($this->localtax1 as $tvakey => $tvaval) { if ($tvakey != 0) // On affiche pas taux 0 { @@ -742,7 +742,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ //Local tax 2 - foreach( $this->localtax2 as $tvakey => $tvaval ) + foreach($this->localtax2 as $tvakey => $tvaval) { if ($tvakey != 0) // On affiche pas taux 0 { diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index d4c548b5dc8..da9f058e26e 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -830,7 +830,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetFillColor(248,248,248); $this->atleastoneratenotnull=0; - foreach( $this->tva as $tvakey => $tvaval ) + foreach($this->tva as $tvakey => $tvaval) { if ($tvakey > 0) // On affiche pas taux 0 { @@ -889,11 +889,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ //Local tax 1 - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) + foreach($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey != 0) // On affiche pas taux 0 { @@ -921,11 +921,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ //Local tax 2 - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) + foreach($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey != 0) // On affiche pas taux 0 { diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index ee40b86377e..ed6a4815d15 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -939,11 +939,11 @@ class pdf_aurore extends ModelePDFSupplierProposal //Local tax 1 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) + foreach($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1','3','5'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey!=0) // On affiche pas taux 0 { @@ -971,11 +971,11 @@ class pdf_aurore extends ModelePDFSupplierProposal //Local tax 2 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) + foreach($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1','3','5'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey!=0) // On affiche pas taux 0 { @@ -1030,11 +1030,11 @@ class pdf_aurore extends ModelePDFSupplierProposal //Local tax 1 after VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) + foreach($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { if ($tvakey != 0) // On affiche pas taux 0 { @@ -1062,11 +1062,11 @@ class pdf_aurore extends ModelePDFSupplierProposal //Local tax 2 after VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) + foreach($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; - foreach( $localtax_rate as $tvakey => $tvaval ) + foreach($localtax_rate as $tvakey => $tvaval) { // retrieve global local tax if ($tvakey != 0) // On affiche pas taux 0 diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index af8c99c3fc7..7aaf2c682df 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -262,7 +262,7 @@ print ' - +
-
+
@@ -415,6 +415,13 @@ $( document ).ready(function() {
global->CASHDESK_ID_THIRDPARTY) or empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH) or empty($conf->global->CASHDESK_ID_BANKACCOUNT_CB)) { + setEventMessages($langs->trans("ErrorModuleSetupNotComplete"), null, 'errors'); +} +if (count($maincategories)==0){ + setEventMessages($langs->trans("TakeposNeedsCategories"), null, 'errors'); +} // User menu and external TakePOS modules $menus = array(); $r=0; From 273d68381c8b7174fa746913abf56d8cf90bdc50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 3 Feb 2019 15:21:21 +0100 Subject: [PATCH 06/10] psr2 end file new line none found --- dev/setup/codesniffer/ruleset.xml | 2 +- htdocs/admin/perms.php | 2 +- htdocs/blockedlog/ajax/check_signature.php | 2 +- htdocs/compta/cashcontrol/class/cashcontrol.class.php | 2 +- htdocs/core/actions_comments.inc.php | 2 +- htdocs/core/class/emailsenderprofile.class.php | 2 +- htdocs/core/lib/fiscalyear.lib.php | 2 +- htdocs/core/modules/modDon.class.php | 2 +- htdocs/core/modules/modSupplierProposal.class.php | 2 +- .../modules/reception/doc/doc_generic_reception_odt.modules.php | 2 +- htdocs/core/modules/reception/mod_reception_beryl.php | 2 +- htdocs/core/modules/reception/mod_reception_moonstone.php | 2 +- htdocs/core/modules/syslog/logHandler.php | 2 +- htdocs/core/modules/syslog/logHandlerInterface.php | 2 +- htdocs/core/modules/syslog/mod_syslog_syslog.php | 2 +- htdocs/core/tpl/advtarget.tpl.php | 2 +- htdocs/core/tpl/extrafields_list_search_input.tpl.php | 2 +- htdocs/core/tpl/extrafields_list_search_title.tpl.php | 2 +- htdocs/datapolicy/class/datapolicycron.class.php | 2 +- htdocs/reception/class/reception.class.php | 2 +- htdocs/takepos/ajax.php | 2 +- htdocs/variants/ajax/get_attribute_values.php | 2 +- htdocs/variants/class/ProductAttribute.class.php | 2 +- htdocs/variants/class/ProductAttributeValue.class.php | 2 +- htdocs/variants/class/ProductCombination2ValuePair.class.php | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index b5c1ae5b6a9..2ce66d75739 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -432,5 +432,5 @@ - + diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index e7cf64d768e..e3ef8417dca 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -220,4 +220,4 @@ dol_fiche_end(); // End of page llxFooter(); -$db->close(); \ No newline at end of file +$db->close(); diff --git a/htdocs/blockedlog/ajax/check_signature.php b/htdocs/blockedlog/ajax/check_signature.php index 9617e6cd1ef..51a98244c40 100644 --- a/htdocs/blockedlog/ajax/check_signature.php +++ b/htdocs/blockedlog/ajax/check_signature.php @@ -57,4 +57,4 @@ $url = $conf->global->BLOCKEDLOG_AUTHORITY_URL.'/blockedlog/ajax/authority.php?s $res = file_get_contents($url); //echo $url; -echo $res; \ No newline at end of file +echo $res; diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index 946658208df..492d8b79875 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -426,4 +426,4 @@ class CashControl extends CommonObject return $result; } -} \ No newline at end of file +} diff --git a/htdocs/core/actions_comments.inc.php b/htdocs/core/actions_comments.inc.php index ee45a035043..83af2cd53cb 100644 --- a/htdocs/core/actions_comments.inc.php +++ b/htdocs/core/actions_comments.inc.php @@ -73,4 +73,4 @@ if ($action == 'deletecomment') $action=''; } } -} \ No newline at end of file +} diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index 3ce9623a05d..b99a5e708d3 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -447,4 +447,4 @@ class EmailSenderProfileLine // @var mixed Sample line property 2 public $prop2; } -*/ \ No newline at end of file +*/ diff --git a/htdocs/core/lib/fiscalyear.lib.php b/htdocs/core/lib/fiscalyear.lib.php index 6ea24bfacc2..3fb57dd55eb 100644 --- a/htdocs/core/lib/fiscalyear.lib.php +++ b/htdocs/core/lib/fiscalyear.lib.php @@ -53,4 +53,4 @@ function fiscalyear_prepare_head(Fiscalyear $object) complete_head_from_modules($conf,$langs,$object,$head,$h,'fiscalyear','remove'); return $head; -} \ No newline at end of file +} diff --git a/htdocs/core/modules/modDon.class.php b/htdocs/core/modules/modDon.class.php index f92c1cea2a5..d30b93a0410 100644 --- a/htdocs/core/modules/modDon.class.php +++ b/htdocs/core/modules/modDon.class.php @@ -162,4 +162,4 @@ class modDon extends DolibarrModules return $this->_init($sql,$options); } -} \ No newline at end of file +} diff --git a/htdocs/core/modules/modSupplierProposal.class.php b/htdocs/core/modules/modSupplierProposal.class.php index 43d42d7b8c3..c61289e2cbf 100644 --- a/htdocs/core/modules/modSupplierProposal.class.php +++ b/htdocs/core/modules/modSupplierProposal.class.php @@ -257,4 +257,4 @@ class modSupplierProposal extends DolibarrModules return $this->_remove($sql, $options); } -} \ No newline at end of file +} diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index e9b616cb0e2..35271ca7f7d 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -519,4 +519,4 @@ class doc_generic_reception_odt extends ModelePdfReception return -1; } -} \ No newline at end of file +} diff --git a/htdocs/core/modules/reception/mod_reception_beryl.php b/htdocs/core/modules/reception/mod_reception_beryl.php index 071c7f732c3..7665079fd0b 100644 --- a/htdocs/core/modules/reception/mod_reception_beryl.php +++ b/htdocs/core/modules/reception/mod_reception_beryl.php @@ -143,4 +143,4 @@ class mod_reception_beryl extends ModelNumRefReception // phpcs:enable return $this->getNextValue($objsoc,$objforref); } -} \ No newline at end of file +} diff --git a/htdocs/core/modules/reception/mod_reception_moonstone.php b/htdocs/core/modules/reception/mod_reception_moonstone.php index ae4c4b42b48..a91dcaf5729 100644 --- a/htdocs/core/modules/reception/mod_reception_moonstone.php +++ b/htdocs/core/modules/reception/mod_reception_moonstone.php @@ -134,4 +134,4 @@ class mod_reception_moonstone extends ModelNumRefReception // phpcs:enable return $this->getNextValue($objsoc,$objforref); } -} \ No newline at end of file +} diff --git a/htdocs/core/modules/syslog/logHandler.php b/htdocs/core/modules/syslog/logHandler.php index fa013f4b083..b2e50933b87 100644 --- a/htdocs/core/modules/syslog/logHandler.php +++ b/htdocs/core/modules/syslog/logHandler.php @@ -97,4 +97,4 @@ class LogHandler { $this->ident+=$ident; } -} \ No newline at end of file +} diff --git a/htdocs/core/modules/syslog/logHandlerInterface.php b/htdocs/core/modules/syslog/logHandlerInterface.php index 6f59482a1c0..76764a5c8a3 100644 --- a/htdocs/core/modules/syslog/logHandlerInterface.php +++ b/htdocs/core/modules/syslog/logHandlerInterface.php @@ -83,4 +83,4 @@ interface LogHandlerInterface * @return void */ public function export($content); -} \ No newline at end of file +} diff --git a/htdocs/core/modules/syslog/mod_syslog_syslog.php b/htdocs/core/modules/syslog/mod_syslog_syslog.php index 1f2f499fbac..26232e91ed5 100644 --- a/htdocs/core/modules/syslog/mod_syslog_syslog.php +++ b/htdocs/core/modules/syslog/mod_syslog_syslog.php @@ -124,4 +124,4 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface syslog($content['level'], $content['message']); closelog(); } -} \ No newline at end of file +} diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index af8c99c3fc7..268a971b51c 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -527,4 +527,4 @@ print '