diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index 4a53f8e7642..8764dea999b 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -5,7 +5,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2017-2018 Frédéric France + * Copyright (C) 2017-2018 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 diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php index 4ab238ee4c8..7d2476878c4 100644 --- a/htdocs/accountancy/bookkeeping/export.php +++ b/htdocs/accountancy/bookkeeping/export.php @@ -4,7 +4,7 @@ * Copyright (C) 2013-2024 Alexandre Spangaro * Copyright (C) 2022 Lionel Vessiller * Copyright (C) 2016-2017 Laurent Destailleur - * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2022 Progiseize * Copyright (C) 2024 MDW * @@ -912,7 +912,7 @@ print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, // Not display message when all the list of docs are included if (!getDolGlobalString('ACCOUNTING_REEXPORT')) { - print info_admin($langs->trans("WarningDataDisappearsWhenDataIsExported"), 0, 0, 0, 'hideonsmartphone info'); + print info_admin($langs->trans("WarningDataDisappearsWhenDataIsExported"), 0, 0, '0', 'hideonsmartphone info'); } //$topicmail = "Information"; diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 5e286613815..8efb0347134 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -4,7 +4,7 @@ * Copyright (C) 2013-2024 Alexandre Spangaro * Copyright (C) 2022 Lionel Vessiller * Copyright (C) 2016-2017 Laurent Destailleur - * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2022 Progiseize * Copyright (C) 2024 MDW * diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 84c8b774960..ddce2f4edc1 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2016-2017 Alexandre Spangaro - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-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 @@ -851,7 +851,7 @@ class AccountancyCategory // extends CommonObject } $pcgverid = getDolGlobalInt('CHARTOFACCOUNTS'); - $pcgvercode = dol_getIdFromCode($this->db, $pcgverid, 'accounting_system', 'rowid', 'pcg_version'); + $pcgvercode = dol_getIdFromCode($this->db, (string) $pcgverid, 'accounting_system', 'rowid', 'pcg_version'); if (empty($pcgvercode)) { $pcgvercode = $pcgverid; } diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index a3318346695..f2d1c9b6332 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -414,7 +414,7 @@ class AccountancyExport // directory already created when module is enabled $outputDir .= '/export'; - $outputDir .= '/'.dol_sanitizePathName($formatexportset); + $outputDir .= '/'.dol_sanitizePathName((string) $formatexportset); } if (!dol_is_dir($outputDir)) { @@ -1110,7 +1110,7 @@ class AccountancyExport $tab['folio'] = ' 1'; - $tab['num_ecriture'] = str_pad(dol_trunc($index, 6, 'right', 'UTF-8', 1), 6, ' ', STR_PAD_LEFT); + $tab['num_ecriture'] = str_pad(dol_trunc((string) $index, 6, 'right', 'UTF-8', 1), 6, ' ', STR_PAD_LEFT); $tab['jour_ecriture'] = dol_print_date($line->doc_date, '%d%m%y'); diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 26ceb4868ba..76f7b43a620 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -408,7 +408,7 @@ class BookKeeping extends CommonObject $sql .= ', entity'; $sql .= ") VALUES ("; $sql .= "'".$this->db->idate($this->doc_date)."'"; - $sql .= ", ".(!isset($this->date_lim_reglement) || dol_strlen($this->date_lim_reglement) == 0 ? 'NULL' : "'".$this->db->idate($this->date_lim_reglement)."'"); + $sql .= ", ".(isDolTms($this->date_lim_reglement) ? "'".$this->db->idate($this->date_lim_reglement)."'" : 'NULL'); $sql .= ", '".$this->db->escape($this->doc_type)."'"; $sql .= ", '".$this->db->escape($this->doc_ref)."'"; $sql .= ", ".((int) $this->fk_doc); @@ -681,8 +681,8 @@ class BookKeeping extends CommonObject $sql .= 'piece_num,'; $sql .= 'entity'; $sql .= ') VALUES ('; - $sql .= ' '.(!isset($this->doc_date) || dol_strlen($this->doc_date) == 0 ? 'NULL' : "'".$this->db->idate($this->doc_date)."'").','; - $sql .= ' '.(!isset($this->date_lim_reglement) || dol_strlen($this->date_lim_reglement) == 0 ? 'NULL' : "'".$this->db->idate($this->date_lim_reglement)."'").','; + $sql .= ' '.(isDolTms($this->doc_date) ? "'".$this->db->idate($this->doc_date)."'" : 'NULL').','; + $sql .= ' '.(isDolTms($this->date_lim_reglement) ? "'".$this->db->idate($this->date_lim_reglement)."'" : 'NULL').','; $sql .= ' '.(!isset($this->doc_type) ? 'NULL' : "'".$this->db->escape($this->doc_type)."'").','; $sql .= ' '.(!isset($this->doc_ref) ? 'NULL' : "'".$this->db->escape($this->doc_ref)."'").','; $sql .= ' '.(empty($this->fk_doc) ? '0' : (int) $this->fk_doc).','; @@ -1446,7 +1446,7 @@ class BookKeeping extends CommonObject // Update request $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.$mode.' SET'; - $sql .= ' doc_date = '.(!isset($this->doc_date) || dol_strlen($this->doc_date) != 0 ? "'".$this->db->idate($this->doc_date)."'" : 'null').','; + $sql .= ' doc_date = '.(isDolTms($this->doc_date) ? "'".$this->db->idate($this->doc_date)."'" : 'null').','; $sql .= ' doc_type = '.(isset($this->doc_type) ? "'".$this->db->escape($this->doc_type)."'" : "null").','; $sql .= ' doc_ref = '.(isset($this->doc_ref) ? "'".$this->db->escape($this->doc_ref)."'" : "null").','; $sql .= ' fk_doc = '.(isset($this->fk_doc) ? $this->fk_doc : "null").','; diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index b1b82d35735..5a0cec8d64d 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -4,6 +4,7 @@ * Copyright (C) 2013-2022 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry + * 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 @@ -75,7 +76,7 @@ $year_current = $year_start; // Validate History $action = GETPOST('action', 'aZ09'); -$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); +$chartaccountcode = dol_getIdFromCode($db, getDolGlobalString('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); // Security check if (!isModEnabled('accounting')) { diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 4c4be8bb0b0..578ad537b7d 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -6,6 +6,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2016 Laurent Destailleur * Copyright (C) 2021 Gauthier VERDOL + * 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 @@ -107,7 +108,7 @@ $hookmanager->initHooks(array('accountancycustomerlist')); $formaccounting = new FormAccounting($db); $accountingAccount = new AccountingAccount($db); -$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); +$chartaccountcode = dol_getIdFromCode($db, getDolGlobalString('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); // Security check if (!isModEnabled('accounting')) { diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index f3dbc54f78a..3085d1ecb86 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -3,6 +3,7 @@ * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2013-2024 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent + * 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 @@ -58,7 +59,7 @@ $year_current = $year_start; // Validate History $action = GETPOST('action', 'aZ09'); -$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); +$chartaccountcode = dol_getIdFromCode($db, getDolGlobalString('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); // Security check if (!isModEnabled('accounting')) { diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index c729802eaf2..7be5d5bf6a8 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -101,7 +101,7 @@ $hookmanager->initHooks(array('accountancyexpensereportlist')); $formaccounting = new FormAccounting($db); $accounting = new AccountingAccount($db); -$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); +$chartaccountcode = dol_getIdFromCode($db, getDolGlobalString('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); // Security check if (!isModEnabled('accounting')) { diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index bb9572bc879..4af41e92e51 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -3,6 +3,7 @@ * Copyright (C) 2013-2021 Florian Henry * Copyright (C) 2013-2022 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent + * 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 @@ -62,7 +63,7 @@ $year_current = $year_start; // Validate History $action = GETPOST('action', 'aZ09'); -$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); +$chartaccountcode = dol_getIdFromCode($db, getDolGlobalString('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); // Security check if (!isModEnabled('accounting')) { diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 66f87389533..b640b0a1bb8 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -6,6 +6,7 @@ * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2014 Juanjo Menent s * Copyright (C) 2016 Laurent Destailleur + * 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 @@ -104,7 +105,7 @@ $hookmanager->initHooks(array('accountancysupplierlist')); $formaccounting = new FormAccounting($db); $accountingAccount = new AccountingAccount($db); -$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); +$chartaccountcode = dol_getIdFromCode($db, getDolGlobalString('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); // Security check if (!isModEnabled('accounting')) { diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index c4937a8a8a8..dfe7441a3d2 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -76,8 +76,8 @@ if ($action == 'update') { $res = dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT", $amount, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "MEMBER_MIN_AMOUNT", $minamount, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "MEMBER_COUNTERS_ARE_PUBLIC", $publiccounters, 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, "MEMBER_SKIP_TABLE", (string) !$showtable, 'chaine', 0, '', $conf->entity); // Logic is reversed for retrocompatibility: "skip -> show" - $res = dolibarr_set_const($db, "MEMBER_HIDE_VOTE_ALLOWED", (string) !$showvoteallowed, 'chaine', 0, '', $conf->entity); // Logic is reversed for retrocompatibility: "hide -> show" + $res = dolibarr_set_const($db, "MEMBER_SKIP_TABLE", !$showtable, 'chaine', 0, '', $conf->entity); // Logic is reversed for retrocompatibility: "skip -> show" + $res = dolibarr_set_const($db, "MEMBER_HIDE_VOTE_ALLOWED", !$showvoteallowed, 'chaine', 0, '', $conf->entity); // Logic is reversed for retrocompatibility: "hide -> show" $res = dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE", $payonline, 'chaine', 0, '', $conf->entity); if ($forcetype < 0) { $res = dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE", $conf->entity); diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 586b34b05b6..c38e698ec7e 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -199,7 +199,7 @@ foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1); + $visible = (int) dol_eval((string) $val['visible'], 1); $arrayfields[$tableprefix.'.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index afb6f6ab4e2..78cd1ec763b 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -1,7 +1,8 @@ - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Alexandre Spangaro +/* Copyright (c) 2004-2011 Laurent Destailleur + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro + * 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 @@ -30,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; -$graphwidth = DolGraph::getDefaultGraphSizeForStats('width', 700); +$graphwidth = DolGraph::getDefaultGraphSizeForStats('width', '700'); $mapratio = 0.5; $graphheight = round($graphwidth * $mapratio); diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php index d4a3324b3cc..66e508b5a1f 100644 --- a/htdocs/adherents/type_translation.php +++ b/htdocs/adherents/type_translation.php @@ -4,6 +4,7 @@ * Copyright (C) 2010-2012 Destailleur Laurent * Copyright (C) 2014 Henry Florian * Copyright (C) 2024 Alexandre Spangaro + * 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 @@ -213,7 +214,7 @@ if ($action == 'edit') { if (!empty($object->multilangs)) { foreach ($object->multilangs as $key => $value) { - $s = picto_from_langcode($key); + $s = picto_from_langcode((string) $key); print '
'; print '
'; print($s ? $s.' ' : '').''.$langs->trans('Language_'.$key).':'; @@ -240,7 +241,7 @@ if ($action == 'edit') { } elseif ($action != 'create') { if (!empty($object->multilangs)) { foreach ($object->multilangs as $key => $value) { - $s = picto_from_langcode($key); + $s = picto_from_langcode((string) $key); print '
'; print($s ? $s.' ' : '').''.$langs->trans('Language_'.$key).':'; print '
'; diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 3d168582b24..f8277cfb7ce 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2024 MDW + * 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 @@ -403,7 +404,7 @@ foreach ($boxactivated as $key => $box) { $langs->load("errors"); print 'note).'">'; if ($box->note == '(WarningUsingThisBoxSlowDown)') { - print img_warning('', 0).' '.$langs->trans("WarningUsingThisBoxSlowDown"); + print img_warning('', '').' '.$langs->trans("WarningUsingThisBoxSlowDown"); } else { print($box->note ? $box->note : ' '); } diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 8aed91aea8f..5c8666d97b4 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -4,7 +4,7 @@ * Copyright (C) 2005 Simon Tosser * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2016 Raphaël Doursenaud - * Copyright (C) 2022 Frédéric France + * Copyright (C) 2022-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 diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 97e680f5374..b552ea16c64 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -11,7 +11,7 @@ * Copyright (C) 2011-2023 Alexandre Spangaro * Copyright (C) 2015 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud - * Copyright (C) 2019-2022 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2020-2022 Open-Dsi * Copyright (C) 2024 Charlene Benke * @@ -2249,7 +2249,7 @@ if ($id > 0) { print ''; print '
'; - print ''; + print ''; print ''; if (!is_null($withentity)) { print ''; diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index c3588fc5e36..36a6b637ec0 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Alexandre Spangaro + * 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 @@ -118,7 +119,7 @@ $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1); + $visible = (int) dol_eval((string) $val['visible'], 1); $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 6f4c72ef592..4710246bc0e 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -222,7 +222,7 @@ if (empty($conf->use_javascript_ajax)) { if ($mode != 'Full_inline') { $uselocalbrowser = true; $readonly = ($mode == 'dolibarr_readonly' ? 1 : 0); - $editor = new DolEditor('formtestfield', getDolGlobalString('FCKEDITOR_TEST', 'Test'), '', 200, $mode, 'In', true, $uselocalbrowser, 1, 120, 8, $readonly); + $editor = new DolEditor('formtestfield', getDolGlobalString('FCKEDITOR_TEST', 'Test'), '', 200, $mode, 'In', true, $uselocalbrowser, 1, 120, '8', $readonly); $editor->Create(); } else { // CKEditor inline enabled with the contenteditable="true" diff --git a/htdocs/admin/invoice.php b/htdocs/admin/invoice.php index 72c53c740fb..e16756f2a4e 100644 --- a/htdocs/admin/invoice.php +++ b/htdocs/admin/invoice.php @@ -752,7 +752,7 @@ if ($resql) { } } print ""; -print ajax_combobox("chq", array(), 0, 0, 'resolve', -2); +print ajax_combobox("chq", array(), 0, 0, 'resolve', '-2'); print ""; print ""; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index dad93cbdc17..6d8a85c8402 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -126,7 +126,7 @@ if ($action == 'update' && !$cancel) { } if ($action == 'disablephpmailwarning' && !$cancel) { - dolibarr_set_const($db, 'MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP', 1, 'chaine', 1, 0, $conf->entity); + dolibarr_set_const($db, 'MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP', 1, 'chaine', 1, '', $conf->entity); setEventMessages($langs->trans("WarningDisabled"), null, 'mesgs'); } diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 31dcb7533a1..1a0aa0ede0d 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -1,6 +1,7 @@ * Copyright (C) 2018 Ferran Marcet + * 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 @@ -106,7 +107,7 @@ $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1); + $visible = (int) dol_eval((string) $val['visible'], 1); $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 491efaf9fc4..223ef04a7dd 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -327,13 +327,13 @@ if ($action == 'set' && $user->admin) { exit; } elseif (getDolGlobalInt("MAIN_FEATURES_LEVEL") > 1 && $action == 'reload' && $user->admin && GETPOST('confirm') == 'yes') { $result = unActivateModule($value, 0); - dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", getDolGlobalInt('MAIN_IHM_PARAMS_REV') + 1, 'chaine', 0, '', $conf->entity); if ($result) { setEventMessages($result, null, 'errors'); header("Location: ".$_SERVER["PHP_SELF"]."?mode=".$mode.$param.($page_y ? '&page_y='.$page_y : '')); } $resarray = activateModule($value, 0, 1); - dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (getDolGlobalInt('MAIN_IHM_PARAMS_REV') + 1), 'chaine', 0, '', $conf->entity); if (!empty($resarray['errors'])) { setEventMessages('', $resarray['errors'], 'errors'); } else { @@ -374,7 +374,7 @@ if (!dol_is_dir($dirins)) { $dirins_ok = (dol_is_dir($dirins)); $help_url = 'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; -llxHeader('', $langs->trans("Setup"), $help_url, '', 0, 0, $morejs, $morecss, 0, 'mod-admin page-modules'); +llxHeader('', $langs->trans("Setup"), $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-admin page-modules'); // Search modules dirs diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index 6cd5d6de4ae..9e397724dcb 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2019 Markus Welters + * 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 diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index c301b909b61..af70c538e9b 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -5,6 +5,7 @@ * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2024 MDW + * 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 @@ -87,7 +88,7 @@ if (preg_match('/t$/i', $maxphp2)) { } if ($maxphp > 0 && $maxphp2 > 0 && $maxphp > $maxphp2) { $langs->load("errors"); - print info_admin($langs->trans("WarningParamUploadMaxFileSizeHigherThanPostMaxSize", @ini_get('upload_max_filesize'), @ini_get('post_max_size')), 0, 0, 0, 'warning'); + print info_admin($langs->trans("WarningParamUploadMaxFileSizeHigherThanPostMaxSize", @ini_get('upload_max_filesize'), @ini_get('post_max_size')), 0, 0, '0', 'warning'); print '
'; } diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 6986d51fbfa..a333b57d7b1 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -5,6 +5,7 @@ * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2015-2022 Alexandre Spangaro * Copyright (C) 2023 Joachim Kueter + * 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 @@ -167,7 +168,7 @@ if (empty($mysoc->tva_assuj)) { print ''.$langs->trans("Parameters").''.$langs->trans("Value").''; print ''; - print ''; + print ''; print ''; print ''; @@ -225,7 +226,7 @@ if (empty($mysoc->tva_assuj)) { print '
'; - print load_fiche_titre('', '', '', 0, 0, '', '-> '.$langs->trans("SummaryOfVatExigibilityUsedByDefault")); + print load_fiche_titre('', '', '', 0, '', '', '-> '.$langs->trans("SummaryOfVatExigibilityUsedByDefault")); //print ' ('.$langs->trans("CanBeChangedWhenMakingInvoice").')'; diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index f05618ba592..e3ab2660d6c 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -749,7 +749,7 @@ $mail_intro = getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO', ''); print ''.$langs->trans("TicketMessageMailIntro"); print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_INTRO', $mail_intro, '100%', 90, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70); +$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_INTRO', $mail_intro, '100%', 90, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, '70'); $doleditor->Create(); print ''; print ''; @@ -761,7 +761,7 @@ $mail_signature = getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE'); print ''.$langs->trans("TicketMessageMailFooter").''; print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, '100%', 90, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70); +$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, '100%', 90, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, '70'); $doleditor->Create(); print ''; print ''; diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index 83a5f66d5e8..42bd9cc8900 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -1,6 +1,7 @@ * Copyright (C) 2016 Christophe Battarel + * 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 @@ -438,7 +439,7 @@ if (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) { print ''.$langs->trans("TicketPublicInterfaceTextHomeLabelAdmin").''; print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HOME', $public_text_home, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_TICKET'), ROWS_2, 70); + $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HOME', $public_text_home, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_TICKET'), ROWS_2, '70'); $doleditor->Create(); print ''; print ''; @@ -450,7 +451,7 @@ if (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) { print ''.$langs->trans("TicketPublicInterfaceTextHelpMessageLabelAdmin").''; print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HELP_MESSAGE', $public_text_help_message, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_TICKET'), ROWS_2, 70); + $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HELP_MESSAGE', $public_text_help_message, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_TICKET'), ROWS_2, '70'); $doleditor->Create(); print ''; print ''; @@ -497,7 +498,7 @@ if (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) { print ''; print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('TICKET_MESSAGE_MAIL_NEW', $mail_mesg_new, '100%', 120, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70); + $doleditor = new DolEditor('TICKET_MESSAGE_MAIL_NEW', $mail_mesg_new, '100%', 120, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, '70'); $doleditor->Create(); print ''; print ''; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index cd1b780e1a1..381afc792d9 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -1,6 +1,7 @@ * Copyright (C) 2006-2021 Regis Houssin + * 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 @@ -583,7 +584,7 @@ if (!empty($_SESSION["commandbackuplastdone"])) { if (!empty($_SESSION["commandbackuptorun"])) { print '
'.$langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser", $dolibarr_main_db_user, $dolibarr_main_db_user).':
'."\n"; print '
'."\n"; - print ajax_autoselect("commandbackuptoruntext", 0); + print ajax_autoselect("commandbackuptoruntext", ''); print '
'; //print $paramclear; diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 0f8b1ac09d5..48df30067a1 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2016 Laurent Destailleur * Copyright (C) 2016 Jean-François Ferry * Copyright (C) 2023 Romain Neil + * 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 @@ -940,7 +941,7 @@ class Documents extends DolibarrApi } // Move the temporary file at its final emplacement - $result = dol_move($destfiletmp, $dest_file, 0, $overwriteifexists, 1, 1, $moreinfo); + $result = dol_move($destfiletmp, $dest_file, '0', $overwriteifexists, 1, 1, $moreinfo); if (!$result) { throw new RestException(500, "Failed to move file into '".$destfile."'"); } diff --git a/htdocs/api/class/api_login.class.php b/htdocs/api/class/api_login.class.php index 7ca042bc472..ab7db1569eb 100644 --- a/htdocs/api/class/api_login.class.php +++ b/htdocs/api/class/api_login.class.php @@ -1,7 +1,8 @@ - * Copyright (C) 2016 Laurent Destailleur - * Copyright (C) 2024 MDW +/* Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2016 Laurent Destailleur + * Copyright (C) 2024 MDW + * 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 @@ -154,7 +155,7 @@ class Login } // Generate token for user - $token = dol_hash($login.uniqid().(!getDolGlobalString('MAIN_API_KEY') ? '' : $conf->global->MAIN_API_KEY), 1); + $token = dol_hash($login.uniqid().getDolGlobalString('MAIN_API_KEY'), '1'); // We store API token into database $sql = "UPDATE ".MAIN_DB_PREFIX."user"; diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index 8c2a8b8b800..00cff62c431 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -2,6 +2,7 @@ /* Copyright (C) 2007-2017 Laurent Destailleur * Copyright (C) 2018-2024 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet + * 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 @@ -105,7 +106,7 @@ $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1); + $visible = (int) dol_eval((string) $val['visible'], 1); $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), diff --git a/htdocs/asset/model/list.php b/htdocs/asset/model/list.php index 4f0c9355907..8d1644e0e9a 100644 --- a/htdocs/asset/model/list.php +++ b/htdocs/asset/model/list.php @@ -1,6 +1,7 @@ * Copyright (C) 2018-2024 Alexandre Spangaro + * 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 @@ -105,7 +106,7 @@ $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1); + $visible = (int) dol_eval((string) $val['visible'], 1); $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index b0547f4adc3..cb72a810f1e 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -560,7 +560,7 @@ if (is_array($blocks)) { } // ID - print ''.dol_escape_htmltag($block->id).''; + print ''.dol_escape_htmltag((string) $block->id).''; // Date print ''.dol_print_date($block->date_creation, 'dayhour').''; diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 6bb7aacb131..dc5ce2b5729 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2017-2020 Laurent Destailleur * Copyright (C) 2022 charlene benke * Copyright (C) 2024 MDW + * 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 @@ -1151,10 +1152,10 @@ class BlockedLog } if ($fk_object) { - $sql .= natural_search("rowid", $fk_object, 1); + $sql .= natural_search("rowid", (string) $fk_object, 1); } if ($search_fk_user > 0) { - $sql .= natural_search("fk_user", $search_fk_user, 2); + $sql .= natural_search("fk_user", (string) $search_fk_user, 2); } if ($search_start > 0) { $sql .= " AND date_creation >= '".$this->db->idate($search_start)."'"; diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 0d46d2ffa19..ddbb7ac010e 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * 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 @@ -108,7 +109,7 @@ $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1); + $visible = (int) dol_eval((string) $val['visible'], 1); $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index e730be6ef7c..a496dc0554c 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -1,6 +1,7 @@ * Copyright (C) 2022 Alice Adminson + * 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 @@ -128,7 +129,7 @@ $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1); + $visible = (int) dol_eval((string) $val['visible'], 1); $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), diff --git a/htdocs/bookcal/calendar_list.php b/htdocs/bookcal/calendar_list.php index 75079272459..983b5bc8b73 100644 --- a/htdocs/bookcal/calendar_list.php +++ b/htdocs/bookcal/calendar_list.php @@ -124,7 +124,7 @@ $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1); + $visible = (int) dol_eval((string) $val['visible'], 1); $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 8ecd22e6c19..4b487ff07c5 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -3,6 +3,7 @@ * Copyright (C) 2007 Rodolphe Quiedeville * Copyright (C) 2010-2016 Destailleur Laurent * Copyright (C) 2015 Raphaël Doursenaud + * 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 @@ -287,7 +288,7 @@ if ($action == 'edit') { if (!empty($object->multilangs)) { foreach ($object->multilangs as $key => $value) { - $s = picto_from_langcode($key); + $s = picto_from_langcode((string) $key); print ''; print ''; print ''; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 96f51ca519a..51de82d294d 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1364,11 +1364,11 @@ if ($action == 'create') { $datep = ($datep ? $datep : (is_null($object->datep) ? '' : $object->datep)); if (GETPOSTINT('datep', 1)) { - $datep = dol_stringtotime(GETPOSTINT('datep', 1), 'tzuserrel'); + $datep = dol_stringtotime((string) GETPOSTINT('datep', 1), 'tzuserrel'); } $datef = ($datef ? $datef : $object->datef); if (GETPOSTINT('datef', 1)) { - $datef = dol_stringtotime(GETPOSTINT('datef', 1), 'tzuserrel'); + $datef = dol_stringtotime((string) GETPOSTINT('datef', 1), 'tzuserrel'); } if (empty($datef) && !empty($datep)) { if (GETPOST("actioncode", 'aZ09') == 'AC_RDV' || !getDolGlobalString('AGENDA_USE_EVENT_TYPE_DEFAULT')) { diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 3a7b1d18a51..eca23912930 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -2469,7 +2469,7 @@ class ActionComm extends CommonObject } if ($result >= 0) { - if (dol_move($outputfiletmp, $outputfile, 0, 1, 0, 0)) { + if (dol_move($outputfiletmp, $outputfile, '0', 1, 0, 0)) { $result = 1; } else { $this->error = 'Failed to rename '.$outputfiletmp.' into '.$outputfile; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index dffa19f916f..44510fdcb0c 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1525,7 +1525,7 @@ if (empty($mode) || $mode == 'show_month') { // View by month $newparam .= '&viewcal=1'; print '
'; - print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid, $search_categ_cus); + print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, '', $filtert, '', $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid, $search_categ_cus); print '
'; print '
'; @@ -1636,7 +1636,7 @@ if (empty($mode) || $mode == 'show_month') { // View by month $newparam .= '&viewweek=1'; print '
'; - print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); + print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, '', $filtert, '', $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); print '
'; print '
'; @@ -1704,7 +1704,7 @@ if (empty($mode) || $mode == 'show_month') { // View by month $arraytimestamp = dol_getdate($timestamp); print '
'; - print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); + print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, '', $filtert, '', $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); print '
'; print '
'; diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 979c62d6172..8fa999af302 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -664,7 +664,7 @@ if ($showbirthday) { print $nav; //print dol_get_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); -//print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); +//print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, '', $filtert, '', $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); //print dol_get_fiche_end(); @@ -758,7 +758,7 @@ if ($massactionbutton) { $i = 0; print '
'; -print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid, $search_categ_cus); +print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, '', $filtert, '', $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid, $search_categ_cus); print '
'; print '
'; diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 43e0492e328..46a73a2381e 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -508,7 +508,7 @@ $s = $newtitle; print $s; print '
'; -print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); +print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, '', $filtert, '', $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); print '
'; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 6ad1b938ebd..c56e1900c8e 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -540,7 +540,7 @@ $s .= "\n".''."\n"; print $s; print '
'; -print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid, $search_categ_cus); +print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, '', $filtert, '', $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid, $search_categ_cus); print '
'; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 30f19ef128b..8c5f6af95b7 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -3,7 +3,8 @@ * Copyright (C) 2005-2019 Laurent Destailleur * Copyright (C) 2005-2016 Regis Houssin * Copyright (C) 2021 Waël Almoman - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * 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 @@ -290,19 +291,19 @@ if (empty($reshook)) { $substitutionarray['__ONLINEPAYMENTLINK_INVOICE__'] = getHtmlOnlinePaymentLink('invoice', $obj->source_id); $substitutionarray['__ONLINEPAYMENTLINK_CONTRACTLINE__'] = getHtmlOnlinePaymentLink('contractline', $obj->source_id); - $substitutionarray['__SECUREKEYPAYMENT__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), 2); + $substitutionarray['__SECUREKEYPAYMENT__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), '2'); if (!getDolGlobalString('PAYMENT_SECURITY_TOKEN_UNIQUE')) { - $substitutionarray['__SECUREKEYPAYMENT_MEMBER__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), 2); - $substitutionarray['__SECUREKEYPAYMENT_DONATION__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), 2); - $substitutionarray['__SECUREKEYPAYMENT_ORDER__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), 2); - $substitutionarray['__SECUREKEYPAYMENT_INVOICE__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), 2); - $substitutionarray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), 2); + $substitutionarray['__SECUREKEYPAYMENT_MEMBER__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), '2'); + $substitutionarray['__SECUREKEYPAYMENT_DONATION__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), '2'); + $substitutionarray['__SECUREKEYPAYMENT_ORDER__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), '2'); + $substitutionarray['__SECUREKEYPAYMENT_INVOICE__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), '2'); + $substitutionarray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), '2'); } else { - $substitutionarray['__SECUREKEYPAYMENT_MEMBER__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'member'.$obj->source_id, 2); - $substitutionarray['__SECUREKEYPAYMENT_DONATION__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'donation'.$obj->source_id, 2); - $substitutionarray['__SECUREKEYPAYMENT_ORDER__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'order'.$obj->source_id, 2); - $substitutionarray['__SECUREKEYPAYMENT_INVOICE__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'invoice'.$obj->source_id, 2); - $substitutionarray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'contractline'.$obj->source_id, 2); + $substitutionarray['__SECUREKEYPAYMENT_MEMBER__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'member'.$obj->source_id, '2'); + $substitutionarray['__SECUREKEYPAYMENT_DONATION__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'donation'.$obj->source_id, '2'); + $substitutionarray['__SECUREKEYPAYMENT_ORDER__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'order'.$obj->source_id, '2'); + $substitutionarray['__SECUREKEYPAYMENT_INVOICE__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'invoice'.$obj->source_id, '2'); + $substitutionarray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'contractline'.$obj->source_id, '2'); } } if (getDolGlobalString('MEMBER_ENABLE_PUBLIC')) { @@ -310,30 +311,30 @@ if (empty($reshook)) { } /* For backward compatibility, deprecated */ if (isModEnabled('paypal') && getDolGlobalString('PAYPAL_SECURITY_TOKEN')) { - $substitutionarray['__SECUREKEYPAYPAL__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), 2); + $substitutionarray['__SECUREKEYPAYPAL__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), '2'); if (!getDolGlobalString('PAYPAL_SECURITY_TOKEN_UNIQUE')) { - $substitutionarray['__SECUREKEYPAYPAL_MEMBER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), 2); + $substitutionarray['__SECUREKEYPAYPAL_MEMBER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), '2'); } else { - $substitutionarray['__SECUREKEYPAYPAL_MEMBER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN') . 'membersubscription'.$obj->source_id, 2); + $substitutionarray['__SECUREKEYPAYPAL_MEMBER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN') . 'membersubscription'.$obj->source_id, '2'); } if (!getDolGlobalString('PAYPAL_SECURITY_TOKEN_UNIQUE')) { - $substitutionarray['__SECUREKEYPAYPAL_ORDER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), 2); + $substitutionarray['__SECUREKEYPAYPAL_ORDER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), '2'); } else { - $substitutionarray['__SECUREKEYPAYPAL_ORDER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN') . 'order'.$obj->source_id, 2); + $substitutionarray['__SECUREKEYPAYPAL_ORDER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN') . 'order'.$obj->source_id, '2'); } if (!getDolGlobalString('PAYPAL_SECURITY_TOKEN_UNIQUE')) { - $substitutionarray['__SECUREKEYPAYPAL_INVOICE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), 2); + $substitutionarray['__SECUREKEYPAYPAL_INVOICE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), '2'); } else { - $substitutionarray['__SECUREKEYPAYPAL_INVOICE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN') . 'invoice'.$obj->source_id, 2); + $substitutionarray['__SECUREKEYPAYPAL_INVOICE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN') . 'invoice'.$obj->source_id, '2'); } if (!getDolGlobalString('PAYPAL_SECURITY_TOKEN_UNIQUE')) { - $substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), 2); + $substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), '2'); } else { - $substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN') . 'contractline'.$obj->source_id, 2); + $substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN') . 'contractline'.$obj->source_id, '2'); } } //$substitutionisok=true; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 35fceb38b3e..7285b13316d 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1298,7 +1298,7 @@ if (empty($reshook)) { $tmptxt .= ' - '; } if (!empty($prod->country_code)) { - $tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, 0, $db, $outputlangs, 0); + $tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $outputlangs, 0); } } else { if (!empty($prod->customcode)) { @@ -1308,7 +1308,7 @@ if (empty($reshook)) { $tmptxt .= ' - '; } if (!empty($prod->country_code)) { - $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, 0, $db, $langs, 0); + $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $langs, 0); } } $tmptxt .= ')'; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 9e50a579a13..63aaf4c22a1 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -268,7 +268,7 @@ foreach ($object->fields as $key => $val) { foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1); + $visible = (int) dol_eval((string) $val['visible'], 1); $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index 23bcf244d01..0cc5ae8a3e9 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013-2023 Charlene BENKE * Copyright (C) 2024 MDW + * 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 @@ -34,8 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; // Load translation files required by the page $langs->loadLangs(array('banks', 'categories')); -$WIDTH = DolGraph::getDefaultGraphSizeForStats('width', 380); // Large for one graph in a smarpthone. -$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height', 160); +$WIDTH = DolGraph::getDefaultGraphSizeForStats('width', '380'); // Large for one graph in a smarpthone. +$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height', '160'); $id = GETPOST('account') ? GETPOST('account', 'alpha') : GETPOST('id'); $ref = GETPOST('ref'); diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index bb9eb6a6478..68ff7564d1d 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -942,7 +942,7 @@ if ($action == 'create') { print ''."\n\n"; print ''; - print dol_get_fiche_head(array(), 0, '', 0); + print dol_get_fiche_head(array(), '', '', 0); //print '
'; diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 8283c121222..b8f1984e80c 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -34,8 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; // Load translation files required by the page $langs->loadLangs(array('banks', 'categories')); -$WIDTH = DolGraph::getDefaultGraphSizeForStats('width', 768); -$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height', 200); +$WIDTH = DolGraph::getDefaultGraphSizeForStats('width', '768'); +$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height', '200'); // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('bankstats', 'globalcard')); diff --git a/htdocs/compta/bank/info.php b/htdocs/compta/bank/info.php index 551934ba258..159fd74e576 100644 --- a/htdocs/compta/bank/info.php +++ b/htdocs/compta/bank/info.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 @@ -77,7 +78,7 @@ $hselected = $h; $h++; -print dol_get_fiche_head($head, $hselected, $langs->trans("LineRecord"), -1, 'accountline'); +print dol_get_fiche_head($head, (string) $hselected, $langs->trans("LineRecord"), -1, 'accountline'); $linkback = ''.$langs->trans("BackToList").''; diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php index 7c717d7ede0..7c427dc8e35 100644 --- a/htdocs/compta/bank/various_payment/document.php +++ b/htdocs/compta/bank/various_payment/document.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * 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 @@ -68,7 +69,7 @@ if (!$sortfield) { $object = new PaymentVarious($db); $object->fetch($id, $ref); -$upload_dir = $conf->bank->dir_output.'/'.dol_sanitizeFileName($object->id); +$upload_dir = $conf->bank->dir_output.'/'.dol_sanitizeFileName((string) $object->id); $modulepart = 'banque'; $permissiontoadd = $user->hasRight('banque', 'modifier'); // Used by the include of actions_dellink.inc.php diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index ec21da52ca6..33b726e819e 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -1,6 +1,7 @@ * Copyright (C) ---Put here your own copyright and developer email--- + * 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 @@ -106,7 +107,7 @@ $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1); + $visible = (int) dol_eval((string) $val['visible'], 1); $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index 9af68d6bf38..bc793f58e2c 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -467,7 +467,7 @@ class CashControl extends CommonObject //var_dump($this->fields['rowid']);exit; $return .= ''; $return .= '
'; - $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1, 1) : $this->ref).''; + $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1, '', 1) : $this->ref).''; if ($selected >= 0) { $return .= ''; } diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index a7197f3c0d4..61d125ab7b9 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -1527,7 +1527,7 @@ class Invoices extends DolibarrApi $paymentobj->amounts = $amounts; // Array with all payments dispatching with invoice id $paymentobj->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching $paymentobj->paiementid = $paymentid; - $paymentobj->paiementcode = (string) dol_getIdFromCode($this->db, $paymentid, 'c_paiement', 'id', 'code', 1); + $paymentobj->paiementcode = (string) dol_getIdFromCode($this->db, (string) $paymentid, 'c_paiement', 'id', 'code', 1); $paymentobj->num_payment = $num_payment; $paymentobj->note_private = $comment; @@ -1675,7 +1675,7 @@ class Invoices extends DolibarrApi $paymentobj->amounts = $amounts; // Array with all payments dispatching with invoice id $paymentobj->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching $paymentobj->paiementid = $paymentid; - $paymentobj->paiementcode = (string) dol_getIdFromCode($this->db, $paymentid, 'c_paiement', 'id', 'code', 1); + $paymentobj->paiementcode = (string) dol_getIdFromCode($this->db, (string) $paymentid, 'c_paiement', 'id', 'code', 1); $paymentobj->num_payment = $num_payment; $paymentobj->note_private = $comment; $paymentobj->ref_ext = $ref_ext; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index d325eb7ecf3..a7daff37b07 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -276,7 +276,7 @@ foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1, 1, '1'); + $visible = (int) dol_eval((string) $val['visible'], 1, 1, '1'); $newkey = ''; if (array_key_exists($key, $arrayfields)) { $newkey = $key; diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 9af72aa1a1f..7d03bc17ba1 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2011-2016 Juanjo Menent * Copyright (C) 2013 Philippe Grand * Copyright (C) 2015-2016 Alexandre Spangaro - * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2018-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 @@ -342,7 +342,7 @@ if ($action == 'new') { // $head[$h][1] = $langs->trans("Info"); // $h++; - print dol_get_fiche_head($head, $hselected, $langs->trans("Cheques"), -1, 'payment'); + print dol_get_fiche_head($head, (string) $hselected, $langs->trans("Cheques"), -1, 'payment'); /* * Confirmation of slip's delete diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index 8489a813174..b1e56ea8b21 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2022 Alexandre Spangaro * Copyright (C) 2024 MDW + * 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 @@ -113,7 +114,7 @@ $h++; */ -print dol_get_fiche_head($head, $hselected, $langs->trans("PaymentSocialContribution"), -1, 'payment'); +print dol_get_fiche_head($head, (string) $hselected, $langs->trans("PaymentSocialContribution"), -1, 'payment'); /* * Deletion confirmation of payment diff --git a/htdocs/compta/payment_vat/card.php b/htdocs/compta/payment_vat/card.php index 0439803779f..4c722a39675 100644 --- a/htdocs/compta/payment_vat/card.php +++ b/htdocs/compta/payment_vat/card.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2024 MDW + * 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 @@ -142,7 +143,7 @@ $h++; */ -print dol_get_fiche_head($head, $hselected, $langs->trans("VATPayment"), -1, 'payment'); +print dol_get_fiche_head($head, (string) $hselected, $langs->trans("VATPayment"), -1, 'payment'); /* * Deletion confirmation of payment diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 5efd34461b2..2c93b7020f0 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -266,7 +266,7 @@ if ($sourcetype == 'salary') { print '
'; print ''; print ''; diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 4bf3836cd5f..662922ba36e 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2012 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -164,7 +164,7 @@ if ($id) { $bon = new BonPrelevement($db); $bon->fetch($lipre->bon_rowid); - print dol_get_fiche_head($head, $hselected, $title, -1, 'payment'); + print dol_get_fiche_head($head, (string) $hselected, $title, -1, 'payment'); print '
'.($s ? $s.' ' : '')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', '').'
'.$langs->trans('Label').''.($object->multilangs[$key]["label"] ?? '').'
'.$labeltoshow.''; -print dol_escape_htmltag($nb); +print dol_escape_htmltag((string) $nb); print '
'.$langs->trans("AmountTotal").'
'; diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 6adb5762ad9..54efdad7705 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -7,7 +7,7 @@ * Copyright (C) 2014-2106 Ferran Marcet * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2014 Florian Henry - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2020 Maxime DEMAREST * Copyright (C) 2021 Alexandre Spangaro * @@ -289,7 +289,7 @@ if ($modecompta == 'BOOKKEEPING') { $predefinedgroupwhere .= ")"; $charofaccountstring = getDolGlobalInt('CHARTOFACCOUNTS'); - $charofaccountstring = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); + $charofaccountstring = dol_getIdFromCode($db, getDolGlobalString('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); $sql = "SELECT -1 as socid, aa.pcg_type, SUM(f.credit - f.debit) as amount"; if ($showaccountdetail == 'no') { diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index e3e38d6f24e..2f89d7106cc 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -5,7 +5,7 @@ * Copyright (C) 2014-2016 Ferran Marcet * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2014 Florian Henry - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2020 Maxime DEMAREST * Copyright (C) 2024 MDW * @@ -919,7 +919,7 @@ if (isModEnabled('accounting') && ($modecompta == 'BOOKKEEPING')) { $predefinedgroupwhere .= ")"; $charofaccountstring = getDolGlobalInt('CHARTOFACCOUNTS'); - $charofaccountstring = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); + $charofaccountstring = dol_getIdFromCode($db, getDolGlobalString('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); $sql = "SELECT b.doc_ref, b.numero_compte, b.subledger_account, b.subledger_label, aa.pcg_type, date_format(b.doc_date,'%Y-%m') as dm, sum(b.debit) as debit, sum(b.credit) as credit, sum(b.montant) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_account as aa"; diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 1950d33111c..76180fc314d 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -8,6 +8,7 @@ * Copyright (C) 2013-2024 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry + * 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 @@ -215,7 +216,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { * Card in view mode */ - dol_htmloutput_errors($error, $errors); + dol_htmloutput_errors((string) $error, $errors); print dol_get_fiche_head($head, 'agenda', $title, -1, 'contact'); diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 012ad228916..a3a6ba51d34 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -8,7 +8,7 @@ * Copyright (C) 2013-2024 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2019 Josep Lluís Amador * Copyright (C) 2020 Open-Dsi * Copyright (C) 2024 MDW @@ -662,11 +662,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $(\'textarea[name="address"]\').val("'.dol_escape_js($objsoc->address).'"); $(\'input[name="zipcode"]\').val("'.dol_escape_js($objsoc->zip).'"); $(\'input[name="town"]\').val("'.dol_escape_js($objsoc->town).'"); - console.log("Set state_id to '.dol_escape_js($objsoc->state_id).'"); - $(\'select[name="state_id"]\').val("'.dol_escape_js($objsoc->state_id).'").trigger("change"); + console.log("Set state_id to '.dol_escape_js((string) $objsoc->state_id).'"); + $(\'select[name="state_id"]\').val("'.dol_escape_js((string) $objsoc->state_id).'").trigger("change"); /* set country at end because it will trigger page refresh */ - console.log("Set country id to '.dol_escape_js($objsoc->country_id).'"); - $(\'select[name="country_id"]\').val("'.dol_escape_js($objsoc->country_id).'").trigger("change"); /* trigger required to update select2 components */ + console.log("Set country id to '.dol_escape_js((string) $objsoc->country_id).'"); + $(\'select[name="country_id"]\').val("'.dol_escape_js((string) $objsoc->country_id).'").trigger("change"); /* trigger required to update select2 components */ }); })'."\n"; print ''."\n"; @@ -970,11 +970,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $(\'textarea[name="address"]\').val("'.dol_escape_js($objsoc->address).'"); $(\'input[name="zipcode"]\').val("'.dol_escape_js($objsoc->zip).'"); $(\'input[name="town"]\').val("'.dol_escape_js($objsoc->town).'"); - console.log("Set state_id to '.dol_escape_js($objsoc->state_id).'"); - $(\'select[name="state_id"]\').val("'.dol_escape_js($objsoc->state_id).'").trigger("change"); + console.log("Set state_id to '.dol_escape_js((string) $objsoc->state_id).'"); + $(\'select[name="state_id"]\').val("'.dol_escape_js((string) $objsoc->state_id).'").trigger("change"); /* set country at end because it will trigger page refresh */ - console.log("Set country id to '.dol_escape_js($objsoc->country_id).'"); - $(\'select[name="country_id"]\').val("'.dol_escape_js($objsoc->country_id).'").trigger("change"); /* trigger required to update select2 components */ + console.log("Set country id to '.dol_escape_js((string) $objsoc->country_id).'"); + $(\'select[name="country_id"]\').val("'.dol_escape_js((string) $objsoc->country_id).'").trigger("change"); /* trigger required to update select2 components */ }); })'."\n"; print ''."\n"; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 8aa28de1f74..1002b8f53b9 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -2038,47 +2038,47 @@ class Contact extends CommonObject if ($mode == 2) { if ($statut == '-1' || $statut == 'ST_NO') { - return img_action($langs->trans("StatusProspect-1"), -1, $picto).' '.$langs->trans("StatusProspect-1"); + return img_action($langs->trans("StatusProspect-1"), '-1', $picto).' '.$langs->trans("StatusProspect-1"); } elseif ($statut == '0' || $statut == 'ST_NEVER') { - return img_action($langs->trans("StatusProspect0"), 0, $picto).' '.$langs->trans("StatusProspect0"); + return img_action($langs->trans("StatusProspect0"), '0', $picto).' '.$langs->trans("StatusProspect0"); } elseif ($statut == '1' || $statut == 'ST_TODO') { - return img_action($langs->trans("StatusProspect1"), 1, $picto).' '.$langs->trans("StatusProspect1"); + return img_action($langs->trans("StatusProspect1"), '1', $picto).' '.$langs->trans("StatusProspect1"); } elseif ($statut == '2' || $statut == 'ST_PEND') { - return img_action($langs->trans("StatusProspect2"), 2, $picto).' '.$langs->trans("StatusProspect2"); + return img_action($langs->trans("StatusProspect2"), '2', $picto).' '.$langs->trans("StatusProspect2"); } elseif ($statut == '3' || $statut == 'ST_DONE') { - return img_action($langs->trans("StatusProspect3"), 3, $picto).' '.$langs->trans("StatusProspect3"); + return img_action($langs->trans("StatusProspect3"), '3', $picto).' '.$langs->trans("StatusProspect3"); } else { - return img_action(($langs->trans("StatusProspect".$statut) != "StatusProspect".$statut) ? $langs->trans("StatusProspect".$statut) : $label, 0, $picto).' '.(($langs->trans("StatusProspect".$statut) != "StatusProspect".$statut) ? $langs->trans("StatusProspect".$statut) : $label); + return img_action(($langs->trans("StatusProspect".$statut) != "StatusProspect".$statut) ? $langs->trans("StatusProspect".$statut) : $label, '0', $picto).' '.(($langs->trans("StatusProspect".$statut) != "StatusProspect".$statut) ? $langs->trans("StatusProspect".$statut) : $label); } } if ($mode == 3) { if ($statut == '-1' || $statut == 'ST_NO') { - return img_action($langs->trans("StatusProspect-1"), -1, $picto); + return img_action($langs->trans("StatusProspect-1"), '-1', $picto); } elseif ($statut == '0' || $statut == 'ST_NEVER') { - return img_action($langs->trans("StatusProspect0"), 0, $picto); + return img_action($langs->trans("StatusProspect0"), '0', $picto); } elseif ($statut == '1' || $statut == 'ST_TODO') { - return img_action($langs->trans("StatusProspect1"), 1, $picto); + return img_action($langs->trans("StatusProspect1"), '1', $picto); } elseif ($statut == '2' || $statut == 'ST_PEND') { - return img_action($langs->trans("StatusProspect2"), 2, $picto); + return img_action($langs->trans("StatusProspect2"), '2', $picto); } elseif ($statut == '3' || $statut == 'ST_DONE') { - return img_action($langs->trans("StatusProspect3"), 3, $picto); + return img_action($langs->trans("StatusProspect3"), '3', $picto); } else { - return img_action(($langs->trans("StatusProspect".$statut) != "StatusProspect".$statut) ? $langs->trans("StatusProspect".$statut) : $label, 0, $picto); + return img_action(($langs->trans("StatusProspect".$statut) != "StatusProspect".$statut) ? $langs->trans("StatusProspect".$statut) : $label, '0', $picto); } } if ($mode == 4) { if ($statut == '-1' || $statut == 'ST_NO') { - return img_action($langs->trans("StatusProspect-1"), -1, $picto).' '.$langs->trans("StatusProspect-1"); + return img_action($langs->trans("StatusProspect-1"), '-1', $picto).' '.$langs->trans("StatusProspect-1"); } elseif ($statut == '0' || $statut == 'ST_NEVER') { - return img_action($langs->trans("StatusProspect0"), 0, $picto).' '.$langs->trans("StatusProspect0"); + return img_action($langs->trans("StatusProspect0"), '0', $picto).' '.$langs->trans("StatusProspect0"); } elseif ($statut == '1' || $statut == 'ST_TODO') { - return img_action($langs->trans("StatusProspect1"), 1, $picto).' '.$langs->trans("StatusProspect1"); + return img_action($langs->trans("StatusProspect1"), '1', $picto).' '.$langs->trans("StatusProspect1"); } elseif ($statut == '2' || $statut == 'ST_PEND') { - return img_action($langs->trans("StatusProspect2"), 2, $picto).' '.$langs->trans("StatusProspect2"); + return img_action($langs->trans("StatusProspect2"), '2', $picto).' '.$langs->trans("StatusProspect2"); } elseif ($statut == '3' || $statut == 'ST_DONE') { - return img_action($langs->trans("StatusProspect3"), 3, $picto).' '.$langs->trans("StatusProspect3"); + return img_action($langs->trans("StatusProspect3"), '3', $picto).' '.$langs->trans("StatusProspect3"); } else { - return img_action(($langs->trans("StatusProspect".$statut) != "StatusProspect".$statut) ? $langs->trans("StatusProspect".$statut) : $label, 0, $picto).' '.(($langs->trans("StatusProspect".$statut) != "StatusProspect".$statut) ? $langs->trans("StatusProspect".$statut) : $label); + return img_action(($langs->trans("StatusProspect".$statut) != "StatusProspect".$statut) ? $langs->trans("StatusProspect".$statut) : $label, '0', $picto).' '.(($langs->trans("StatusProspect".$statut) != "StatusProspect".$statut) ? $langs->trans("StatusProspect".$statut) : $label); } } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 867c6b26d51..8d21b7255d1 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -9,7 +9,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Juanjo Menent - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2019 Josep Lluís Amador * Copyright (C) 2020 Open-Dsi * Copyright (C) 2024 MDW @@ -229,7 +229,7 @@ $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1); + $visible = (int) dol_eval((string) $val['visible'], 1); $arrayfields['p.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), diff --git a/htdocs/contact/messaging.php b/htdocs/contact/messaging.php index a2f4f0f0c01..9ec768fd56a 100644 --- a/htdocs/contact/messaging.php +++ b/htdocs/contact/messaging.php @@ -8,6 +8,7 @@ * Copyright (C) 2013-2024 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry + * 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 @@ -49,7 +50,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // Load translation files required by the page $langs->loadLangs(array('companies', 'users', 'other', 'commercial')); -$mesg = ''; $error = 0; $errors = array(); +$mesg = ''; +$error = ''; +$errors = array(); // Get parameters $action = (GETPOST('action', 'alpha') ? GETPOST('action', 'alpha') : 'view'); diff --git a/htdocs/core/ajax/flowjs-server.php b/htdocs/core/ajax/flowjs-server.php index 12fd91e12a0..d10dc5f2f85 100644 --- a/htdocs/core/ajax/flowjs-server.php +++ b/htdocs/core/ajax/flowjs-server.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * 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 @@ -56,7 +57,7 @@ $flowChunkNumber = GETPOST('flowChunkNumber', 'alpha'); $flowChunkSize = GETPOST('flowChunkSize', 'alpha'); $flowTotalSize = GETPOST('flowTotalSize', 'alpha'); -$result = restrictedArea($user, $module, 0, '', 0, 'fk_soc', 'rowid', 0, 1); // Call with mode return +$result = restrictedArea($user, $module, 0, '', '', 'fk_soc', 'rowid', 0, 1); // Call with mode return if ($action != 'upload') { httponly_accessforbidden("Param action must be 'upload'"); diff --git a/htdocs/core/ajax/onlineSign.php b/htdocs/core/ajax/onlineSign.php index 0a449c2e309..9a5c32eb3ac 100644 --- a/htdocs/core/ajax/onlineSign.php +++ b/htdocs/core/ajax/onlineSign.php @@ -581,7 +581,7 @@ if ($action == "importSignature") { if (!empty($object->id)) { $object->fetch_thirdparty(); - $upload_dir = $conf->societe->multidir_output[$object->thirdparty->entity] . '/' . dol_sanitizeFileName($object->thirdparty->id) . '/'; + $upload_dir = $conf->societe->multidir_output[$object->thirdparty->entity] . '/' . dol_sanitizeFileName((string) $object->thirdparty->id) . '/'; $default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance $default_font = pdf_getPDFFont($langs); // Must be after pdf_getInstance diff --git a/htdocs/core/ajax/selectobject.php b/htdocs/core/ajax/selectobject.php index 3ca27b2c79c..b9e8f227cce 100644 --- a/htdocs/core/ajax/selectobject.php +++ b/htdocs/core/ajax/selectobject.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 @@ -134,7 +135,7 @@ if ($usesublevelpermission && !isset($user->rights->$module->$element)) { // The */ // When used from jQuery, the search term is added as GET param "term". -$searchkey = (($id && GETPOST($id, 'alpha')) ? GETPOST($id, 'alpha') : (($htmlname && GETPOST($htmlname, 'alpha')) ? GETPOST($htmlname, 'alpha') : '')); +$searchkey = (($id && GETPOST((string) $id, 'alpha')) ? GETPOST((string) $id, 'alpha') : (($htmlname && GETPOST($htmlname, 'alpha')) ? GETPOST($htmlname, 'alpha') : '')); // Add a security test to avoid to get content of all tables if (!empty($objecttmp->module)) { diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 1a92bec6a16..d9c2a5d5b2e 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -280,10 +280,10 @@ class CMailFile $this->mixed_boundary = "multipart_x.".time().".x_boundary"; // On defini related_boundary - $this->related_boundary = 'mul_'.dol_hash(uniqid("dolibarr2"), 3); // Force md5 hash (does not contain special chars) + $this->related_boundary = 'mul_'.dol_hash(uniqid("dolibarr2"), '3'); // Force md5 hash (does not contain special chars) // On defini alternative_boundary - $this->alternative_boundary = 'mul_'.dol_hash(uniqid("dolibarr3"), 3); // Force md5 hash (does not contain special chars) + $this->alternative_boundary = 'mul_'.dol_hash(uniqid("dolibarr3"), '3'); // Force md5 hash (does not contain special chars) if (empty($subject)) { dol_syslog("CMailFile::CMailfile: Try to send an email with empty subject"); @@ -1534,7 +1534,7 @@ class CMailFile } require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - dol_move($srcfile, $destfile, 0, 1, 0, 0); + dol_move($srcfile, $destfile, '0', 1, 0, 0); } } diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index aff8e70e489..658c1b05942 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -303,7 +303,7 @@ abstract class CommonDocGenerator global $conf; if (empty($mysoc->forme_juridique) && !empty($mysoc->forme_juridique_code)) { - $mysoc->forme_juridique = getFormeJuridiqueLabel($mysoc->forme_juridique_code); + $mysoc->forme_juridique = getFormeJuridiqueLabel((string) $mysoc->forme_juridique_code); } if (empty($mysoc->country) && !empty($mysoc->country_code)) { $mysoc->country = $outputlangs->transnoentitiesnoconv("Country".$mysoc->country_code); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 8adebffa1df..1255271cdd5 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1004,7 +1004,7 @@ abstract class CommonObject } $enabled = 1; if ($enabled && isset($extrafields->attributes[$this->table_element]['enabled'][$key])) { - $enabled = (int) dol_eval($extrafields->attributes[$this->table_element]['enabled'][$key], 1, 1, '2'); + $enabled = (int) dol_eval((string) $extrafields->attributes[$this->table_element]['enabled'][$key], 1, 1, '2'); } if ($enabled && isset($extrafields->attributes[$this->table_element]['list'][$key])) { $enabled = (int) dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1, 1, '2'); @@ -8866,7 +8866,7 @@ abstract class CommonObject // Test on 'enabled' ('enabled' is different than 'list' = 'visibility') $enabled = 1; if ($enabled && isset($extrafields->attributes[$this->table_element]['enabled'][$key])) { - $enabled = (int) dol_eval($extrafields->attributes[$this->table_element]['enabled'][$key], 1, 1, '2'); + $enabled = (int) dol_eval((string) $extrafields->attributes[$this->table_element]['enabled'][$key], 1, 1, '2'); } if (empty($enabled)) { continue; diff --git a/htdocs/core/class/diasporahandler.class.php b/htdocs/core/class/diasporahandler.class.php index 3b60cc5c16c..b309228c6c5 100644 --- a/htdocs/core/class/diasporahandler.class.php +++ b/htdocs/core/class/diasporahandler.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 @@ -86,7 +87,7 @@ class DiasporaHandler return false; } - $cacheFile = $cacheDir.'/'.dol_hash($urlAPI, 3); + $cacheFile = $cacheDir.'/'.dol_hash($urlAPI, '3'); $foundInCache = false; $data = null; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 161dbec1546..cce6537ed81 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2320,7 +2320,7 @@ class ExtraFields $enabled = 1; if (isset($this->attributes[$object->table_element]['enabled'][$key])) { // 'enabled' is often a condition on module enabled or not - $enabled = (int) dol_eval($this->attributes[$object->table_element]['enabled'][$key], 1, 1, '2'); + $enabled = (int) dol_eval((string) $this->attributes[$object->table_element]['enabled'][$key], 1, 1, '2'); } $visibility = 1; diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index 77a08bdb1d5..ca504ec621a 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -1,6 +1,7 @@ - * Copyright (C) 2011-2023 Laurent Destailleur +/* Copyright (C) 2011-2022 Regis Houssin + * Copyright (C) 2011-2023 Laurent Destailleur + * 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 @@ -34,6 +35,10 @@ class FileUpload { public $options; protected $fk_element; + + /** + * @var string object element + */ protected $element; /** @@ -525,7 +530,7 @@ class FileUpload isset($_SERVER['HTTP_X_FILE_SIZE']) ? $_SERVER['HTTP_X_FILE_SIZE'] : (isset($upload['size']) ? $upload['size'] : null), isset($_SERVER['HTTP_X_FILE_TYPE']) ? $_SERVER['HTTP_X_FILE_TYPE'] : (isset($upload['type']) ? $upload['type'] : null), isset($upload['error']) ? $upload['error'] : null, - 0 + '0' ); if (!empty($tmpres->error)) { $error++; diff --git a/htdocs/core/class/google.class.php b/htdocs/core/class/google.class.php index a9cb5713c2c..5f0dddc4b43 100644 --- a/htdocs/core/class/google.class.php +++ b/htdocs/core/class/google.class.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2010 Laurent Destailleur + * 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 @@ -36,6 +37,9 @@ class GoogleAPI */ public $error = ''; + /** + * @var string google key + */ public $key; /** @@ -80,7 +84,7 @@ class GoogleAPI //print $code; //print "
"; $latitude = substr($code, 0, strpos($code, ",")); - $longitude = substr($code, strpos($code, ",") + 1, dol_strlen(strpos($code, ",")) - 3); + $longitude = substr($code, strpos($code, ",") + 1, dol_strlen((string) strpos($code, ",")) - 3); // Output the coordinates //echo "Longitude: $longitude ',' Latitude: $latitude"; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 44bb59fab65..75fcbf7becb 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2670,7 +2670,7 @@ class Form if ((int) $warehouseId>0) { $urloption .= '&warehouseid=' . (int) $warehouseId; } - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); + $out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); if (isModEnabled('variants') && is_array($selected_combinations)) { // Code to automatically insert with javascript the select of attributes under the select of product @@ -5991,7 +5991,7 @@ class Form print '
'; print ''; print ''; - $this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty); + $this->selectAvailabilityDelay($selected, $htmlname, '', $addempty); print ''; print ''; print ''; @@ -6022,7 +6022,7 @@ class Form print '
'; print ''; print ''; - $this->selectInputReason($selected, $htmlname, -1, $addempty); + $this->selectInputReason($selected, $htmlname, '-1', $addempty); print ''; print ''; } else { @@ -6344,7 +6344,7 @@ class Form $newfilter .= ' AND (' . $filter . ')'; } // output the combo of discounts - $nbqualifiedlines = $this->select_remises($selected, $htmlname, $newfilter, $socid, $maxvalue); + $nbqualifiedlines = $this->select_remises((string) $selected, $htmlname, $newfilter, $socid, $maxvalue); if ($nbqualifiedlines > 0) { print '   '; } else { @@ -9364,7 +9364,7 @@ class Form if (empty($reshook)) { print ''; - print load_fiche_titre($langs->trans($title), $morehtmlright, '', 0, 0, 'showlinkedobjectblock'); + print load_fiche_titre($langs->trans($title), $morehtmlright, '', 0, '', 'showlinkedobjectblock'); print '
'; diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 10b6f28705e..427751e574e 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2016 Marcos García * Copyright (C) 2016-2024 Alexandre Spangaro * Copyright (C) 2024 MDW + * 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 @@ -222,7 +223,7 @@ class FormAccounting extends Form } } - $out .= Form::multiselectarray($htmlname, $options, $selected, $showempty, 0, $morecss, 0, 0, 0, 'code_journal', '', ($disabledajaxcombo ? 0 : 1)); + $out .= Form::multiselectarray($htmlname, $options, $selected, $showempty, 0, $morecss, 0, 0, '', 'code_journal', '', ($disabledajaxcombo ? 0 : 1)); return $out; } diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index d012ea3fac3..2c75db69e11 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -2,6 +2,7 @@ /* Copyright (c) 2008-2012 Laurent Destailleur * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2010-2018 Juanjo Menent + * 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 @@ -249,7 +250,7 @@ class FormActions $error = 0; if (empty($reshook)) { print '' . "\n"; - print load_fiche_titre($title, $morehtmlright, '', 0, 0, '', $morehtmlcenter); + print load_fiche_titre($title, $morehtmlright, '', 0, '', '', $morehtmlcenter); } $page = 0; @@ -258,12 +259,12 @@ class FormActions print '
'; print '
'; print ''; - print getTitleFieldOfList('Ref', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1); - print getTitleFieldOfList('Date', 0, $_SERVER["PHP_SELF"], 'a.datep', $page, $param, '', $sortfield, $sortorder, 'center ', 1); - print getTitleFieldOfList('By', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1); - print getTitleFieldOfList('Type', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1); - print getTitleFieldOfList('Title', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1); - print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, 'right ', 1); + print getTitleFieldOfList('Ref', 0, $_SERVER["PHP_SELF"], '', (string) $page, $param, '', $sortfield, $sortorder, '', 1); + print getTitleFieldOfList('Date', 0, $_SERVER["PHP_SELF"], 'a.datep', (string) $page, $param, '', $sortfield, $sortorder, 'center ', 1); + print getTitleFieldOfList('By', 0, $_SERVER["PHP_SELF"], '', (string) $page, $param, '', $sortfield, $sortorder, '', 1); + print getTitleFieldOfList('Type', 0, $_SERVER["PHP_SELF"], '', (string) $page, $param, '', $sortfield, $sortorder, '', 1); + print getTitleFieldOfList('Title', 0, $_SERVER["PHP_SELF"], '', (string) $page, $param, '', $sortfield, $sortorder, '', 1); + print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', (string) $page, $param, '', $sortfield, $sortorder, 'right ', 1); print ''; print "\n"; diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 5e9de42f3c4..be42abc3f6e 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -729,7 +729,7 @@ class FormCompany extends Form print "\n" . '' . "\n"; print ''; - print ajax_autocompleter(($socid ? $socid : -1), $htmlname, DOL_URL_ROOT . '/societe/ajax/ajaxcompanies.php', '', $minLength, 0); + print ajax_autocompleter((string) ($socid ? $socid : -1), $htmlname, DOL_URL_ROOT . '/societe/ajax/ajaxcompanies.php', '', $minLength, 0); return $socid; } else { // Search to list thirdparties diff --git a/htdocs/core/class/mastodonhandler.class.php b/htdocs/core/class/mastodonhandler.class.php index 2ca873b1184..6d34e1f231c 100644 --- a/htdocs/core/class/mastodonhandler.class.php +++ b/htdocs/core/class/mastodonhandler.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * 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 @@ -91,7 +92,7 @@ class MastodonHandler if (empty($this->accessToken) && isset($authParams['access_token'])) { return false; } - $cacheFile = $cacheDir.'/'.dol_hash($urlAPI, 3); + $cacheFile = $cacheDir.'/'.dol_hash($urlAPI, '3'); $foundInCache = false; $data = null; diff --git a/htdocs/core/class/reddithandler.class.php b/htdocs/core/class/reddithandler.class.php index a843b1873e3..429bc2a5b22 100644 --- a/htdocs/core/class/reddithandler.class.php +++ b/htdocs/core/class/reddithandler.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 @@ -141,7 +142,7 @@ class RedditHandler return false; } - $cacheFile = $cacheDir . '/' . dol_hash($urlAPI, 3); + $cacheFile = $cacheDir . '/' . dol_hash($urlAPI, '3'); $foundInCache = false; $data = null; diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index 5a31f520a17..2108711871a 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -217,7 +217,7 @@ class RssParser } $this->_urlRSS = $urlRSS; - $newpathofdestfile = $cachedir.'/'.dol_hash($this->_urlRSS, 3); // Force md5 hash (does not contain special chars) + $newpathofdestfile = $cachedir.'/'.dol_hash($this->_urlRSS, '3'); // Force md5 hash (does not contain special chars) $newmask = '0644'; //dol_syslog("RssParser::parser parse url=".$urlRSS." => cache file=".$newpathofdestfile); diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 6019807b6f4..898cdd2a212 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -1599,7 +1599,7 @@ class SMTPs $this->_msgContent[$strType]['dataText'] = $strContentAltText; if ($this->getMD5flag()) { - $this->_msgContent[$strType]['md5'] = dol_hash($strContent, 3); + $this->_msgContent[$strType]['md5'] = dol_hash($strContent, '3'); } //} } @@ -1779,7 +1779,7 @@ class SMTPs $this->_msgContent['attachment'][$strFileName]['cid'] = $strCid; // If defined, it means this attachment must be shown inline if ($this->getMD5flag()) { - $this->_msgContent['attachment'][$strFileName]['md5'] = dol_hash($strContent, 3); + $this->_msgContent['attachment'][$strFileName]['md5'] = dol_hash($strContent, '3'); } } } @@ -1806,7 +1806,7 @@ class SMTPs $this->_msgContent['image'][$strImageName]['data'] = $strContent; if ($this->getMD5flag()) { - $this->_msgContent['image'][$strImageName]['md5'] = dol_hash($strContent, 3); + $this->_msgContent['image'][$strImageName]['md5'] = dol_hash($strContent, '3'); } } } @@ -1941,8 +1941,8 @@ class SMTPs private function _setBoundary() { $this->_smtpsBoundary = "multipart_x.".time().".x_boundary"; - $this->_smtpsRelatedBoundary = 'mul_'.dol_hash(uniqid("dolibarr2"), 3); - $this->_smtpsAlternativeBoundary = 'mul_'.dol_hash(uniqid("dolibarr3"), 3); + $this->_smtpsRelatedBoundary = 'mul_'.dol_hash(uniqid("dolibarr2"), '3'); + $this->_smtpsAlternativeBoundary = 'mul_'.dol_hash(uniqid("dolibarr3"), '3'); } /** diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 4843fa2c01f..26783e2a011 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -1054,7 +1054,7 @@ class Utils if ($numsave >= $nbSaves) { dol_delete_file($logpath.'/'.$logname.'.'.$numsave.'.gz', 0, 0, 0, null, false, 0); } else { - dol_move($logpath.'/'.$logname.'.'.$numsave.'.gz', $logpath.'/'.$logname.'.'.($numsave + 1).'.gz', 0, 1, 0, 0); + dol_move($logpath.'/'.$logname.'.'.$numsave.'.gz', $logpath.'/'.$logname.'.'.($numsave + 1).'.gz', '0', 1, 0, 0); } } diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 2846e939f98..41cf88a005c 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -682,7 +682,7 @@ if (!defined('MAIN_CUSTOM_REPORT_KEEP_GRAPH_ONLY')) { // Add measure from extrafields if ($object->isextrafieldmanaged) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1, 1, '1'))) { + if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || dol_eval((string) $extrafields->attributes[$object->table_element]['enabled'][$key], 1, 1, '1'))) { $arrayofyaxis['te.'.$key] = array( 'label' => $extrafields->attributes[$object->table_element]['label'][$key], 'position' => (int) $extrafields->attributes[$object->table_element]['pos'][$key], diff --git a/htdocs/core/filemanagerdol/connectors/php/connector.lib.php b/htdocs/core/filemanagerdol/connectors/php/connector.lib.php index dbdf5227355..15b3fffaec2 100644 --- a/htdocs/core/filemanagerdol/connectors/php/connector.lib.php +++ b/htdocs/core/filemanagerdol/connectors/php/connector.lib.php @@ -3,6 +3,7 @@ * FCKeditor - The text editor for Internet - http://www.fckeditor.net * Copyright (C) 2003-2010 Frederico Caldeira Knabben * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * == BEGIN LICENSE == * @@ -91,7 +92,7 @@ function CreateXmlFooter() function SendError($number, $text) { if ($_GET['Command'] == 'FileUpload') { - SendUploadResults($number, "", "", $text); + SendUploadResults((string) $number, "", "", $text); } if (isset($GLOBALS['HeaderSent']) && $GLOBALS['HeaderSent']) { @@ -811,7 +812,7 @@ function SanitizeFileName($sNewFileName) /** * This is the function that sends the results of the uploading process. * - * @param string $errorNumber errorNumber + * @param string $errorNumber errorNumber * @param string $fileUrl fileUrl * @param string $fileName fileName * @param string $customMsg customMsg @@ -826,7 +827,7 @@ function SendUploadResults($errorNumber, $fileUrl = '', $fileName = '', $customM (function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})(); EOF; - if ($errorNumber && $errorNumber != 201) { + if ($errorNumber && $errorNumber != '201') { $fileUrl = ""; $fileName = ""; } diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index f9dc8b5e262..7c7ae304d60 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -674,6 +674,7 @@ function dolibarr_set_const($db, $name, $value, $type = 'chaine', $visible = 0, // Clean parameters $name = trim($name); + $value = (string) $value; // Check parameters if (empty($name)) { diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 31f6e9b97c9..5a40f704af9 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -3,6 +3,7 @@ * Copyright (C) 2007-2015 Regis Houssin * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2024 MDW + * 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 @@ -662,8 +663,8 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof var url = \''.DOL_URL_ROOT.'/core/ajax/constantonoff.php\'; var code = \''.dol_escape_js($code).'\'; var entity = \''.dol_escape_js($entity).'\'; - var strict = \''.dol_escape_js($strict).'\'; - var userid = \''.dol_escape_js($user->id).'\'; + var strict = \''.dol_escape_js((string) $strict).'\'; + var userid = \''.dol_escape_js((string) $user->id).'\'; var yesButton = \''.dol_escape_js($langs->transnoentities("Yes")).'\'; var noButton = \''.dol_escape_js($langs->transnoentities("No")).'\'; var token = \''.currentToken().'\'; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index fcb4a2680e5..97239fa0791 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -2550,7 +2550,7 @@ function addEventTypeSQL(&$sql, $actioncode, $sqlANDOR = "AND") * * @param string $sql $sql modified * @param string $donetodo donetodo - * @param string $now now + * @param int $now now * @param array $filters array * @return string sql request */ @@ -2635,7 +2635,7 @@ function htmlPrintOnlineFooter($fromcompany, $langs, $addformmessage = 0, $suffi // Juridical status $line1 = ""; if ($fromcompany->forme_juridique_code) { - $line1 .= ($line1 ? " - " : "").getFormeJuridiqueLabel($fromcompany->forme_juridique_code); + $line1 .= ($line1 ? " - " : "").getFormeJuridiqueLabel((string) $fromcompany->forme_juridique_code); } // Capital if ($fromcompany->capital) { diff --git a/htdocs/core/lib/customreports.lib.php b/htdocs/core/lib/customreports.lib.php index e3d274a7cf6..14bf5350bfb 100644 --- a/htdocs/core/lib/customreports.lib.php +++ b/htdocs/core/lib/customreports.lib.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 @@ -109,7 +110,7 @@ function fillArrayOfMeasures($object, $tablealias, $labelofobject, &$arrayofmesu // Add extrafields to Measures if (!empty($object->isextrafieldmanaged) && isset($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || (int) dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1, 1, '1'))) { + if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || (int) dol_eval((string) $extrafields->attributes[$object->table_element]['enabled'][$key], 1, 1, '1'))) { // @phan-suppress-next-line PhanTypeMismatchDimAssignment $position = (!empty($val['position']) ? $val['position'] : 0); $arrayofmesures[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-sum'] = array( diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 24d43764c82..c06058d3213 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1233,7 +1233,7 @@ function dol_move_dir($srcdir, $destdir, $overwriteifexists = 1, $indexdatabase if ($file["type"] == "dir") { $res = dol_move_dir($filepath.'/'.$oldname, $filepath.'/'.$newname, $overwriteifexists, $indexdatabase, $renamedircontent); } else { - $res = dol_move($filepath.'/'.$oldname, $filepath.'/'.$newname, 0, $overwriteifexists, 0, $indexdatabase); + $res = dol_move($filepath.'/'.$oldname, $filepath.'/'.$newname, '0', $overwriteifexists, 0, $indexdatabase); } if (!$res) { return $result; @@ -2735,7 +2735,7 @@ function dol_most_recent_file($dir, $regexfilter = '', $excludefilter = array('( * * @param string $modulepart Module of document ('module', 'module_user_temp', 'module_user' or 'module_temp'). Example: 'medias', 'invoice', 'logs', 'tax-vat', ... * @param string $original_file Relative path with filename, relative to modulepart. - * @param string $entity Restrict onto entity (0=no restriction) + * @param int $entity Restrict onto entity (0=no restriction) * @param User|null $fuser User object (forced) * @param string $refname Ref of object to check permission for external users (autodetect if not provided by taking the dirname of $original_file) or for hierarchy * @param string $mode Check permission for 'read' or 'write' diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 10cc3818d26..33897612e67 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2239,7 +2239,7 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename = // If adding log inside HTML page is required if ((!empty($_REQUEST['logtohtml']) && getDolGlobalString('MAIN_ENABLE_LOG_TO_HTML')) || (is_object($user) && $user->hasRight('debugbar', 'read') && is_object($debugbar))) { - $ospid = sprintf("%7s", dol_trunc(getmypid(), 7, 'right', 'UTF-8', 1)); + $ospid = sprintf("%7s", dol_trunc((string) getmypid(), 7, 'right', 'UTF-8', 1)); $osuser = " ".sprintf("%6s", dol_trunc(function_exists('posix_getuid') ? posix_getuid() : '', 6, 'right', 'UTF-8', 1)); $conf->logbuffer[] = dol_print_date(time(), "%Y-%m-%d %H:%M:%S")." ".sprintf("%-7s", $logLevels[$level])." ".$ospid." ".$osuser." ".$message; @@ -6577,7 +6577,7 @@ function print_fleche_navigation($page, $file, $options = '', $nextpage = 0, $be print ''; } else { print ''; - print ajax_combobox("limit", array(), 0, 0, 'resolve', -1, 'limit'); + print ajax_combobox("limit", array(), 0, 0, 'resolve', '-1', 'limit'); //print ajax_combobox("limit"); } @@ -6967,7 +6967,7 @@ function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round $ret = price($dimension, 0, $outputlangs, 0, 0, $round); // @phan-suppress-next-line PhanPluginSuspiciousParamPosition - $ret .= ' '.measuringUnitString(0, $type, $unit, $use_short_label, $outputlangs); + $ret .= ' '.measuringUnitString(0, $type, (string) $unit, $use_short_label, $outputlangs); return $ret; } @@ -8548,7 +8548,7 @@ function dol_htmlcleanlastbr($stringtodecode) * Replace html_entity_decode functions to manage errors * * @param string $a Operand a - * @param string $b Operand b (ENT_QUOTES|ENT_HTML5=convert simple, double quotes, colon, e accent, ...) + * @param int $b Operand b (ENT_QUOTES|ENT_HTML5=convert simple, double quotes, colon, e accent, ...) * @param string $c Operand c * @param int $keepsomeentities Entities but &, <, >, " are not converted. * @return string String decoded @@ -11541,7 +11541,7 @@ function showDirectDownloadLink($object) $out .= img_picto($langs->trans("PublicDownloadLinkDesc"), 'globe').' '.$langs->trans("DirectDownloadLink").'
'; if ($url) { $out .= ''; - $out .= ajax_autoselect("directdownloadlink", 0); + $out .= ajax_autoselect("directdownloadlink", ''); } else { $out .= ''; } diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index c4112bd672b..b804e827585 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1820,7 +1820,7 @@ function dol_print_reduction($reduction, $langs) if ($reduction == 100) { $string = $langs->transnoentities("Offered"); } else { - $string = vatrate($reduction, true); + $string = vatrate((string) $reduction, true); } return $string; diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index 2335ada1fb5..0ebfb8b8d94 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * 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 @@ -1193,7 +1194,7 @@ function reWriteAllMenus($file, $menus, $menuWantTo, $key, $action) $str_menu .= "\t\t\t'url' => '".dol_escape_php($menu['url'], 1)."',\n"; $str_menu .= "\t\t\t'langs' => '".dol_escape_php($menu['langs'], 1)."',\n"; $str_menu .= "\t\t\t'position' => ".((int) $menu['position']).",\n"; - $str_menu .= "\t\t\t'enabled' => '".dol_escape_php($menu['enabled'], 1)."',\n"; + $str_menu .= "\t\t\t'enabled' => '".dol_escape_php((string) $menu['enabled'], 1)."',\n"; $str_menu .= "\t\t\t'perms' => '".dol_escape_php($menu['perms'], 1)."',\n"; $str_menu .= "\t\t\t'target' => '".dol_escape_php($menu['target'], 1)."',\n"; $str_menu .= "\t\t\t'user' => ".((int) $menu['user']).",\n"; diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index ed2c1ac5e53..a5e48935052 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -219,7 +219,7 @@ function showOnlinePaymentUrl($type, $ref, $amount = 0) $out .= ''; - $out .= ajax_autoselect("onlinepaymenturl", 0); + $out .= ajax_autoselect("onlinepaymenturl", ''); return $out; } @@ -275,7 +275,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'y if (!getDolGlobalString('PAYMENT_SECURITY_TOKEN_UNIQUE')) { $out .= '&securekey='.urlencode(getDolGlobalString('PAYMENT_SECURITY_TOKEN')); } else { - $out .= '&securekey='.urlencode(dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), 2)); + $out .= '&securekey='.urlencode(dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), '2')); } } //if ($mode) $out.='&noidempotency=1'; @@ -297,7 +297,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'y $out .= "hash('" . getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$type."' + order_ref)"; } if ($mode == 0) { - $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $type.$ref, 2); + $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $type.$ref, '2'); } $out .= ($mode ? '' : ''); } @@ -320,7 +320,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'y $out .= "hash('" . getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$type."' + invoice_ref)"; } if ($mode == 0) { - $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $type.$ref, 2); + $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $type.$ref, '2'); } $out .= ($mode ? '' : ''); } @@ -343,7 +343,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'y $out .= "hash('" . getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$type."' + contractline_ref)"; } if ($mode == 0) { - $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $type.$ref, 2); + $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $type.$ref, '2'); } $out .= ($mode ? '' : ''); } @@ -369,7 +369,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'y $out .= "hash('" . getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$newtype."' + member_ref)"; } if ($mode == 0) { - $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $newtype.$ref, 2); + $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $newtype.$ref, '2'); } $out .= ($mode ? '' : ''); } @@ -392,7 +392,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'y $out .= "hash('" . getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$type."' + donation_ref)"; } if ($mode == 0) { - $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $type.$ref, 2); + $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $type.$ref, '2'); } $out .= ($mode ? '' : ''); } @@ -415,7 +415,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'y $out .= "hash('" . getDolGlobalString('PAYMENT_SECURITY_TOKEN')."' + '".$type."' + invoice_ref)"; } if ($mode == 0) { - $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $type.$ref, 2); + $out .= dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . $type.$ref, '2'); } $out .= ($mode ? '' : ''); } diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index df5ac25f5c1..861d632bc64 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -658,7 +658,7 @@ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $t // Legal form if (getDolGlobalString('MAIN_LEGALFORM_IN_ADDRESS') && !empty($targetcompany->forme_juridique_code)) { - $tmp = getFormeJuridiqueLabel($targetcompany->forme_juridique_code); + $tmp = getFormeJuridiqueLabel((string) $targetcompany->forme_juridique_code); $stringaddress .= ($stringaddress ? "\n" : '').$tmp; } @@ -1102,7 +1102,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ // Line 3 of company infos // Juridical status if (!empty($fromcompany->forme_juridique_code) && $fromcompany->forme_juridique_code) { - $line3 .= ($line3 ? " - " : "").$outputlangs->convToOutputCharset(getFormeJuridiqueLabel($fromcompany->forme_juridique_code)); + $line3 .= ($line3 ? " - " : "").$outputlangs->convToOutputCharset(getFormeJuridiqueLabel((string) $fromcompany->forme_juridique_code)); } // Capital if (!empty($fromcompany->capital)) { diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index dd5d927662b..4dd48f7fcf0 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -582,7 +582,7 @@ function project_admin_prepare_head() * Show task lines with a particular parent * * @param string $inc Line number (start to 0, then increased by recursive call) - * @param string $parent Id of parent task to show (0 to show all) + * @param int $parent Id of parent task to show (0 to show all) * @param Task[] $lines Array of lines * @param int $level Level (start to 0, then increased/decrease by recursive call), or -1 to show all level in order of $lines without the recursive groupment feature. * @param string $var Color @@ -1384,7 +1384,7 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec * @param int $level Level (start to 0, then increased/decrease by recursive call) * @param string $projectsrole Array of roles user has on project * @param string $tasksrole Array of roles user has on task - * @param string $mine Show only task lines I am assigned to + * @param int $mine Show only task lines I am assigned to * @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is assigned to me, 2=Enable add time only if tasks is assigned to me and hide others * @param int $preselectedday Preselected day * @param array $isavailable Array with data that say if user is available for several days for morning and afternoon @@ -1782,7 +1782,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr * @param int $level Level (start to 0, then increased/decrease by recursive call) * @param string $projectsrole Array of roles user has on project * @param string $tasksrole Array of roles user has on task - * @param string $mine Show only task lines I am assigned to + * @param int $mine Show only task lines I am assigned to * @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is assigned to me, 2=Enable add time only if tasks is assigned to me and hide others * @param array $isavailable Array with data that say if user is available for several days for morning and afternoon * @param int $oldprojectforbreak Old project id of last project break @@ -2182,7 +2182,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ * @param int $level Level (start to 0, then increased/decrease by recursive call) * @param string $projectsrole Array of roles user has on project * @param string $tasksrole Array of roles user has on task - * @param string $mine Show only task lines I am assigned to + * @param int $mine Show only task lines I am assigned to * @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to * @param array $isavailable Array with data that say if user is available for several days for morning and afternoon * @param int $oldprojectforbreak Old project id of last project break diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index 4c2e13693ec..ee2ac8d39c5 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -1,6 +1,7 @@ + * 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 @@ -49,7 +50,7 @@ function showOnlineSignatureUrl($type, $ref, $obj = null, $mode = '') } $out .= ''.img_picto('', 'globe', 'class="paddingleft"').''; $out .= ''; - $out .= ajax_autoselect("onlinesignatureurl", 0); + $out .= ajax_autoselect("onlinesignatureurl", ''); return $out; } diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index fcb8ed36e2b..668ccef36d6 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -1,7 +1,7 @@ * Copyright (C) 2016 Christophe Battarel - * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software: you can redistribute it and/or modify @@ -187,7 +187,7 @@ function showDirectPublicLink($object) $out .= ''; $out .= ''.img_picto('', 'object_globe.png', 'class="paddingleft"').''; $out .= ''; - $out .= ajax_autoselect("directpubliclink", 0); + $out .= ajax_autoselect("directpubliclink", ''); } else { $out .= ''.$langs->trans("TicketNotCreatedFromPublicInterface").''; } diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index f518868015b..2e2eb0371fb 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.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 @@ -196,7 +197,7 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, $tplcontent .= ''."\n"; $tplcontent .= ''."\n"; $tplcontent .= ''."\n"; - $tplcontent .= ''."\n"; + $tplcontent .= ''."\n"; // Add favicon if ($objectpage->id == $object->fk_default_home) { diff --git a/htdocs/core/lib/ws.lib.php b/htdocs/core/lib/ws.lib.php index 92398e0620d..f56e899debd 100644 --- a/htdocs/core/lib/ws.lib.php +++ b/htdocs/core/lib/ws.lib.php @@ -1,6 +1,7 @@ - * Copyright (C) 2024 MDW +/* Copyright (C) 2011 Laurent Destailleur + * Copyright (C) 2024 MDW + * 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 @@ -86,7 +87,7 @@ function check_authentication($authentication, &$error, &$errorcode, &$errorlabe $authmode = explode(',', $dolibarr_main_authentication); include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; - $login = checkLoginPassEntity($authentication['login'], $authentication['password'], $authentication['entity'], $authmode, 'ws'); + $login = checkLoginPassEntity($authentication['login'], $authentication['password'], (string) $authentication['entity'], $authmode, 'ws'); if ($login === '--bad-login-validity--') { $login = ''; } diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 3f0aad13e43..e5f2244f88a 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -2,6 +2,7 @@ /* Copyright (C) 2010-2022 Laurent Destailleur * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2024 MDW + * 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 @@ -688,7 +689,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t /** * Function to test if an entry is enabled or not * - * @param string $type_user 0=We need backoffice menu, 1=We need frontoffice menu + * @param int $type_user 0=We need backoffice menu, 1=We need frontoffice menu * @param array{rowid:string,fk_menu:string,langs:string,enabled:int<0,2>,type:string,fk_mainmenu:string,fk_leftmenu:string,url:string,titre:string,perms:string,target:string,mainmenu:string,leftmenu:string,position:int,level:int,prefix:string} $menuentry Array for menu entry * @param string[] $listofmodulesforexternal Array with list of modules allowed to external users * @return int<0,2> 0=Hide, 1=Show, 2=Show gray diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index e39607bf5fa..23fbc7c175e 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -279,8 +279,8 @@ class pdf_ban extends ModeleBankAccountDoc * Show table for lines * * @param TCPDF $pdf Object PDF - * @param string $tab_top Top position of table - * @param string $tab_height Height of table (rectangle) + * @param int $tab_top Top position of table + * @param int $tab_height Height of table (rectangle) * @param int $nexY Y * @param Translate $outputlangs Langs object * @param int $hidetop Hide top bar of array @@ -359,15 +359,11 @@ class pdf_ban extends ModeleBankAccountDoc /* Removed: A project can have more than thousands linked objects (orders, invoices, proposals, etc.... $object->fetchObjectLinked(); - foreach($object->linkedObjects as $objecttype => $objects) - { - //var_dump($objects);exit; - if ($objecttype == 'commande') - { + foreach($object->linkedObjects as $objecttype => $objects) { + if ($objecttype == 'commande') { $outputlangs->load('orders'); $num=count($objects); - for ($i=0;$i<$num;$i++) - { + for ($i=0;$i<$num;$i++) { $posy+=4; $pdf->SetXY($posx,$posy); $pdf->SetFont('','', $default_font_size - 1); diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index cd1a9de66e8..27201aebf05 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -2,6 +2,7 @@ /* Copyright (C) 2016 Laurent Destailleur * Copyright (C) 2020 Josep Lluís Amador * Copyright (C) 2024 MDW + * 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 @@ -479,8 +480,8 @@ class pdf_sepamandate extends ModeleBankAccountDoc * Show table for lines * * @param TCPDF $pdf Object PDF - * @param string $tab_top Top position of table - * @param string $tab_height Height of table (rectangle) + * @param int $tab_top Top position of table + * @param int $tab_height Height of table (rectangle) * @param int $nexY Y * @param Translate $outputlangs Langs object * @param int $hidetop Hide top bar of array diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index e4fadaef0ac..818731d1962 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -558,7 +558,7 @@ class pdf_eratosthene extends ModelePDFCommandes $posYAfterDescription = 0; if ($this->getColumnStatus('position')) { - $this->printStdColumnContent($pdf, $curY, 'position', $i + 1); + $this->printStdColumnContent($pdf, $curY, 'position', (string) ($i + 1)); } if ($this->getColumnStatus('photo')) { diff --git a/htdocs/core/modules/expensereport/mod_expensereport_sand.php b/htdocs/core/modules/expensereport/mod_expensereport_sand.php index 0c5962c871e..15180f5ff26 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_sand.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_sand.php @@ -152,7 +152,7 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport $fuser->fetch($object->fk_user_author); } - $numFinal = get_next_value($db, $mask, 'expensereport', 'ref', '', null, $date, 'next', true, $fuser); + $numFinal = get_next_value($db, $mask, 'expensereport', 'ref', '', null, (string) $date, 'next', true, $fuser); return $numFinal; } diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 0cffc22136c..5ff58804d45 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -715,7 +715,7 @@ class pdf_sponge extends ModelePDFFactures $posYAfterDescription = 0; if ($this->getColumnStatus('position')) { - $this->printStdColumnContent($pdf, $curY, 'position', $i + 1); + $this->printStdColumnContent($pdf, $curY, 'position', (string) ($i + 1)); } if ($this->getColumnStatus('photo')) { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 6e44e5fcd38..39c4f86b2e1 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -943,8 +943,8 @@ class pdf_azur extends ModelePDFPropales if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD') && !empty($this->emetteur->shipping_method_id)) { $shipping_method_id = $this->emetteur->shipping_method_id; } - $shipping_method_code = dol_getIdFromCode($this->db, $shipping_method_id, 'c_shipment_mode', 'rowid', 'code'); - $shipping_method_label = dol_getIdFromCode($this->db, $shipping_method_id, 'c_shipment_mode', 'rowid', 'libelle'); + $shipping_method_code = dol_getIdFromCode($this->db, (string) $shipping_method_id, 'c_shipment_mode', 'rowid', 'code'); + $shipping_method_label = dol_getIdFromCode($this->db, (string) $shipping_method_id, 'c_shipment_mode', 'rowid', 'libelle'); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); $pdf->SetXY($this->marge_gauche, $posy); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 34026f6c4de..cbfdab2ccb9 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -569,7 +569,7 @@ class pdf_cyan extends ModelePDFPropales $posYAfterDescription = 0; if ($this->getColumnStatus('position')) { - $this->printStdColumnContent($pdf, $curY, 'position', $i + 1); + $this->printStdColumnContent($pdf, $curY, 'position', (string) ($i + 1)); } if ($this->getColumnStatus('photo')) { @@ -1041,8 +1041,8 @@ class pdf_cyan extends ModelePDFPropales if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD') && !empty($this->emetteur->shipping_method_id)) { $shipping_method_id = $this->emetteur->shipping_method_id; } - $shipping_method_code = dol_getIdFromCode($this->db, $shipping_method_id, 'c_shipment_mode', 'rowid', 'code'); - $shipping_method_label = dol_getIdFromCode($this->db, $shipping_method_id, 'c_shipment_mode', 'rowid', 'libelle'); + $shipping_method_code = dol_getIdFromCode($this->db, (string) $shipping_method_id, 'c_shipment_mode', 'rowid', 'code'); + $shipping_method_label = dol_getIdFromCode($this->db, (string) $shipping_method_id, 'c_shipment_mode', 'rowid', 'libelle'); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); $pdf->SetXY($this->marge_gauche, $posy); diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 8112697b973..99d0d83d13e 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -463,7 +463,7 @@ class pdf_paiement extends CommonDocGenerator * Output body * * @param TCPDF $pdf PDF object - * @param string $page Page + * @param int $page Page * @param array $lines Array of lines * @param Translate $outputlangs Object langs * @return void diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 2e5e7ed21dd..55e689e2dc3 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -235,7 +235,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc if ($conf->societe->multidir_output[$object->entity]) { $dir = $conf->societe->multidir_output[$object->entity]; - $objectref = dol_sanitizeFileName($object->id); + $objectref = dol_sanitizeFileName((string) $object->id); if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; } diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 86fdedacb87..b5208a8a0bb 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -1,4 +1,6 @@ + */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index b4548c71e28..be095d7e8dd 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -6,7 +6,7 @@ * Copyright (C) 2014 Florian Henry * Copyright (C) 2014 Raphaël Doursenaud * Copyright (C) 2015-2016 Marcos García - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2022 OpenDSI @@ -447,7 +447,7 @@ if ($nolinesbefore) { $type_tva = 2; } if ($seller->tva_assuj == "0") { - echo ''.vatrate(0, true); + echo ''.vatrate('0', true); } else { echo $form->load_tva('tva_tx', (GETPOSTISSET("tva_tx") ? GETPOST("tva_tx", 'alpha', 2) : -1), $seller, $buyer, 0, 0, '', false, 1, $type_tva); } diff --git a/htdocs/don/card.php b/htdocs/don/card.php index f6a10595347..a824afafea4 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -946,8 +946,8 @@ if (!empty($id) && $action != 'edit') { /* * Generated documents */ - $filename = dol_sanitizeFileName($object->id); - $filedir = $conf->don->dir_output."/".dol_sanitizeFileName($object->id); + $filename = dol_sanitizeFileName((string) $object->id); + $filedir = $conf->don->dir_output."/".dol_sanitizeFileName((string) $object->id); $urlsource = $_SERVER['PHP_SELF'].'?rowid='.$object->id; $genallowed = (($object->paid == 0 || $user->admin) && $user->hasRight('don', 'lire')); $delallowed = $user->hasRight('don', 'creer'); diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index e37fb0e5e18..4e958b9f04d 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -268,7 +268,7 @@ class EcmFiles extends CommonObject // If ref not defined if (empty($this->ref)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php'; - $this->ref = dol_hash($this->filepath.'/'.$this->filename, 3); + $this->ref = dol_hash($this->filepath.'/'.$this->filename, '3'); } $maxposition = 0; @@ -718,7 +718,7 @@ class EcmFiles extends CommonObject // Update request $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET'; - $sql .= " ref = '".$this->db->escape(dol_hash($this->filepath."/".$this->filename, 3))."',"; + $sql .= " ref = '".$this->db->escape(dol_hash($this->filepath."/".$this->filename, '3'))."',"; $sql .= ' label = '.(isset($this->label) ? "'".$this->db->escape($this->label)."'" : "null").','; $sql .= ' share = '.(!empty($this->share) ? "'".$this->db->escape($this->share)."'" : "null").','; $sql .= ' entity = '.(isset($this->entity) ? $this->entity : $conf->entity).','; diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php index 5856a5aa4e2..9f71c561f11 100644 --- a/htdocs/ecm/dir_add_card.php +++ b/htdocs/ecm/dir_add_card.php @@ -2,6 +2,7 @@ /* Copyright (C) 2008-2017 Laurent Destailleur * Copyright (C) 2008-2012 Regis Houssin * Copyright (C) 2015-2024 Alexandre Spangaro + * 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 @@ -224,7 +225,7 @@ if ($action == 'create') { print ''; } if ($pageid) { - print ''; + print ''; } $title = $langs->trans("ECMNewSection"); diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 40e88635b75..2f05b88bef3 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -332,7 +332,7 @@ $moreheadjs .= ''."\n"; -llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', 0, 0, $morejs, '', 0, 'mod-ecm page-index'); +llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', 0, 0, $morejs, '', '', 'mod-ecm page-index'); $head = ecm_prepare_dasboard_head(null); print dol_get_fiche_head($head, 'index', '', -1, ''); diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 5d76d4a8d7f..8d37b0bd7d7 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -303,7 +303,7 @@ $moreheadjs .= ''."\n"; -llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', 0, 0, $morejs, '', 0, 'mod-ecm page-index_auto'); +llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', 0, 0, $morejs, '', '', 'mod-ecm page-index_auto'); // Add sections to manage diff --git a/htdocs/ecm/index_medias.php b/htdocs/ecm/index_medias.php index b6726fe9e99..a86d5b4a233 100644 --- a/htdocs/ecm/index_medias.php +++ b/htdocs/ecm/index_medias.php @@ -302,7 +302,7 @@ $moreheadjs .= ''."\n"; -llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', 0, 0, $morejs, '', 0, 'mod-ecm page-index_medias'); +llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', 0, 0, $morejs, '', '', 'mod-ecm page-index_medias'); $head = ecm_prepare_dasboard_head(null); print dol_get_fiche_head($head, 'index_medias', '', -1, ''); diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 8ec583e5c52..a2d04445b92 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1720,7 +1720,7 @@ class EmailCollector extends CommonObject //var_dump($headers); //var_dump($overview);exit; - $operationslog .= '
** Process email #'.dol_escape_htmltag($iforemailloop); + $operationslog .= '
** Process email #'.dol_escape_htmltag((string) $iforemailloop); if (getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')) { /** @var Webklex\PHPIMAP\Message $imapemail */ @@ -2907,7 +2907,7 @@ class EmailCollector extends CommonObject } else { $pj = getAttachments($imapemail, $connection); foreach ($pj as $key => $val) { - $data[$val['filename']] = getFileData($imapemail, $val['pos'], $val['type'], $connection); + $data[$val['filename']] = getFileData($imapemail, (string) $val['pos'], $val['type'], $connection); } } if (count($data) > 0) { @@ -3701,7 +3701,7 @@ class EmailCollector extends CommonObject if (!$s->parts) { // simple - $this->getpart($mbox, $mid, $s, 0); // pass 0 as part-number + $this->getpart($mbox, $mid, $s, '0'); // pass '0' as part-number } else { // multipart: cycle through each part foreach ($s->parts as $partno0 => $p) { diff --git a/htdocs/emailcollector/lib/emailcollector.lib.php b/htdocs/emailcollector/lib/emailcollector.lib.php index 34638e7f1d1..75a5d47103e 100644 --- a/htdocs/emailcollector/lib/emailcollector.lib.php +++ b/htdocs/emailcollector/lib/emailcollector.lib.php @@ -147,9 +147,9 @@ function getAttachments($jk, $mbox) * Get content of a joined file from its position into a given email * * @param integer $jk numéro du mail - * @param integer $fpos position de la pièce jointe + * @param string $fpos position de la pièce jointe * @param integer $type type de la pièce jointe - * @param object $mbox object connection imaap + * @param object $mbox object connection imap * @return mixed data */ function getFileData($jk, $fpos, $type, $mbox) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index eb0b843d2f8..a6ad366354a 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -255,7 +255,7 @@ class ConferenceOrBooth extends ActionComm $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_new.php?id='.urlencode((string) ($id)).'&type=conf'; - $encodedsecurekey = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'conferenceorbooth'.$id, 2); + $encodedsecurekey = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'conferenceorbooth'.$id, '2'); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); /*$this->fields['pubregister'] = array('type'=>'url', 'label'=>$langs->trans("PublicAttendeeSubscriptionPage"), 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>1); diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 16105fe3338..0696741b37f 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2021 Florian Henry * Copyright (C) 2024 Alexandre Spangaro + * 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 @@ -655,7 +656,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $sourcetouse = 'boothlocation'; $reftouse = $fac->id; - $url = getOnlinePaymentUrl(0, $sourcetouse, $reftouse); + $url = getOnlinePaymentUrl(0, $sourcetouse, (string) $reftouse); $url .= '&booth='.$object->id; print '
'; print ''; print '
' . $form->selectMultiCurrency($obj->code, 'multicurrency_code', 1, " code != '".$conf->currency."'", true) . ''; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index b245e5dc733..acfac153f22 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2014 Marcos García - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-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 @@ -200,7 +200,7 @@ $title = $object->title." - ".$langs->trans('Card'); $helpurl = ''; $arrayofjs = array(); $arrayofcss = array('/opensurvey/css/style.css'); -llxHeader('', $title, $helpurl, 0, 0, 0, $arrayofjs, $arrayofcss); +llxHeader('', $title, $helpurl, '', 0, 0, $arrayofjs, $arrayofcss); // Define format of choices diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index defcaa66c93..ce744ace43e 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -1,8 +1,8 @@ * Copyright (C) 2014 Marcos García - * Copyright (C) 2018 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2018-2024 Frédéric France + * 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 @@ -430,7 +430,7 @@ $helpurl = ''; $arrayofjs = array(); $arrayofcss = array('/opensurvey/css/style.css'); -llxHeader('', $title, $helpurl, 0, 0, 0, $arrayofjs, $arrayofcss); +llxHeader('', $title, $helpurl, '', 0, 0, $arrayofjs, $arrayofcss); // Define format of choices diff --git a/htdocs/opensurvey/wizard/choix_date.php b/htdocs/opensurvey/wizard/choix_date.php index d4b4a56b17d..e3aa1de911e 100644 --- a/htdocs/opensurvey/wizard/choix_date.php +++ b/htdocs/opensurvey/wizard/choix_date.php @@ -1,7 +1,8 @@ * Copyright (C) 2014 Marcos García - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * 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 @@ -139,7 +140,7 @@ if (GETPOST('confirmation')) { $erreur = true; } - if (issetAndNoEmpty('horaires'.$i, $_SESSION) === false || issetAndNoEmpty($j, $_SESSION['horaires'.$i]) === false) { + if (issetAndNoEmpty('horaires'.$i, $_SESSION) === false || issetAndNoEmpty((string) $j, $_SESSION['horaires'.$i]) === false) { if (issetAndNoEmpty('horaires'.$i, $_SESSION) === true) { $_SESSION["horaires$i"][$j] = ''; } else { @@ -434,7 +435,7 @@ if (issetAndNoEmpty('choixjourajout')) { for ($i = 0; $i < $cle; $i++) { $horairesi = GETPOST("horaires".$i); for ($j = 0; $j < $_SESSION["nbrecaseshoraires"]; $j++) { - if (issetAndNoEmpty('horaires'.$i) === true && issetAndNoEmpty($i, $_POST['horaires'.$i]) === true) { + if (issetAndNoEmpty('horaires'.$i) === true && issetAndNoEmpty((string) $i, $_POST['horaires'.$i]) === true) { $_SESSION["horaires$i"][$j] = $horairesi[$j]; } } @@ -443,7 +444,7 @@ if (issetAndNoEmpty('choixjourajout')) { $nbofchoice = count($_SESSION["totalchoixjour"]); for ($i = $cle; $i < $nbofchoice; $i++) { $k = $i + 1; - if (issetAndNoEmpty('horaires'.$i) === true && issetAndNoEmpty($i, $_POST['horaires'.$i]) === true) { + if (issetAndNoEmpty('horaires'.$i) === true && issetAndNoEmpty((string) $i, $_POST['horaires'.$i]) === true) { for ($j = 0; $j < $_SESSION["nbrecaseshoraires"]; $j++) { $horairesi = GETPOST("horaires".$i, 'array'); $_SESSION["horaires$i"][$j] = $horairesi[$j]; diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 1d87bec950b..acf08b5843e 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -1,6 +1,7 @@ * Copyright (C) 2021 NextGestion + * 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 @@ -134,7 +135,7 @@ $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1); + $visible = (int) dol_eval((string) $val['visible'], 1); $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 4d77495dcfc..12922338bfb 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5534,7 +5534,7 @@ class Product extends CommonObject } if (!empty($this->entity) && $permissiontoreadproduct) { - $tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80, 0, 0, 0, 0, 1); + $tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80, 0, 0, 0, 0, '1'); if ($this->nbphoto > 0) { $datas['photo'] = '
'."\n" . $tmpphoto . '
'; } @@ -6753,7 +6753,7 @@ class Product extends CommonObject * @param string $price_type Base price type * @param float $price_vat VAT % tax * @param int $npr NPR - * @param string $psq ¿? + * @param int<0,1> $psq 1 if it has price by quantity * @return int -1 KO, 1 OK */ public function generateMultiprices(User $user, $baseprice, $price_type, $price_vat, $npr, $psq) diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index b571e2a6d46..1bccc2290cf 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.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 @@ -111,7 +112,7 @@ $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1); + $visible = (int) dol_eval((string) $val['visible'], 1); $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index bae4dde9757..36971b0a456 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -6,6 +6,7 @@ * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2019 Thibault FOUCART * Copyright (C) 2024 MDW + * 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 @@ -36,8 +37,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -$WIDTH = DolGraph::getDefaultGraphSizeForStats('width', 380); -$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height', 160); +$WIDTH = DolGraph::getDefaultGraphSizeForStats('width', '380'); +$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height', '160'); // Load translation files required by the page $langs->loadLangs(array('companies', 'products', 'stocks', 'bills', 'other')); diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 0ce9bb275c0..b098b86f8de 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -5,6 +5,7 @@ * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2024 MDW + * 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 @@ -119,7 +120,7 @@ $arrayfields = array( foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1); + $visible = (int) dol_eval((string) $val['visible'], 1); $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 915c60ee58b..b7c9b9588a0 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2021 Ferran Marcet - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-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 @@ -111,7 +111,7 @@ $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1); + $visible = (int) dol_eval((string) $val['visible'], 1); $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_document.php b/htdocs/product/stock/stocktransfer/stocktransfer_document.php index 7d6a138fea6..af2e915a067 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_document.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_document.php @@ -1,6 +1,7 @@ * Copyright (C) 2021 Gauthier VERDOL + * 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 @@ -70,7 +71,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals -//if ($id > 0 || !empty($ref)) $upload_dir = $conf->stocktransfer->multidir_output[$object->entity?$object->entity:$conf->entity] . "/stocktransfer/" . dol_sanitizeFileName($object->id); +//if ($id > 0 || !empty($ref)) $upload_dir = $conf->stocktransfer->multidir_output[$object->entity?$object->entity:$conf->entity] . "/stocktransfer/" . dol_sanitizeFileName((string) $object->id); if ($id > 0 || !empty($ref)) { $upload_dir = $conf->stocktransfer->multidir_output[$object->entity ? $object->entity : $conf->entity]."/stocktransfer/".dol_sanitizeFileName($object->ref); } diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_list.php b/htdocs/product/stock/stocktransfer/stocktransfer_list.php index 32953350955..7c203388784 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_list.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_list.php @@ -2,6 +2,7 @@ /* Copyright (C) 2007-2017 Laurent Destailleur * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) ---Put here your own copyright and developer email--- + * 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 @@ -108,7 +109,7 @@ $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1); + $visible = (int) dol_eval((string) $val['visible'], 1); $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index 03db7871053..59cb0fa4ad1 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-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 @@ -106,8 +106,8 @@ print '