From 1f43cf56d91261c3affa4798afc4bd1d0bb98ff2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Mar 2024 22:11:11 +0100 Subject: [PATCH 01/75] Fix regression --- htdocs/expedition/list.php | 2 +- htdocs/reception/list.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index a71b364cdac..69980c72d1e 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -62,7 +62,7 @@ $search_zip = GETPOST('search_zip', 'alpha'); $search_state = GETPOST("search_state"); $search_country = GETPOSTINT("search_country"); $search_type_thirdparty = GETPOSTINT("search_type_thirdparty"); -$search_billed = GETPOSTINT("search_billed"); +$search_billed = GETPOST("search_billed", 'intcomma'); $search_datedelivery_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datedelivery_startmonth'), GETPOSTINT('search_datedelivery_startday'), GETPOSTINT('search_datedelivery_startyear')); $search_datedelivery_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datedelivery_endmonth'), GETPOSTINT('search_datedelivery_endday'), GETPOSTINT('search_datedelivery_endyear')); $search_datereceipt_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datereceipt_startmonth'), GETPOSTINT('search_datereceipt_startday'), GETPOSTINT('search_datereceipt_startyear')); diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index f6242c6ee14..20b9262923f 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -75,7 +75,7 @@ $search_date_create_endmonth = GETPOSTINT('search_date_create_endmonth'); $search_date_create_endyear = GETPOSTINT('search_date_create_endyear'); $search_date_create_start = dol_mktime(0, 0, 0, $search_date_create_startmonth, $search_date_create_startday, $search_date_create_startyear); // Use tzserver $search_date_create_end = dol_mktime(23, 59, 59, $search_date_create_endmonth, $search_date_create_endday, $search_date_create_endyear); -$search_billed = GETPOSTINT("search_billed"); +$search_billed = GETPOST("search_billed", 'intcomma'); $search_status = GETPOST('search_status', 'intcomma'); $search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); From f8ea5ac0776e80476a0f41a6bdb418c645feacdd Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Fri, 15 Mar 2024 23:33:51 +0100 Subject: [PATCH 02/75] Proposed function for records that can't be found --- htdocs/core/lib/functions.lib.php | 66 +++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4a6e3a42f01..b8762bb0414 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13905,3 +13905,69 @@ function buildParamDate($prefix, $timestamp = null, $hourTime = '', $gm = 'auto' return '&' . http_build_query($TParam); } + +/** + * Displays an error page when a record is not found. It allows customization of the message, + * whether to include the header and footer, and if only the message should be shown without additional details. + * The function also supports executing additional hooks for customized handling of error pages. + * + * @param string $message Custom error message to display. If empty, a default "Record Not Found" message is shown. + * @param int $printheader Determines if the page header should be printed (1 = yes, 0 = no). + * @param int $printfooter Determines if the page footer should be printed (1 = yes, 0 = no). + * @param int $showonlymessage If set to 1, only the error message is displayed without any additional information or hooks. + * @param mixed $params Optional parameters to pass to hooks for further processing or customization. + * @global object $conf Dolibarr configuration object (global) + * @global object $db Database connection object (global) + * @global object $user Current user object (global) + * @global Translate $langs Language translation object, initialized within the function if not already. + * @global object $hookmanager Hook manager object, initialized within the function if not already for executing hooks. + * @global string $action Current action, can be modified by hooks. + * @global object $object Current object, can be modified by hooks. + * @return void This function terminates script execution after outputting the error page. + */ + +function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $showonlymessage = 0, $params = null) + { + global $conf, $db, $user, $langs, $hookmanager; + global $action, $object; + + if (!is_object($langs)) { + include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; + $langs = new Translate('', $conf); + $langs->setDefaultLang(); + } + + $langs->load("errors"); + + if ($printheader) { + if (function_exists("llxHeader")) { + llxHeader(''); + } elseif (function_exists("llxHeaderVierge")) { + llxHeaderVierge(''); + } + } + print '
'; + if (empty($message)) { + print $langs->trans("ErrorRecordNotFound"); + } else { + print $langs->trans($message); + } + print '
'; + print '
'; + if (empty($showonlymessage)) { + if (empty($hookmanager)) { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager = new HookManager($db); + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context + $hookmanager->initHooks(array('main')); + } + + $parameters = array('message'=>$message, 'params'=>$params); + $reshook = $hookmanager->executeHooks('getErrorRecordNotFound', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks + print $hookmanager->resPrint; + } + if ($printfooter && function_exists("llxFooter")) { + llxFooter(); + } + exit(0); + } From 05ee3d482c0ceab0fcde6c4afe775115cc6b5048 Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 00:00:06 +0100 Subject: [PATCH 03/75] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 35 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b8762bb0414..8c055faf841 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13925,32 +13925,31 @@ function buildParamDate($prefix, $timestamp = null, $hourTime = '', $gm = 'auto' * @global object $object Current object, can be modified by hooks. * @return void This function terminates script execution after outputting the error page. */ - function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $showonlymessage = 0, $params = null) - { - global $conf, $db, $user, $langs, $hookmanager; +{ + global $conf, $db, $user, $langs, $hookmanager; global $action, $object; - if (!is_object($langs)) { - include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; - $langs = new Translate('', $conf); - $langs->setDefaultLang(); + if (!is_object($langs)) { + include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; + $langs = new Translate('', $conf); + $langs->setDefaultLang(); } - $langs->load("errors"); + $langs->load("errors"); - if ($printheader) { - if (function_exists("llxHeader")) { - llxHeader(''); + if ($printheader) { + if (function_exists("llxHeader")) { + llxHeader(''); } elseif (function_exists("llxHeaderVierge")) { - llxHeaderVierge(''); + llxHeaderVierge(''); } } print '
'; - if (empty($message)) { - print $langs->trans("ErrorRecordNotFound"); + if (empty($message)) { + print $langs->trans("ErrorRecordNotFound"); } else { - print $langs->trans($message); + print $langs->trans($message); } print '
'; print '
'; @@ -13962,9 +13961,9 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show $hookmanager->initHooks(array('main')); } - $parameters = array('message'=>$message, 'params'=>$params); - $reshook = $hookmanager->executeHooks('getErrorRecordNotFound', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - print $hookmanager->resPrint; + $parameters = array('message'=>$message, 'params'=>$params); + $reshook = $hookmanager->executeHooks('getErrorRecordNotFound', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks + print $hookmanager->resPrint; } if ($printfooter && function_exists("llxFooter")) { llxFooter(); From c12af524d57e9169e3ed46a28c16778e8193b578 Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 00:05:34 +0100 Subject: [PATCH 04/75] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 75 ++++++++++++++++--------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8c055faf841..4651e6a17e6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13927,46 +13927,47 @@ function buildParamDate($prefix, $timestamp = null, $hourTime = '', $gm = 'auto' */ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $showonlymessage = 0, $params = null) { - global $conf, $db, $user, $langs, $hookmanager; + global $conf, $db, $user, $langs, $hookmanager; global $action, $object; - if (!is_object($langs)) { - include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; - $langs = new Translate('', $conf); - $langs->setDefaultLang(); + if (!is_object($langs)) { + include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; + $langs = new Translate('', $conf); + $langs->setDefaultLang(); } - $langs->load("errors"); + $langs->load("errors"); - if ($printheader) { - if (function_exists("llxHeader")) { - llxHeader(''); - } elseif (function_exists("llxHeaderVierge")) { - llxHeaderVierge(''); - } - } - print '
'; - if (empty($message)) { - print $langs->trans("ErrorRecordNotFound"); - } else { - print $langs->trans($message); - } - print '
'; - print '
'; - if (empty($showonlymessage)) { - if (empty($hookmanager)) { - include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; - $hookmanager = new HookManager($db); - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context - $hookmanager->initHooks(array('main')); - } + if ($printheader) { + if (function_exists("llxHeader")) { + llxHeader(''); + } elseif (function_exists("llxHeaderVierge")) { + llxHeaderVierge(''); + } + } + print '
'; + if (empty($message)) { + print $langs->trans("ErrorRecordNotFound"); + } else { + print $langs->trans($message); + } + print '
'; + print '
'; + if (empty($showonlymessage)) { + if (empty($hookmanager)) { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager = new HookManager($db); + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context + $hookmanager->initHooks(array('main')); + } - $parameters = array('message'=>$message, 'params'=>$params); - $reshook = $hookmanager->executeHooks('getErrorRecordNotFound', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - print $hookmanager->resPrint; - } - if ($printfooter && function_exists("llxFooter")) { - llxFooter(); - } - exit(0); - } + $parameters = array('message'=>$message, 'params'=>$params); + $reshook = $hookmanager->executeHooks('getErrorRecordNotFound', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks + print $hookmanager->resPrint; + } + if ($printfooter && function_exists("llxFooter")) { + llxFooter(); + } + exit(0); +} + From 48bbc532b9ce94a5d82184c365405c62f8a9d8f7 Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 00:11:06 +0100 Subject: [PATCH 05/75] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4651e6a17e6..e5d23dc7115 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13927,14 +13927,14 @@ function buildParamDate($prefix, $timestamp = null, $hourTime = '', $gm = 'auto' */ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $showonlymessage = 0, $params = null) { - global $conf, $db, $user, $langs, $hookmanager; - global $action, $object; - + global $conf, $db, $user, $langs, $hookmanager; + global $action, $object; + if (!is_object($langs)) { - include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; - $langs = new Translate('', $conf); - $langs->setDefaultLang(); - } + include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; + $langs = new Translate('', $conf); + $langs->setDefaultLang(); + } $langs->load("errors"); From e1cf39773bf71ad9c29914d045d3c9f3ae08c6ab Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 00:13:51 +0100 Subject: [PATCH 06/75] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e5d23dc7115..a6178020bdc 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13930,7 +13930,7 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show global $conf, $db, $user, $langs, $hookmanager; global $action, $object; - if (!is_object($langs)) { + if (!is_object($langs)) { include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; $langs = new Translate('', $conf); $langs->setDefaultLang(); From 13350802e5c04f3821239fa35ae9f62b50d3b334 Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 00:16:15 +0100 Subject: [PATCH 07/75] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a6178020bdc..c4a99a7ecfa 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13929,7 +13929,6 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show { global $conf, $db, $user, $langs, $hookmanager; global $action, $object; - if (!is_object($langs)) { include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; $langs = new Translate('', $conf); From fb9f9a7c8b4ae71182df185c2b47378ad08407a3 Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 00:22:17 +0100 Subject: [PATCH 08/75] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c4a99a7ecfa..610eb22a218 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13929,14 +13929,15 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show { global $conf, $db, $user, $langs, $hookmanager; global $action, $object; + if (!is_object($langs)) { include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; $langs = new Translate('', $conf); $langs->setDefaultLang(); } - + $langs->load("errors"); - + if ($printheader) { if (function_exists("llxHeader")) { llxHeader(''); @@ -13944,6 +13945,7 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show llxHeaderVierge(''); } } + print '
'; if (empty($message)) { print $langs->trans("ErrorRecordNotFound"); @@ -13952,18 +13954,20 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show } print '
'; print '
'; + if (empty($showonlymessage)) { if (empty($hookmanager)) { - include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; - $hookmanager = new HookManager($db); - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager = new HookManager($db); + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('main')); } $parameters = array('message'=>$message, 'params'=>$params); $reshook = $hookmanager->executeHooks('getErrorRecordNotFound', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - print $hookmanager->resPrint; + print $hookmanager->resPrint; } + if ($printfooter && function_exists("llxFooter")) { llxFooter(); } From 4dc118a759bb883ccaa5a77d84d95c3b9bb0871a Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 00:25:05 +0100 Subject: [PATCH 09/75] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 610eb22a218..b5d8b656189 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13973,4 +13973,3 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show } exit(0); } - From d339f4252c031148623b40c4f763a6d330886472 Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 00:26:50 +0100 Subject: [PATCH 10/75] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b5d8b656189..b15deef2f01 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13967,8 +13967,8 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show $reshook = $hookmanager->executeHooks('getErrorRecordNotFound', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks print $hookmanager->resPrint; } - - if ($printfooter && function_exists("llxFooter")) { + + if ($printfooter && function_exists("llxFooter")) { llxFooter(); } exit(0); From dd7f84abde2a5f144e9c260e95c4518801aafc1b Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 00:30:24 +0100 Subject: [PATCH 11/75] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b15deef2f01..e6b133f3b6f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13929,15 +13929,15 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show { global $conf, $db, $user, $langs, $hookmanager; global $action, $object; - + if (!is_object($langs)) { include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; $langs = new Translate('', $conf); $langs->setDefaultLang(); } - + $langs->load("errors"); - + if ($printheader) { if (function_exists("llxHeader")) { llxHeader(''); @@ -13945,7 +13945,7 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show llxHeaderVierge(''); } } - + print '
'; if (empty($message)) { print $langs->trans("ErrorRecordNotFound"); @@ -13954,7 +13954,7 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show } print '
'; print '
'; - + if (empty($showonlymessage)) { if (empty($hookmanager)) { include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; @@ -13962,7 +13962,7 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('main')); } - + $parameters = array('message'=>$message, 'params'=>$params); $reshook = $hookmanager->executeHooks('getErrorRecordNotFound', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks print $hookmanager->resPrint; From cd47aa1aad1be9cf6577e5431de0f46698b0aad4 Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 00:34:09 +0100 Subject: [PATCH 12/75] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e6b133f3b6f..702f90beeae 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13932,8 +13932,8 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show if (!is_object($langs)) { include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; - $langs = new Translate('', $conf); - $langs->setDefaultLang(); + $langs = new Translate('', $conf); + $langs->setDefaultLang(); } $langs->load("errors"); From 82dc53e796c5ea5440a7956678a8cb618f1a256a Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 00:36:43 +0100 Subject: [PATCH 13/75] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 702f90beeae..60de32cfb5e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13936,15 +13936,15 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show $langs->setDefaultLang(); } - $langs->load("errors"); + $langs->load("errors"); - if ($printheader) { - if (function_exists("llxHeader")) { - llxHeader(''); - } elseif (function_exists("llxHeaderVierge")) { - llxHeaderVierge(''); - } - } + if ($printheader) { + if (function_exists("llxHeader")) { + llxHeader(''); + } elseif (function_exists("llxHeaderVierge")) { + llxHeaderVierge(''); + } + } print '
'; if (empty($message)) { From 0c7ed79f40c85a6684fdc99a6e482e123842198b Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 00:42:57 +0100 Subject: [PATCH 14/75] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 60de32cfb5e..ea7c71bf971 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13939,21 +13939,21 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show $langs->load("errors"); if ($printheader) { - if (function_exists("llxHeader")) { + if (function_exists("llxHeader")) { llxHeader(''); } elseif (function_exists("llxHeaderVierge")) { llxHeaderVierge(''); } } - print '
'; - if (empty($message)) { - print $langs->trans("ErrorRecordNotFound"); - } else { - print $langs->trans($message); - } - print '
'; - print '
'; + print '
'; + if (empty($message)) { + print $langs->trans("ErrorRecordNotFound"); + } else { + print $langs->trans($message); + } + print '
'; + print '
'; if (empty($showonlymessage)) { if (empty($hookmanager)) { From 3fba583ffadb45f723c0fe72238c1f0fd461beaa Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 00:46:40 +0100 Subject: [PATCH 15/75] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ea7c71bf971..16328dfcece 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13955,21 +13955,21 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show print '
'; print '
'; - if (empty($showonlymessage)) { - if (empty($hookmanager)) { - include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; - $hookmanager = new HookManager($db); - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context - $hookmanager->initHooks(array('main')); - } + if (empty($showonlymessage)) { + if (empty($hookmanager)) { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager = new HookManager($db); + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context + $hookmanager->initHooks(array('main')); + } - $parameters = array('message'=>$message, 'params'=>$params); - $reshook = $hookmanager->executeHooks('getErrorRecordNotFound', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - print $hookmanager->resPrint; - } + $parameters = array('message'=>$message, 'params'=>$params); + $reshook = $hookmanager->executeHooks('getErrorRecordNotFound', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks + print $hookmanager->resPrint; + } if ($printfooter && function_exists("llxFooter")) { - llxFooter(); - } - exit(0); + llxFooter(); + } + exit(0); } From 3b0bd0c427312b5f1b6ba72a6043d3772ff2418b Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 00:49:12 +0100 Subject: [PATCH 16/75] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 16328dfcece..99f35c5740f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13969,7 +13969,7 @@ function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $show } if ($printfooter && function_exists("llxFooter")) { - llxFooter(); + llxFooter(); } exit(0); } From 6b20661c37da2c53b7f612d5a4f6347097ee3421 Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:31:35 +0100 Subject: [PATCH 17/75] Update card.php with new function recordNotFound --- htdocs/societe/card.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 52921b28c80..3cc208d270d 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -142,9 +142,7 @@ if ($socid > 0) { } if (!($object->id > 0) && $action == 'view') { - $langs->load("errors"); - print($langs->trans('ErrorRecordNotFound')); - exit; + recordNotFound(); } // Get object canvas (By default, this is not defined, so standard usage of dolibarr) From 09b89903ca19962692d6ec2fc3dc646f50001cb3 Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:52:04 +0100 Subject: [PATCH 18/75] Update card.php --- htdocs/societe/card.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 3cc208d270d..52921b28c80 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -142,7 +142,9 @@ if ($socid > 0) { } if (!($object->id > 0) && $action == 'view') { - recordNotFound(); + $langs->load("errors"); + print($langs->trans('ErrorRecordNotFound')); + exit; } // Get object canvas (By default, this is not defined, so standard usage of dolibarr) From a516b920405aa1a583a56f46b6cf39cf6c40f238 Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 12:02:33 +0100 Subject: [PATCH 19/75] Update card.php with new function record not found --- htdocs/societe/card.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 52921b28c80..3cc208d270d 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -142,9 +142,7 @@ if ($socid > 0) { } if (!($object->id > 0) && $action == 'view') { - $langs->load("errors"); - print($langs->trans('ErrorRecordNotFound')); - exit; + recordNotFound(); } // Get object canvas (By default, this is not defined, so standard usage of dolibarr) From a72d772c617a1e8a73c8ed455eadb721a913a674 Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 12:24:13 +0100 Subject: [PATCH 20/75] Update card.php From efd11891cc4e7586877709cdb2ae3b54de26bd6c Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 12:43:52 +0100 Subject: [PATCH 21/75] Update card.php From 62e3d499d68729aff9915cd96e5bff636b882664 Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 12:47:35 +0100 Subject: [PATCH 22/75] Update knowledgemanagement.php --- htdocs/admin/knowledgemanagement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/knowledgemanagement.php b/htdocs/admin/knowledgemanagement.php index c3b7a4be39c..9e0b93c022b 100644 --- a/htdocs/admin/knowledgemanagement.php +++ b/htdocs/admin/knowledgemanagement.php @@ -95,7 +95,7 @@ if ($action == 'updateMask') { $tmpobjectkey = GETPOST('object', 'aZ09'); if (in_array($tmpobjectkey, $myTmpObjects)) { - $tmpobject = new $tmpobjectkey($db); + $tmpobject = new $tmpobjectkey(); $tmpobject->initAsSpecimen(); // Search template files From ee481d7dd0c7f13f276e9948e65a3ac1f011eaaa Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 12:49:01 +0100 Subject: [PATCH 23/75] Update knowledgemanagement.php --- htdocs/admin/knowledgemanagement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/knowledgemanagement.php b/htdocs/admin/knowledgemanagement.php index 9e0b93c022b..c3b7a4be39c 100644 --- a/htdocs/admin/knowledgemanagement.php +++ b/htdocs/admin/knowledgemanagement.php @@ -95,7 +95,7 @@ if ($action == 'updateMask') { $tmpobjectkey = GETPOST('object', 'aZ09'); if (in_array($tmpobjectkey, $myTmpObjects)) { - $tmpobject = new $tmpobjectkey(); + $tmpobject = new $tmpobjectkey($db); $tmpobject->initAsSpecimen(); // Search template files From 23d656de0dcbf2a892123fb4a4efa848eef918a7 Mon Sep 17 00:00:00 2001 From: Zephyriony <142790847+zephyriony@users.noreply.github.com> Date: Sat, 16 Mar 2024 14:19:59 +0100 Subject: [PATCH 24/75] Update card.php From a37c79c5ee61718868fe89c710ea73fde57403c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Sun, 17 Mar 2024 12:44:37 +0100 Subject: [PATCH 25/75] Display additional boxes in all case --- htdocs/accountancy/index.php | 43 ++++++++++++++---------------------- 1 file changed, 16 insertions(+), 27 deletions(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index db569da428c..b2a106712d3 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -80,7 +80,7 @@ llxHeader('', $langs->trans("AccountancyArea"), $help_url); if (isModEnabled('accounting')) { $step = 0; - $resultboxes = FormOther::getBoxesArea($user, "27"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb) + $helpisexpanded = empty($resultboxes['boxactivated']) || (empty($resultboxes['boxlista']) && empty($resultboxes['boxlistb'])); // If there is no widget, the tooltip help is expanded by default. $showtutorial = ''; @@ -264,32 +264,6 @@ if (isModEnabled('accounting')) { print '
'; - print '
'; - - /* - * Show boxes - */ - $boxlist = '
'; - - $boxlist .= '
'; - - $boxlist .= $resultboxes['boxlista']; - - $boxlist .= '
'; - - $boxlist .= '
'; - - $boxlist .= $resultboxes['boxlistb']; - - $boxlist .= '
'; - $boxlist .= "\n"; - - $boxlist .= '
'; - - - print $boxlist; - - print '
'; } elseif (isModEnabled('comptabilite')) { print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy'); @@ -300,6 +274,21 @@ if (isModEnabled('accounting')) { print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy'); } +/* + * Show boxes + */ +$resultboxes = FormOther::getBoxesArea($user, "27"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb) +$boxlist = '
'; +$boxlist .= '
'; +$boxlist .= $resultboxes['boxlista']; +$boxlist .= '
'; +$boxlist .= '
'; +$boxlist .= $resultboxes['boxlistb']; +$boxlist .= '
'; +$boxlist .= "\n"; +$boxlist .= '
'; +print $boxlist; + // End of page llxFooter(); $db->close(); From 1c5b344c2d8b36bd614f2b62bf06018a2c26b675 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Mar 2024 21:19:49 +0100 Subject: [PATCH 26/75] Update index.php --- htdocs/accountancy/index.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index b2a106712d3..10adfea0bc8 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -263,7 +263,6 @@ if (isModEnabled('accounting')) { print ''; print '
'; - } elseif (isModEnabled('comptabilite')) { print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy'); From b4880a8b172dc60985da76620070a471f506397d Mon Sep 17 00:00:00 2001 From: ksar Date: Sun, 17 Mar 2024 23:16:27 +0100 Subject: [PATCH 27/75] FIX : Issue with special characters in Frencj=h Move to ANSI instead of UTF-8 --- build/exe/doliwamp/Languages/MyFrench.isl | 54 +++++++++++------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/build/exe/doliwamp/Languages/MyFrench.isl b/build/exe/doliwamp/Languages/MyFrench.isl index ca38aa599e3..2fb684657a5 100644 --- a/build/exe/doliwamp/Languages/MyFrench.isl +++ b/build/exe/doliwamp/Languages/MyFrench.isl @@ -2,47 +2,47 @@ [CustomMessages] NameAndVersion=%1 version %2 -AdditionalIcons=Icônes supplémentaires : -CreateDesktopIcon=Créer une icône sur le &Bureau -CreateQuickLaunchIcon=Créer une icône dans la barre de &Lancement rapide +AdditionalIcons=Icônes supplémentaires : +CreateDesktopIcon=Créer une icône sur le &Bureau +CreateQuickLaunchIcon=Créer une icône dans la barre de &Lancement rapide ProgramOnTheWeb=Page d'accueil de %1 -UninstallProgram=Désinstaller %1 -LaunchProgram=Exécuter %1 +UninstallProgram=Désinstaller %1 +LaunchProgram=Exécuter %1 AssocFileExtension=&Associer %1 avec l'extension de fichier %2 AssocingFileExtension=Associe %1 avec l'extension de fichier %2... -YouWillInstallDoliWamp=Vous allez installer DoliWamp sur votre ordinateur (donc Dolibarr + tous ses composants prérequis comme Apache, Mysql et PHP). -ThisAssistantInstallOrUpgrade=AVERTISSEMENT: L'utilisation d'un ERP CRM installé sur un ordinateur local peut être dangereuse: si votre ordinateur tombe en panne, vous pouvez perdre toutes vos données. Faites-le si vous êtes prêt à gérer les sauvegardes vous-même sérieusement. Sinon, utilisez plutôt une installation en Saas (voir https://saas.dolibarr.org). -IfYouHaveTechnicalKnowledge=De plus, si vous avez des compétences techniques et envisagez de partager votre Apache, Mysql et PHP avec d''autres applications que Dolibarr, vous ne devriez pas utiliser cet assistant mais faire plutôt une installation manuelle de Dolibarr sur un serveur existant équipé de Apache, Mysql et PHP. -ButIfYouLook=Mais si vous recherchez une installation clé en main automatisée sur une poste local, vous êtes sur la bonne voie... -DoYouWantToStart=Voulez-vous démarrer le processus d'installation ? +YouWillInstallDoliWamp=Vous allez installer DoliWamp sur votre ordinateur (donc Dolibarr + tous ses composants prérequis comme Apache, Mysql et PHP). +ThisAssistantInstallOrUpgrade=AVERTISSEMENT: L'utilisation d'un ERP CRM installé sur un ordinateur local peut être dangereuse: si votre ordinateur tombe en panne, vous pouvez perdre toutes vos données. Faites-le si vous êtes prêt à gérer les sauvegardes vous-même sérieusement. Sinon, utilisez plutôt une installation en Saas (voir https://saas.dolibarr.org). +IfYouHaveTechnicalKnowledge=De plus, si vous avez des compétences techniques et envisagez de partager votre Apache, Mysql et PHP avec d''autres applications que Dolibarr, vous ne devriez pas utiliser cet assistant mais faire plutôt une installation manuelle de Dolibarr sur un serveur existant équipé de Apache, Mysql et PHP. +ButIfYouLook=Mais si vous recherchez une installation clé en main automatisée sur une poste local, vous êtes sur la bonne voie... +DoYouWantToStart=Voulez-vous démarrer le processus d'installation ? -TechnicalParameters=Paramètres techniques -IfFirstInstall=S'il s'agit de la première installation, merci de spécifier ces quelques paramètres techniques. Si vous ne les comprennez pas, êtes non sûr, ou procédez à une mise à jour, laissez les champs avec les valeurs proposées par défaut. +TechnicalParameters=Paramètres techniques +IfFirstInstall=S'il s'agit de la première installation, merci de spécifier ces quelques paramètres techniques. Si vous ne les comprennez pas, êtes non sûr, ou procédez à une mise à jour, laissez les champs avec les valeurs proposées par défaut. ; WARNING !!! STRINGS FOR THIS 4 STRINGS MUST BE LOWER THAN 70 CHARACTERS -SMTPServer=Serveur SMTP (le votre ou de votre FAI, première installation uniquement): -ApachePort=Port Apache (première installation uniquement, le choix standard est 80): -MySqlPort=Port Mysql (première installation uniquement, le choix standard est 3306): -MySqlPassword=Mot de passe serveur+base MySql de root (première installation uniquement): +SMTPServer=Serveur SMTP (le votre ou de votre FAI, première installation uniquement): +ApachePort=Port Apache (première installation uniquement, le choix standard est 80): +MySqlPort=Port Mysql (première installation uniquement, le choix standard est 3306): +MySqlPassword=Mot de passe serveur+base MySql de root (première installation uniquement): -FailedToDeleteLock=Echec de la suppression du fichier %1/www/dolibarr/install.lock. Vous pouvez ignorer l'avertissement mais il est possible que vous deviez le supprimer manuellement plus tard. Dans ce cas, cela vous sera signalé. Cliquez sur OK pour continuer... +FailedToDeleteLock=Echec de la suppression du fichier %1/www/dolibarr/install.lock. Vous pouvez ignorer l'avertissement mais il est possible que vous deviez le supprimer manuellement plus tard. Dans ce cas, cela vous sera signalé. Cliquez sur OK pour continuer... -PortAlreadyInUse=Le port %1 semble déjà utilisé. Il est recommandé d'annuler pour revenir en arrière et spécifier une autre valeur pour le port %2. Annuler le choix et choisir une autre valeur ? +PortAlreadyInUse=Le port %1 semble déjà utilisé. Il est recommandé d'annuler pour revenir en arrière et spécifier une autre valeur pour le port %2. Annuler le choix et choisir une autre valeur ? -FirefoxDetected=Firefox a été détecté sur votre ordinateur. Voulez-vous en faire votre navigateur par défaut pour Dolibarr ? -ChromeDetected=Chrome a été détecté sur votre ordinateur. Voulez-vous en faire votre navigateur par défaut pour Dolibarr ? -ChooseDefaultBrowser=Merci de choisir votre navigateur par défaut (iexplore.exe, firefox.exe, chrome.exe, MicrosoftEdge.exe...). Si vous n'êtes pas sûr, cliquez simplement sur Ouvrir : +FirefoxDetected=Firefox a été détecté sur votre ordinateur. Voulez-vous en faire votre navigateur par défaut pour Dolibarr ? +ChromeDetected=Chrome a été détecté sur votre ordinateur. Voulez-vous en faire votre navigateur par défaut pour Dolibarr ? +ChooseDefaultBrowser=Merci de choisir votre navigateur par défaut (iexplore.exe, firefox.exe, chrome.exe, MicrosoftEdge.exe...). Si vous n'êtes pas sûr, cliquez simplement sur Ouvrir : LaunchNow=Lancer Dolibarr maintenant -ProgramHasBeenRemoved=Les fichiers du programme Dolibarr ont été supprimés. Toutefois, tous vos fichiers de données sont toujours dans le répertoire %1. Vous devez supprimer ce répertoire manuellement pour avoir une désinstallation complète. +ProgramHasBeenRemoved=Les fichiers du programme Dolibarr ont été supprimés. Toutefois, tous vos fichiers de données sont toujours dans le répertoire %1. Vous devez supprimer ce répertoire manuellement pour avoir une désinstallation complète. -DoliWampWillStartApacheMysql=L'installeur DoliWamp va maintenant démarrer ou redémarrer Apache et Mysql, ceci peut durer de quelques secondes à une minute après cette confirmation. Démarrer l'installation ou mise à jour du serveur web et base de données requis par Dolibarr ? +DoliWampWillStartApacheMysql=L'installeur DoliWamp va maintenant démarrer ou redémarrer Apache et Mysql, ceci peut durer de quelques secondes à une minute après cette confirmation. Démarrer l'installation ou mise à jour du serveur web et base de données requis par Dolibarr ? -OldVersionFoundAndMoveInNew=Une ancienne version de base a été trouvée et déplacée pour fonctionner avec la nouvelle version de Dolibarr. -OldVersionFoundButFailedToMoveInNew=Une ancienne version de base a été trouvée mais ne peut être déplacée pour être utilisée avec la nouvelle version de Dolibarr. +OldVersionFoundAndMoveInNew=Une ancienne version de base a été trouvée et déplacée pour fonctionner avec la nouvelle version de Dolibarr. +OldVersionFoundButFailedToMoveInNew=Une ancienne version de base a été trouvée mais ne peut être déplacée pour être utilisée avec la nouvelle version de Dolibarr. -DLLMissing=L'installation de votre Windows est incomplète. Il manque le composant "Micrsoft Visual C++ Redistributable for Visual Studio 2017". Installer la version 32-bit (vcredist_x86.exe) d'abord (vous pourrez le trouver à https://www.microsoft.com/fr-fr/download/) puis relancer l'installation de DoliWamp après. -ContinueAnyway=Continuer malgré tout (le process d'installaton échouera) +DLLMissing=L'installation de votre Windows est incomplète. Il manque le composant "Micrsoft Visual C++ Redistributable for Visual Studio 2017". Installer la version 32-bit (vcredist_x86.exe) d'abord (vous pourrez le trouver à https://www.microsoft.com/fr-fr/download/) puis relancer l'installation de DoliWamp après. +ContinueAnyway=Continuer malgré tout (le process d'installaton échouera) From 632ee1b81b1bf217a10c9f250e0e26a0828e7f68 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Mon, 18 Mar 2024 04:36:25 +0100 Subject: [PATCH 28/75] NEW auto fill infos in template email --- htdocs/core/lib/emaillayout.lib.php | 36 ++++++++++++++--------------- htdocs/langs/en_US/mails.lang | 2 ++ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/htdocs/core/lib/emaillayout.lib.php b/htdocs/core/lib/emaillayout.lib.php index 1240c2fa664..9ae359f26df 100644 --- a/htdocs/core/lib/emaillayout.lib.php +++ b/htdocs/core/lib/emaillayout.lib.php @@ -30,28 +30,28 @@ */ function getHtmlOfLayout($name) { + global $conf, $mysoc, $user, $langs; + if ($name == 'basic') { $out = '
-
- Gray rectangle -
-

Lorem, ipsum dolor sit amet consectetur adipisicing elit.

-

Lorem, ipsum dolor sit amet consectetur

- +
'; + if (!empty($mysoc->logo)) { + if (file_exists($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + $out .= ''; + } + } else { + $out .= 'Gray rectangle'; + } + $out .= '
+

'.$langs->trans('TitleOfMailHolder').'

- - - - Gray rectangle - -
'; +

'.$langs->trans('ContentOfMailHOlder').'

+ '; + if (!(empty($user->signature))) { + $out .= '

'.dol_htmlentities($user->signature).'

'; + } + $out .= ''; } elseif ($name == 'news') { $out = '

Lorem, ipsum dolor sit amet consectetur adipisicing elit sit amet consectetur

diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index d2e29b3941a..4160930b410 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -191,3 +191,5 @@ helpWithAi=Generate message from AI YouCanMakeSomeInstructionForEmail=You can make some instructions for your Email (Example: generate image in email template...) ModelTemplate=Email template YouCanChooseAModelForYouMailContent= You can choose one of template models or generate one with AI +TitleOfMailHolder=Title of the e-mail goes here +ContentOfMailHOlder=Content of email goes here... \ No newline at end of file From 626cb3cfa0f65bca19d40da47eef4628ab787d0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 18 Mar 2024 08:01:45 +0100 Subject: [PATCH 29/75] fix typo in ChangeLog --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b31afcad981..56b6be75962 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,11 +28,11 @@ FIX: Bad column for total in bom list FIX: Bad condition on button back to draft on recruitment job. FIX: Bad CRLF when sending text only content. Fix dol_htmlwithnojs() FIX: Bad picto on list of permission of a user when user not admin -FIX: bad timzeone for the start/end date of an event +FIX: bad timezone for the start/end date of an event FIX: Better test on validity of compute field syntax with parenthesis FIX: close #28279 FIX: Count of virtual stock at Services and MoLine with disabled stock change (#28580) -FIX: disabled pito of menu must be greyed. +FIX: disabled picto of menu must be greyed. FIX: Don't display column when it's out of date (#28271) FIX: duplicate with lines: 414-416 (#28358) FIX: edit bank suggested for credit transfer payment in invoice setup From ddfef5ac4ced6f6826f94e48b124aace7e82cbfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 18 Mar 2024 09:23:20 +0100 Subject: [PATCH 30/75] Update ChangeLog --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 56b6be75962..32270994e3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -38,7 +38,7 @@ FIX: duplicate with lines: 414-416 (#28358) FIX: edit bank suggested for credit transfer payment in invoice setup FIX: Error When cloning fourn price no default value for tva_tx (#28368) FIX: fatal error Unsupported operand types when recording load payment -FIX: Fix create shipping with product who have negative stocks on warehouse but the negative stock transfert is allowed (#26217) +FIX: Fix create shipping with product who have negative stocks on warehouse but the negative stock transfer is allowed (#26217) FIX: migration missing 2 columns in llx_resource and 1 in llx_user FIX: missing trans FIX: notification module: for supplier orders (any of the 3 triggers), user can choose an e-mail template in conf, but the conf is not used when sending the notification (#28216) @@ -63,7 +63,7 @@ FIX: Special code is now transmitted by args only in order supplier (#28619) FIX: subscription must be editable when accounting isn't reconciled (#28469) FIX: Translation for select (#28677) FIX: upload odt files should not start/end with space -FIX: Value of field int = 0 from modulebuilder must nto be set to null +FIX: Value of field int = 0 from modulebuilder must not be set to null FIX: Wrong currency shown in TakePOS payment page FIX: #yogosha21416 From 884cc5bd554a76a8c65a82c552bf09e803320e9f Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 12:18:06 +0100 Subject: [PATCH 31/75] Fix: Initilialise $out to fix PhanUndeclaredVariableAssignOp --- htdocs/comm/mailing/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index d0efa85599e..9c512bfc047 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -1491,6 +1491,7 @@ if ($action == 'create') { print ''; // List of files $listofpaths = dol_dir_list($upload_dir, 'all', 0, '', '', 'name', SORT_ASC, 0); + $out = ''; // TODO Trick to have param removedfile containing nb of image to delete. But this does not works without javascript $out .= ''."\n"; From ef6b5940015bd2454e134ef166d6ace95f331e96 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 12:19:28 +0100 Subject: [PATCH 32/75] Fix: Initilialise $amount_ttc_diff to fix PhanUndeclaredVariableAssignOp --- htdocs/compta/facture/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 7296c3dd820..86898548291 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1573,6 +1573,7 @@ if (empty($reshook)) { $TTotalByTva[$line->tva_tx] += $line->total_ttc; } + $amount_ttc_diff = 0.; foreach ($TTotalByTva as $tva => &$total) { $coef = $total / $srcobject->total_ttc; // Calc coef $am = $amount * $coef; From 935f788774e8ae385f063768720773db1669c1b3 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 12:20:44 +0100 Subject: [PATCH 33/75] Fix: Initilialise $total_ttc to fix PhanUndeclaredVariableAssignOp --- htdocs/compta/paiement_vat.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/paiement_vat.php b/htdocs/compta/paiement_vat.php index af4e1463ae3..ecb946e6686 100644 --- a/htdocs/compta/paiement_vat.php +++ b/htdocs/compta/paiement_vat.php @@ -253,6 +253,7 @@ if ($action == 'create') { $total = 0; $totalrecu = 0; + $total_ttc = 0.; while ($i < $num) { $objp = $tva; From 707e0dbd8769047b1becc03a0843d879f03b91aa Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 12:21:45 +0100 Subject: [PATCH 34/75] Fix: Update initial assing to $sql to fix PhanUndeclaredVariableAssignOp --- htdocs/core/actions_extrafields.inc.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index affca98a90d..61b31bfb5fd 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -172,19 +172,19 @@ if ($action == 'add') { //In sellist we have only one line and it can have come to do SQL expression if ($type == 'sellist' || $type == 'chkbxlst') { foreach ($parameters_array as $param_ligne) { - $params['options'] = array($parameters=>null); + $params['options'] = array($parameters => null); } } else { // Else it's separated key/value and coma list foreach ($parameters_array as $param_ligne) { - if (strpos($param_ligne, ',')!==false) { + if (strpos($param_ligne, ',') !== false) { list($key, $value) = explode(',', $param_ligne); if (!array_key_exists('options', $params)) { $params['options'] = array(); } } else { - $key=$param_ligne; - $value=null; + $key = $param_ligne; + $value = null; } $params['options'][$key] = $value; } @@ -345,7 +345,7 @@ if ($action == 'update') { //In sellist we have only one line and it can have come to do SQL expression if ($type == 'sellist' || $type == 'chkbxlst') { foreach ($parameters_array as $param_ligne) { - $params['options'] = array($parameters=>null); + $params['options'] = array($parameters => null); } } else { //Else it's separated key/value and coma list @@ -447,7 +447,7 @@ if ($action == 'encrypt') { if ($extrafields->attributes[$elementtype]['entityid'][$attributekey] == $conf->entity || empty($extrafields->attributes[$elementtype]['entityid'][$attributekey])) { dol_syslog("Loop on each extafields of table ".$arrayofelement['table_element']); - $sql .= "SELECT te.rowid, te.".$attributekey; + $sql = "SELECT te.rowid, te.".$attributekey; $sql .= " FROM ".MAIN_DB_PREFIX.$arrayofelement['table_element']." as t, ".MAIN_DB_PREFIX.$arrayofelement['table_element'].'_extrafields as te'; $sql .= " WHERE te.fk_object = t.rowid"; $sql .= " AND te.".$attributekey." NOT LIKE 'dolcrypt:%'"; @@ -462,7 +462,7 @@ if ($action == 'encrypt') { $resql = $db->query($sql); if ($resql) { $num_rows = $db->num_rows($resql); - $i=0; + $i = 0; while ($i < $num_rows) { $objtmp = $db->fetch_object($resql); $id = $objtmp->rowid; From cf952d3fdeebb9527024e515bbc59df013e06405 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 12:23:37 +0100 Subject: [PATCH 35/75] Fix: Initialise $fieldtocount to fix PhanUndeclaredVariableAssignOp --- htdocs/core/customreports.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 9498ed91d9c..d6e4f788500 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -390,6 +390,7 @@ if ($action == 'viewgraph') { // Get all possible values of fields when a 'group by' is set, and save this into $arrayofvaluesforgroupby // $arrayofvaluesforgroupby will be used to forge lael of each grouped series if (is_array($search_groupby) && count($search_groupby)) { + $fieldtocount = ''; foreach ($search_groupby as $gkey => $gval) { $gvalwithoutprefix = preg_replace('/^[a-z]+\./', '', $gval); From 0b16a0618e1e60ca271f2f1e0cc75a83fb8f3b7f Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 12:56:59 +0100 Subject: [PATCH 36/75] Fix: Initialise $logouthtmltext to fix PhanUndeclaredVariableAssignOp --- htdocs/core/get_info.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/get_info.php b/htdocs/core/get_info.php index 28434f7d405..a8828f8c456 100644 --- a/htdocs/core/get_info.php +++ b/htdocs/core/get_info.php @@ -88,6 +88,7 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL')) { } $logouttext = ''; +$logouthtmltext = ''; if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { //$logouthtmltext=$appli.'
'; if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http') { From a34798c8328072b1af076f88b11a6378cfe708dd Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 12:57:50 +0100 Subject: [PATCH 37/75] Fix: Initialise $toprightmenu to fix PhanUndeclaredVariableAssignOp --- htdocs/core/get_info.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/get_info.php b/htdocs/core/get_info.php index a8828f8c456..2b5fc8f69d4 100644 --- a/htdocs/core/get_info.php +++ b/htdocs/core/get_info.php @@ -89,6 +89,7 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL')) { $logouttext = ''; $logouthtmltext = ''; +$toprightmenu = ''; if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { //$logouthtmltext=$appli.'
'; if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http') { From bee172c4b762bde8dd4e876026d41c71a5c72d0f Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 13:00:51 +0100 Subject: [PATCH 38/75] Fix: Initialise $x to fix PhanUndeclaredVariableAssignOp & optimize --- htdocs/core/lib/functions2.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index cfe406a7684..36cb26e4b6d 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1589,8 +1589,9 @@ function check_value($mask, $value) function binhex($bin, $pad = false, $upper = false) { $last = dol_strlen($bin) - 1; + $x = 0; for ($i = 0; $i <= $last; $i++) { - $x += $bin[$last - $i] * pow(2, $i); + $x += ($bin[$last - $i] ? 1 : 0) << $i; } $x = dechex($x); if ($pad) { From 83f2282517d46bfce976c55fd8390e75b4c6ec0b Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 13:04:36 +0100 Subject: [PATCH 39/75] Fix: Initialise $bookmarkList to fix PhanUndeclaredVariableAssignOp --- htdocs/core/multicompany_page.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/multicompany_page.php b/htdocs/core/multicompany_page.php index 864dd76cc3d..9286e3efaaa 100644 --- a/htdocs/core/multicompany_page.php +++ b/htdocs/core/multicompany_page.php @@ -91,7 +91,9 @@ print ''."\n"; print '
'; //print '
'; - +if (!isset($bookmarkList)) { + $bookmarkList = ''; +} if (!isModEnabled('multicompany')) { $langs->load("admin"); $bookmarkList .= '
'.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("MultiCompany")).''; @@ -128,7 +130,7 @@ if (!isModEnabled('multicompany')) { // Execute hook printBookmarks - $parameters = array('multicompany'=>$multicompanyList); + $parameters = array('multicompany' => $multicompanyList); $reshook = $hookmanager->executeHooks('printMultiCompanyEntities', $parameters); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { $multicompanyList .= $hookmanager->resPrint; From a5d16b326b0e68b82fbd0651a15e5c00dbca5b64 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 13:06:35 +0100 Subject: [PATCH 40/75] Fix: Initialise $amount_ttc_diff to fix PhanUndeclaredVariableAssignOp --- htdocs/fourn/facture/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 97f21ccb533..db8b2f6c8e6 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1172,6 +1172,7 @@ if (empty($reshook)) { $TTotalByTva[$line->tva_tx] += $line->total_ttc; } + $amount_ttc_diff = 0.; foreach ($TTotalByTva as $tva => &$total) { $coef = $total / $srcobject->total_ttc; // Calc coef $am = $amount * $coef; From 3c49c976bfa4385df88b864deb48ad4ab9270d44 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 13:08:16 +0100 Subject: [PATCH 41/75] Fix: Initialise $moreforfilter to fix PhanUndeclaredVariableAssignOp --- htdocs/intracommreport/list.php | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php index 3611ae2c51e..132163b1f89 100644 --- a/htdocs/intracommreport/list.php +++ b/htdocs/intracommreport/list.php @@ -113,20 +113,20 @@ else $result=restrictedArea($user, 'produit|service', '', '', '', '', '', $objca // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'i.ref'=>"Ref", - 'pfi.ref_fourn'=>"RefSupplier", - 'i.label'=>"ProductLabel", - 'i.description'=>"Description", - "i.note"=>"Note", + 'i.ref' => "Ref", + 'pfi.ref_fourn' => "RefSupplier", + 'i.label' => "ProductLabel", + 'i.description' => "Description", + "i.note" => "Note", ); $isInEEC = isInEEC($mysoc); // Definition of fields for lists $arrayfields = array( - 'i.ref' => array('label'=>$langs->trans("Ref"), 'checked'=>1), - 'i.label' => array('label'=>$langs->trans("Label"), 'checked'=>1), - 'i.fk_product_type'=>array('label'=>$langs->trans("Type"), 'checked'=>0, 'enabled'=>(isModEnabled("product") && isModEnabled("service"))), + 'i.ref' => array('label' => $langs->trans("Ref"), 'checked' => 1), + 'i.label' => array('label' => $langs->trans("Label"), 'checked' => 1), + 'i.fk_product_type' => array('label' => $langs->trans("Type"), 'checked' => 0, 'enabled' => (isModEnabled("product") && isModEnabled("service"))), ); /* @@ -360,7 +360,7 @@ $param .= $hookmanager->resPrint; // List of mass actions available $arrayofmassactions = array( - 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + 'generate_doc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), //'builddoc'=>$langs->trans("PDFMerge"), //'presend'=>$langs->trans("SendByMail"), ); @@ -415,6 +415,9 @@ if ($search_all) { $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +if (!isset($moreforfilter)) { + $moreforfilter = ''; +} if (empty($reshook)) { $moreforfilter .= $hookmanager->resPrint; } else { @@ -470,7 +473,7 @@ if (!empty($arrayfields['customerorsupplier']['checked'])) { if (!empty($arrayfields['i.fk_product_type']['checked'])) { print ''; - $array = array('-1'=>' ', '0'=>$langs->trans('Product'), '1'=>$langs->trans('Service')); + $array = array('-1' => ' ', '0' => $langs->trans('Product'), '1' => $langs->trans('Service')); print $form->selectarray('search_type', $array, $search_type); print ''; } @@ -480,7 +483,7 @@ if (!empty($arrayfields['i.fk_product_type']['checked'])) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; */ // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -532,7 +535,7 @@ if (!empty($arrayfields['i.fk_product_type']['checked'])) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; */ // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['i.datec']['checked'])) { From f99f86284382704eed058b2e94e63c83ee08dccc Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 13:10:27 +0100 Subject: [PATCH 42/75] Fix: Initialise $choixdate to fix PhanUndeclaredVariableAssignOp + minor optimisation --- htdocs/opensurvey/wizard/choix_date.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/opensurvey/wizard/choix_date.php b/htdocs/opensurvey/wizard/choix_date.php index 3eca1f0e68f..ff15655c5ff 100644 --- a/htdocs/opensurvey/wizard/choix_date.php +++ b/htdocs/opensurvey/wizard/choix_date.php @@ -38,6 +38,7 @@ $_SESSION["formatsondage"] = "D"; $erreur = false; $erreurNbchoice = 0; +$choixdate = ''; /* * Actions @@ -178,7 +179,7 @@ if (GETPOST('confirmation')) { // Add survey into database if (!$erreur && $erreurNb == 0) { - $_SESSION["toutchoix"] = substr("$choixdate", 1); + $_SESSION["toutchoix"] = substr($choixdate, 1); unset($_SESSION["nbrecaseshoraires"]); ajouter_sondage(); From ad96eb00a8a2d9a5371b641a68150b678b334c5b Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 13:12:11 +0100 Subject: [PATCH 43/75] Fix: Initialise $textlate to fix PhanUndeclaredVariableAssignOp --- htdocs/partnership/partnership_list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 327b8e7988e..ccbda2e2e62 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -862,6 +862,7 @@ $savnbfield = $totalarray['nbfield']; $totalarray = array(); $totalarray['nbfield'] = 0; $imaxinloop = ($limit ? min($num, $limit) : $num); +$textlate = ''; while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); if (empty($obj)) { From d2568a0878922e46299a025af531fc2d4a8ddd4e Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 12:25:09 +0100 Subject: [PATCH 44/75] Qual: Enable PhanUndeclaredVariableAssignOp --- dev/tools/phan/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 1d8a2f6f467..21d410a9665 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -497,7 +497,7 @@ return [ // 'PhanTypeMismatchDimAssignment', // 'PhanPluginDescriptionlessCommentOnProtectedMethod', // 'PhanPluginPrintfIncompatibleArgumentTypeWeak', - 'PhanUndeclaredVariableAssignOp', + // 'PhanUndeclaredVariableAssignOp', // 'PhanTypeExpectedObjectOrClassName', 'PhanEmptyFQSENInClasslike', // 'PhanTypeMismatchArgumentInternalReal', From 3d61fbf4f2b47b574d00802b5e9a569947fe922b Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 13:14:08 +0100 Subject: [PATCH 45/75] Fix: Initialise $errmsg to fix PhanUndeclaredVariableAssignOp --- htdocs/public/project/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 7d5df469aac..60c91239254 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -59,6 +59,7 @@ $langs->loadLangs(array("other", "dict", "bills", "companies", "errors", "paybox // Security check // No check on module enabled. Done later according to $validpaymentmethod +$errmsg = ''; $action = GETPOST('action', 'aZ09'); $id = GETPOSTINT('id'); $securekeyreceived = GETPOST("securekey", 'alpha'); From 449cb7758df8ccd89fed99c2262792577307c149 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 13:14:47 +0100 Subject: [PATCH 46/75] Fix: Initialise $errmsg to fix PhanUndeclaredVariableAssignOp --- htdocs/public/project/viewandvote.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index c436a2ead90..90b56165cc2 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -66,6 +66,7 @@ $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", // Security check // No check on module enabled. Done later according to $validpaymentmethod +$errmsg = ''; $action = GETPOST('action', 'aZ09'); $id = GETPOST('id'); $securekeyreceived = GETPOST("securekey"); @@ -172,7 +173,7 @@ if (strlen($idvote)) { // Has not already voted $conforbooth = new ActionComm($db); $resultconforbooth = $conforbooth->fetch($idvote); - if ($resultconforbooth<=0) { + if ($resultconforbooth <= 0) { $error++; $errmsg .= $conforbooth->error; } else { @@ -188,11 +189,11 @@ if (strlen($idvote)) { } } } - if ($votestatus=="ok") { + if ($votestatus == "ok") { setEventMessage($langs->trans("VoteOk"), 'mesgs'); - } elseif ($votestatus=="ko") { + } elseif ($votestatus == "ko") { setEventMessage($langs->trans("AlreadyVoted"), 'warnings'); - } elseif ($votestatus=="err") { + } elseif ($votestatus == "err") { setEventMessage($langs->trans("VoteError"), 'warnings'); } header("Refresh:0;url=".dol_buildpath('/public/project/viewandvote.php?id='.$id.'&securekey=', 1).$securekeyreceived); From bb7eda434231def4a18719c4bf48c35483f4bfea Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 13:16:35 +0100 Subject: [PATCH 47/75] Fix: Initialise $moreforfilter to fix PhanUndeclaredVariableAssignOp Also fix a few PhanUndeclaredGlobalVariable notifications. --- htdocs/public/test/test_arrays.php | 59 ++++++++++++++++-------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php index 71639adc51b..838052dac5b 100644 --- a/htdocs/public/test/test_arrays.php +++ b/htdocs/public/test/test_arrays.php @@ -68,27 +68,27 @@ if (empty($usedolheader)) { use_javascript_ajax)) { include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; } @@ -201,10 +204,10 @@ if ($filtert) { if ($socid) { $nav .= ''; } -if ($showbirthday) { +if (isset($showbirthday) && $showbirthday) { $nav .= ''; } -if ($pid) { +if (isset($pid) && $pid) { $nav .= ''; } if ($type) { @@ -213,7 +216,7 @@ if ($type) { if ($usergroup) { $nav .= ''; } -$nav .= $form->selectDate($dateselect, 'dateselect', 0, 0, 1, '', 1, 0); +$nav .= $form->selectDate($dateselect ?? '', 'dateselect', 0, 0, 1, '', 1, 0); $nav .= ' '; $nav .= ''; @@ -222,25 +225,25 @@ print_barre_liste('Title of my list', 12, $_SERVER["PHP_SELF"], '', '', '', 'Tex $moreforfilter .= '
'; $moreforfilter .= $langs->trans('This is a select list for a filter A (no combo forced)').': '; -$cate_arbo = array('field1'=>'value1a into the select list A', 'field2'=>'value2a'); +$cate_arbo = array('field1' => 'value1a into the select list A', 'field2' => 'value2a'); $moreforfilter .= $form->selectarray('search_aaa', $cate_arbo, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidth300', 0); // List with no js combo $moreforfilter .= '
'; $moreforfilter .= '
'; $moreforfilter .= $langs->trans('This is a select list for a filter B (auto combo)').': '; -$cate_arbo = array('field1'=>'value1b into the select list B', 'field2'=>'value2b'); +$cate_arbo = array('field1' => 'value1b into the select list B', 'field2' => 'value2b'); $moreforfilter .= $form->selectarray('search_bbb', $cate_arbo, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidth300', -1); // List with js combo auto $moreforfilter .= '
'; $moreforfilter .= '
'; $moreforfilter .= $langs->trans('This is a select list for a filter C (combo forced)').': '; -$cate_arbo = array('field1'=>'value1c into the select list C', 'field2'=>'value2c'); +$cate_arbo = array('field1' => 'value1c into the select list C', 'field2' => 'value2c'); $moreforfilter .= $form->selectarray('search_ccc', $cate_arbo, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidth300', 1); // List with js combo forced $moreforfilter .= '
'; $moreforfilter .= '
'; $moreforfilter .= $langs->trans('This is a select list for a filter D (combo forced)').': '; -$cate_arbo = array('field1'=>'value1d into the select list D', 'field2'=>'value2d'); +$cate_arbo = array('field1' => 'value1d into the select list D', 'field2' => 'value2d'); $moreforfilter .= $form->selectarray('search_ddd', $cate_arbo, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidth300', 1); // List with js combo forced $moreforfilter .= '
'; @@ -328,7 +331,7 @@ $(document).ready(function(){ use_javascript_ajax)) { include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; } From 114f5abd79475bb1be5136ff68330a970e39edb6 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 13:17:17 +0100 Subject: [PATCH 48/75] Fix: Initialise $total_ttc to fix PhanUndeclaredVariableAssignOp --- htdocs/salaries/paiement_salary.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php index 6e5b19c857e..5f3165ed14b 100644 --- a/htdocs/salaries/paiement_salary.php +++ b/htdocs/salaries/paiement_salary.php @@ -264,6 +264,7 @@ if ($action == 'create') { print "\n"; $total = 0; + $total_ttc = 0.; $totalrecu = 0; while ($i < $num) { From 751992b030037374f8e4541539e1cdb203a12dfa Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 13:20:16 +0100 Subject: [PATCH 49/75] Fix: Initialise $quantityToBeDelivered,$htmlforlines to fix PhanUndeclaredVariableAssignOp --- htdocs/takepos/invoice.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index a1d1f03cb54..f9d7e96cb4f 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -567,6 +567,7 @@ if (empty($reshook)) { echo ""; if ($nbofsuggested > 0) { + $quantityToBeDelivered = 0; echo "
".$langs->trans("SearchIntoBatch").": $nbofsuggested

"; foreach ($prod->stock_warehouse[getDolGlobalString($constantforkey)]->detail_batch as $dbatch) { // $dbatch is instance of Productbatch $batchStock = + $dbatch->qty; // To get a numeric @@ -1604,6 +1605,7 @@ if (!empty($_SESSION["basiclayout"]) && $_SESSION["basiclayout"] == 1) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $categorie = new Categorie($db); $categories = $categorie->get_full_arbo('product'); + $htmlforlines = ''; foreach ($categories as $row) { if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { $htmlforlines .= '
Date: Mon, 18 Mar 2024 13:54:05 +0100 Subject: [PATCH 50/75] Fix PhanPossiblyUndeclaredGlobalVariable and PhanPossiblyUndeclaredGlobalVariable --- htdocs/compta/prelevement/factures.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 1fe40efa05e..d100cf59961 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -274,10 +274,10 @@ if ($resql) { $num = $db->num_rows($resql); $i = 0; + $param = "&id=".$id; if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.((int) $limit); } - $param = "&id=".urlencode((string) ($id)); // Lines of title fields print '
'; @@ -325,10 +325,14 @@ if ($resql) { while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); - if ($salaryBonPl) { + $itemurl = ''; + $partyurl = ''; + if ($salaryBonPl && ($salarytmp instanceof Salary) && ($user instanceof User)) { $salarytmp->fetch($obj->salaryid); $usertmp->fetch($obj->userid); - } else { + $itemurl = $salarytmp->getNomUrl(1); + $partyurl = $usertmp->getNomUrl(1); + } elseif ($invoicetmp instanceof Facture && $invoicetmpsupplier instanceof FactureFournisseur) { if ($obj->type == 'bank-transfer') { $invoicetmp = $invoicetmpsupplier; } else { @@ -337,22 +341,24 @@ if ($resql) { $invoicetmp->fetch($obj->facid); $thirdpartytmp->fetch($obj->socid); + $itemurl = $invoicetmp->getNomUrl(1); + $partyurl = $thirdpartytmp->getNomUrl(1); } print '
'; print '\n"; - if ($object->type == 'bank-transfer' && !$salaryBonPl) { + if ($object->type == 'bank-transfer' && !$salaryBonPl && $invoicetmp instanceof Facture) { print '\n"; } print '\n"; // Amount of invoice From c5b62a4a73631999e7183273266aa43345861815 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 Mar 2024 13:55:03 +0100 Subject: [PATCH 51/75] Add typing to fix PhanTypeMismatchDimFetch --- htdocs/compta/prelevement/class/bonprelevement.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 2cc21fb215d..e3a3eb07439 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -83,6 +83,9 @@ class BonPrelevement extends CommonObject public $factures = array(); + /** + * @var array + */ public $methodes_trans = array(); public $invoice_in_error = array(); @@ -171,6 +174,9 @@ class BonPrelevement extends CommonObject public $credite; public $note; public $date_trans; + /** + * @var int Current transport method, index to $methodes_trans + */ public $method_trans; public $fk_user_trans; public $date_credit; From 9913778da0cd573c2f95718c4cb7a8370503918a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 18 Mar 2024 14:04:51 +0100 Subject: [PATCH 52/75] fix migration for postgresql 19.0.0 -> 20.0.0 --- htdocs/install/mysql/migration/19.0.0-20.0.0.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql index cbbb6d34cdc..170f02a9ec1 100644 --- a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql +++ b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql @@ -227,8 +227,10 @@ ALTER TABLE llx_product ADD COLUMN last_main_doc varchar(255); ALTER TABLE llx_knowledgemanagement_knowledgerecord MODIFY COLUMN answer longtext; -ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME llx_receptiondet_batch_extrafields; -ALTER TABLE llx_commande_fournisseur_dispatch RENAME llx_receptiondet_batch; +-- VMYSQL4.3 ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME llx_receptiondet_batch_extrafields; +-- VMYSQL4.3 ALTER TABLE llx_commande_fournisseur_dispatch RENAME llx_receptiondet_batch; +-- VPGSQL8.2 ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME TO llx_receptiondet_batch_extrafields; +-- VPGSQL8.2 ALTER TABLE llx_commande_fournisseur_dispatch RENAME TO llx_receptiondet_batch; -- Rename const to add customer categories on not customer/prospect third-party if enabled UPDATE llx_const SET name = 'THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT' WHERE name = 'THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER'; From 1783d68fd4aa9542a4a58006c642287d2021e23d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 18 Mar 2024 14:10:55 +0100 Subject: [PATCH 53/75] Update pgsql.class.php --- htdocs/core/db/pgsql.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index a76fbfb6857..ecb9b0f0df9 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -724,7 +724,7 @@ class DoliDBPgsql extends DoliDB */ public function escape($stringtoencode) { - return pg_escape_string($stringtoencode); + return pg_escape_string($this->db, $stringtoencode); } /** From 6640354e79ad6b2b3abed9f16daa50136b1ee84b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 14:32:59 +0100 Subject: [PATCH 54/75] Move to use the english key name ofmodule --- htdocs/admin/workflow.php | 2 +- htdocs/core/lib/functions.lib.php | 6 ++-- htdocs/core/menus/init_menu_auguria.sql | 38 ++++++++++++------------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 648f7706ad9..d68b7c054ef 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -158,7 +158,7 @@ $workflowcodes = array( 'WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE' => array( 'family' => 'classify_shipping', 'position' => 90, - 'enabled' => isModEnabled("expedition") && isModEnabled("facture"), + 'enabled' => isModEnabled("shipping") && isModEnabled("invoice"), 'picto' => 'shipment', 'deprecated' => 1 ), diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7554f5e5851..bb5abcf9f4c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -11765,9 +11765,9 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st * @param string $actionType 'default', 'danger', 'email', 'clone', 'cancel', 'delete', ... * @param string|array $url Url for link or array of subbutton description ('label'=>, 'url'=>, 'lang'=>, 'perm'=> ) * Example when an array is used: $arrayforbutaction = array( - * 10 => array('lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - * 20 => array('lang'=>'orders', 'enabled'=>isModEnabled("commande"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - * 30 => array('lang'=>'bills', 'enabled'=>isModEnabled("facture"), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + * 10 => array('lang'=>'propal', 'enabled'=>isModEnabled("proposal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + * 20 => array('lang'=>'orders', 'enabled'=>isModEnabled("order"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + * 30 => array('lang'=>'bills', 'enabled'=>isModEnabled("invoice"), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), * ); * @param string $id Attribute id of action button. Example 'action-delete'. This can be used for full ajax confirm if this code is reused into the ->formconfirm() method. * @param int|boolean $userRight User action right diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index e661fb3db4c..d177030b841 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -18,7 +18,7 @@ insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, left insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 16__+MAX_llx_menu__, 'bom|mrp', 'isModEnabled("bom") || isModEnabled("mrp")', __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&leftmenu=', 'TMenuMRP', -1, 'mrp', '$user->hasRight("bom","read") || $user->hasRight("mrp","read")', '', 0, 31, __ENTITY__, ''); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 7__+MAX_llx_menu__, 'projet', 'isModEnabled("project")', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->hasRight("projet","lire")', '', 2, 32, __ENTITY__, ''); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 5__+MAX_llx_menu__, 'propal|commande|fournisseur|supplier_order|supplier_invoice|contrat|ficheinter', 'isModEnabled("propal") || isModEnabled("commande") || isModEnabled("supplier_order") || isModEnabled("contrat") || isModEnabled("ficheinter")', __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->hasRight("societe","lire") || $user->hasRight("societe","contact","lire")', '', 2, 40, __ENTITY__, ''); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("facture") || isModEnabled("don") || isModEnabled("tax") || isModEnabled("salaries") || isModEnabled("supplier_invoice") || isModEnabled("loan") || isModEnabled("banque")', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->hasRight("facture","lire") || $user->hasRight("don","lire") || $user->hasRight("tax","charges","lire") || $user->hasRight("salaries","read") || $user->hasRight("loan","read") || $user->hasRight("banque","lire") || $user->hasRight("fournisseur","facture","lire") || $user->hasRight("supplier_invoice","read")', '', 2, 50, __ENTITY__, ''); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("invoice") || isModEnabled("don") || isModEnabled("tax") || isModEnabled("salaries") || isModEnabled("supplier_invoice") || isModEnabled("loan") || isModEnabled("banque")', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->hasRight("facture","lire") || $user->hasRight("don","lire") || $user->hasRight("tax","charges","lire") || $user->hasRight("salaries","read") || $user->hasRight("loan","read") || $user->hasRight("banque","lire") || $user->hasRight("fournisseur","facture","lire") || $user->hasRight("supplier_invoice","read")', '', 2, 50, __ENTITY__, ''); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 14__+MAX_llx_menu__, 'banque|prelevement', 'isModEnabled("banque") || isModEnabled("prelevement")', __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->hasRight("banque","lire") || $user->hasRight("prelevement","bons","lire")', '', 0, 52, __ENTITY__, ''); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 9__+MAX_llx_menu__, 'comptabilite|accounting|asset', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("asset")', __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', -1, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","mouvements","lire") || $user->hasRight("asset","read")', '', 2, 54, __ENTITY__, ''); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 8__+MAX_llx_menu__, '', '', __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '', '', 2, 90, __ENTITY__, ''); @@ -231,23 +231,23 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_invoice")', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&leftmenu=customers_bills_stats&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__); -- Billing - Customer invoice -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'billing', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/card.php?mainmenu=billing&action=create&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1705__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', 'List', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'billing', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/card.php?mainmenu=billing&action=create&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1705__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', 'List', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1720__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_draft&search_status=0', 'BillShortStatusDraft', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1721__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_notpaid&search_status=1', 'BillShortStatusNotPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1722__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_paid&search_status=2', 'BillShortStatusPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1723__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_canceled&search_status=3', 'BillShortStatusCanceled', 2, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1720__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_draft&search_status=0', 'BillShortStatusDraft', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1721__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_notpaid&search_status=1', 'BillShortStatusNotPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1722__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_paid&search_status=2', 'BillShortStatusPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1723__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_canceled&search_status=3', 'BillShortStatusCanceled', 2, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/invoicetemplate_list.php?mainmenu=billing&leftmenu=customers_bills', 'ListOfTemplates', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/invoicetemplate_list.php?mainmenu=billing&leftmenu=customers_bills', 'ListOfTemplates', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'billing', 'customers_bills_payment', 1700__+MAX_llx_menu__, '/compta/paiement/list.php?mainmenu=billing&leftmenu=customers_bills_payment', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'billing', 'customers_bills_reports', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?mainmenu=billing&leftmenu=customers_bills_reports', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&leftmenu=customers_bills_stats', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'billing', 'customers_bills_payment', 1700__+MAX_llx_menu__, '/compta/paiement/list.php?mainmenu=billing&leftmenu=customers_bills_payment', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'billing', 'customers_bills_reports', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?mainmenu=billing&leftmenu=customers_bills_reports', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&leftmenu=customers_bills_stats', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __ENTITY__); -- Billing - Orders to bill -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande")', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'billing', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?mainmenu=billing&leftmenu=orders&search_status=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("order")', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'billing', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?mainmenu=billing&leftmenu=orders&search_status=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__); -- Donations insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("don")', __HANDLER__, 'left', 2000__+MAX_llx_menu__, 'billing', 'donations', 6__+MAX_llx_menu__, '/don/index.php?mainmenu=billing&leftmenu=donations', 'Donations', 0, 'donations', '$user->rights->don->lire', '', 2, 4, __ENTITY__); @@ -316,9 +316,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2450__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_period', 2451__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'FiscalPeriod', 1, 'admin', '', '', 2, 80, __ENTITY__); -- Binding -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("facture") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("facture") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("facture") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)', __HANDLER__, 'left', 2410__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_supplier', 2400__+MAX_llx_menu__, '/accountancy/supplier/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier', 'SuppliersVentilation', 1, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES) && $leftmenu=="accountancy_dispatch_supplier"', __HANDLER__, 'left', 2411__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES) && $leftmenu=="accountancy_dispatch_supplier"', __HANDLER__, 'left', 2412__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 7, __ENTITY__); @@ -379,9 +379,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("asset") && $leftmenu=="asset"', __HANDLER__, 'left', 3006__+MAX_llx_menu__, 'asset', '', 3004__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy', 'MenuListTypeAssets', 3, 'assets', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->hasRight("asset","model_advance","read"):$user->hasRight("asset","read"))', '', 0, 25, __ENTITY__); -- Check deposit -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1711__+MAX_llx_menu__, 'accountancy', 'checks', 14__+MAX_llx_menu__, '/compta/paiement/cheque/index.php?mainmenu=bank&leftmenu=checks', 'MenuChequeDeposits', 0, 'bills', '$user->hasRight("banque","lire")', '', 2, 9, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1712__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/card.php?mainmenu=bank&leftmenu=checks&action=new', 'NewCheckDeposit', 1, 'compta', '$user->hasRight("banque","lire")', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1713__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/list.php?mainmenu=bank&leftmenu=checks', 'List', 1, 'bills', '$user->hasRight("banque","lire")', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("bank") && (isModEnabled("invoice") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1711__+MAX_llx_menu__, 'accountancy', 'checks', 14__+MAX_llx_menu__, '/compta/paiement/cheque/index.php?mainmenu=bank&leftmenu=checks', 'MenuChequeDeposits', 0, 'bills', '$user->hasRight("banque","lire")', '', 2, 9, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("bank") && (isModEnabled("invoice") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1712__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/card.php?mainmenu=bank&leftmenu=checks&action=new', 'NewCheckDeposit', 1, 'compta', '$user->hasRight("banque","lire")', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("bank") && (isModEnabled("invoice") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1713__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/list.php?mainmenu=bank&leftmenu=checks', 'List', 1, 'bills', '$user->hasRight("banque","lire")', '', 2, 1, __ENTITY__); -- PaymentByDirectDebit insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement")', __HANDLER__, 'left', 2500__+MAX_llx_menu__, 'accountancy', 'withdraw', 14__+MAX_llx_menu__, '/compta/prelevement/index.php?mainmenu=bank&leftmenu=withdraw', 'PaymentByDirectDebit', 0, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 9, __ENTITY__); From 90882d46b2532beff42b1d87add039af46551dc8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 14:36:09 +0100 Subject: [PATCH 55/75] Update factures.php --- htdocs/compta/prelevement/factures.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index d100cf59961..1dc1fd3d76d 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -274,7 +274,7 @@ if ($resql) { $num = $db->num_rows($resql); $i = 0; - $param = "&id=".$id; + $param = "&id=".((int) $id); if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.((int) $limit); } From d73d27466bbd4a8592173d683f95fb861e8e63c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 14:40:47 +0100 Subject: [PATCH 56/75] Update 19.0.0-20.0.0.sql --- htdocs/install/mysql/migration/19.0.0-20.0.0.sql | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql index 170f02a9ec1..acd230f65cb 100644 --- a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql +++ b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql @@ -5,7 +5,7 @@ -- -- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y -- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y --- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; +-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; -- Note that "RENAME TO" is both compatible mysql/postgesql, not "RENAME" alone. -- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol; -- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60); -- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname; @@ -227,10 +227,8 @@ ALTER TABLE llx_product ADD COLUMN last_main_doc varchar(255); ALTER TABLE llx_knowledgemanagement_knowledgerecord MODIFY COLUMN answer longtext; --- VMYSQL4.3 ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME llx_receptiondet_batch_extrafields; --- VMYSQL4.3 ALTER TABLE llx_commande_fournisseur_dispatch RENAME llx_receptiondet_batch; --- VPGSQL8.2 ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME TO llx_receptiondet_batch_extrafields; --- VPGSQL8.2 ALTER TABLE llx_commande_fournisseur_dispatch RENAME TO llx_receptiondet_batch; +ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME TO llx_receptiondet_batch_extrafields; +ALTER TABLE llx_commande_fournisseur_dispatch RENAME TO llx_receptiondet_batch; -- Rename const to add customer categories on not customer/prospect third-party if enabled UPDATE llx_const SET name = 'THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT' WHERE name = 'THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER'; From 034ce8cb98ac13c01f8fb35eba62c5e37e8626fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 14:44:18 +0100 Subject: [PATCH 57/75] Fix trans key code --- htdocs/core/lib/emaillayout.lib.php | 4 ++-- htdocs/langs/en_US/mails.lang | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/emaillayout.lib.php b/htdocs/core/lib/emaillayout.lib.php index 9ae359f26df..75b7b589c44 100644 --- a/htdocs/core/lib/emaillayout.lib.php +++ b/htdocs/core/lib/emaillayout.lib.php @@ -43,10 +43,10 @@ function getHtmlOfLayout($name) } else { $out .= 'Gray rectangle'; } - $out .= ' + $out .= '

'.$langs->trans('TitleOfMailHolder').'

'; if (!(empty($user->signature))) { $out .= '

'.dol_htmlentities($user->signature).'

'; diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index 4160930b410..da25fc5a5f9 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -192,4 +192,4 @@ YouCanMakeSomeInstructionForEmail=You can make some instructions for your Email ModelTemplate=Email template YouCanChooseAModelForYouMailContent= You can choose one of template models or generate one with AI TitleOfMailHolder=Title of the e-mail goes here -ContentOfMailHOlder=Content of email goes here... \ No newline at end of file +ContentOfMailHolder=Content of email goes here... From 72d758e05455f94766dd936a4c5e94a29695811b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 14:56:54 +0100 Subject: [PATCH 58/75] Doc --- .../interface_99_modMyModule_MyModuleTriggers.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php index db9cb264f7b..c68c6a4f33e 100644 --- a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php +++ b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php @@ -139,7 +139,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'ORDER_DELETE': //case 'ORDER_CANCEL': //case 'ORDER_SENTBYMAIL': - //case 'ORDER_CLASSIFY_BILLED': + //case 'ORDER_CLASSIFY_BILLED': // TODO Replace it with ORDER_MODIFY + //case 'ORDER_CLASSIFY_UNBILLED': // TODO Replace it with ORDER_MODIFY //case 'ORDER_SETDRAFT': //case 'LINEORDER_INSERT': //case 'LINEORDER_UPDATE': @@ -151,6 +152,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'ORDER_SUPPLIER_VALIDATE': //case 'ORDER_SUPPLIER_DELETE': //case 'ORDER_SUPPLIER_APPROVE': + //case 'ORDER_SUPPLIER_CLASSIFY_BILLED': // TODO Replace with ORDER_SUPPLIER_MODIFY + //case 'ORDER_SUPPLIER_CLASSIFY_UNBILLED': // TODO Replace with ORDER_SUPPLIER_MODIFY //case 'ORDER_SUPPLIER_REFUSE': //case 'ORDER_SUPPLIER_CANCEL': //case 'ORDER_SUPPLIER_SENTBYMAIL': @@ -165,6 +168,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'PROPAL_MODIFY': //case 'PROPAL_VALIDATE': //case 'PROPAL_SENTBYMAIL': + //case 'PROPAL_CLASSIFY_BILLED': // TODO Replace it with PROPAL_MODIFY + //case 'PROPAL_CLASSIFY_UNBILLED': // TODO Replace it with PROPAL_MODIFY //case 'PROPAL_CLOSE_SIGNED': //case 'PROPAL_CLOSE_REFUSED': //case 'PROPAL_DELETE': @@ -240,6 +245,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'FICHINTER_CREATE': //case 'FICHINTER_MODIFY': //case 'FICHINTER_VALIDATE': + //case 'FICHINTER_CLASSIFY_BILLED': // TODO Replace it with FICHINTER_MODIFY + //case 'FICHINTER_CLASSIFY_UNBILLED': // TODO Replace it with FICHINTER_MODIFY //case 'FICHINTER_DELETE': //case 'LINEFICHINTER_CREATE': //case 'LINEFICHINTER_UPDATE': From b72b38f5d1b6fc29552e103aec60d4679f2caa9b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 15:03:41 +0100 Subject: [PATCH 59/75] Doc --- ...ace_99_modMyModule_MyModuleTriggers.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php index c68c6a4f33e..3ab08016799 100644 --- a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php +++ b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php @@ -139,8 +139,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'ORDER_DELETE': //case 'ORDER_CANCEL': //case 'ORDER_SENTBYMAIL': - //case 'ORDER_CLASSIFY_BILLED': // TODO Replace it with ORDER_MODIFY - //case 'ORDER_CLASSIFY_UNBILLED': // TODO Replace it with ORDER_MODIFY + //case 'ORDER_CLASSIFY_BILLED': // TODO Replace it with ORDER_BILLED + //case 'ORDER_CLASSIFY_UNBILLED': // TODO Replace it with ORDER_UNBILLED //case 'ORDER_SETDRAFT': //case 'LINEORDER_INSERT': //case 'LINEORDER_UPDATE': @@ -152,8 +152,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'ORDER_SUPPLIER_VALIDATE': //case 'ORDER_SUPPLIER_DELETE': //case 'ORDER_SUPPLIER_APPROVE': - //case 'ORDER_SUPPLIER_CLASSIFY_BILLED': // TODO Replace with ORDER_SUPPLIER_MODIFY - //case 'ORDER_SUPPLIER_CLASSIFY_UNBILLED': // TODO Replace with ORDER_SUPPLIER_MODIFY + //case 'ORDER_SUPPLIER_CLASSIFY_BILLED': // TODO Replace with ORDER_SUPPLIER_BILLED + //case 'ORDER_SUPPLIER_CLASSIFY_UNBILLED': // TODO Replace with ORDER_SUPPLIER_UNBILLED //case 'ORDER_SUPPLIER_REFUSE': //case 'ORDER_SUPPLIER_CANCEL': //case 'ORDER_SUPPLIER_SENTBYMAIL': @@ -168,8 +168,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'PROPAL_MODIFY': //case 'PROPAL_VALIDATE': //case 'PROPAL_SENTBYMAIL': - //case 'PROPAL_CLASSIFY_BILLED': // TODO Replace it with PROPAL_MODIFY - //case 'PROPAL_CLASSIFY_UNBILLED': // TODO Replace it with PROPAL_MODIFY + //case 'PROPAL_CLASSIFY_BILLED': // TODO Replace it with PROPAL_BILLED + //case 'PROPAL_CLASSIFY_UNBILLED': // TODO Replace it with PROPAL_UNBILLED //case 'PROPAL_CLOSE_SIGNED': //case 'PROPAL_CLOSE_REFUSED': //case 'PROPAL_DELETE': @@ -245,8 +245,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'FICHINTER_CREATE': //case 'FICHINTER_MODIFY': //case 'FICHINTER_VALIDATE': - //case 'FICHINTER_CLASSIFY_BILLED': // TODO Replace it with FICHINTER_MODIFY - //case 'FICHINTER_CLASSIFY_UNBILLED': // TODO Replace it with FICHINTER_MODIFY + //case 'FICHINTER_CLASSIFY_BILLED': // TODO Replace it with FICHINTER_BILLED + //case 'FICHINTER_CLASSIFY_UNBILLED': // TODO Replace it with FICHINTER_UNBILLED //case 'FICHINTER_DELETE': //case 'LINEFICHINTER_CREATE': //case 'LINEFICHINTER_UPDATE': From 20018163e29a67ccdad87c92171a11d23d872539 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 15:13:43 +0100 Subject: [PATCH 60/75] Fix restore declaration to avoid to many uncompatibility problems. --- htdocs/core/triggers/dolibarrtriggers.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/triggers/dolibarrtriggers.class.php b/htdocs/core/triggers/dolibarrtriggers.class.php index e1eb9be0c0c..fd3004a9c9d 100644 --- a/htdocs/core/triggers/dolibarrtriggers.class.php +++ b/htdocs/core/triggers/dolibarrtriggers.class.php @@ -186,5 +186,5 @@ abstract class DolibarrTriggers * @param conf $conf Object conf * @return int if KO: <0 || if no trigger ran: 0 || if OK: >0 */ - abstract public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf); + abstract public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf); } From f9346a8022c895900ad2a8784b17dce308a65aaf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 15:13:43 +0100 Subject: [PATCH 61/75] Fix restore declaration to avoid to many uncompatibility problems. --- htdocs/core/triggers/dolibarrtriggers.class.php | 2 +- htdocs/core/triggers/interface_20_all_Logevents.class.php | 2 +- .../triggers/interface_20_modWorkflow_WorkflowManager.class.php | 2 +- .../core/triggers/interface_50_modAgenda_ActionsAuto.class.php | 2 +- .../interface_50_modBlockedlog_ActionsBlockedLog.class.php | 2 +- ...nterface_50_modEventOrganization_EventOrganization.class.php | 2 +- htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php | 2 +- .../interface_50_modMailmanspip_Mailmanspipsynchro.class.php | 2 +- .../interface_50_modNotification_Notification.class.php | 2 +- .../core/triggers/interface_50_modTicket_TicketEmail.class.php | 2 +- htdocs/core/triggers/interface_80_modStripe_Stripe.class.php | 2 +- .../triggers/interface_90_modSociete_ContactRoles.class.php | 2 +- .../triggers/interface_95_modWebhook_WebhookTriggers.class.php | 2 +- .../triggers/interface_95_modZapier_ZapierTriggers.class.php | 2 +- .../interface_99_modMyModule_MyModuleTriggers.class.php | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/core/triggers/dolibarrtriggers.class.php b/htdocs/core/triggers/dolibarrtriggers.class.php index e1eb9be0c0c..fd3004a9c9d 100644 --- a/htdocs/core/triggers/dolibarrtriggers.class.php +++ b/htdocs/core/triggers/dolibarrtriggers.class.php @@ -186,5 +186,5 @@ abstract class DolibarrTriggers * @param conf $conf Object conf * @return int if KO: <0 || if no trigger ran: 0 || if OK: >0 */ - abstract public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf); + abstract public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf); } diff --git a/htdocs/core/triggers/interface_20_all_Logevents.class.php b/htdocs/core/triggers/interface_20_all_Logevents.class.php index 47432eeb75c..adc63815e33 100644 --- a/htdocs/core/triggers/interface_20_all_Logevents.class.php +++ b/htdocs/core/triggers/interface_20_all_Logevents.class.php @@ -88,7 +88,7 @@ class InterfaceLogevents extends DolibarrTriggers * @return int if KO: <0, if no trigger ran: 0, if OK: >0 * @throws Exception dol_syslog can throw Exceptions */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (getDolGlobalString('MAIN_LOGEVENTS_DISABLE_ALL')) { return 0; // Log events is disabled (hidden features) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 96da2886c32..1edea428b6f 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -62,7 +62,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->workflow) || empty($conf->workflow->enabled)) { return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 034a052ce0c..4d6a062e38b 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -77,7 +77,7 @@ class InterfaceActionsAuto extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (!isModEnabled('agenda')) { return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php index 68cfccb49d5..a27ee6b7d66 100644 --- a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php +++ b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php @@ -56,7 +56,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->blockedlog) || empty($conf->blockedlog->enabled)) { return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php b/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php index f54615a2aaf..445bbf4ac3c 100644 --- a/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php +++ b/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php @@ -69,7 +69,7 @@ class InterfaceEventOrganization extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->eventorganization) || empty($conf->eventorganization->enabled)) { return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php index 105739fa5de..1a92bca5b66 100644 --- a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php @@ -59,7 +59,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->ldap) || empty($conf->ldap->enabled)) { return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php index a73a0eb2eb4..5b746b971cb 100644 --- a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php @@ -57,7 +57,7 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->mailmanspip) || empty($conf->mailmanspip->enabled)) { return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index 602c3798c97..b9a009f7c0a 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -64,7 +64,7 @@ class InterfaceNotification extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { global $hookmanager; diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index b37bd6ced34..08a24e1fc63 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -59,7 +59,7 @@ class InterfaceTicketEmail extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { global $mysoc; diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php index 2d2b6db94c9..7178f29654c 100644 --- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php +++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php @@ -64,7 +64,7 @@ class InterfaceStripe extends DolibarrTriggers * @param Conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { // Put here code you want to execute when a Dolibarr business event occurs. // Data and type of action are stored into $object and $action diff --git a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php index 7c3047b03d3..6906157f6ef 100644 --- a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php +++ b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php @@ -65,7 +65,7 @@ class InterfaceContactRoles extends DolibarrTriggers * @param conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if ($action === 'PROPAL_CREATE' || $action === 'ORDER_CREATE' || $action === 'BILL_CREATE' || $action === 'ORDER_SUPPLIER_CREATE' || $action === 'BILL_SUPPLIER_CREATE' || $action === 'PROPOSAL_SUPPLIER_CREATE' diff --git a/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php b/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php index 70777a03ed4..c78c99fc304 100644 --- a/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php +++ b/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php @@ -65,7 +65,7 @@ class InterfaceWebhookTriggers extends DolibarrTriggers * @param Conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->webhook) || empty($conf->webhook->enabled)) { return 0; // If module is not enabled, we do nothing diff --git a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php index 701cfeec3fd..bfb4cf8ada3 100644 --- a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php +++ b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php @@ -58,7 +58,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers * @param Conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->zapier) || empty($conf->zapier->enabled)) { // Module not active, we do nothing diff --git a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php index 3ab08016799..32a980784e1 100644 --- a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php +++ b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php @@ -65,7 +65,7 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers * @param Conf $conf Object conf * @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK */ - public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (!isModEnabled('mymodule')) { return 0; // If module is not enabled, we do nothing From 57181e64070233881536f8a8ee2f0c72852a9d81 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 15:28:19 +0100 Subject: [PATCH 62/75] Typo --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index bb5abcf9f4c..9b0d6cfaab4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -11765,7 +11765,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st * @param string $actionType 'default', 'danger', 'email', 'clone', 'cancel', 'delete', ... * @param string|array $url Url for link or array of subbutton description ('label'=>, 'url'=>, 'lang'=>, 'perm'=> ) * Example when an array is used: $arrayforbutaction = array( - * 10 => array('lang'=>'propal', 'enabled'=>isModEnabled("proposal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + * 10 => array('lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), * 20 => array('lang'=>'orders', 'enabled'=>isModEnabled("order"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), * 30 => array('lang'=>'bills', 'enabled'=>isModEnabled("invoice"), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), * ); From 49bd37a72d37448602566dec1c206a792553f2d5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 16:02:33 +0100 Subject: [PATCH 63/75] Doc --- htdocs/admin/system/database-tables.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index e122150571b..defb52235b7 100644 --- a/htdocs/admin/system/database-tables.php +++ b/htdocs/admin/system/database-tables.php @@ -168,7 +168,8 @@ if (!$base) { print '
'; print ''; print ''; From fcff03c66d68d0486a80abc0d032b2eff4f75bc9 Mon Sep 17 00:00:00 2001 From: mrozniecki Date: Mon, 18 Mar 2024 16:10:39 +0100 Subject: [PATCH 64/75] Add substitution for mail intro and signature on ticket mail --- htdocs/core/class/html.formticket.class.php | 8 ++++++-- htdocs/ticket/card.php | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 4fa8ee3eac6..471cffd2a84 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1661,10 +1661,14 @@ class FormTicket $texttooltip .= '

'.$langs->trans("ForEmailMessageWillBeCompletedWith").'...'; } if (getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO')) { - $texttooltip .= '
'.$langs->trans("TicketMessageMailIntro").'
'.getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO'); + $mail_intro = make_substitutions(getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO'), $this->substit); + print ''; + $texttooltip .= '
'.$langs->trans("TicketMessageMailIntro").'
'.$mail_intro; } if (getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE')) { - $texttooltip .= '

'.$langs->trans("TicketMessageMailFooter").'
'.getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE'); + $mail_signature = make_substitutions(getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE'), $this->substit); + print ''; + $texttooltip .= '

'.$langs->trans("TicketMessageMailFooter").'
'.$mail_signature; } print $form->textwithpicto('', $texttooltip, 1, 'help'); } diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 037ec5c57c4..db416fb7742 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1536,6 +1536,7 @@ if ($action == 'create' || $action == 'presend') { $morehtmlright = ''; $help = ""; $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); $morehtmlright .= $form->textwithpicto(''.$langs->trans("TicketMessageSubstitutionReplacedByGenericValues").'', $help, 1, 'helpclickable', '', 0, 3, 'helpsubstitution'); print '
'; From a9cabe6fe4c5f89b78180b238a8b430199be6519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 18 Mar 2024 16:39:49 +0100 Subject: [PATCH 65/75] Update codespell-dict.txt --- dev/tools/codespell/codespell-dict.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tools/codespell/codespell-dict.txt b/dev/tools/codespell/codespell-dict.txt index f6d51c0b68d..047de65a4a8 100644 --- a/dev/tools/codespell/codespell-dict.txt +++ b/dev/tools/codespell/codespell-dict.txt @@ -9,6 +9,7 @@ aploha->alpha aplohanothtml->alphanohtml aplphanothtml->alphanohtml choosed->chosen +cumuled->cumulative dokument->document dolibar->dolibarr dolibarrr->dolibarr From 06ae1deb1b81147fb0f76acb9833ec1cb410d183 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 17:27:06 +0100 Subject: [PATCH 66/75] Fix better error message when using bad character_set_client --- htdocs/conf/conf.php.example | 7 +++---- htdocs/core/db/mysqli.class.php | 8 ++++++-- htdocs/website/index.php | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example index d0ca5f7142e..4d8c4f8fadd 100644 --- a/htdocs/conf/conf.php.example +++ b/htdocs/conf/conf.php.example @@ -130,8 +130,8 @@ $dolibarr_main_db_user=''; // dolibarr_main_db_pass // ===================== // This parameter contains password used to read and write into Dolibarr database. -// If content is 'crypted:...', the password is encrypted/decrypted with dol_encode/dol_decode. -// If content is 'dolcrypt:...', the password is encrypted/decrypted with dolEncrypt/dolDecrypt. +// If content is 'crypted:...', the password is encrypted/decrypted with dol_encode/dol_decode. +// If content is 'dolcrypt:...', the password is encrypted/decrypted with dolEncrypt/dolDecrypt. // // Examples: // $dolibarr_main_db_pass='myadminpass'; @@ -160,6 +160,7 @@ $dolibarr_main_db_type=''; // Default value: depends on database driver // Examples: // dolibarr_main_db_character_set='utf8'; +// dolibarr_main_db_character_set='utf8mb4'; // $dolibarr_main_db_character_set='utf8'; @@ -455,5 +456,3 @@ $dolibarr_cron_allow_cli='0'; //############################## // External modules //############################## - - diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 8024bb4aa5b..ff63113e47b 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -125,11 +125,15 @@ class DoliDBMysqli extends DoliDB dol_syslog(get_class($this)."::DoliDBMysqli You should set the \$dolibarr_main_db_character_set and \$dolibarr_main_db_collation for the PHP to the one of the database ".$this->db->character_set_name(), LOG_WARNING); $this->db->set_charset($clientmustbe); // This set charset, but with a bad collation } catch (Exception $e) { - print 'Failed to force character set to '.$clientmustbe." according to setup to match the one of the server database.
\n"; + print 'Failed to force character_set_client to '.$clientmustbe." (according to setup) to match the one of the server database.
\n"; print $e->getMessage(); print "
\n"; if ($clientmustbe != 'utf8') { - print 'Edit conf/conf.php file to set a charset "utf8" instead of "'.$clientmustbe.'".'."\n"; + print 'Edit conf/conf.php file to set a charset "utf8"'; + if ($clientmustbe != 'utf8mb4') { + print ' or "utf8mb4"'; + } + print ' instead of "'.$clientmustbe.'".'."\n"; } exit; } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 2b622531dac..d64888743cb 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -683,7 +683,7 @@ if ($action == 'adddir' && $permtouploadfile) } */ -// Add site +// Add a website if ($action == 'addsite' && $usercanedit) { $db->begin(); From 13f7012d401525d80317d484bdca362e402af6c2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 18:17:53 +0100 Subject: [PATCH 67/75] NEW Add maintenance tool to switch utf8 -> utf8mb4 --- htdocs/admin/system/database-tables.php | 42 +++++++---- htdocs/admin/system/dbtable.php | 94 +++++++++++++++++++++++-- htdocs/core/lib/functions.lib.php | 8 +-- 3 files changed, 120 insertions(+), 24 deletions(-) diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index defb52235b7..14121aebab8 100644 --- a/htdocs/admin/system/database-tables.php +++ b/htdocs/admin/system/database-tables.php @@ -39,6 +39,7 @@ if (!$user->admin) { accessforbidden(); } +$table = GETPOST('table', 'aZ09'); $action = GETPOST('action', 'aZ09'); @@ -46,16 +47,20 @@ $action = GETPOST('action', 'aZ09'); * Actions */ -if ($action == 'convert') { - $sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." ENGINE=INNODB"; +if ($action == 'convert') { // Convert engine into innodb + $sql = "ALTER TABLE ".$db->sanitize($table)." ENGINE=INNODB"; $db->query($sql); } if ($action == 'convertutf8') { - $sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." CHARACTER SET utf8 COLLATE utf8_unicode_ci"; + $sql = "ALTER TABLE ".$db->sanitize($table)." CHARACTER SET utf8 COLLATE utf8_unicode_ci"; + $db->query($sql); +} +if ($action == 'convertutf8mb4') { + $sql = "ALTER TABLE ".$db->sanitize($table)." CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"; $db->query($sql); } if ($action == 'convertdynamic') { - $sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." ROW_FORMAT=DYNAMIC;"; + $sql = "ALTER TABLE ".$db->sanitize($table)." ROW_FORMAT=DYNAMIC;"; $db->query($sql); } @@ -160,17 +165,24 @@ if (!$base) { print '
'.$langs->trans("Convert").' Dynamic'; } print ''; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php index c7e7c5baa5e..a47be52e386 100644 --- a/htdocs/admin/system/dbtable.php +++ b/htdocs/admin/system/dbtable.php @@ -33,7 +33,57 @@ if (!$user->admin) { accessforbidden(); } -$table = GETPOST('table', 'alpha'); +$table = GETPOST('table', 'aZ09'); +$field = GETPOST('field', 'aZ09'); +$action = GETPOST('action', 'aZ09'); + + +/* + * Actions + */ + +if ($action == 'convertutf8') { + $sql = "SHOW FULL COLUMNS IN ".$db->sanitize($table); + + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) { + $row = $db->fetch_row($resql); + if ($row[0] == $field) { + $sql = 'ALTER TABLE '.$db->sanitize($table).' MODIFY '.$db->sanitize($row[0]).' '.$row[1].' CHARACTER SET utf8'; // We must not sanitize the $row[1] + $db->query($sql); + + $sql = 'ALTER TABLE '.$db->sanitize($table).' MODIFY '.$db->sanitize($row[0]).' '.$row[1].' COLLATE utf8_unicode_ci'; // We must not sanitize the $row[1] + $db->query($sql); + + break; + } + } + } +} +if ($action == 'convertutf8mb4') { + $sql = "SHOW FULL COLUMNS IN ".$db->sanitize($table); + + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) { + $row = $db->fetch_row($resql); + if ($row[0] == $field) { + $sql = 'ALTER TABLE '.$db->sanitize($table).' MODIFY '.$db->sanitize($row[0]).' '.$row[1].' CHARACTER SET utf8mb4'; // We must not sanitize the $row[1] + $db->query($sql); + + $sql = 'ALTER TABLE '.$db->sanitize($table).' MODIFY '.$db->sanitize($row[0]).' '.$row[1].' COLLATE utf8mb4_unicode_ci'; // We must not sanitize the $row[1] + $db->query($sql); + + break; + } + } + } +} /* @@ -48,7 +98,7 @@ print load_fiche_titre($langs->trans("Table")." ".$table, '', 'title_setup'); // Define request to get table description $base = 0; if (preg_match('/mysql/i', $conf->db->type)) { - $sql = "SHOW TABLE STATUS LIKE '".$db->escape($table)."'"; + $sql = "SHOW TABLE STATUS LIKE '".$db->escape($db->escapeforlike($table))."'"; $base = 1; } elseif ($conf->db->type == 'pgsql') { $sql = "SELECT conname,contype FROM pg_constraint"; @@ -99,7 +149,7 @@ if (!$base) { print ''; // $sql = "DESCRIBE ".$table; - $sql = "SHOW FULL COLUMNS IN ".$db->escape($table); + $sql = "SHOW FULL COLUMNS IN ".$db->sanitize($table); $resql = $db->query($sql); if ($resql) { @@ -109,12 +159,46 @@ if (!$base) { $row = $db->fetch_row($resql); print ''; + // field print ""; + // type - print ""; + print ""; + // collation - print ""; + print ""; + // null print ""; // key diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9b0d6cfaab4..4a1beee4bcf 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5437,7 +5437,7 @@ function img_mime($file, $titlealt = '', $morecss = '') */ function img_search($titlealt = 'default', $other = '') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') { $titlealt = $langs->trans('Search'); @@ -5460,7 +5460,7 @@ function img_search($titlealt = 'default', $other = '') */ function img_searchclear($titlealt = 'default', $other = '') { - global $conf, $langs; + global $langs; if ($titlealt == 'default') { $titlealt = $langs->trans('Search'); @@ -5682,7 +5682,7 @@ function dol_print_error($db = null, $error = '', $errors = null) */ function dol_print_error_email($prefixcode, $errormessage = '', $errormessages = array(), $morecss = 'error', $email = '') { - global $langs, $conf; + global $langs; if (empty($email)) { $email = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL'); @@ -5745,7 +5745,7 @@ function print_liste_field_titre($name, $file = "", $field = "", $begin = "", $m */ function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin = "", $moreparam = "", $moreattrib = "", $sortfield = "", $sortorder = "", $prefix = "", $disablesortlink = 0, $tooltip = '', $forcenowrapcolumntitle = 0) { - global $conf, $langs, $form; + global $langs, $form; //print "$name, $file, $field, $begin, $options, $moreattrib, $sortfield, $sortorder
\n"; if ($moreattrib == 'class="right"') { From 62cf3ab098682dccfd78ad4aecdbcb5b1573764f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 19:27:52 +0100 Subject: [PATCH 68/75] Enhance error message --- htdocs/core/class/CMailFile.class.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 2ba41c28f43..11e25c2c741 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -275,8 +275,9 @@ class CMailFile // Search into the body for errors)); // Output errors set by findHtmlImagesInSrcData $this->error = 'ErrorInAddAttachementsImageBaseOnMedia'; return; } @@ -1900,8 +1901,6 @@ class CMailFile */ private function findHtmlImagesIsSrcData($images_dir) { - global $conf; - // Build the array of image extensions $extensions = array_keys($this->image_types); @@ -1927,7 +1926,7 @@ class CMailFile if (!empty($matches) && !empty($matches[1])) { if (empty($images_dir)) { // No temp directory provided, so we are not able to support convertion of data:image into physical images. - $this->error = 'NoTempDirProvidedInCMailConstructorSoCantConvertDataImgOnDisk'; + $this->errors[] = 'NoTempDirProvidedInCMailConstructorSoCantConvertDataImgOnDisk'; return -1; } @@ -1949,7 +1948,7 @@ class CMailFile dolChmod($destfiletmp); } else { $this->errors[] = "Failed to open file '".$destfiletmp."' for write"; - return -1; + return -2; } } From 04ae0f776d4d05b534e70331c9e1dec7157252b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 20:02:08 +0100 Subject: [PATCH 69/75] FIX trackid and temp dir on payment confirmation of event registration --- htdocs/public/payment/paymentok.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index ca5db265610..62f9797d833 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1378,7 +1378,10 @@ if ($ispaymentok) { $listofmimes = array(dol_mimetype($file)); } - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, $cc, '', 0, $ishtml); + $trackid = 'inv'.$object->id; + $upload_dir_tmp = $conf->admin->dir_output.'/temp/'.uniqid('cmailfile'); + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, $cc, '', 0, $ishtml, '', '', $trackid, '', 'standard', '', $upload_dir_tmp); $result = $mailfile->sendfile(); if ($result) { From a0b7cb90d86c2f7a740654dd8a7576193929d899 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 20:02:08 +0100 Subject: [PATCH 70/75] FIX trackid and temp dir on payment confirmation of event registration --- htdocs/core/class/CMailFile.class.php | 6 ++++++ htdocs/public/payment/paymentok.php | 18 ++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 11e25c2c741..3539c62b6cf 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1901,9 +1901,15 @@ class CMailFile */ private function findHtmlImagesIsSrcData($images_dir) { + global $conf; + // Build the array of image extensions $extensions = array_keys($this->image_types); + if (empty($images_dir)) { + $images_dir = $conf->admin->dir_output.'/temp/'.uniqid('cmailfile'); + } + if ($images_dir && !dol_is_dir($images_dir)) { dol_mkdir($images_dir, DOL_DATA_ROOT); } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index ca5db265610..3c710691bdd 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1378,7 +1378,9 @@ if ($ispaymentok) { $listofmimes = array(dol_mimetype($file)); } - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, $cc, '', 0, $ishtml); + $trackid = 'inv'.$object->id; + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, $cc, '', 0, $ishtml, '', '', $trackid, '', 'standard'); $result = $mailfile->sendfile(); if ($result) { @@ -1569,8 +1571,9 @@ if ($ispaymentok) { $urlback = $_SERVER["REQUEST_URI"]; $ishtml = dol_textishtml($texttosend); // May contain urls + $trackid = 'inv'.$invoice->id; - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml, '', '', $trackid, '', 'standard'); $result = $mailfile->sendfile(); if ($result) { @@ -1777,10 +1780,7 @@ if ($ispaymentok) { print $conf->global->$key; } - $sendemail = ''; - if (getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL')) { - $sendemail = $conf->global->ONLINE_PAYMENT_SENDEMAIL; - } + $sendemail = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL'); $tmptag = dolExplodeIntoArray($fulltag, '.', '='); @@ -1860,9 +1860,10 @@ if ($ispaymentok) { $ishtml = dol_textishtml($content); // May contain urls + $trackid = ''; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml); + $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml, '', '', $trackid, '', 'standard'); $result = $mailfile->sendfile(); if ($result) { @@ -1941,9 +1942,10 @@ if ($ispaymentok) { $ishtml = dol_textishtml($content); // May contain urls + $trackid = ''; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml); + $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml, '', '', $trackid, '', 'standard'); $result = $mailfile->sendfile(); if ($result) { From 1a82c5e8ced5270313c6391787490fd891d1d9bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 20:38:51 +0100 Subject: [PATCH 71/75] Fix warnings --- htdocs/admin/mails_templates.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index ae1f8bf67d1..546427463da 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -681,7 +681,7 @@ if (!empty($user->admin) && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu // Confirm deletion of record if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((int) $rowid).'&code='.urlencode($code).'&id='.((int) $id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((int) $rowid).'&id='.((int) $id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); } @@ -1101,7 +1101,7 @@ if ($num) { } print "\n"; - print ''; + print ''; print '\n"; - print ''; + print ''; print '
'; - print($salaryBonPl ? $salarytmp->getNomUrl(1) : $invoicetmp->getNomUrl(1)); + print $itemurl; print "'; print dol_escape_htmltag($invoicetmp->ref_supplier); print "'; - print($salaryBonPl ? $usertmp->getNomUrl(-1) : $thirdpartytmp->getNomUrl(1)); + print $partyurl; print "'.$obj->Auto_increment.''.$obj->Check_time.''.$obj->Collation; - if (isset($obj->Collation) && (in_array($obj->Collation, array("utf8mb4_general_ci", "utf8mb4_unicode_ci", "latin1_swedish_ci")))) { + // Accept utf8, utf8mb3_unicode_ci, utf8mb4_unicode_ci + if (isset($obj->Collation) && (in_array($obj->Collation, array("utf8mb4_general_ci", "latin1_swedish_ci")))) { print '
'.$langs->trans("Convert").' UTF8'; } print '
'.$obj->Rows.''.$obj->Avg_row_length.''.$obj->Data_length.''.$obj->Max_data_length.''.$obj->Index_length.''.$obj->Auto_increment.''.$obj->Check_time.''.$obj->Collation; - // Accept utf8, utf8mb3_unicode_ci, utf8mb4_unicode_ci - if (isset($obj->Collation) && (in_array($obj->Collation, array("utf8mb4_general_ci", "latin1_swedish_ci")))) { - print '
'.$langs->trans("Convert").' UTF8'; + print '
'.$obj->Rows.''.$obj->Avg_row_length.''.$obj->Data_length.''.$obj->Max_data_length.''.$obj->Index_length.''.$obj->Auto_increment.''.$obj->Check_time.''.$obj->Collation; + // Link to convert collation + if (isset($obj->Collation)) { + print '
'.$langs->trans("ConvertInto"); + if (!in_array($obj->Collation, array("utf8_unicode_ci"))) { + print ' utf8'; + } + if (!in_array($obj->Collation, array("utf8mb4_unicode_ci"))) { + print ' utf8mb4'; + } + print ''; } print '
".$row[0]."".$row[1].""; + $proptype = $row[1]; + $pictoType = ''; + $matches = array(); + if (preg_match('/^varchar/', $proptype, $matches)) { + $pictoType = 'varchar'; + } elseif (strpos($proptype, 'int') === 0 || strpos($proptype, 'tinyint') === 0 || strpos($proptype, 'bigint') === 0) { + $pictoType = 'int'; + } elseif (strpos($proptype, 'timestamp') === 0) { + $pictoType = 'datetime'; + } elseif (strpos($proptype, 'real') === 0) { + $pictoType = 'double'; + } + print(!empty($pictoType) ? getPictoForType($pictoType) : getPictoForType($proptype)).''.dol_escape_htmltag($proptype).''; + print "".$row[2]."".(empty($row[2]) ? ' ' : $row[2]); + + // Link to convert collation + if (isset($row[2])) { + print '
'.$langs->trans("ConvertInto"); + if (!in_array($row[2], array("utf8_unicode_ci"))) { + print ' utf8'; + } + if (!in_array($row[2], array("utf8mb4_unicode_ci"))) { + print ' utf8mb4'; + } + print ''; + } else { + print '
 '; + } + + print "
".$row[3]."
'; $fieldsforcontent = array('topic', 'email_from','joinfiles', 'content'); From ae41b07b705aad3f99fdc7eb997c0bbfd2ad35d4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 20:51:47 +0100 Subject: [PATCH 72/75] Fix trans --- htdocs/langs/en_US/admin.lang | 3 ++- htdocs/langs/en_US/eventorganization.lang | 1 + htdocs/public/eventorganization/attendee_new.php | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f20f46f5c03..ed6431ff1d6 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1666,7 +1666,7 @@ LDAPDescUsers=This page allows you to define LDAP attributes name in LDAP tree f LDAPDescGroups=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr groups. LDAPDescMembers=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr members module. LDAPDescMembersTypes=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr members types. -LDAPDescValues=Example values are designed for OpenLDAP with following loaded schemas: core.schema, cosine.schema, inetorgperson.schema). If you use thoose values and OpenLDAP, modify your LDAP config file slapd.conf to have all thoose schemas loaded. +LDAPDescValues=Example values are designed for OpenLDAP with following loaded schemas: core.schema, cosine.schema, inetorgperson.schema). If you use those values and OpenLDAP, modify your LDAP config file slapd.conf to have all those schemas loaded. ForANonAnonymousAccess=For an authenticated access (for a write access for example) PerfDolibarr=Performance setup/optimizing report YouMayFindPerfAdviceHere=This page provides some checks or advice related to performance. @@ -2452,3 +2452,4 @@ VideoGeneration=Video generation AudioText=Audio - Text AIPromptForFeatures=AI custom prompts for features EnterAnIP=Enter an IP address +ConvertInto=Convert into diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 9d3b5c5fb08..e0e26dc460b 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -27,6 +27,7 @@ EventOrganizationMenuLeft = Organized events EventOrganizationConferenceOrBoothMenuLeft = Conference Or Booth PaymentEvent=Payment of event +EventFee=Event fee # # Admin page diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index 3d6db67046d..3eb22bceb3a 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -510,6 +510,8 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen // TODO Use default language of $thirdparty->default_lang to build $outputlang + $outputlangs->loadLangs(array("eventorganization")); + // Get product to use for invoice $productforinvoicerow = new Product($db); $productforinvoicerow->id = 0; @@ -629,7 +631,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); + $outputlangs->loadLangs(array("main", "members", "eventorganization")); // Get email content from template $arraydefaultmessage = null; From dfa9ed67d07b9af4a4f7cf3e3e23f15c5519f170 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 20:38:51 +0100 Subject: [PATCH 73/75] Fix warnings --- htdocs/admin/mails_templates.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index cabbe69c319..7a6d513c589 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -681,7 +681,7 @@ if (!empty($user->admin) && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu // Confirm deletion of record if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((int) $rowid).'&code='.urlencode($code).'&id='.((int) $id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((int) $rowid).'&id='.((int) $id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); } @@ -1096,7 +1096,7 @@ if ($num) { } print "
'; $fieldsforcontent = array('topic', 'email_from','joinfiles', 'content'); From 08ed8f9aaffba580ba2519d4700a4f7bed55e096 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 20:51:47 +0100 Subject: [PATCH 74/75] Fix trans --- htdocs/langs/en_US/admin.lang | 5 +++-- htdocs/langs/en_US/eventorganization.lang | 1 + htdocs/public/eventorganization/attendee_new.php | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 931cb74aa11..2d89a39b03a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1669,7 +1669,7 @@ LDAPDescUsers=This page allows you to define LDAP attributes name in LDAP tree f LDAPDescGroups=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr groups. LDAPDescMembers=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr members module. LDAPDescMembersTypes=This page allows you to define LDAP attributes name in LDAP tree for each data found on Dolibarr members types. -LDAPDescValues=Example values are designed for OpenLDAP with following loaded schemas: core.schema, cosine.schema, inetorgperson.schema). If you use thoose values and OpenLDAP, modify your LDAP config file slapd.conf to have all thoose schemas loaded. +LDAPDescValues=Example values are designed for OpenLDAP with following loaded schemas: core.schema, cosine.schema, inetorgperson.schema). If you use those values and OpenLDAP, modify your LDAP config file slapd.conf to have all those schemas loaded. ForANonAnonymousAccess=For an authenticated access (for a write access for example) PerfDolibarr=Performance setup/optimizing report YouMayFindPerfAdviceHere=This page provides some checks or advice related to performance. @@ -2442,4 +2442,5 @@ RecommendedForProduction=Recommended for Production RecommendedForDebug=Recommended for Debug ExportUseForce=Use the parameter -f ExportUseForceHelp=Force to continue the export even when an error is found (Backup may not be reliable) -EnterAnIP=Enter an IP address \ No newline at end of file +EnterAnIP=Enter an IP address +ConvertInto=Convert into diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 30c3f5d6b59..4dda951377a 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -27,6 +27,7 @@ EventOrganizationMenuLeft = Organized events EventOrganizationConferenceOrBoothMenuLeft = Conference Or Booth PaymentEvent=Payment of event +EventFee=Event fee # # Admin page diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index a2175e26ae3..154cac787c5 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -510,6 +510,8 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen // TODO Use default language of $thirdparty->default_lang to build $outputlang + $outputlangs->loadLangs(array("eventorganization")); + // Get product to use for invoice $productforinvoicerow = new Product($db); $productforinvoicerow->id = 0; @@ -629,7 +631,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); + $outputlangs->loadLangs(array("main", "members", "eventorganization")); // Get email content from template $arraydefaultmessage = null; From defd044a747295564f79ea4b7011bfb1b927de8a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Mar 2024 23:34:08 +0100 Subject: [PATCH 75/75] Fix phpunit --- htdocs/admin/system/dbtable.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php index a47be52e386..2cec477994f 100644 --- a/htdocs/admin/system/dbtable.php +++ b/htdocs/admin/system/dbtable.php @@ -52,10 +52,10 @@ if ($action == 'convertutf8') { while ($i < $num) { $row = $db->fetch_row($resql); if ($row[0] == $field) { - $sql = 'ALTER TABLE '.$db->sanitize($table).' MODIFY '.$db->sanitize($row[0]).' '.$row[1].' CHARACTER SET utf8'; // We must not sanitize the $row[1] + $sql = "ALTER TABLE ".$db->sanitize($table)." MODIFY ".$db->sanitize($row[0])." ".$row[1]." CHARACTER SET utf8"; // We must not sanitize the $row[1] $db->query($sql); - $sql = 'ALTER TABLE '.$db->sanitize($table).' MODIFY '.$db->sanitize($row[0]).' '.$row[1].' COLLATE utf8_unicode_ci'; // We must not sanitize the $row[1] + $sql = "ALTER TABLE ".$db->sanitize($table)." MODIFY ".$db->sanitize($row[0])." ".$row[1]." COLLATE utf8_unicode_ci"; // We must not sanitize the $row[1] $db->query($sql); break; @@ -73,10 +73,10 @@ if ($action == 'convertutf8mb4') { while ($i < $num) { $row = $db->fetch_row($resql); if ($row[0] == $field) { - $sql = 'ALTER TABLE '.$db->sanitize($table).' MODIFY '.$db->sanitize($row[0]).' '.$row[1].' CHARACTER SET utf8mb4'; // We must not sanitize the $row[1] + $sql = "ALTER TABLE ".$db->sanitize($table)." MODIFY ".$db->sanitize($row[0])." ".$row[1]." CHARACTER SET utf8mb4"; // We must not sanitize the $row[1] $db->query($sql); - $sql = 'ALTER TABLE '.$db->sanitize($table).' MODIFY '.$db->sanitize($row[0]).' '.$row[1].' COLLATE utf8mb4_unicode_ci'; // We must not sanitize the $row[1] + $sql = "ALTER TABLE ".$db->sanitize($table)." MODIFY ".$db->sanitize($row[0])." ".$row[1]." COLLATE utf8mb4_unicode_ci"; // We must not sanitize the $row[1] $db->query($sql); break;