fix tooltip

This commit is contained in:
Frédéric FRANCE 2023-02-05 20:41:29 +01:00
parent 6e07cee3fc
commit 19631fef74
4 changed files with 36 additions and 29 deletions

View File

@ -1727,6 +1727,18 @@ class ActionComm extends CommonObject
$tooltip .= '</div>';
}
$linkclose = '';
$classfortooltip = 'classfortooltip';
$dataparams = '';
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
$params = [
'id' => $this->id,
'objecttype' => $this->element,
'option' => $option,
];
$classfortooltip = 'classforajaxtooltip';
$dataparams = ' data-params='.json_encode($params);
$label = $langs->trans('Loading');
}
//if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color)
// $linkclose = ' style="background-color:#'.$this->type_color.'"';
@ -1735,18 +1747,8 @@ class ActionComm extends CommonObject
$label = $langs->trans("ShowAction");
$linkclose .= ' alt="'.dol_escape_htmltag($tooltip, 1).'"';
}
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
$params = [
'id' => $this->id,
'objecttype' => $this->element,
'option' => $option,
];
$linkclose .= '" data-params='.json_encode($params).' title="' . $langs->trans('Loading') . '"';
$linkclose .= ' class="'.$classname.' classforajaxtooltip"';
} else {
$linkclose .= ' title="'.dol_escape_htmltag($tooltip, 1, 0, '', 1).'"';
$linkclose .= ' class="'.$classname.' classfortooltip"';
}
$linkclose .= ' title="'.dol_escape_htmltag($tooltip, 1, 0, '', 1).'"';
$linkclose .= $dataparams.' class="'.$classname.' '.$classfortooltip.'"';
} else {
$linkclose .= ' class="'.$classname.'"';
}
@ -1806,7 +1808,7 @@ class ActionComm extends CommonObject
$result .= $linkstart;
if ($withpicto) {
$result .= img_object(($notooltip ? '' : $langs->trans("ShowAction").': '.$label), ($overwritepicto ? $overwritepicto : 'action'), (($this->type_color && $overwritepicto) ? 'style="color: #'.$this->type_color.' !important;" ' : '').($notooltip ? 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'"' : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
$result .= img_object(($notooltip ? '' : $langs->trans("ShowAction").': '.$label), ($overwritepicto ? $overwritepicto : 'action'), (($this->type_color && $overwritepicto) ? 'style="color: #'.$this->type_color.' !important;" ' : '').($notooltip ? 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'"' : $dataparams.' class="'.(($withpicto != 2) ? 'paddingright ' : '').$classfortooltip.'"'), 0, 0, $notooltip ? 0 : 1);
}
$result .= dol_escape_htmltag($labelshort);
$result .= $linkend;

View File

@ -3832,23 +3832,25 @@ class Commande extends CommonOrder
}
$linkclose = '';
$classfortooltip = 'classfortooltip';
$dataparams = '';
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
$params = [
'id' => $this->id,
'objecttype' => $this->element,
'option' => $option,
];
$classfortooltip = 'classforajaxtooltip';
$dataparams = ' data-params='.json_encode($params);
$label = $langs->trans('Loading');
}
if (empty($notooltip) && $user->rights->commande->lire) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$label = $langs->trans("Order");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
$params = [
'id' => $this->id,
'objecttype' => $this->element,
'option' => $option,
];
$linkclose .= ' data-params='.json_encode($params).' title="' . $langs->trans('Loading') . '"';
$linkclose .= ' class="classforajaxtooltip"';
} else {
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' class="classfortooltip"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= $dataparams.' class="'.$classfortooltip.'"';
$target_value = array('_self', '_blank', '_parent', '_top');
if (in_array($target, $target_value)) {
@ -3867,7 +3869,7 @@ class Commande extends CommonOrder
$result .= $linkstart;
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) {
$result .= $this->ref;

View File

@ -5009,6 +5009,8 @@ class Product extends CommonObject
{
global $conf, $langs;
$langs->load('products');
$datas = [];
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {

View File

@ -2665,15 +2665,16 @@ class Societe extends CommonObject
if (isset($this->client) && isset($this->fournisseur)) {
$datas['type'] = ' &nbsp; ' . $this->getTypeUrl(1);
}
$datas['name'] = '<br><b>'.$langs->trans('Name').':</b> '.dol_escape_htmltag($this->name);
if (!empty($this->name_alias)) {
$datas['namealias'] = ' ('.dol_escape_htmltag($this->name_alias).')';
}
if ($this->email) {
if (!empty($this->email)) {
$datas['email'] = '<br>'.img_picto('', 'email', 'class="pictofixedwidth"').$this->email;
}
if (!empty($this->url)) {
$datas['url'] = '<br>'.img_picto('', 'globe', 'class="pictofixedwidth"').$this->url;
}
if (!empty($this->phone) || !empty($this->fax)) {
$phonelist = array();
if ($this->phone) {