diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index 8286b4c6c4f..dc040a6465b 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -187,6 +187,9 @@ + + + @@ -429,5 +432,5 @@ - + diff --git a/dev/translation/autotranslator.class.php b/dev/translation/autotranslator.class.php index 0e0e0ea8787..4da15890045 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 21e53d5c928..decae324ac5 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 9bce886420d..78fe73322f2 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 3c10e1a9068..4063e28f369 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 930028ae274..1efebf5c234 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 df4af8a0a12..f2676620c30 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 f2c0691da00..1a82d2758e4 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 6fd9504964c..d889ef37195 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 091f1019cdd..1b82fc88bd2 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 1499cc60819..6e8824c5a23 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 57aebf6f255..5050327298b 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 a026db19c70..9d28206a91e 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 56e2baef9dd..0c5ba39bd94 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 abcd85df1d4..30ed5a07207 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 e7f74d5fb7c..1611de1e4ee 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -94,7 +94,7 @@ if (! GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end) $idpays = $mysoc->country_id; -$sql = "SELECT f.rowid, f.ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlf, f.close_code,"; +$sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlf, f.close_code,"; $sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tva as total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.vat_src_code,"; $sql .= " s.rowid as socid, s.nom as name, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,"; $sql .= " p.accountancy_code_buy , aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte"; @@ -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 4e33eee1f43..25c53863162 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/admin/perms.php b/htdocs/admin/perms.php index 33fb71a3f26..28774ab82b6 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 259f49d0ee8..6de8a2352d0 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/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php index 96a7aaf23c8..82f58bd6c6b 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 c99cc034d80..16500e50990 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 422275c5382..3c455f102f9 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 4c8f9941dac..05117f5e7cb 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 dc4ad6bd393..7e14aaff68e 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 acaff575bd6..fff9b40d5ea 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_.*(?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 14b831a5526..0c7bb1aea93 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/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index 3428593b4fe..44f523c0635 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/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index bc783d2d8d3..6e907699f22 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2454,7 +2454,7 @@ class Contrat extends CommonObject } if (! $error) { - foreach ( $this->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/actions_comments.inc.php b/htdocs/core/actions_comments.inc.php index f0ae690fe7a..a08baca1ace 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/commonobject.class.php b/htdocs/core/class/commonobject.class.php index dc610854ead..132e1b0a674 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5015,7 +5015,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; } @@ -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/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index a9821178f20..5c9797a2407 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/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index adf774778d0..973bfe961b8 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 ab845b19900..61c8f2a4bed 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/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 14951cbb5bb..b67780da75a 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,11 +2655,11 @@ 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 (($fuser->rights->stock->{$lire} || $fuser->rights->stock->movement->{$lire} || $fuser->rights->stock->mouvement->{$lire}) || preg_match('/^specimen/i', $original_file)) + 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; } diff --git a/htdocs/core/lib/fiscalyear.lib.php b/htdocs/core/lib/fiscalyear.lib.php index 6ba1b04a41c..8ca5c10e03b 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/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 56dd0270c86..93d097856b6 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 e4f2fca0178..d33c1e40e4f 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 7d51791a542..2b7fba96c5c 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 84d148d3c76..2b818d907ae 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/modDon.class.php b/htdocs/core/modules/modDon.class.php index bc1af9e34ff..bb27b309c1d 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 322ed6cec50..3d580fa439c 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/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index 0c6671e15c9..af650b1695e 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 b6bd4010c7e..7cb4e6c565d 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 83b4242be91..369c63fdf53 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/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 29a4559f470..3b269513e76 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 48aea84373b..7624ec5cec0 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 6c1202b9b25..bbf5443255a 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/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 5f12fe1453e..977819bb796 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 24d8b411dde..bcd8445c3ab 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 a286068d31e..9fb7ac18d31 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/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 f6d204f5df3..a750481a3d1 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; diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 0458d2c98be..874e518511a 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -197,7 +197,9 @@ class Users extends DolibarrApi * * @param int $id Id of account to update * @param array $request_data Datas - * @return int + * @return array + * + * @throws RestException */ function put($id, $request_data = null) { diff --git a/htdocs/variants/ajax/get_attribute_values.php b/htdocs/variants/ajax/get_attribute_values.php index d291d3ded6b..79ee93e897b 100644 --- a/htdocs/variants/ajax/get_attribute_values.php +++ b/htdocs/variants/ajax/get_attribute_values.php @@ -57,4 +57,4 @@ if ($res == -1) { exit(); } -print json_encode($res); \ No newline at end of file +print json_encode($res); diff --git a/htdocs/variants/class/ProductAttribute.class.php b/htdocs/variants/class/ProductAttribute.class.php index bdaaff20988..06884f288b5 100644 --- a/htdocs/variants/class/ProductAttribute.class.php +++ b/htdocs/variants/class/ProductAttribute.class.php @@ -346,4 +346,4 @@ class ProductAttribute return 1; } -} \ No newline at end of file +} diff --git a/htdocs/variants/class/ProductAttributeValue.class.php b/htdocs/variants/class/ProductAttributeValue.class.php index 2988fd9715e..e5257c5fd0a 100644 --- a/htdocs/variants/class/ProductAttributeValue.class.php +++ b/htdocs/variants/class/ProductAttributeValue.class.php @@ -226,4 +226,4 @@ class ProductAttributeValue return -1; } -} \ No newline at end of file +} diff --git a/htdocs/variants/class/ProductCombination2ValuePair.class.php b/htdocs/variants/class/ProductCombination2ValuePair.class.php index 7332670f684..e07ba6077e7 100644 --- a/htdocs/variants/class/ProductCombination2ValuePair.class.php +++ b/htdocs/variants/class/ProductCombination2ValuePair.class.php @@ -157,4 +157,4 @@ WHERE c2v.fk_prod_combination = ".(int) $fk_combination; return -1; } -} \ No newline at end of file +}