*
* 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
@@ -278,7 +279,7 @@ if ($object->id > 0) {
$listofuserid = array();
if (empty($donotclearsession)) {
if ($object->userownerid > 0) {
- $listofuserid[$object->userownerid] = array('id'=>$object->userownerid, 'transparency'=>$object->transparency); // Owner first
+ $listofuserid[$object->userownerid] = array('id' => $object->userownerid, 'transparency' => $object->transparency); // Owner first
}
if (!empty($object->userassigned)) { // Now concat assigned users
// Restore array with key with same value than param 'id'
@@ -298,7 +299,7 @@ if ($object->id > 0) {
$listofcontactid = array(); // not used yet
$listofotherid = array(); // not used yet
print '';
- print $form->select_dolusers_forevent('view', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, '', ($object->datep != $object->datef) ? 1 : 0, $listofuserid, $listofcontactid, $listofotherid);
+ print $form->select_dolusers_forevent('view', 'assignedtouser', 1, array(), 0, '', array(), 0, 0, 0, '', ($object->datep != $object->datef) ? 1 : 0, $listofuserid, $listofcontactid, $listofotherid);
print '
';
/*if (in_array($user->id,array_keys($listofuserid)))
{
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index 53bc33241f8..63048fefeb9 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -2158,9 +2158,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
'@phan-var-force ActionComm $event';
if (empty($reshook)) {
// Other calendar
+ /*
if (empty($event->fulldayevent)) {
//print $event->getNomUrl(2).' ';
}
+ */
// Date
if (empty($event->fulldayevent)) {
diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php
index 7bce264617d..064ca39d86d 100644
--- a/htdocs/comm/action/list.php
+++ b/htdocs/comm/action/list.php
@@ -1149,8 +1149,8 @@ while ($i < $imaxinloop) {
print '';
if ($obj->socid > 0) {
$societestatic->id = $obj->socid;
- $societestatic->client = $obj->client;
- $societestatic->name = $obj->societe;
+ $societestatic->client = (int) $obj->client;
+ $societestatic->name = (string) $obj->societe;
$societestatic->email = $obj->socemail;
print $societestatic->getNomUrl(1, '', 28);
diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php
index 0e9b5bbbaf1..d5d99d1c8da 100644
--- a/htdocs/comm/mailing/cibles.php
+++ b/htdocs/comm/mailing/cibles.php
@@ -93,6 +93,7 @@ $result = $object->fetch($id);
$hookmanager->initHooks(array('ciblescard', 'globalcard'));
$sqlmessage = '';
+$mesgs = array();
// List of sending methods
$listofmethods = array();
diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php
index b501d463135..92147f8bc63 100644
--- a/htdocs/commande/list_det.php
+++ b/htdocs/commande/list_det.php
@@ -91,6 +91,7 @@ $search_dateorder_end = dol_mktime(23, 59, 59, GETPOSTINT('search_dateorder_end_
$search_datedelivery_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datedelivery_start_month'), GETPOSTINT('search_datedelivery_start_day'), GETPOSTINT('search_datedelivery_start_year'));
$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datedelivery_end_month'), GETPOSTINT('search_datedelivery_end_day'), GETPOSTINT('search_datedelivery_end_year'));
+$search_product_category_array = array();
if (isModEnabled('category')) {
$search_product_category_array = GETPOST("search_category_".Categorie::TYPE_PRODUCT."_list", "array");
$searchCategoryProductOperator = 0;
@@ -255,6 +256,7 @@ if ($user->socid) {
}
$result = restrictedArea($user, 'commande', $id, '');
+$permissiontoread = false;
/*
* Actions
@@ -1498,6 +1500,7 @@ if ($resql) {
// Détail commande
$totalqty = 0;
+ $oldref = null;
$totalarray = array();
$totalarray['nbfield'] = 0;
@@ -1816,7 +1819,7 @@ if ($resql) {
// Channel
if (!empty($arrayfields['c.fk_input_reason']['checked'])) {
print ' | ';
- $form->formInputReason($_SERVER['PHP_SELF'], $obj->fk_input_reason, 'none', '');
+ $form->formInputReason($_SERVER['PHP_SELF'], $obj->fk_input_reason, 'none', 0);
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
@@ -2101,6 +2104,7 @@ if ($resql) {
if (!empty($arrayfields['shippable']['checked'])) {
print '';
if (!empty($show_shippable_command) && isModEnabled('stock')) {
+ $text_icon = '';
if (($obj->fk_statut > $generic_commande::STATUS_DRAFT) && ($obj->fk_statut < $generic_commande::STATUS_CLOSED)) {
$generic_commande->loadExpeditions(); // Load array ->expeditions
diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php
index c423ee3e42e..2005e7d0fb2 100644
--- a/htdocs/compta/accounting-files.php
+++ b/htdocs/compta/accounting-files.php
@@ -417,11 +417,11 @@ if ($action == 'searchfiles' || $action == 'dl') { // Test on permission not req
//var_dump($files);
if (count($files) < 1) {
$nofile = array();
- $nofile['id'] = $objd->id;
- $nofile['entity'] = $objd->entity;
+ $nofile['id'] = (int) $objd->id;
+ $nofile['entity'] = (int) $objd->entity;
$nofile['date'] = $db->jdate($objd->date);
$nofile['date_due'] = $db->jdate($objd->date_due);
- $nofile['paid'] = $objd->paid;
+ $nofile['paid'] = (int) $objd->paid;
$nofile['amount_ht'] = $objd->total_ht;
$nofile['amount_ttc'] = $objd->total_ttc;
$nofile['amount_vat'] = $objd->total_vat;
@@ -444,11 +444,11 @@ if ($action == 'searchfiles' || $action == 'dl') { // Test on permission not req
$filesarray[$nofile['item'].'_'.$nofile['id']] = $nofile;
} else {
foreach ($files as $key => $file) {
- $file['id'] = $objd->id;
- $file['entity'] = $objd->entity;
+ $file['id'] = (int) $objd->id;
+ $file['entity'] = (int) $objd->entity;
$file['date'] = $db->jdate($objd->date);
$file['date_due'] = $db->jdate($objd->date_due);
- $file['paid'] = $objd->paid;
+ $file['paid'] = (int) $objd->paid;
$file['amount_ht'] = $objd->total_ht;
$file['amount_ttc'] = $objd->total_ttc;
$file['amount_vat'] = $objd->total_vat;
@@ -816,7 +816,7 @@ if (!empty($date_start) && !empty($date_stop)) {
print ' | ';
if ($data['item'] == 'Invoice') {
- $invoice->id = $data['id'];
+ $invoice->id = (int) $data['id'];
$invoice->ref = $data['ref'];
$invoice->total_ht = $data['amount_ht'];
$invoice->total_ttc = $data['amount_ttc'];
@@ -827,7 +827,7 @@ if (!empty($date_start) && !empty($date_stop)) {
$invoice->multicurrency_code = $data['currency'];
print $invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0);
} elseif ($data['item'] == 'SupplierInvoice') {
- $supplier_invoice->id = $data['id'];
+ $supplier_invoice->id = (int) $data['id'];
$supplier_invoice->ref = $data['ref'];
$supplier_invoice->total_ht = $data['amount_ht'];
$supplier_invoice->total_ttc = $data['amount_ttc'];
@@ -838,27 +838,27 @@ if (!empty($date_start) && !empty($date_stop)) {
$supplier_invoice->multicurrency_code = $data['currency'];
print $supplier_invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0);
} elseif ($data['item'] == 'ExpenseReport') {
- $expensereport->id = $data['id'];
+ $expensereport->id = (int) $data['id'];
$expensereport->ref = $data['ref'];
print $expensereport->getNomUrl(1, 0, 0, 0, 0, 0);
} elseif ($data['item'] == 'SalaryPayment') {
- $salary_payment->id = $data['id'];
+ $salary_payment->id = (int) $data['id'];
$salary_payment->ref = $data['ref'];
print $salary_payment->getNomUrl(1);
} elseif ($data['item'] == 'Donation') {
- $don->id = $data['id'];
+ $don->id = (int) $data['id'];
$don->ref = $data['ref'];
print $don->getNomUrl(1, 0, '', 0);
} elseif ($data['item'] == 'SocialContributions') {
- $charge_sociales->id = $data['id'];
+ $charge_sociales->id = (int) $data['id'];
$charge_sociales->ref = $data['ref'];
print $charge_sociales->getNomUrl(1, 0, 0, 0, 0);
} elseif ($data['item'] == 'VariousPayment') {
- $various_payment->id = $data['id'];
+ $various_payment->id = (int) $data['id'];
$various_payment->ref = $data['ref'];
print $various_payment->getNomUrl(1, '', 0, 0);
} elseif ($data['item'] == 'LoanPayment') {
- $payment_loan->id = $data['id'];
+ $payment_loan->id = (int) $data['id'];
$payment_loan->ref = $data['ref'];
print $payment_loan->getNomUrl(1, 0, 0, '', 0);
} else {
diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php
index 8299965fc17..8132b0729a7 100644
--- a/htdocs/compta/bank/annuel.php
+++ b/htdocs/compta/bank/annuel.php
@@ -305,11 +305,11 @@ if ($result < 0) {
$obj = $db->fetch_object($resql);
$min = $db->jdate($obj->min);
$max = $db->jdate($obj->max);
+ $log = "graph.php: min=".$min." max=".$max;
+ dol_syslog($log);
} else {
dol_print_error($db);
}
- $log = "graph.php: min=".$min." max=".$max;
- dol_syslog($log);
// CRED PART
// Chargement du tableau des années
diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php
index ea8b2bd39a4..6f4e4a946f3 100644
--- a/htdocs/compta/bank/bankentries_list.php
+++ b/htdocs/compta/bank/bankentries_list.php
@@ -974,6 +974,7 @@ if ($resql) {
$last_receipts = array();
$last_releve = '';
$last_ok = 0;
+ $numr = 0;
$resqlr = $db->query($sql);
if ($resqlr) {
@@ -1101,7 +1102,7 @@ if ($resql) {
// Bank line
$moreforfilter .= ' ';
$tmptitle = $langs->trans('RubriquesTransactions');
- $cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, $search_bid, 'parent', null, null, 1);
+ $cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, $search_bid, 'parent', 0, 0, 1);
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_bid', $cate_arbo, $search_bid, $tmptitle, 0, 0, '', 0, 0, 0, '', '', 1);
$moreforfilter .= ' ';
}
diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php
index f78e9d08bef..31f7fc7ca20 100644
--- a/htdocs/compta/bank/card.php
+++ b/htdocs/compta/bank/card.php
@@ -505,7 +505,7 @@ if ($action == 'create') {
$arrayselected[] = $cat->id;
}
}
- print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
+ print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print " | ";
}
@@ -594,6 +594,10 @@ if ($action == 'create') {
$name = 'cle_rib';
$sizecss = 'minwidth50';
$content = $object->cle_rib;
+ } else {
+ $name = 'undefined';
+ $sizecss = 'undefined';
+ $content = 'undefined';
}
print ''.$langs->trans($val).' | ';
@@ -651,7 +655,7 @@ if ($action == 'create') {
print '| '.$langs->trans("AccountancyCode").' | ';
print '';
print img_picto('', 'accounting_account', 'class="pictofixedwidth"');
- print $formaccounting->select_account($object->account_number, 'account_number', 1, '', 1, 1);
+ print $formaccounting->select_account($object->account_number, 'account_number', 1, array(), 1, 1);
if ($formaccounting->nbaccounts == 0) {
$langs->load("errors");
$htmltext = $langs->transnoentitiesnoconv("WarningGoOnAccountancySetupToAddAccounts", $langs->transnoentitiesnoconv("MenuAccountancy"), $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Chartofaccounts"));
@@ -1069,7 +1073,7 @@ if ($action == 'create') {
$arrayselected[] = $cat->id;
}
}
- print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
+ print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print " |
";
}
@@ -1110,7 +1114,7 @@ if ($action == 'create') {
if (isModEnabled('accounting')) {
/** @var FormAccounting $formaccounting */
print img_picto('', 'accounting_account', 'class="pictofixedwidth"');
- print $formaccounting->select_account($object->account_number, 'account_number', 1, '', 1, 1);
+ print $formaccounting->select_account($object->account_number, 'account_number', 1, array(), 1, 1);
if ($formaccounting->nbaccounts == 0) {
$langs->load("errors");
$htmltext = $langs->transnoentitiesnoconv("WarningGoOnAccountancySetupToAddAccounts", $langs->transnoentitiesnoconv("MenuAccountancy"), $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Chartofaccounts"));
@@ -1182,6 +1186,10 @@ if ($action == 'create') {
$name = 'cle_rib';
$css = 'width50';
$content = $object->cle_rib;
+ } else {
+ $name = 'undefined';
+ $css = 'undefined';
+ $content = 'undefined';
}
print '| '.$langs->trans($val).' | ';
diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php
index 20a1be491c9..be7ff72baf1 100644
--- a/htdocs/compta/bank/graph.php
+++ b/htdocs/compta/bank/graph.php
@@ -94,6 +94,13 @@ if (GETPOST("ref")) {
$title = $object->ref.' - '.$langs->trans("Graph");
$helpurl = "";
+$show1 = '';
+$show2 = '';
+$show3 = '';
+$show4 = '';
+$show5 = '';
+$morehtml = '';
+
llxHeader('', $title, $helpurl);
$result = dol_mkdir($conf->bank->dir_temp);
diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php
index 1e9a8a4080f..511b2b52a22 100644
--- a/htdocs/compta/bank/line.php
+++ b/htdocs/compta/bank/line.php
@@ -636,7 +636,7 @@ if ($result) {
// Bank line
print '
| '.$form->editfieldkey('RubriquesTransactions', 'custcats', '', $object, 0).' | ';
- $cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, null, 'parent', null, null, 1);
+ $cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, '', 'parent', 0, 0, 1);
$arrayselected = array();
@@ -647,7 +647,7 @@ if ($result) {
$arrayselected[] = $cat->id;
}
}
- print img_picto('', 'category', 'class="paddingright"').$form->multiselectarray('custcats', $cate_arbo, $arrayselected, null, null, null, null, "90%");
+ print img_picto('', 'category', 'class="paddingright"').$form->multiselectarray('custcats', $cate_arbo, $arrayselected, 0, 0, '', 0, "90%");
print " |
";
}
diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php
index d65c44e8837..f1d3523c336 100644
--- a/htdocs/compta/bank/releve.php
+++ b/htdocs/compta/bank/releve.php
@@ -495,6 +495,8 @@ if (empty($numref)) {
$obj = $db->fetch_object($resql);
$total = $obj->amount;
$db->free($resql);
+ } else {
+ $total = 0;
}
$totalc = $totald = 0;
diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php
index 80101b1b9e8..6150abc0cf3 100644
--- a/htdocs/compta/bank/transfer.php
+++ b/htdocs/compta/bank/transfer.php
@@ -173,13 +173,13 @@ if ($action == 'add' && $user->hasRight('banque', 'transfer')) {
}
if (!$error) {
- $bank_line_id_from = $tmpaccountfrom->addline($dateo[$n], $typefrom, $label[$n], price2num(-1 * (float) $amount[$n]), '', '', $user);
+ $bank_line_id_from = $tmpaccountfrom->addline($dateo[$n], $typefrom, $label[$n], price2num(-1 * (float) $amount[$n]), '', 0, $user);
}
if (!($bank_line_id_from > 0)) {
$error++;
}
if (!$error) {
- $bank_line_id_to = $tmpaccountto->addline($dateo[$n], $typeto, $label[$n], $amountto[$n], '', '', $user);
+ $bank_line_id_to = $tmpaccountto->addline($dateo[$n], $typeto, $label[$n], $amountto[$n], '', 0, $user);
}
if (!($bank_line_id_to > 0)) {
$error++;
diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php
index be77fa1b9c9..69c859037b2 100644
--- a/htdocs/compta/bank/treso.php
+++ b/htdocs/compta/bank/treso.php
@@ -5,6 +5,7 @@
* Copyright (C) 2015 Marcos García
* Copyright (C) 2022 Alexandre Spangaro
+ * Copyright (C) 2024 MDW
*
* 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
@@ -283,7 +284,7 @@ if (GETPOST("account") || GETPOST("ref")) {
if ($tmpobj->family == 'invoice') {
$facturestatic->ref = $tmpobj->ref;
$facturestatic->id = $tmpobj->objid;
- $facturestatic->type = $tmpobj->type;
+ $facturestatic->type = (int) $tmpobj->type;
$ref = $facturestatic->getNomUrl(1, '');
$societestatic->id = $tmpobj->socid;
diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php
index 8e5a6c41a57..a8dfc070bd4 100644
--- a/htdocs/compta/bank/various_payment/card.php
+++ b/htdocs/compta/bank/various_payment/card.php
@@ -226,6 +226,8 @@ if (empty($reshook)) {
if ($result > 0) {
$result = $accountline->delete($user); // $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing)
}
+ } else {
+ $account_line = null;
}
if ($result >= 0) {
@@ -233,7 +235,7 @@ if (empty($reshook)) {
header("Location: ".DOL_URL_ROOT.'/compta/bank/various_payment/list.php');
exit;
} else {
- $object->error = $accountline->error;
+ $object->error = $accountline ? $accountline->error : 'No AccountLine';
$db->rollback();
setEventMessages($object->error, $object->errors, 'errors');
}
@@ -356,9 +358,13 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && $permissiontoadd) {
$form = new Form($db);
if (isModEnabled('accounting')) {
$formaccounting = new FormAccounting($db);
+} else {
+ $formaccounting = null;
}
if (isModEnabled('project')) {
$formproject = new FormProjets($db);
+} else {
+ $formproject = null;
}
if ($id) {
@@ -531,7 +537,7 @@ if ($action == 'create') {
// TODO Remove the fieldrequired and allow instead to edit a various payment to enter accounting code
print '| '.$langs->trans("AccountAccounting").' | ';
print '';
- print $formaccounting->select_account($accountancy_code, 'accountancy_code', 1, null, 1, 1);
+ print $formaccounting->select_account($accountancy_code, 'accountancy_code', 1, array(), 1, 1);
print ' |
';
} else { // For external software
print '| '.$langs->trans("AccountAccounting").' | ';
@@ -606,7 +612,7 @@ if ($id) {
$morehtmlref = '';
// Project
- if (isModEnabled('project')) {
+ if (isModEnabled('project') && $formproject !== null) {
$langs->load("projects");
//$morehtmlref .= '
';
if ($permissiontoadd) {
diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php
index 8aa20523f7d..e45bd655ef3 100644
--- a/htdocs/core/modules/mailings/modules_mailings.php
+++ b/htdocs/core/modules/mailings/modules_mailings.php
@@ -449,4 +449,20 @@ class MailingTargets // This can't be abstract as it is used for some method
dol_syslog($msg, LOG_ERR);
return array();
}
+
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ /**
+ * Add destinations in the targets table
+ *
+ * @param int $mailing_id Id of emailing
+ * @return int Return integer < 0 on error, count of added when ok
+ */
+ public function add_to_target($mailing_id)
+ {
+ // phpcs:enable
+ // Needs to be implemented in child class
+ $msg = get_class($this)."::".__FUNCTION__." not implemented";
+ dol_syslog($msg, LOG_ERR);
+ return -1;
+ }
}