From cffc478b26e7c58c69a5a4455005c2781ef745c3 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 10 Mar 2025 00:37:54 +0100 Subject: [PATCH 1/4] FIX Show the default duration of a membership type. --- htdocs/adherents/type.php | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 91f105c48b8..990569282ec 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -471,6 +471,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') { } } + // Creation if ($action == 'create') { print load_fiche_titre($langs->trans("NewMemberType"), '', 'members'); @@ -593,14 +594,18 @@ if ($rowid > 0) { print yn($object->vote); print ''; - // Duration - print ''.$langs->trans("Duration").''.$object->duration_value.' '; + $durationarray = array(); if ($object->duration_value > 1) { - $dur = array("i" => $langs->trans("Minutes"), "h" => $langs->trans("Hours"), "d" => $langs->trans("Days"), "w" => $langs->trans("Weeks"), "m" => $langs->trans("Months"), "y" => $langs->trans("Years")); - } elseif ($object->duration_value > 0) { - $dur = array("i" => $langs->trans("Minute"), "h" => $langs->trans("Hour"), "d" => $langs->trans("Day"), "w" => $langs->trans("Week"), "m" => $langs->trans("Month"), "y" => $langs->trans("Year")); + $durationarray = array("s" => $langs->trans("Seconds"), "mn" => $langs->trans("Minutes"), "i" => $langs->trans("Minutes"), "h" => $langs->trans("Hours"), "d" => $langs->trans("Days"), "w" => $langs->trans("Weeks"), "m" => $langs->trans("Months"), "y" => $langs->trans("Years")); + } else { + $durationarray = array("s" => $langs->trans("Seconds"), "mn" => $langs->trans("Minutes"), "i" => $langs->trans("Minute"), "h" => $langs->trans("Hour"), "d" => $langs->trans("Day"), "w" => $langs->trans("Week"), "m" => $langs->trans("Month"), "y" => $langs->trans("Year")); } - print(!empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? $langs->trans($dur[$object->duration_unit]) : '')." "; + + // Duration + print ''.$langs->trans("Duration").''; + print $object->duration_value > 0 ? $object->duration_value : ''; + print ' '; + print (!empty($object->duration_unit) && isset($durationarray[$object->duration_unit]) ? $langs->trans($durationarray[$object->duration_unit]) : ''); print ''; // Description @@ -1022,7 +1027,7 @@ if ($rowid > 0) { print ''.$langs->trans("Amount").''; print ''; print ''; @@ -1035,7 +1040,7 @@ if ($rowid > 0) { print ''; print ''.$langs->trans("Duration").''; - print ' '; + print ' '; print $formproduct->selectMeasuringUnits("duration_unit", "time", ($object->duration_unit === '' ? 'y' : $object->duration_unit), 0, 1); print ''; From 45877c8b6db0f3564a10613890dadcc5d8a9c103 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 10 Mar 2025 00:46:07 +0100 Subject: [PATCH 2/4] Fix click on alert checkbox in project list --- htdocs/projet/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 9eebe13d211..7d5412ddf9e 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -1235,7 +1235,7 @@ if (getDolGlobalString('MAIN_SEARCH_CATEGORY_CUSTOMER_ON_PROJECT_LIST') && isMod // alert on late date $moreforfilter .= '
'; -$moreforfilter .= $langs->trans('Alert').' '; +$moreforfilter .= ''; $moreforfilter .= '
'; if (getDolGlobalInt('PROJECT_ENABLE_SUB_PROJECT')) { From f70f623466bdc6e593f5f6acdf96f4b260b8edac Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 10 Mar 2025 18:26:01 +0100 Subject: [PATCH 3/4] Add missing authentication "NONE" into setup. --- htdocs/admin/mails.php | 9 +++++++-- htdocs/langs/en_US/admin.lang | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index afda0e31733..8f495458d7c 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -471,10 +471,13 @@ if ($action == 'edit') { $vartosmtpstype = 'MAIN_MAIL_SMTPS_AUTH_TYPE'; if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { // Note: Default value for MAIN_MAIL_SMTPS_AUTH_TYPE if not defined is 'LOGIN' (but login/pass may be empty and they won't be provided in such a case) + print ' '; + print ''; + print '
'; print ' '; print ''; print '
'; - print ' '; + print ' '; print ''; print '
'; print ' '; @@ -731,7 +734,9 @@ if ($action == 'edit') { if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) { $authtype = getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE', 'LOGIN'); $text = ''; - if ($authtype === "LOGIN") { + if ($authtype === "NONE") { + $text = $langs->trans("None"); + } elseif ($authtype === "LOGIN") { $text = $langs->trans("UseAUTHLOGIN"); } elseif ($authtype === "PLAIN") { $text = $langs->trans("UseAUTHPLAIN"); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index ad8c3bede2e..cbd65d8478f 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2432,6 +2432,7 @@ DontForgetCreateTokenOauthMod=A token with the right permissions must have been AuthenticationMethod=Authentication method MAIN_MAIL_SMTPS_AUTH_TYPE=Authentication method UsePassword=Use a password +UseAUTHNONE=Use no authentication (try also with or without the SMTP user ID) UseAUTHLOGIN=Use a password (AUTH LOGIN) UseAUTHPLAIN=Use a password (AUTH PLAIN) UseOauth=Use a OAUTH token From e362f99aa0b7fa179eb91686914a3e127f40dacf Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 10 Mar 2025 19:24:21 +0100 Subject: [PATCH 4/4] Fix serious regression --- htdocs/core/lib/functions.lib.php | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 52da5d6af68..e9501697c4c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -12889,26 +12889,12 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url = unset($attr['href']); } - // Escape all attributes - if (!empty($params['use_unsecured_unescapedattr'])) { // Not recommended. - if (is_array($params['use_unsecured_unescapedattr'])) { - foreach ($attr as $attrK => $attrV) { - if (in_array($attrK, $params['use_unsecured_unescapedattr'])) { - $attr[$attrK] = dol_htmlentities($attrV, ENT_QUOTES | ENT_SUBSTITUTE); - } else { - $attr[$attrK] = dolPrintHTMLForAttribute($attrV); - } - } - } else { - $attr = array_map('dol_htmlentities', $attr); - } - } else { - $attr = array_map('dolPrintHTMLForAttribute', $attr); - } - $TCompiledAttr = array(); foreach ($attr as $key => $value) { - if ($key == 'href') { + if (!empty($params['use_unsecured_unescapedattr']) && is_array($params['use_unsecured_unescapedattr']) && in_array($key, $params['use_unsecured_unescapedattr'])) { + // Not recommended + $value = dol_htmlentities($attrV, ENT_QUOTES | ENT_SUBSTITUTE); + } elseif ($key == 'href') { $value = dolPrintHTMLForAttributeUrl($value); } else { $value = dolPrintHTMLForAttribute($value);