From a75572db5c2b5c9e63bbefe7b356af757552ceb2 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Fri, 1 Aug 2025 13:49:01 +0200 Subject: [PATCH 1/4] Fix preview of image in document tab of thirdparty. --- htdocs/societe/document.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 91238bf1b4e..42ab5a876a8 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -192,10 +192,11 @@ print ''; print dol_get_fiche_end(); -$modulepart = 'societe'; +$modulepart = 'company'; $permissiontoadd = $user->hasRight('societe', 'creer'); $permtoedit = $user->hasRight('societe', 'creer'); $param = '&id='.$object->id; +$relativepathwithnofile = $object->id . '/'; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; // End of page From c0ad262944fa0ea25052fbcf687655690a48ad93 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 1 Aug 2025 19:41:37 +0200 Subject: [PATCH 2/4] FIX : main checkbox left column was before global conf (#34858) --- htdocs/core/class/conf.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 1a771c3fd58..217e9e01301 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -964,11 +964,6 @@ class Conf extends stdClass } } - // conf->main_checkbox_left_column = constant to set checkbox list to left - if (!isset($this->main_checkbox_left_column)) { - $this->main_checkbox_left_column = getDolGlobalInt("MAIN_CHECKBOX_LEFT_COLUMN"); - } - // Set PRODUIT_LIMIT_SIZE if never defined if (!isset($this->global->PRODUIT_LIMIT_SIZE)) { $this->global->PRODUIT_LIMIT_SIZE = 1000; @@ -1202,6 +1197,11 @@ class Conf extends stdClass $this->global->MAIN_CHECKBOX_LEFT_COLUMN = 1; } + // conf->main_checkbox_left_column = constant to set checkbox list to left + if (!isset($this->main_checkbox_left_column)) { + $this->main_checkbox_left_column = getDolGlobalInt("MAIN_CHECKBOX_LEFT_COLUMN"); + } + // For modules that want to disable top or left menu if (!empty($this->global->MAIN_HIDE_TOP_MENU)) { $this->dol_hide_topmenu = getDolGlobalInt('MAIN_HIDE_TOP_MENU'); From b748bf1fc05e9e924f7371502af19b3e9a8861d5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Aug 2025 17:42:58 +0200 Subject: [PATCH 3/4] Fix warning --- htdocs/core/lib/date.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 69d5a8b7a19..6d4585c41c9 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -1079,7 +1079,9 @@ function num_open_day($timestampStart, $timestampEnd, $inhour = 0, $lastday = 0, // Check if start/end days are working days just ONCE to optimize performance // by avoiding redundant calls to the potentially slow num_public_holiday() function. + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition $isStartDayWorking = (num_public_holiday($timestampStart, $timestampStart, $country_code, 1) == 0); + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition $isEndDayWorking = (num_public_holiday($timestampEnd, $timestampEnd, $country_code, 1) == 0); // Deduct 0.5 if the leave starts in the afternoon of a working day. From 22de4342ad614630974296232675f74a5989e58a Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Tue, 5 Aug 2025 01:04:22 +0200 Subject: [PATCH 4/4] FIX array for arrayofkeyval is lost in module builder edit of property --- htdocs/core/lib/functions.lib.php | 13 +++++-------- htdocs/modulebuilder/index.php | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5674c20027d..b099e5e2588 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -781,13 +781,12 @@ function GETPOSTISARRAY($paramname, $method = 0) * @param string $check Type of check * '' or 'none'=no check (deprecated) * 'password'=allow characters for a password - * 'email'=allow characters for an email + * 'email'=allow characters for an email "email@domain.com" * 'array', 'array:restricthtml' or 'array:aZ09' to check it's an array * 'int'=check it's numeric (integer or float) * 'intcomma'=check it's integer+comma ('1,2,3,4...') - * 'alpha'=Same than alphanohtml - * 'alphawithlgt'=alpha with lgt - * 'alphanohtml'=check there is no html content and no " and no ../ + * 'alphanohtml'=check there is no html content and no " and no ../ ('alpha' is an alias of 'alphanohtml') + * 'alphawithlgt'=alpha with lgt and no " and no ../ (Can be used for email string like "Name ") * 'aZ'=check it's a-z only * 'aZ09'=check it's simple alpha string (recommended for keys) * 'aZ09arobase'=check it's a string for an element type ('myobject@mymodule') @@ -1142,7 +1141,6 @@ function GETPOSTINT($paramname, $method = 0) return (int) GETPOST($paramname, 'int', $method, null, null, 0); } - /** * Return the value of a $_GET or $_POST supervariable, converted into float. * @@ -1157,7 +1155,6 @@ function GETPOSTFLOAT($paramname, $rounding = '') return (float) price2num(GETPOST($paramname), $rounding, 2); } - /** * Helper function that combines values of a dolibarr DatePicker (such as Form::selectDate) for year, month, day (and * optionally hour, minute, second) fields to return a timestamp. @@ -1278,7 +1275,7 @@ function sanitizeVal($out = '', $check = 'alphanohtml', $filter = null, $options } break; case 'alpha': // No html and no ../ and " - case 'alphanohtml': // Recommended for most scalar parameters and search parameters + case 'alphanohtml': // Recommended for most scalar parameters and search parameters. Not valid for json string. if (!is_array($out)) { $out = trim($out); do { @@ -1317,7 +1314,7 @@ function sanitizeVal($out = '', $check = 'alphanohtml', $filter = null, $options } while ($oldstringtoclean != $out); } break; - case 'nohtml': // No html + case 'nohtml': // No html. Valid for JSON strings. $out = dol_string_nohtmltag($out, 0); break; case 'restricthtmlnolink': diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 78991a19b15..7b5cab0d82e 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1841,7 +1841,7 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) && 'name' => GETPOST('propname', 'aZ09'), 'label' => GETPOST('proplabel', 'alpha'), 'type' => strtolower(GETPOST('proptype', 'alpha')), - 'arrayofkeyval' => GETPOST('proparrayofkeyval', 'alphawithlgt'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}' + 'arrayofkeyval' => GETPOST('proparrayofkeyval', 'nohtml'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}' 'visible' => GETPOST('propvisible', 'alphanohtml'), 'enabled' => GETPOST('propenabled', 'alphanohtml'), 'position' => GETPOSTINT('propposition'),