Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2024-03-29 11:51:07 +01:00
commit df6c697dfc
4 changed files with 52 additions and 27 deletions

View file

@ -5,7 +5,7 @@
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Pierre-Henry Favre <phf@atm-consulting.fr>
* Copyright (C) 2016-2023 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016-2024 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2022 Lionel Vessiller <lvessiller@open-dsi.fr>
* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2017 Elarifr. Ari Elbaz <github@accedinfo.com>
@ -395,11 +395,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;
}
}

View file

@ -1001,7 +1001,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, (GETPOSTINT('typeid') ? GETPOSTINT('typeid') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0, '', 0, 0, 0, '', '', 1);
print $form->selectarray("typeid", $listetype, (GETPOSTINT('typeid') ? GETPOSTINT('typeid') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0, '', 0, 0, 0, '', 'minwidth150', 1);
} else {
print '<span class="error">'.$langs->trans("NoTypeDefinedGoToSetup").'</span>';
}

View file

@ -1041,7 +1041,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.' ');
}

View file

@ -2696,12 +2696,16 @@ function top_menu_quickadd()
// 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 ($conf->browser->os === 'macintosh') {
$stringforfirstkey .= ' CTL +';
} else {
if ($conf->browser->name == 'chrome') {
$stringforfirstkey .= ' ALT +';
} elseif ($conf->browser->name == 'firefox') {
$stringforfirstkey .= ' ALT + SHIFT +';
} else {
$stringforfirstkey .= ' CTL +';
}
}
$html .= '<!-- div for quick add link -->
@ -2727,10 +2731,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 = "'.$conf->browser->os.'";
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) {
@ -2943,12 +2955,16 @@ function top_menu_bookmark()
// 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 ($conf->browser->os === '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
@ -2986,11 +3002,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 = "'.$conf->browser->os.'";
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) {