fix for double tooltip

This commit is contained in:
Frédéric FRANCE 2023-02-04 22:09:18 +01:00
parent 83b4fde50c
commit 473690f49b

View File

@ -3809,23 +3809,25 @@ class Propal extends CommonObject
} }
$linkclose = ''; $linkclose = '';
if (empty($notooltip) && $user->rights->propal->lire) { $classfortooltip = 'classfortooltip';
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $dataparams = '';
$label = $langs->trans("Proposal");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
$params = [ $params = [
'id' => $this->id, 'id' => $this->id,
'objecttype' => $this->element, 'objecttype' => $this->element,
'option' => $option, 'option' => $option,
]; ];
$linkclose .= ' data-params='.json_encode($params).' title="' . $langs->trans('Loading') . '"'; $classfortooltip = 'classforajaxtooltip';
$linkclose .= ' class="classforajaxtooltip"'; $dataparams = ' data-params='.json_encode($params);
} else { $label = $langs->trans('Loading');
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' class="classfortooltip"';
} }
if (empty($notooltip) && $user->rights->propal->lire) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$label = $langs->trans("Proposal");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= $dataparams.' class="'.$classfortooltip.'"';
} }
$linkstart = '<a href="'.$url.'"'; $linkstart = '<a href="'.$url.'"';
@ -3834,7 +3836,7 @@ class Propal extends CommonObject
$result .= $linkstart; $result .= $linkstart;
if ($withpicto) { if ($withpicto) {
$result .= img_object(($notooltip ? '' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); $result .= img_object(($notooltip ? '' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : $dataparams.' class="'.(($withpicto != 2) ? 'paddingright ' : '').$classfortooltip.'"'), 0, 0, $notooltip ? 0 : 1);
} }
if ($withpicto != 2) { if ($withpicto != 2) {
$result .= $this->ref; $result .= $this->ref;