Merge branch 'develop' into fix_element_type_part_05

This commit is contained in:
Laurent Destailleur 2024-03-09 15:23:23 +01:00 committed by GitHub
commit abc57a767b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
70 changed files with 258 additions and 197 deletions

View file

@ -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 '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
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;

View file

@ -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 '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
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 '</td>';
} 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;

View file

@ -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 '<td class="liste_titre">';
print '<input type="text" class="flat" size="6" name="search_current_account" id="search_current_account" value="'.dol_escape_htmltag($search_current_account).'">';
$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 '</td>';
print '<td class="liste_titre">&nbsp;</td>';

View file

@ -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) . "'";
}

View file

@ -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"),

View file

@ -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"),

View file

@ -339,6 +339,7 @@ print '<td>'.$langs->trans("Value").'</td>';
print "</tr>\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 "</td></tr>\n";
// Insert subscription into bank account
print '<tr class="oddeven"><td>'.$langs->trans("MoreActionsOnSubscription").'</td>';
$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 '<tr class="oddeven"><td>'.$langs->trans("VATToUseForSubscriptions").'</td>';
if (isModEnabled("bank")) {
print '<td>';
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 '</td>';
} else {
print '<td class="right">';
@ -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;
}

View file

@ -220,6 +220,7 @@ if (getDolGlobalString('MEMBER_ENABLE_PUBLIC')) {
print "</td></tr>\n";
// Force nature of member (mor/phy)
$morphys = array();
$morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Moral");
print '<tr class="oddeven drag" id="trforcenature"><td>';

View file

@ -1019,6 +1019,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print "</td>\n";
// Morphy
$morphys = array();
$morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Moral");
print '<tr><td class="fieldrequired">'.$langs->trans("MemberNature")."</td><td>\n";

View file

@ -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++;

View file

@ -220,6 +220,7 @@ print '<td>'.$langs->trans("Example").'</td>';
print '<td class="center">'.$langs->trans("Status").'</td>';
print "</tr>\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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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 "</tr>\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");

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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 '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled']==1) {
if ($val['enabled'] == 1) {
$setupnotempty++;
print '<tr class="oddeven"><td>';
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
@ -572,7 +573,7 @@ if ($action == 'edit') {
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled']==1) {
if ($val['enabled'] == 1) {
$setupnotempty++;
print '<tr class="oddeven"><td>';
$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);

View file

@ -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 '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled']==1) {
if ($val['enabled'] == 1) {
$setupnotempty++;
print '<tr class="oddeven"><td>';
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
@ -269,7 +269,7 @@ if ($action == 'edit') {
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled']==1) {
if ($val['enabled'] == 1) {
$setupnotempty++;
print '<tr class="oddeven"><td>';
$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 '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
} 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;
}

View file

@ -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';

View file

@ -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 .= '<a class="marginleftonly marginrightonly" href="index.php?menu_handler='.$menu_handler_to_search.'&action=up&token='.newToken().'&menuId='.$menu['rowid'].'">'.img_picto("Up", "1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler_to_search.'&action=down&menuId='.$menu['rowid'].'">'.img_picto("Down", "1downarrow").'</a>';
$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 '<tr>';
print '<td colspan="2">';
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'].'<br>'."\n";
tree_recur($data, $father, 0, 'iddivjstree'.$datar['rowid'], 1, 1);
}

View file

@ -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;
}

View file

@ -143,6 +143,7 @@ if ($mode == 'setup' && $user->admin) {
print '<span class="opacitymedium">'.$langs->trans("OAuthSetupForLogin")."</span><br><br>\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) {

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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)) {

View file

@ -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;
}

View file

@ -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 '<span class="opacitymedium">'.$langs->trans("StockTransferSetupPage").'</
$moduledir = 'stocktransfer';
$myTmpObjects = array();
$myTmpObjects[$moduledir]=array('includerefgeneration'=>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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -210,7 +210,7 @@ if ($action == 'edit') {
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled']==1) {
if ($val['enabled'] == 1) {
$setupnotempty++;
print '<tr class="oddeven"><td>';
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
@ -221,7 +221,7 @@ if ($action == 'edit') {
print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">' . "\n";
print getDolGlobalString($constname);
print "</textarea>\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 '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled']==1) {
if ($val['enabled'] == 1) {
$setupnotempty++;
print '<tr class="oddeven"><td>';
$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 '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
}
} 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;
}

View file

@ -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;
}

View file

@ -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 '<span class="opacitymedium">'.$langs->trans("AssetSetupPage").'</span>';
$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 '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled']==1) {
if ($val['enabled'] == 1) {
$setupnotempty++;
print '<tr class="oddeven"><td>';
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
@ -477,7 +478,7 @@ if ($action == 'edit') {
print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">' . "\n";
print getDolGlobalString($constname);
print "</textarea>\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 '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled']==1) {
if ($val['enabled'] == 1) {
$setupnotempty++;
print '<tr class="oddeven"><td>';
$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 '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
}
} 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') {

View file

@ -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 {

View file

@ -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<string,string> $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 '<input type="hidden" name="mode" value="'.$mode.'">';
$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;

View file

@ -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<string,string> $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 '<input type="hidden" name="mode" value="'.$mode.'">';
$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'])) {

View file

@ -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');

View file

@ -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;

View file

@ -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;

View file

@ -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()) {

View file

@ -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++;

View file

@ -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 '<td colspan="4">'.$langs->trans("Statistics").'</td>';
print "</tr>\n";
$listoftype = $tripandexpense_static->listOfTypes();
$dataseries = array();
foreach ($listoftype as $code => $label) {
$dataseries[] = array($label, (isset($nb[$code]) ? (int) $nb[$code] : 0));
}

View file

@ -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<string,mixed> $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'];

View file

@ -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';

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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));

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -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);

View file

@ -263,6 +263,9 @@ if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
$name = array();
$amount = array();
$amount_ht = array();
$qty = array();
// SQL request
$catotal = 0;

View file

@ -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";

View file

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* 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 .= '</label>';
$filter .= '<script>'."\n";;
$filter .= '<script>'."\n";
$filter .= "var nbSelected = jQuery('#".$htmlName."').val().length;";
$filter .= "console.log('Nb of element now = '+nbSelected);\n";
$filter .= "if (nbSelected > 1) { jQuery('.".$htmlName2."').show(); } else { jQuery('.".$htmlName2."').hide(); }\n";

View file

@ -6228,7 +6228,7 @@ function vatrate($rate, $addpercent = false, $info_bits = 0, $usestarfornpr = 0,
* Function used into PDF and HTML pages
*
* @param float $amount Amount to format
* @param integer $form Type of format, HTML or not (not by default)
* @param int<0,1> $form Type of formatting: 1=HTML, 0=no formatting (no by default)
* @param Translate|string $outlangs Object langs for output. '' use default lang. 'none' use international separators.
* @param int $trunc 1=Truncate if there is more decimals than MAIN_MAX_DECIMALS_SHOWN (default), 0=Does not truncate. Deprecated because amount are rounded (to unit or total amount accuracy) before being inserted into database or after a computation, so this parameter should be useless.
* @param int $rounding MINIMUM number of decimal to show: 0=no change, -1=we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT)

View file

@ -5,6 +5,7 @@
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* 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
@ -46,7 +47,7 @@
* @param string $price_base_type 'HT'=Unit price parameter $pu is HT, 'TTC'=Unit price parameter $pu is TTC (HT+VAT but not Localtax. TODO Add also mode 'INCT' when pu is price HT+VAT+LT1+LT2)
* @param int $info_bits Miscellaneous information on line
* @param int $type 0/1=Product/service
* @param Societe $seller Thirdparty seller (we need $seller->country_id property). Provided only if seller is the supplier, otherwise $seller will be $mysoc.
* @param Societe|string $seller Thirdparty seller (we need $seller->country_id property). Provided only if seller is the supplier, otherwise $seller will be $mysoc.
* @param array $localtaxes_array Array with localtaxes info array('0'=>type1,'1'=>rate1,'2'=>type2,'3'=>rate2) (loaded by getLocalTaxesFromRate(vatrate, 0, ...) function).
* @param integer $progress Situation invoices progress (value from 0 to 100, 100 by default)
* @param double $multicurrency_tx Currency rate (1 by default)
@ -83,7 +84,7 @@
* 25=multicurrency_total_tax1 for total_ht
* 26=multicurrency_total_tax2 for total_ht
*/
function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller = '', $localtaxes_array = '', $progress = 100, $multicurrency_tx = 1, $pu_devise = 0, $multicurrency_code = '')
function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller = '', $localtaxes_array = [], $progress = 100, $multicurrency_tx = 1, $pu_devise = 0, $multicurrency_code = '')
{
global $conf, $mysoc, $db;
@ -114,7 +115,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
dol_syslog("Price.lib::calcul_price_total Warning: function was called with a bad value for vat rate (should be often < 100, always < 1000). There is surely a bug.", LOG_ERR);
}
// Too verbose. Enable for debug only
//dol_syslog("Price.lib::calcul_price_total qty=".$qty." pu=".$pu." remiserpercent_ligne=".$remise_percent_ligne." txtva=".$txtva." uselocaltax1_rate=".$uselocaltax1_rate." uselocaltax2_rate=".$uselocaltax2_rate.' remise_percent_global='.$remise_percent_global.' price_base_type='.$ice_base_type.' type='.$type.' progress='.$progress);
// dol_syslog("Price.lib::calcul_price_total qty=".$qty." pu=".$pu." remiserpercent_ligne=".$remise_percent_ligne." txtva=".$txtva." uselocaltax1_rate=".$uselocaltax1_rate." uselocaltax2_rate=".$uselocaltax2_rate.' remise_percent_global='.$remise_percent_global.' price_base_type='.$ice_base_type.' type='.$type.' progress='.$progress);
$countryid = $seller->country_id;
@ -439,12 +440,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
$result[25] = $result[9];
$result[26] = $result[10];
}
//var_dump($result);
// initialize result array
//for ($i=0; $i <= 18; $i++) $result[$i] = (float) $result[$i];
dol_syslog('Price.lib::calcul_price_total MAIN_ROUNDING_RULE_TOT='.(!getDolGlobalString('MAIN_ROUNDING_RULE_TOT') ? '' : $conf->global->MAIN_ROUNDING_RULE_TOT).' pu='.$pu.' qty='.$qty.' price_base_type='.$price_base_type.' total_ht='.$result[0].'-total_vat='.$result[1].'-total_ttc='.$result[2]);
dol_syslog('Price.lib::calcul_price_total MAIN_ROUNDING_RULE_TOT='.getDolGlobalString('MAIN_ROUNDING_RULE_TOT').' pu='.$pu.' qty='.$qty.' price_base_type='.$price_base_type.' total_ht='.$result[0].'-total_vat='.$result[1].'-total_ttc='.$result[2]);
return $result;
}

View file

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* 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
@ -1101,7 +1102,7 @@ function getImagePublicURLOfObject($object, $no = 1, $extName = '')
* @param int $status 0 or 1, or -1 for both
* @return array Array with results of search
*/
function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $sortfield = 'date_creation', $sortorder = 'DESC', $langcode = '', $otherfilters = 'null', $status = 1)
function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $sortfield = 'date_creation', $sortorder = 'DESC', $langcode = '', $otherfilters = [], $status = 1)
{
global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running included containers.
@ -1261,7 +1262,7 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so
* @param string $urltograb URL to grab (example: http://www.nltechno.com/ or http://www.nltechno.com/dir1/ or http://www.nltechno.com/dir1/mapage1)
* @param string $tmp Content to parse
* @param string $action Var $action
* @param string $modifylinks 0=Do not modify content, 1=Replace links with a link to viewimage
* @param int $modifylinks 0=Do not modify content, 1=Replace links with a link to viewimage
* @param int $grabimages 0=Do not grab images, 1=Grab images
* @param string $grabimagesinto 'root' or 'subpage'
* @return void
@ -1316,10 +1317,6 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify
$filetosave = preg_replace('/\/[^\/]+\/\.\./', '', $filetosave);
$filename = preg_replace('/\/[^\/]+\/\.\./', '', $filename);
//var_dump($filetosave);
//var_dump($filename);
//exit;
if (empty($alreadygrabbed[$urltograbbis])) {
if ($grabimages) {
$tmpgeturl = getURLContent($urltograbbis, 'GET', '', 1, array(), array('http', 'https'), 0);
@ -1385,10 +1382,6 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify
$filetosave = preg_replace('/\/[^\/]+\/\.\./', '', $filetosave);
$filename = preg_replace('/\/[^\/]+\/\.\./', '', $filename);
//var_dump($filetosave);
//var_dump($filename);
//exit;
if (empty($alreadygrabbed[$urltograbbis])) {
if ($grabimages) {
$tmpgeturl = getURLContent($urltograbbis, 'GET', '', 1, array(), array('http', 'https'), 0);

View file

@ -131,14 +131,14 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
* @param int $type Type of barcode (EAN, ISBN, ...) as rowid
* @return string
*/
public function literalBarcodeType($db, $type = '')
public function literalBarcodeType($db, $type = 0)
{
global $conf;
$out = '';
$sql = "SELECT rowid, code, libelle as label";
$sql .= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
$sql .= " WHERE rowid = '".$db->escape($type)."'";
$sql .= " WHERE rowid = ".(int) $type;
$sql .= " AND entity = ".((int) $conf->entity);
$result = $db->query($sql);
if ($result) {

View file

@ -143,14 +143,14 @@ class mod_barcode_thirdparty_standard extends ModeleNumRefBarCode
* @param int $type Type of barcode (EAN, ISBN, ...) as rowid
* @return string
*/
public function literalBarcodeType($db, $type = '')
public function literalBarcodeType($db, $type = 0)
{
global $conf;
$out = '';
$sql = "SELECT rowid, code, libelle as label";
$sql .= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
$sql .= " WHERE rowid = '".$db->escape($type)."'";
$sql .= " WHERE rowid = ". (int) $type;
$sql .= " AND entity = ".((int) $conf->entity);
$result = $db->query($sql);
if ($result) {

View file

@ -289,11 +289,11 @@ class LoanSchedule extends CommonObject
/**
* Update database
*
* @param User $user User that modify
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int Return integer <0 if KO, >0 if OK
* @param User|null $user User that modify
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int Return integer <0 if KO, >0 if OK
*/
public function update($user = 0, $notrigger = 0)
public function update($user = null, $notrigger = 0)
{
global $conf, $langs;
$error = 0;

View file

@ -257,7 +257,7 @@ class Mo extends CommonObject
*/
public function __construct(DoliDB $db)
{
global $conf, $langs;
global $langs;
$this->db = $db;
@ -484,8 +484,6 @@ class Mo extends CommonObject
*/
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
{
global $conf;
dol_syslog(__METHOD__, LOG_DEBUG);
$records = array();
@ -1040,7 +1038,7 @@ class Mo extends CommonObject
*/
public function validate($user, $notrigger = 0)
{
global $conf, $langs;
global $conf;
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@ -1372,7 +1370,7 @@ class Mo extends CommonObject
*/
public function getTooltipContentArray($params)
{
global $conf, $langs;
global $langs;
$langs->loadLangs(['mrp', 'products']);
$nofetch = isset($params['nofetch']) ? true : false;
@ -1640,7 +1638,7 @@ class Mo extends CommonObject
*/
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
{
global $conf, $langs;
global $langs;
$langs->load("mrp");
@ -1664,36 +1662,6 @@ class Mo extends CommonObject
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
}
/**
* Action executed by scheduler
* CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters'
* Use public function doScheduledJob($param1, $param2, ...) to get parameters
*
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
*/
public function doScheduledJob()
{
global $conf, $langs;
//$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log';
$error = 0;
$this->output = '';
$this->error = '';
dol_syslog(__METHOD__, LOG_DEBUG);
$now = dol_now();
$this->db->begin();
// ...
$this->db->commit();
return $error;
}
/**
* Return HTML table table of source object lines
* TODO Move this and previous function into output html class file (htmlline.class.php).
@ -1706,7 +1674,7 @@ class Mo extends CommonObject
*/
public function printOriginLinesList($restrictlist = '', $selectedLines = array())
{
global $langs, $hookmanager, $conf, $form, $action;
global $langs, $hookmanager, $form, $action;
$langs->load('stocks');
$text_stock_options = $langs->trans("RealStockDesc").'<br>';
@ -1998,6 +1966,7 @@ class Mo extends CommonObject
}
}
/**
* Class MoLine. You can also remove this and generate a CRUD class for lines objects.
*/
@ -2081,7 +2050,7 @@ class MoLine extends CommonObjectLine
*/
public function __construct(DoliDB $db)
{
global $conf, $langs;
global $langs;
$this->db = $db;

View file

@ -1190,7 +1190,7 @@ class Task extends CommonObjectLine
*
* @param User|null $userp Return roles on project for this internal user. If set, usert and taskid must not be defined.
* @param User|null $usert Return roles on task for this internal user. If set userp must NOT be defined. -1 means no filter.
* @param int $projectid Project id list separated with , to filter on project
* @param string $projectid Project id list separated with , to filter on project
* @param int $taskid Task id to filter on a task
* @param integer $filteronprojstatus Filter on project status if userp is set. Not used if userp not defined.
* @return array|int Array (projectid => 'list of roles for project' or taskid => 'list of roles for task')
@ -1595,7 +1595,7 @@ class Task extends CommonObjectLine
/**
* Calculate quantity and value of time consumed using the thm (hourly amount value of work for user entering time)
*
* @param User $fuser Filter on a dedicated user
* @param User|string $fuser Filter on a dedicated user
* @param string $dates Start date (ex 00:00:00)
* @param string $datee End date (ex 23:59:59)
* @return array Array of info for task array('amount','nbseconds','nblinesnull')

View file

@ -47,7 +47,7 @@ body > nav {
.spacer{
--spacer-margin: calc(var(--font-size) * 2);
margin-top: var(--spacer-margin);
margin-bottom: var(--spacer-margin);;
margin-bottom: var(--spacer-margin);
}
html{
@ -142,4 +142,4 @@ Home Styles
*/
.home-links-card{
}
}

View file

@ -2,6 +2,7 @@
/* Copyright (C) 2023-2024 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2023-2024 Lionel Vessiller <lvessiller@easya.solutions>
* Copyright (C) 2023-2024 Patrice Andreani <pandreani@easya.solutions>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* 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
@ -539,14 +540,14 @@ class FormListWebPortal
// Remain to pay
if (!empty($arrayfields['remain_to_pay']['checked'])) {
$html .= '<th scope="col">';
$html .= $langs->trans($arrayfields['remain_to_pay']['label']);;
$html .= $langs->trans($arrayfields['remain_to_pay']['label']);
$html .= '</th>';
$totalarray['nbfield']++;
}
// Download link
if (!empty($arrayfields['download_link']['checked'])) {
$html .= '<th scope="col">';
$html .= $langs->trans($arrayfields['download_link']['label']);;
$html .= $langs->trans($arrayfields['download_link']['label']);
$html .= '</th>';
$totalarray['nbfield']++;
}