diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 5f6959cccd8..032b3ac6e3e 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -47,8 +47,10 @@ if (!$user->hasRight('accounting', 'chartofaccount')) { accessforbidden(); } +$acts = array(); $acts[0] = "activate"; $acts[1] = "disable"; +$actl = array(); $actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"'); $actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"'); @@ -117,7 +119,7 @@ $tabcond[32] = isModEnabled('accounting'); // List of help for fields $tabhelp = array(); -$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode"), 'category_type'=>$langs->trans("SetToYesIfGroupIsComputationOfOtherGroups"), 'formula'=>$langs->trans("EnterCalculationRuleIfPreviousFieldIsYes")); +$tabhelp[32] = array('code' => $langs->trans("EnterAnyCode"), 'category_type' => $langs->trans("SetToYesIfGroupIsComputationOfOtherGroups"), 'formula' => $langs->trans("EnterCalculationRuleIfPreviousFieldIsYes")); // List of check for fields (NOT USED YET) $tabfieldcheck = array(); @@ -247,7 +249,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { $result = $db->query($sql); if ($result) { // Add is ok setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); - $_POST = array('id'=>$id); // Clean $_POST array, we keep only + $_POST = array('id' => $id); // Clean $_POST array, we keep only } else { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors'); @@ -582,7 +584,7 @@ if ($tabname[$id]) { } $tmpaction = 'create'; - $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); + $parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]); $reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error = $hookmanager->error; $errors = $hookmanager->errors; @@ -786,7 +788,7 @@ if ($resql) { print ''; if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) { $tmpaction = 'edit'; - $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); + $parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]); $reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error = $hookmanager->error; $errors = $hookmanager->errors; @@ -833,7 +835,7 @@ if ($resql) { $canbemodified = $iserasable; $tmpaction = 'view'; - $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); + $parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]); $reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error = $hookmanager->error; diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 3c4365844e8..1b12d17df07 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -50,8 +50,10 @@ if (!$user->hasRight('accounting', 'chartofaccount')) { accessforbidden(); } +$acts = array(); $acts[0] = "activate"; $acts[1] = "disable"; +$actl = array(); $actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"'); $actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"'); @@ -128,7 +130,7 @@ $tabcond[35] = isModEnabled('accounting'); // List of help for fields $tabhelp = array(); -$tabhelp[35] = array('code'=>$langs->trans("EnterAnyCode")); +$tabhelp[35] = array('code' => $langs->trans("EnterAnyCode")); // List of check for fields (NOT USED YET) $tabfieldcheck = array(); @@ -228,7 +230,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { $result = $db->query($sql); if ($result) { // Add is ok setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); - $_POST = array('id'=>$id); // Clean $_POST array, we keep only id + $_POST = array('id' => $id); // Clean $_POST array, we keep only id } else { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors'); @@ -451,7 +453,7 @@ if ($id) { } $tmpaction = 'create'; - $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); + $parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]); $reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error = $hookmanager->error; $errors = $hookmanager->errors; @@ -561,7 +563,7 @@ if ($id) { print ''; if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) { $tmpaction = 'edit'; - $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); + $parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]); $reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error = $hookmanager->error; $errors = $hookmanager->errors; @@ -580,7 +582,7 @@ if ($id) { print ''; } else { $tmpaction = 'view'; - $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); + $parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]); $reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error = $hookmanager->error; diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index e93164b01be..fa0db20a05f 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -503,8 +503,8 @@ if ($resql) { if ($massaction !== 'set_default_account') { $arrayofmassactions = array( - 'changeaccount'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Save") - ,'set_default_account'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("ConfirmPreselectAccount") + 'changeaccount' => img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Save") + ,'set_default_account' => img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("ConfirmPreselectAccount") ); $massactionbutton = $form->selectMassAction('', $arrayofmassactions, 1); } @@ -516,7 +516,8 @@ if ($resql) { print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, '', '', $limit, 0, 0, 1); if ($massaction == 'set_default_account') { - $formquestion[]=array('type' => 'other', + $formquestion = array(); + $formquestion[] = array('type' => 'other', 'name' => 'set_default_account', 'label' => $langs->trans("AccountancyCode"), 'value' => $form->select_account('', 'default_account', 1, array(), 0, 0, 'maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone')); @@ -589,7 +590,7 @@ if ($resql) { // Current account print ''; print ''; - $listofvals = array('withoutvalidaccount'=>$langs->trans("WithoutValidAccount"), 'withvalidaccount'=>$langs->trans("WithValidAccount")); + $listofvals = array('withoutvalidaccount' => $langs->trans("WithoutValidAccount"), 'withvalidaccount' => $langs->trans("WithValidAccount")); print ' '.$langs->trans("or").' '.$form->selectarray('search_current_account_valid', $listofvals, $search_current_account_valid, 1); print ''; print ' '; diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index fe111b7cd56..d40ddeda75a 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -2595,6 +2595,7 @@ class BookKeeping extends CommonObject if (getDolGlobalString('ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT')) { $accounting_groups_used_for_income_statement = array_filter(array_map('trim', explode(',', getDolGlobalString('ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT'))), 'strlen'); + $pcg_type_filter = array(); foreach ($accounting_groups_used_for_income_statement as $item) { $pcg_type_filter[] = "'" . $this->db->escape($item) . "'"; } diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 22047f60fe5..e7487c70e0f 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -471,6 +471,7 @@ if ($result) { print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); if ($massaction == 'set_default_account') { + $formquestion = array(); $formquestion[] = array('type' => 'other', 'name' => 'set_default_account', 'label' => $langs->trans("AccountancyCode"), diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index cf495bf632a..db16688ff31 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -478,6 +478,7 @@ if ($result) { print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); if ($massaction == 'set_default_account') { + $formquestion = array(); $formquestion[] = array('type' => 'other', 'name' => 'set_default_account', 'label' => $langs->trans("AccountancyCode"), diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 6a5139cf16b..d93ba0b2138 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -339,6 +339,7 @@ print ''.$langs->trans("Value").''; print "\n"; // Start date of new membership +$startpoint = array(); $startpoint[0] = $langs->trans("SubscriptionPayment"); $startpoint["m"] = $langs->trans("Month"); $startpoint["Y"] = $langs->trans("Year"); @@ -393,7 +394,7 @@ print "\n"; // Insert subscription into bank account print ''.$langs->trans("MoreActionsOnSubscription").''; -$arraychoices = array('0'=>$langs->trans("None")); +$arraychoices = array('0' => $langs->trans("None")); if (isModEnabled("bank")) { $arraychoices['bankdirect'] = $langs->trans("MoreActionBankDirect"); } @@ -416,7 +417,7 @@ if (isModEnabled('invoice')) { print ''.$langs->trans("VATToUseForSubscriptions").''; if (isModEnabled("bank")) { print ''; - print $form->selectarray('ADHERENT_VAT_FOR_SUBSCRIPTIONS', array('0'=>$langs->trans("NoVatOnSubscription"), 'defaultforfoundationcountry'=>$langs->trans("Default")), getDolGlobalString('ADHERENT_VAT_FOR_SUBSCRIPTIONS', '0'), 0); + print $form->selectarray('ADHERENT_VAT_FOR_SUBSCRIPTIONS', array('0' => $langs->trans("NoVatOnSubscription"), 'defaultforfoundationcountry' => $langs->trans("Default")), getDolGlobalString('ADHERENT_VAT_FOR_SUBSCRIPTIONS', '0'), 0); print ''; } else { print ''; @@ -494,6 +495,7 @@ foreach ($dirmodels as $reldir) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index f922f1abb7f..7cd4f79b8c5 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -220,6 +220,7 @@ if (getDolGlobalString('MEMBER_ENABLE_PUBLIC')) { print "\n"; // Force nature of member (mor/phy) + $morphys = array(); $morphys["phy"] = $langs->trans("Physical"); $morphys["mor"] = $langs->trans("Moral"); print ''; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index aaee4c47aa4..b9370bf20c8 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1019,6 +1019,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "\n"; // Morphy + $morphys = array(); $morphys["phy"] = $langs->trans("Physical"); $morphys["mor"] = $langs->trans("Moral"); print ''.$langs->trans("MemberNature")."\n"; diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index b6c2ea3a676..0672b5f90c0 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -33,10 +33,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; $WIDTH = DolGraph::getDefaultGraphSizeForStats('width'); $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); -$userid = GETPOSTINT('userid'); if ($userid < 0) { +$userid = GETPOSTINT('userid'); +if ($userid < 0) { $userid = 0; } -$socid = GETPOSTINT('socid'); if ($socid < 0) { +$socid = GETPOSTINT('socid'); +if ($socid < 0) { $socid = 0; } @@ -91,6 +93,7 @@ $mesg = $px1->isGraphKo(); if (!$mesg) { $px1->SetData($data); $i = $startyear; + $legend = array(); while ($i <= $endyear) { $legend[] = $i; $i++; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 7e29be5e759..f8ca472744f 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -220,6 +220,7 @@ print ''.$langs->trans("Example").''; print ''.$langs->trans("Status").''; print "\n"; +$bankorder = array(); $bankorder[0][0] = $langs->trans("BankOrderGlobal"); $bankorder[0][1] = $langs->trans("BankOrderGlobalDesc"); $bankorder[0][2] = 'BankCode DeskCode BankAccountNumber BankAccountNumberKey'; @@ -309,6 +310,7 @@ foreach ($dirmodels as $reldir) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index 9435f55868d..319e5b71789 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -331,6 +331,7 @@ foreach ($dirmodels as $reldir) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 9a4ba84d3c7..62d11335384 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -414,6 +414,7 @@ foreach ($dirmodels as $reldir) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 29effeb5c80..e30a2b8d0c5 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -55,7 +55,7 @@ if (!getDolGlobalString('CONTRACT_ADDON')) { include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; -$error=0; +$error = 0; if ($action == 'updateMask') { $maskconst = GETPOST('maskconstcontract', 'aZ09'); @@ -363,6 +363,7 @@ foreach ($dirmodels as $reldir) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/admin/delivery.php b/htdocs/admin/delivery.php index 89c653c5b39..0e6339c36f8 100644 --- a/htdocs/admin/delivery.php +++ b/htdocs/admin/delivery.php @@ -373,6 +373,7 @@ if (getDolGlobalString('MAIN_SUBMODULE_DELIVERY')) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 0ddc49e5c85..d054f3bfa5e 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -321,6 +321,7 @@ foreach ($dirmodels as $reldir) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index 16f4e1acc36..64cba2b7c6f 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -161,7 +161,7 @@ if ($action == 'updateMask') { $amounts = GETPOSTINT('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY'); $res5 = dolibarr_set_const($db, 'EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', intval($amounts), 'chaine', 0, '', $conf->entity); - if (!($res1 > 0) || !($res2 > 0) || !($res3 >= 0) || !($res4 >0) || !($res5 >0)) { + if (!($res1 > 0) || !($res2 > 0) || !($res3 >= 0) || !($res4 > 0) || !($res5 > 0)) { $error++; } @@ -337,6 +337,7 @@ foreach ($dirmodels as $reldir) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 8beab5a7ef5..3721646d950 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -507,6 +507,7 @@ foreach ($dirmodels as $reldir) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } @@ -626,10 +627,10 @@ if (getDolGlobalString('INVOICE_USE_DEFAULT_DOCUMENT')) { // Hidden conf print "\n"; $listtype = array( - Facture::TYPE_STANDARD=>$langs->trans("InvoiceStandard"), - Facture::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"), - Facture::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"), - Facture::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"), + Facture::TYPE_STANDARD => $langs->trans("InvoiceStandard"), + Facture::TYPE_REPLACEMENT => $langs->trans("InvoiceReplacement"), + Facture::TYPE_CREDIT_NOTE => $langs->trans("InvoiceAvoir"), + Facture::TYPE_DEPOSIT => $langs->trans("InvoiceDeposit"), ); if (getDolGlobalInt('INVOICE_USE_SITUATION')) { $listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation"); diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 0ce25e70225..aba9db7f9fd 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -413,6 +413,7 @@ foreach ($dirmodels as $reldir) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index 21280dd8008..34153e22866 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -327,6 +327,7 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php index e0c92c8f663..eef0a7a34a8 100644 --- a/htdocs/admin/hrm.php +++ b/htdocs/admin/hrm.php @@ -56,8 +56,8 @@ $scandir = GETPOST('scan_dir', 'alpha'); $type = 'evaluation'; $arrayofparameters = array( - 'HRM_MAXRANK'=>array('type'=>'integer','enabled'=>1), - 'HRM_DEFAULT_SKILL_DESCRIPTION'=>array('type'=>'varchar','enabled'=>1), + 'HRM_MAXRANK' => array('type' => 'integer','enabled' => 1), + 'HRM_DEFAULT_SKILL_DESCRIPTION' => array('type' => 'varchar','enabled' => 1), ); $error = 0; @@ -212,7 +212,7 @@ print dol_get_fiche_head($head, 'settings', $langs->trans($page_name), -1, "hrm" $moduledir = 'hrm'; $myTmpObjects = array(); -$myTmpObjects['evaluation'] = array('label'=>'Evaluation', 'includerefgeneration'=>1, 'includedocgeneration'=>0); +$myTmpObjects['evaluation'] = array('label' => 'Evaluation', 'includerefgeneration' => 1, 'includedocgeneration' => 0); foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { if ($myTmpObjectKey != $type) { @@ -374,6 +374,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } @@ -487,7 +488,7 @@ if ($action == 'edit') { print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; foreach ($arrayofparameters as $constname => $val) { - if ($val['enabled']==1) { + if ($val['enabled'] == 1) { $setupnotempty++; print ''; $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); @@ -572,7 +573,7 @@ if ($action == 'edit') { print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; foreach ($arrayofparameters as $constname => $val) { - if ($val['enabled']==1) { + if ($val['enabled'] == 1) { $setupnotempty++; print ''; $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); @@ -581,7 +582,7 @@ if ($action == 'edit') { if ($val['type'] == 'textarea') { print dol_nl2br(getDolGlobalString($constname)); - } elseif ($val['type']== 'html') { + } elseif ($val['type'] == 'html') { print getDolGlobalString($constname); } elseif ($val['type'] == 'yesno') { print ajax_constantonoff($constname); @@ -592,7 +593,7 @@ if ($action == 'edit') { $tmp = explode(':', $val['type']); $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname)); - if ($template<0) { + if ($template < 0) { setEventMessages(null, $formmail->errors, 'errors'); } print $langs->trans($template->label); diff --git a/htdocs/admin/knowledgemanagement.php b/htdocs/admin/knowledgemanagement.php index c50951f1e3f..b8445a0fb9a 100644 --- a/htdocs/admin/knowledgemanagement.php +++ b/htdocs/admin/knowledgemanagement.php @@ -45,7 +45,7 @@ $scandir = GETPOST('scan_dir', 'alpha'); $type = 'knowledgemanagement'; $arrayofparameters = array( - 'KNOWLEDGEMANAGEMENT_MYPARAM1'=>array('type'=>'string', 'css'=>'minwidth500' ,'enabled'=>0), + 'KNOWLEDGEMANAGEMENT_MYPARAM1' => array('type' => 'string', 'css' => 'minwidth500' ,'enabled' => 0), //'KNOWLEDGEMANAGEMENT_MYPARAM2'=>array('type'=>'textarea','enabled'=>1), //'KNOWLEDGEMANAGEMENT_MYPARAM3'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), //'KNOWLEDGEMANAGEMENT_MYPARAM4'=>array('type'=>'emailtemplate:thirdparty', 'enabled'=>1), @@ -202,7 +202,7 @@ if ($action == 'edit') { print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; foreach ($arrayofparameters as $constname => $val) { - if ($val['enabled']==1) { + if ($val['enabled'] == 1) { $setupnotempty++; print ''; $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); @@ -269,7 +269,7 @@ if ($action == 'edit') { print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; foreach ($arrayofparameters as $constname => $val) { - if ($val['enabled']==1) { + if ($val['enabled'] == 1) { $setupnotempty++; print ''; $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); @@ -278,7 +278,7 @@ if ($action == 'edit') { if ($val['type'] == 'textarea') { print dol_nl2br(getDolGlobalString($constname)); - } elseif ($val['type']== 'html') { + } elseif ($val['type'] == 'html') { print getDolGlobalString($constname); } elseif ($val['type'] == 'yesno') { print ajax_constantonoff($constname); @@ -289,7 +289,7 @@ if ($action == 'edit') { $tmp = explode(':', $val['type']); $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname)); - if ($template<0) { + if ($template < 0) { setEventMessages(null, $formmail->errors, 'errors'); } print $langs->trans($template->label); @@ -306,13 +306,13 @@ if ($action == 'edit') { } print '
'; } elseif (preg_match('/thirdparty_type/', $val['type'])) { - if (getDolGlobalString($constname)==2) { + if (getDolGlobalString($constname) == 2) { print $langs->trans("Prospect"); - } elseif (getDolGlobalString($constname)==3) { + } elseif (getDolGlobalString($constname) == 3) { print $langs->trans("ProspectCustomer"); - } elseif (getDolGlobalInt($constname)==1) { + } elseif (getDolGlobalInt($constname) == 1) { print $langs->trans("Customer"); - } elseif (getDolGlobalInt($constname)==0) { + } elseif (getDolGlobalInt($constname) == 0) { print $langs->trans("NorProspectNorCustomer"); } } else { @@ -335,7 +335,7 @@ if ($action == 'edit') { $moduledir = 'knowledgemanagement'; $myTmpObjects = array(); -$myTmpObjects['MyObject'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0); +$myTmpObjects['MyObject'] = array('includerefgeneration' => 0, 'includedocgeneration' => 0); foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { @@ -497,6 +497,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index f0a84949504..473227f6889 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -131,6 +131,7 @@ print load_fiche_titre($langs->trans("Menus"), '', 'title_setup'); $h = 0; +$head = array(); $head[$h][0] = DOL_URL_ROOT."/admin/menus.php"; $head[$h][1] = $langs->trans("MenuHandlers"); $head[$h][2] = 'handler'; diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index c6099a88c6c..8e7238131bb 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -274,7 +274,8 @@ i.e.: data[]= array (index, parent index, string ) // First the root item of the tree must be declared: -$data[] = array('rowid'=>0, 'fk_menu'=>-1, 'title'=>"racine", 'mainmenu'=>'', 'leftmenu'=>'', 'fk_mainmenu'=>'', 'fk_leftmenu'=>''); +$data = array(); +$data[] = array('rowid' => 0, 'fk_menu' => -1, 'title' => "racine", 'mainmenu' => '', 'leftmenu' => '', 'fk_mainmenu' => '', 'fk_leftmenu' => ''); // Then all child items must be declared @@ -314,17 +315,17 @@ if ($res) { $buttons .= ''.img_picto("Up", "1uparrow").''.img_picto("Down", "1downarrow").''; $data[] = array( - 'rowid'=>$menu['rowid'], - 'module'=>$menu['module'], - 'fk_menu'=>$menu['fk_menu'], - 'title'=>$titre, - 'mainmenu'=>$menu['mainmenu'], - 'leftmenu'=>$menu['leftmenu'], - 'fk_mainmenu'=>$menu['fk_mainmenu'], - 'fk_leftmenu'=>$menu['fk_leftmenu'], - 'position'=>$menu['position'], - 'entry'=>$entry, - 'buttons'=>$buttons + 'rowid' => $menu['rowid'], + 'module' => $menu['module'], + 'fk_menu' => $menu['fk_menu'], + 'title' => $titre, + 'mainmenu' => $menu['mainmenu'], + 'leftmenu' => $menu['leftmenu'], + 'fk_mainmenu' => $menu['fk_mainmenu'], + 'fk_leftmenu' => $menu['fk_leftmenu'], + 'position' => $menu['position'], + 'entry' => $entry, + 'buttons' => $buttons ); $i++; } @@ -378,7 +379,7 @@ if (count($remainingdata)) { print ''; print ''; foreach ($remainingdata as $datar) { - $father = array('rowid'=>$datar['rowid'], 'title'=>"???", 'mainmenu'=>$datar['fk_mainmenu'], 'leftmenu'=>$datar['fk_leftmenu'], 'fk_mainmenu'=>'', 'fk_leftmenu'=>''); + $father = array('rowid' => $datar['rowid'], 'title' => "???", 'mainmenu' => $datar['fk_mainmenu'], 'leftmenu' => $datar['fk_leftmenu'], 'fk_mainmenu' => '', 'fk_leftmenu' => ''); //print 'Start with rowid='.$datar['rowid'].' mainmenu='.$father ['mainmenu'].' leftmenu='.$father ['leftmenu'].'
'."\n"; tree_recur($data, $father, 0, 'iddivjstree'.$datar['rowid'], 1, 1); } diff --git a/htdocs/admin/mrp.php b/htdocs/admin/mrp.php index 382106a9b94..5c2de506880 100644 --- a/htdocs/admin/mrp.php +++ b/htdocs/admin/mrp.php @@ -327,6 +327,7 @@ foreach ($dirmodels as $reldir) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index 98f7b8d2a9e..9ba965e6bfc 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -143,6 +143,7 @@ if ($mode == 'setup' && $user->admin) { print ''.$langs->trans("OAuthSetupForLogin")."

\n"; // Define $listinsetup + $listinsetup = array(); foreach ($conf->global as $key => $val) { if (!empty($val) && preg_match('/^OAUTH_.*_ID$/', $key)) { $provider = preg_replace('/_ID$/', '', $key); @@ -156,7 +157,7 @@ if ($mode == 'setup' && $user->admin) { } } - $oauthstateanticsrf = bin2hex(random_bytes(128/8)); + $oauthstateanticsrf = bin2hex(random_bytes(128 / 8)); // $list is defined into oauth.lib.php to the list of supporter OAuth providers. foreach ($listinsetup as $key) { diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 2eb1ed3c820..6913857a69f 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -390,6 +390,7 @@ foreach ($dirmodels as $reldir) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index 2f921128690..3b5ee37b77c 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -331,6 +331,7 @@ foreach ($dirmodels as $reldir) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 4c6a5610067..ab111f7c67f 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -198,6 +198,7 @@ $dir = "../core/modules/security/generate"; clearstatcache(); $handle = opendir($dir); $i = 1; +$arrayhandler = array(); if (is_resource($handle)) { while (($file = readdir($handle)) !== false) { if (preg_match('/(modGeneratePass[a-z]+)\.class\.php$/i', $file, $reg)) { diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index b611e00c2ca..4c8c5fc51ae 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -571,6 +571,7 @@ foreach ($dirmodels as $reldir) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/admin/stocktransfer.php b/htdocs/admin/stocktransfer.php index 314b24d9fb0..b7e027db2b2 100644 --- a/htdocs/admin/stocktransfer.php +++ b/htdocs/admin/stocktransfer.php @@ -50,8 +50,8 @@ $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); $arrayofparameters = array( - 'STOCKTRANSFER_MYPARAM1'=>array('css'=>'minwidth200', 'enabled'=>1), - 'STOCKTRANSFER_MYPARAM2'=>array('css'=>'minwidth500', 'enabled'=>1) + 'STOCKTRANSFER_MYPARAM1' => array('css' => 'minwidth200', 'enabled' => 1), + 'STOCKTRANSFER_MYPARAM2' => array('css' => 'minwidth500', 'enabled' => 1) ); $error = 0; @@ -233,7 +233,7 @@ print ''.$langs->trans("StockTransferSetupPage").'1, 'includedocgeneration'=>1, 'class'=>'StockTransfer'); +$myTmpObjects[$moduledir] = array('includerefgeneration' => 1, 'includedocgeneration' => 1, 'class' => 'StockTransfer'); foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { if ($myTmpObjectKey == 'MyObject') { @@ -396,6 +396,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 82a55ca18d6..09728fbe93e 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -379,6 +379,7 @@ foreach ($dirmodels as $reldir) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index 19405ddbf4b..60cc1ce67b5 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -408,6 +408,7 @@ foreach ($dirmodels as $reldir) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index 2053df210be..6cd21cd1567 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -231,6 +231,7 @@ foreach ($dirmodels as $reldir) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index 19d6a23afd2..598b8a687e8 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -154,6 +154,7 @@ foreach ($dirmodels as $reldir) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/admin/webhook.php b/htdocs/admin/webhook.php index 4301353540f..7755856f8a0 100644 --- a/htdocs/admin/webhook.php +++ b/htdocs/admin/webhook.php @@ -210,7 +210,7 @@ if ($action == 'edit') { print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; foreach ($arrayofparameters as $constname => $val) { - if ($val['enabled']==1) { + if ($val['enabled'] == 1) { $setupnotempty++; print ''; $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); @@ -221,7 +221,7 @@ if ($action == 'edit') { print '\n"; - } elseif ($val['type']== 'html') { + } elseif ($val['type'] == 'html') { require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; $doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%'); $doleditor->Create(); @@ -300,7 +300,7 @@ if ($action == 'edit') { print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; foreach ($arrayofparameters as $constname => $val) { - if ($val['enabled']==1) { + if ($val['enabled'] == 1) { $setupnotempty++; print ''; $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); @@ -309,7 +309,7 @@ if ($action == 'edit') { if ($val['type'] == 'textarea') { print dol_nl2br(getDolGlobalString($constname)); - } elseif ($val['type']== 'html') { + } elseif ($val['type'] == 'html') { print getDolGlobalString($constname); } elseif ($val['type'] == 'yesno') { print ajax_constantonoff($constname); @@ -320,7 +320,7 @@ if ($action == 'edit') { $tmp = explode(':', $val['type']); $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname)); - if ($template<0) { + if ($template < 0) { setEventMessages(null, $formmail->errors, 'errors'); } print $langs->trans($template->label); @@ -338,13 +338,13 @@ if ($action == 'edit') { print '
'; } } elseif (preg_match('/thirdparty_type/', $val['type'])) { - if (getDolGlobalInt($constname)==2) { + if (getDolGlobalInt($constname) == 2) { print $langs->trans("Prospect"); - } elseif (getDolGlobalInt($constname)==3) { + } elseif (getDolGlobalInt($constname) == 3) { print $langs->trans("ProspectCustomer"); - } elseif (getDolGlobalInt($constname)==1) { + } elseif (getDolGlobalInt($constname) == 1) { print $langs->trans("Customer"); - } elseif (getDolGlobalInt($constname)==0) { + } elseif (getDolGlobalInt($constname) == 0) { print $langs->trans("NorProspectNorCustomer"); } } elseif ($val['type'] == 'product') { @@ -377,7 +377,8 @@ if ($action == 'edit') { $moduledir = 'webhook'; -$myTmpObjects['MyObject'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0); +$myTmpObjects = array(); +$myTmpObjects['MyObject'] = array('includerefgeneration' => 0, 'includedocgeneration' => 0); foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { @@ -539,6 +540,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/admin/workstation.php b/htdocs/admin/workstation.php index de2e7de2e74..67c2bb9869a 100644 --- a/htdocs/admin/workstation.php +++ b/htdocs/admin/workstation.php @@ -222,7 +222,7 @@ if ($action == 'edit') { $moduledir = 'workstation'; $myTmpObjects = array(); -$myTmpObjects['workstation'] = array('includerefgeneration'=>1, 'includedocgeneration'=>0); +$myTmpObjects['workstation'] = array('includerefgeneration' => 1, 'includedocgeneration' => 0); foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { @@ -385,6 +385,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php index 135a487952d..72e6cac37ea 100644 --- a/htdocs/asset/admin/setup.php +++ b/htdocs/asset/admin/setup.php @@ -47,8 +47,8 @@ $scandir = GETPOST('scan_dir', 'alpha'); $type = 'asset'; $arrayofparameters = array( - 'ASSET_ACCOUNTANCY_CATEGORY'=>array('type'=>'accountancy_category', 'enabled'=>1), - 'ASSET_DEPRECIATION_DURATION_PER_YEAR'=>array('type'=>'string', 'css'=>'minwidth200', 'enabled'=>1), + 'ASSET_ACCOUNTANCY_CATEGORY' => array('type' => 'accountancy_category', 'enabled' => 1), + 'ASSET_DEPRECIATION_DURATION_PER_YEAR' => array('type' => 'string', 'css' => 'minwidth200', 'enabled' => 1), //'ASSET_MYPARAM2'=>array('type'=>'textarea','enabled'=>1), //'ASSET_MYPARAM3'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), //'ASSET_MYPARAM4'=>array('type'=>'emailtemplate:thirdparty', 'enabled'=>1), @@ -197,7 +197,7 @@ echo ''.$langs->trans("AssetSetupPage").''; $moduledir = 'asset'; $myTmpObjects = array(); -$myTmpObjects['Asset'] = array('includerefgeneration'=>1, 'includedocgeneration'=>0); +$myTmpObjects['Asset'] = array('includerefgeneration' => 1, 'includedocgeneration' => 0); foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { @@ -359,6 +359,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { if (is_dir($dir)) { $handle = opendir($dir); if (is_resource($handle)) { + $filelist = array(); while (($file = readdir($handle)) !== false) { $filelist[] = $file; } @@ -466,7 +467,7 @@ if ($action == 'edit') { print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; foreach ($arrayofparameters as $constname => $val) { - if ($val['enabled']==1) { + if ($val['enabled'] == 1) { $setupnotempty++; print ''; $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); @@ -477,7 +478,7 @@ if ($action == 'edit') { print '\n"; - } elseif ($val['type']== 'html') { + } elseif ($val['type'] == 'html') { require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; $doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%'); $doleditor->Create(); @@ -581,7 +582,7 @@ if ($action == 'edit') { print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; foreach ($arrayofparameters as $constname => $val) { - if ($val['enabled']==1) { + if ($val['enabled'] == 1) { $setupnotempty++; print ''; $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); @@ -590,7 +591,7 @@ if ($action == 'edit') { if ($val['type'] == 'textarea') { print dol_nl2br(getDolGlobalString($constname)); - } elseif ($val['type']== 'html') { + } elseif ($val['type'] == 'html') { print getDolGlobalString($constname); } elseif ($val['type'] == 'yesno') { print ajax_constantonoff($constname); @@ -601,7 +602,7 @@ if ($action == 'edit') { $tmp = explode(':', $val['type']); $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname)); - if ($template<0) { + if ($template < 0) { setEventMessages(null, $formmail->errors, 'errors'); } print $langs->trans($template->label); @@ -619,13 +620,13 @@ if ($action == 'edit') { print '
'; } } elseif (preg_match('/thirdparty_type/', $val['type'])) { - if (getDolGlobalInt($constname)==2) { + if (getDolGlobalInt($constname) == 2) { print $langs->trans("Prospect"); - } elseif (getDolGlobalInt($constname)==3) { + } elseif (getDolGlobalInt($constname) == 3) { print $langs->trans("ProspectCustomer"); - } elseif (getDolGlobalInt($constname)==1) { + } elseif (getDolGlobalInt($constname) == 1) { print $langs->trans("Customer"); - } elseif (getDolGlobalInt($constname)==0) { + } elseif (getDolGlobalInt($constname) == 0) { print $langs->trans("NorProspectNorCustomer"); } } elseif ($val['type'] == 'product') { diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 9f39d925bb6..9dbc437758c 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -222,6 +222,7 @@ if (empty($reshook)) { ); complete_substitutions_array($substitutionarray, $langs); + $arrayofrecords = array(); // For labels if ($mode == 'label') { $txtforsticker = "%PHOTO%"; // Photo will be barcode image, %BARCODE% possible when using TCPDF generator @@ -236,14 +237,14 @@ if (empty($reshook)) { if ($numberofsticker <= $MAXSTICKERS) { for ($i = 0; $i < $numberofsticker; $i++) { $arrayofrecords[] = array( - 'textleft'=>$textleft, - 'textheader'=>$textheader, - 'textfooter'=>$textfooter, - 'textright'=>$textright, - 'code'=>$code, - 'encoding'=>$encoding, - 'is2d'=>$is2d, - 'photo'=>!empty($barcodeimage) ? $barcodeimage : '' // Photo must be a file that exists with format supported by TCPDF + 'textleft' => $textleft, + 'textheader' => $textheader, + 'textfooter' => $textfooter, + 'textright' => $textright, + 'code' => $code, + 'encoding' => $encoding, + 'is2d' => $is2d, + 'photo' => !empty($barcodeimage) ? $barcodeimage : '' // Photo must be a file that exists with format supported by TCPDF ); } } else { diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index d27b46dd02c..16efbe2d5df 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -113,6 +113,16 @@ foreach ($object->fields as $key => $val) { // $fieldstosearchall = array_merge($fieldstosearchall, empty($hookmanager->resArray['fieldstosearchall']) ? array() : $hookmanager->resArray['fieldstosearchall']); // } + +// $fieldstosearchall is supposedly defined further below, ensure that it is. +if (!isset($fieldstosearchall) || !is_array($fieldstosearchall)) { + $fieldstosearchall = array(); +} +' + @phan-var-force array $fieldstosearchall +'; + + // Definition of array of fields for columns $arrayfields = array(); foreach ($object->fields as $key => $val) { @@ -120,11 +130,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } @@ -460,8 +470,8 @@ print ''; $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/bookcal/availabilities_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); @@ -563,7 +573,7 @@ foreach ($object->fields as $key => $val) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; /*if (!empty($arrayfields['anotherfield']['checked'])) { @@ -609,7 +619,7 @@ foreach ($object->fields as $key => $val) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; /*if (!empty($arrayfields['anotherfield']['checked'])) { @@ -741,7 +751,7 @@ while ($i < $imaxinloop) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; /*if (!empty($arrayfields['anotherfield']['checked'])) { @@ -786,7 +796,7 @@ if ($num == 0) { $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/bookcal/calendar_list.php b/htdocs/bookcal/calendar_list.php index 781cad7732e..7a735b81c86 100644 --- a/htdocs/bookcal/calendar_list.php +++ b/htdocs/bookcal/calendar_list.php @@ -111,6 +111,14 @@ foreach ($object->fields as $key => $val) { // $fieldstosearchall = array_merge($fieldstosearchall, empty($hookmanager->resArray['fieldstosearchall']) ? array() : $hookmanager->resArray['fieldstosearchall']); // } +// $fieldstosearchall is supposedly defined further below, ensure that it is. +if (!isset($fieldstosearchall) || !is_array($fieldstosearchall)) { + $fieldstosearchall = array(); +} +' + @phan-var-force array $fieldstosearchall +'; + // Definition of array of fields for columns $arrayfields = array(); foreach ($object->fields as $key => $val) { @@ -118,11 +126,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } @@ -444,8 +452,8 @@ print ''; $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/bookcal/calendar_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); @@ -546,7 +554,7 @@ foreach ($object->fields as $key => $val) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; /*if (!empty($arrayfields['anotherfield']['checked'])) { @@ -592,7 +600,7 @@ foreach ($object->fields as $key => $val) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; /*if (!empty($arrayfields['anotherfield']['checked'])) { @@ -724,7 +732,7 @@ while ($i < $imaxinloop) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; /*if (!empty($arrayfields['anotherfield']['checked'])) { diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 7ce401bc3c9..f0843f3c990 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -2069,12 +2069,13 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa //print img_picto($langs->trans("Birthday"), 'birthday-cake').' '; $tmpid = $event->id; + if (empty($cachecontacts[$tmpid])) { $newcontact = new Contact($db); $newcontact->fetch($tmpid); - $cachecontact[$tmpid] = $newcontact; + $cachecontacts[$tmpid] = $newcontact; } - print $cachecontact[$tmpid]->getNomUrl(1, '', 0, '', -1, 0, 'valignmiddle inline-block'); + print $cachecontacts[$tmpid]->getNomUrl(1, '', 0, '', -1, 0, 'valignmiddle inline-block'); //$event->picto = 'birthday-cake'; //print $event->getNomUrl(1, $maxnbofchar, 'cal_event', 'birthday', 'contact'); diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 0eec5b4bb58..0451f7d48fe 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -1485,6 +1485,7 @@ if ($resql) { $totalarray = array(); $totalarray['nbfield'] = 0; + $subtotalarray = array(); $subtotalarray['nbfield'] = 0; $totalarray['val']['cdet.total_tva'] = 0; $totalarray['val']['cdet.total_ttc'] = 0; diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index ba40644c70c..5978fcc75b8 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -103,6 +103,8 @@ if (!empty($id)) { $sql .= " GROUP BY dm"; $resql = $db->query($sql); +$encaiss = array(); +$decaiss = array(); if ($resql) { $num = $db->num_rows($resql); $i = 0; @@ -301,6 +303,7 @@ if ($result < 0) { // CRED PART // Chargement du tableau des années + $tblyear = array(); $tblyear[0] = array(); $tblyear[1] = array(); $tblyear[2] = array(); @@ -339,6 +342,7 @@ if ($result < 0) { $data_year_0 = array(); $data_year_1 = array(); $data_year_2 = array(); + $datamin = array(); for ($i = 0; $i < 12; $i++) { $data_year_0[$i] = isset($tblyear[0][substr("0".($i + 1), -2)]) ? $tblyear[0][substr("0".($i + 1), -2)] : 0; diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index dd0b5d1cfe6..6ef7b315179 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -195,6 +195,7 @@ if ($result < 0) { $xmonth = substr($textdate, 4, 2); $i = 0; + $dataall = array(); while ($xmonth == $month) { $subtotal = $subtotal + (isset($amounts[$textdate]) ? $amounts[$textdate] : 0); if ($day > time()) { diff --git a/htdocs/compta/bank/info.php b/htdocs/compta/bank/info.php index 36e525add58..551934ba258 100644 --- a/htdocs/compta/bank/info.php +++ b/htdocs/compta/bank/info.php @@ -66,6 +66,7 @@ $object->info($id); $h = 0; +$head = array(); $head[$h][0] = DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$id; $head[$h][1] = $langs->trans("BankTransaction"); $h++; diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index 588ca81e0e8..4adeb8913d6 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -83,6 +83,8 @@ $sql .= " GROUP BY d.type"; $sql .= " ORDER BY d.type"; $result = $db->query($sql); +$somme = array(); +$nb = array(); if ($result) { $num = $db->num_rows($result); $i = 0; @@ -113,6 +115,7 @@ print ''.$langs->trans("Statistics").''; print "\n"; $listoftype = $tripandexpense_static->listOfTypes(); +$dataseries = array(); foreach ($listoftype as $code => $label) { $dataseries[] = array($label, (isset($nb[$code]) ? (int) $nb[$code] : 0)); } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index a0748e540ed..66afe9fcb73 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -139,7 +139,7 @@ $hookmanager->initHooks(array('invoicecard', 'globalcard')); $usercanread = $user->hasRight("facture", "lire"); $usercancreate = $user->hasRight("facture", "creer"); $usercanissuepayment = $user->hasRight("facture", "paiement"); -$usercandelete = $user->hasRight("facture", "supprimer"); +$usercandelete = $user->hasRight("facture", "supprimer") || ($usercancreate && isset($object->status) && $object->status == $object::STATUS_DRAFT); $usercancreatecontract = $user->hasRight("contrat", "creer"); // Advanced Permissions @@ -2447,6 +2447,7 @@ if (empty($reshook)) { } if (!$error) { + '@phan-var-force array $lines'; // Add batchinfo if the detail_batch array is defined if (isModEnabled('productbatch') && !empty($lines[$i]->detail_batch) && is_array($lines[$i]->detail_batch) && getDolGlobalString('INVOICE_INCUDE_DETAILS_OF_LOTS_SERIALS')) { $langs->load('productbatch'); @@ -4452,6 +4453,7 @@ if ($action == 'create') { $close[$i]['reason'] = $form->textwithpicto($langs->transnoentities("Other"), $close[$i]['label'], 1); $i++; // arrayreasons[code]=reason + $arrayreasons = []; foreach ($close as $key => $val) { $arrayreasons[$close[$key]['code']] = $close[$key]['reason']; } @@ -4484,6 +4486,7 @@ if ($action == 'create') { $close[1]['reason'] = $form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBadCustomer", $object->ref), $close[1]['label'], 1); $close[2]['reason'] = $form->textwithpicto($langs->transnoentities("ConfirmClassifyAbandonReasonOther"), $close[2]['label'], 1); // arrayreasons + $arrayreasons = []; $arrayreasons[$close[1]['code']] = $close[1]['reason']; $arrayreasons[$close[2]['code']] = $close[2]['reason']; diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index 2797c3203c9..e302bcc2ee1 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -215,6 +215,7 @@ if ($action == 'create') { // View mode if ($id) { $h = 0; + $head = array(); $head[$h][0] = DOL_URL_ROOT.'/compta/localtax/card.php?id='.$object->id; $head[$h][1] = $langs->trans('Card'); $head[$h][2] = 'card'; diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 29cd19534e9..9af72aa1a1f 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -333,6 +333,7 @@ if ($action == 'new') { } $h = 0; + $head = array(); $head[$h][0] = $_SERVER["PHP_SELF"].'?id='.$object->id; $head[$h][1] = $langs->trans("CheckReceipt"); $hselected = $h; diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index 55df11fe81b..9288421622e 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -100,6 +100,7 @@ $form = new Form($db); $h = 0; +$head = array(); $head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$id; $head[$h][1] = $langs->trans("PaymentSocialContribution"); $hselected = $h; diff --git a/htdocs/compta/payment_vat/card.php b/htdocs/compta/payment_vat/card.php index b49e93ebed3..4d9d34abc75 100644 --- a/htdocs/compta/payment_vat/card.php +++ b/htdocs/compta/payment_vat/card.php @@ -129,6 +129,7 @@ $form = new Form($db); $h = 0; +$head = array(); $head[$h][0] = DOL_URL_ROOT.'/compta/payment_vat/card.php?id='.$id; $head[$h][1] = $langs->trans("VATPayment"); $hselected = $h; diff --git a/htdocs/compta/prelevement/orders_list.php b/htdocs/compta/prelevement/orders_list.php index 6bf465d1ea1..23eee162758 100644 --- a/htdocs/compta/prelevement/orders_list.php +++ b/htdocs/compta/prelevement/orders_list.php @@ -103,6 +103,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' // Delete draft if (($massaction == "delete" || ($action == 'delete' && $confirm == 'yes')) && $permissiontodelete) { + $TMsg = array(); $db->begin(); $objecttmp = new BonPrelevement($db); foreach ($toselect as $toselectid) { @@ -279,8 +280,8 @@ if ($type != '') { } $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); if ($usercancreate) { $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewStandingOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php?type='.urlencode($type)); diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index ea5fe2d3ca9..0f2b503da99 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -638,6 +638,10 @@ $totalarray = array(); $totalarray['nbfield'] = 0; $totalarray['val'] = array('totalttcfield' => 0); $imaxinloop = ($limit ? min($num, $limit) : $num); +if (!isset($TLoadedUsers) || !is_array($TLoadedUsers)) { + // Ensure array is initialised + $TLoadedUsers = array(); +} while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 6a52f9ee62a..0d364c64625 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -209,7 +209,7 @@ $allparams = array_merge($commonparams, $headerparams, $tableparams); $headerparams = array_merge($commonparams, $headerparams); $tableparams = array_merge($commonparams, $tableparams); -$paramslink=""; +$paramslink = ""; foreach ($allparams as $key => $value) { $paramslink .= '&'.$key.'='.$value; } @@ -232,8 +232,8 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") { $modecompta = "RECETTES-DEPENSES"; } -$exportlink=""; -$namelink=""; +$exportlink = ""; +$namelink = ""; // Show report header if ($modecompta == "CREANCES-DETTES") { @@ -360,6 +360,9 @@ if ($modecompta == 'CREANCES-DETTES') { dol_syslog("cabyprodserv", LOG_DEBUG); $result = $db->query($sql); + $amount_ht = array(); + $amount = array(); + $qty = array(); if ($result) { $num = $db->num_rows($result); $i = 0; diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index eb69cefa804..38619a7eacf 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -166,7 +166,7 @@ $allparams = array_merge($commonparams, $headerparams, $tableparams); $headerparams = array_merge($commonparams, $headerparams); $tableparams = array_merge($commonparams, $tableparams); -$paramslink=""; +$paramslink = ""; foreach ($allparams as $key => $value) { $paramslink .= '&'.$key.'='.$value; } @@ -187,8 +187,8 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") { $modecompta = "RECETTES-DEPENSES"; } -$exportlink=""; -$namelink=""; +$exportlink = ""; +$namelink = ""; // Show report header if ($modecompta == "CREANCES-DETTES") { @@ -288,6 +288,7 @@ $sql .= " GROUP BY u.rowid, u.lastname, u.firstname"; $sql .= " ORDER BY u.rowid"; $amount = array(); +$amount_ht = array(); dol_syslog("cabyuser", LOG_DEBUG); $result = $db->query($sql); diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 6c1b1c3558a..b7d157302c1 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -197,7 +197,7 @@ $allparams = array_merge($commonparams, $headerparams, $tableparams); $headerparams = array_merge($commonparams, $headerparams); $tableparams = array_merge($commonparams, $tableparams); -$paramslink=""; +$paramslink = ""; foreach ($allparams as $key => $value) { $paramslink .= '&'.$key.'='.$value; } @@ -221,8 +221,8 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") { $modecompta = "RECETTES-DEPENSES"; } -$exportlink=""; -$namelink=""; +$exportlink = ""; +$namelink = ""; // Show report header if ($modecompta == "CREANCES-DETTES") { @@ -354,6 +354,10 @@ $sql .= " ORDER BY s.rowid"; //echo $sql; $amount = array(); +$amount_ht = array(); +$address_zip = array(); +$address_town = array(); +$address_pays = array(); dol_syslog("casoc", LOG_DEBUG); $result = $db->query($sql); diff --git a/htdocs/compta/stats/supplier_turnover_by_prodserv.php b/htdocs/compta/stats/supplier_turnover_by_prodserv.php index e9568c4aa73..67c38c55d4b 100644 --- a/htdocs/compta/stats/supplier_turnover_by_prodserv.php +++ b/htdocs/compta/stats/supplier_turnover_by_prodserv.php @@ -263,6 +263,9 @@ if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') { $name = array(); +$amount = array(); +$amount_ht = array(); +$qty = array(); // SQL request $catotal = 0; diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php index 205f9000031..ef2f7fe3177 100644 --- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php +++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php @@ -245,6 +245,9 @@ $catotal_ht = 0; $name = array(); $amount = array(); $amount_ht = array(); +$address_zip = array(); +$address_town = array(); +$address_pays = array(); if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT DISTINCT s.rowid as socid, s.nom as name, s.zip, s.town, s.fk_pays,"; $sql .= " sum(f.total_ht) as amount, sum(f.total_ttc) as amount_ttc"; diff --git a/htdocs/core/class/html.formcategory.class.php b/htdocs/core/class/html.formcategory.class.php index 34a1961bc84..193967845ab 100644 --- a/htdocs/core/class/html.formcategory.class.php +++ b/htdocs/core/class/html.formcategory.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 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 @@ -81,7 +82,7 @@ class FormCategory extends Form $filter .= $langs->trans('UseOrOperatorShort'); $filter .= ''; - $filter .= '