2
0
forked from Wavyzz/dolibarr

Debug v21

This commit is contained in:
Laurent Destailleur
2024-11-08 18:45:56 +01:00
parent 59718892fa
commit ec7ea921d4
2 changed files with 3 additions and 2 deletions

View File

@@ -1403,7 +1403,8 @@ class FormFile
// Show title of list of existing files
$morehtmlright = '';
if (!empty($moreoptions['showhideaddbutton']) && $conf->use_javascript_ajax) {
$morehtmlright .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', 'javascript:console.log("open add file form");jQuery(".divattachnewfile").toggle(); if (!jQuery(".divattachnewfile").is(":hidden")) { jQuery("input[type=\'file\']").click(); }', '', $permtoeditline);
$url = 'javascript:console.log("open add file form");jQuery(".divattachnewfile").toggle(); if (!jQuery(".divattachnewfile").is(":hidden")) { jQuery("input[type=\'file\']").click(); }';
$morehtmlright .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $url, '', $permtoeditline);
}
if ((empty($useinecm) || $useinecm == 3 || $useinecm == 6) && $title != 'none') {

View File

@@ -12874,7 +12874,7 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u
$TCompiledAttr = array();
foreach ($attr as $key => $value) {
$TCompiledAttr[] = $key.'="'.dolPrintHTMLForAttribute($value).'"';
$TCompiledAttr[] = $key.'="'.dol_escape_htmltag($value).'"'; // Do not use dolPrintHTMLForAttribute() here, we must accept "javascript:string"
}
$compiledAttributes = (empty($TCompiledAttr) ? '' : implode(' ', $TCompiledAttr));