From 522a012053eaf7390081fc7292683dc44fe544cf Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 26 Mar 2024 16:13:54 +0100 Subject: [PATCH 1/6] FIX Accountancy export with file or not --- .../accountancy/class/accountancyexport.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index c515b7230b2..d986e5c0d56 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaƫl Doursenaud * Copyright (C) 2016 Pierre-Henry Favre - * Copyright (C) 2016-2023 Alexandre Spangaro + * Copyright (C) 2016-2024 Alexandre Spangaro * Copyright (C) 2022 Lionel Vessiller * Copyright (C) 2013-2017 Olivier Geffroy * Copyright (C) 2017 Elarifr. Ari Elbaz @@ -385,11 +385,12 @@ class AccountancyExport // directory already created when module is enabled $outputDir .= '/export'; $outputDir .= '/'.dol_sanitizePathName($formatexportset); - if (!dol_is_dir($outputDir)) { - if (dol_mkdir($outputDir) < 0) { - $this->errors[] = $langs->trans('ErrorCanNotCreateDir', $outputDir); - return -1; - } + } + + if (!dol_is_dir($outputDir)) { + if (dol_mkdir($outputDir) < 0) { + $this->errors[] = $langs->trans('ErrorCanNotCreateDir', $outputDir); + return -1; } } From e1fc40d694c8622199ba6e3d43d48cb9b79ba673 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 26 Mar 2024 19:36:15 +0100 Subject: [PATCH 2/6] FIX wrong shortcut key for macintosh --- htdocs/main.inc.php | 68 ++++++++++++++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 19 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 64652fd3dd1..f1e18f07178 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2575,17 +2575,24 @@ function top_menu_quickadd() { global $conf, $langs; + $tmp = getBrowserInfo($_SERVER["HTTP_USER_AGENT"]); + $ostype = $tmp['browseros']; + $html = ''; // accesskey is for Windows or Linux: ALT + key for chrome, ALT + SHIFT + KEY for firefox // accesskey is for Mac: CTRL + key for all browsers $stringforfirstkey = $langs->trans("KeyboardShortcut"); - if ($conf->browser->name == 'chrome') { - $stringforfirstkey .= ' ALT +'; - } elseif ($conf->browser->name == 'firefox') { - $stringforfirstkey .= ' ALT + SHIFT +'; - } else { + if ($ostype === 'macintosh') { $stringforfirstkey .= ' CTL +'; + } else { + if ($conf->browser->name == 'chrome') { + $stringforfirstkey .= ' ALT +'; + } elseif ($conf->browser->name == 'firefox') { + $stringforfirstkey .= ' ALT + SHIFT +'; + } else { + $stringforfirstkey .= ' CTL +'; + } } $html .= ' @@ -2610,10 +2617,18 @@ function top_menu_quickadd() // Key map shortcut $(document).keydown(function(event){ - if ( event.which === 76 && event.ctrlKey && event.shiftKey ){ - console.log(\'control + shift + l : trigger open quick add dropdown\'); - openQuickAddDropDown(event); - } + var ostype = "'.$ostype.'"; + if (ostype === "macintosh") { + if ( event.which === 65 && event.ctrlKey ) { + console.log(\'control + a : trigger open quick add dropdown\'); + openQuickAddDropDown(event); + } else { + if ( event.which === 65 && event.ctrlKey && event.shiftKey ) { + console.log(\'control + shift + a : trigger open quick add dropdown\'); + openQuickAddDropDown(event); + } + } + } }); var openQuickAddDropDown = function(event) { @@ -2822,15 +2837,22 @@ function top_menu_bookmark() return $html; } + $tmp = getBrowserInfo($_SERVER["HTTP_USER_AGENT"]); + $ostype = $tmp['browseros']; + // accesskey is for Windows or Linux: ALT + key for chrome, ALT + SHIFT + KEY for firefox // accesskey is for Mac: CTRL + key for all browsers $stringforfirstkey = $langs->trans("KeyboardShortcut"); - if ($conf->browser->name == 'chrome') { - $stringforfirstkey .= ' ALT +'; - } elseif ($conf->browser->name == 'firefox') { - $stringforfirstkey .= ' ALT + SHIFT +'; - } else { + if ($ostype === 'macintosh') { $stringforfirstkey .= ' CTL +'; + } else { + if ($conf->browser->name == 'chrome') { + $stringforfirstkey .= ' ALT +'; + } elseif ($conf->browser->name == 'firefox') { + $stringforfirstkey .= ' ALT + SHIFT +'; + } else { + $stringforfirstkey .= ' CTL +'; + } } if (!defined('JS_JQUERY_DISABLE_DROPDOWN') && !empty($conf->use_javascript_ajax)) { // This may be set by some pages that use different jquery version to avoid errors @@ -2868,11 +2890,19 @@ function top_menu_bookmark() }); // Key map shortcut - jQuery(document).keydown(function(event){ - if( event.which === 77 && event.ctrlKey && event.shiftKey ){ - console.log("Click on control + shift + m : trigger open bookmark dropdown"); - openBookMarkDropDown(event); - } + jQuery(document).keydown(function(event) { + var ostype = "'.$ostype.'"; + if (ostype === "macintosh") { + if ( event.which === 66 && event.ctrlKey ) { + console.log("Click on control + b : trigger open bookmark dropdown"); + openBookMarkDropDown(event); + } + } else { + if ( event.which === 66 && event.ctrlKey && event.shiftKey ) { + console.log("Click on control + shift + b : trigger open bookmark dropdown"); + openBookMarkDropDown(event); + } + } }); var openBookMarkDropDown = function(event) { From 3b9be9779279eae7781c30cdf16e47f828c2ea71 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 26 Mar 2024 19:40:14 +0100 Subject: [PATCH 3/6] FIX syntax error --- htdocs/main.inc.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index f1e18f07178..ab01142c1f9 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2622,11 +2622,11 @@ function top_menu_quickadd() if ( event.which === 65 && event.ctrlKey ) { console.log(\'control + a : trigger open quick add dropdown\'); openQuickAddDropDown(event); - } else { - if ( event.which === 65 && event.ctrlKey && event.shiftKey ) { - console.log(\'control + shift + a : trigger open quick add dropdown\'); - openQuickAddDropDown(event); - } + } + } else { + if ( event.which === 65 && event.ctrlKey && event.shiftKey ) { + console.log(\'control + shift + a : trigger open quick add dropdown\'); + openQuickAddDropDown(event); } } }); From 48e85e6690da5b4f7b46b1b9ec8febf7082bdf51 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 26 Mar 2024 20:15:21 +0100 Subject: [PATCH 4/6] FIX use $conf->browser->os instead --- htdocs/main.inc.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index ab01142c1f9..9d95f466254 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2575,15 +2575,12 @@ function top_menu_quickadd() { global $conf, $langs; - $tmp = getBrowserInfo($_SERVER["HTTP_USER_AGENT"]); - $ostype = $tmp['browseros']; - $html = ''; // accesskey is for Windows or Linux: ALT + key for chrome, ALT + SHIFT + KEY for firefox // accesskey is for Mac: CTRL + key for all browsers $stringforfirstkey = $langs->trans("KeyboardShortcut"); - if ($ostype === 'macintosh') { + if ($conf->browser->os === 'macintosh') { $stringforfirstkey .= ' CTL +'; } else { if ($conf->browser->name == 'chrome') { @@ -2617,7 +2614,7 @@ function top_menu_quickadd() // Key map shortcut $(document).keydown(function(event){ - var ostype = "'.$ostype.'"; + var ostype = "'.$conf->browser->os.'"; if (ostype === "macintosh") { if ( event.which === 65 && event.ctrlKey ) { console.log(\'control + a : trigger open quick add dropdown\'); @@ -2837,13 +2834,10 @@ function top_menu_bookmark() return $html; } - $tmp = getBrowserInfo($_SERVER["HTTP_USER_AGENT"]); - $ostype = $tmp['browseros']; - // accesskey is for Windows or Linux: ALT + key for chrome, ALT + SHIFT + KEY for firefox // accesskey is for Mac: CTRL + key for all browsers $stringforfirstkey = $langs->trans("KeyboardShortcut"); - if ($ostype === 'macintosh') { + if ($conf->browser->os === 'macintosh') { $stringforfirstkey .= ' CTL +'; } else { if ($conf->browser->name == 'chrome') { @@ -2891,7 +2885,7 @@ function top_menu_bookmark() // Key map shortcut jQuery(document).keydown(function(event) { - var ostype = "'.$ostype.'"; + var ostype = "'.$conf->browser->os.'"; if (ostype === "macintosh") { if ( event.which === 66 && event.ctrlKey ) { console.log("Click on control + b : trigger open bookmark dropdown"); From 96711686da15126d49568d17ae35557980891e9d Mon Sep 17 00:00:00 2001 From: Hystepik Date: Thu, 28 Mar 2024 14:56:10 +0100 Subject: [PATCH 5/6] Fix select member type id width --- htdocs/adherents/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 0bc4aeed29c..7d9b73d444b 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1016,7 +1016,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $listetype = $adht->liste_array(1); print img_picto('', $adht->picto, 'class="pictofixedwidth"'); if (count($listetype)) { - print $form->selectarray("typeid", $listetype, (GETPOST('typeid', 'int') ? GETPOST('typeid', 'int') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0, '', 0, 0, 0, '', '', 1); + print $form->selectarray("typeid", $listetype, (GETPOST('typeid', 'int') ? GETPOST('typeid', 'int') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0, '', 0, 0, 0, '', 'minwidth150', 1); } else { print ''.$langs->trans("NoTypeDefinedGoToSetup").''; } From fa250c8f8abe7b992a3e5e94400d1e6eafb2ec8f Mon Sep 17 00:00:00 2001 From: terhoy <70033666+terhoy@users.noreply.github.com> Date: Thu, 28 Mar 2024 15:13:38 +0100 Subject: [PATCH 6/6] Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into 19.0 --- htdocs/admin/mails_templates.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 7a6d513c589..b19093eeeb0 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -1040,7 +1040,7 @@ foreach ($fieldlist as $field => $value) { } $sortfieldtouse = ($sortable ? $fieldlist[$field] : ''); if ($sortfieldtouse == 'type_template') { - $sortfieldtouse.= 'type_template,lang,position,label'; + $sortfieldtouse .= ',lang,position,label'; } print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], $sortfieldtouse, ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, $css.' '); }