clean code
This commit is contained in:
parent
e5190ef6a5
commit
06904246f8
@ -1336,11 +1336,18 @@ class Holiday extends CommonObject
|
|||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
$label = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Holiday").'</u>';
|
$params = [
|
||||||
if (isset($this->statut)) {
|
'id' => $this->id,
|
||||||
$label .= ' '.$this->getLibStatut(5);
|
'objecttype' => $this->element,
|
||||||
|
];
|
||||||
|
$classfortooltip = 'classfortooltip';
|
||||||
|
$dataparams = '';
|
||||||
|
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||||
|
$classfortooltip = 'classforajaxtooltip';
|
||||||
|
$dataparams = ' data-params='.json_encode($params);
|
||||||
|
// $label = $langs->trans('Loading');
|
||||||
}
|
}
|
||||||
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
$label = implode($this->getTooltipContentArray($params));
|
||||||
|
|
||||||
$url = DOL_URL_ROOT.'/holiday/card.php?id='.$this->id;
|
$url = DOL_URL_ROOT.'/holiday/card.php?id='.$this->id;
|
||||||
|
|
||||||
@ -1355,17 +1362,6 @@ class Holiday extends CommonObject
|
|||||||
$url .= '&save_lastsearch_values=1';
|
$url .= '&save_lastsearch_values=1';
|
||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
$classfortooltip = 'classfortooltip';
|
|
||||||
$dataparams = '';
|
|
||||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
|
||||||
$params = [
|
|
||||||
'id' => $this->id,
|
|
||||||
'objecttype' => $this->element,
|
|
||||||
];
|
|
||||||
$classfortooltip = 'classforajaxtooltip';
|
|
||||||
$dataparams = ' data-params='.json_encode($params);
|
|
||||||
// $label = $langs->trans('Loading');
|
|
||||||
}
|
|
||||||
$linkstart = '<a href="'.$url.'"'.$dataparams.' title="'.dol_escape_htmltag($label, 1).'" class="'.$classfortooltip.'">';
|
$linkstart = '<a href="'.$url.'"'.$dataparams.' title="'.dol_escape_htmltag($label, 1).'" class="'.$classfortooltip.'">';
|
||||||
$linkend = '</a>';
|
$linkend = '</a>';
|
||||||
|
|
||||||
|
|||||||
@ -794,13 +794,19 @@ class MyObject extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
|
$params = [
|
||||||
$label = img_picto('', $this->picto).' <u>'.$langs->trans("MyObject").'</u>';
|
'id' => $this->id,
|
||||||
if (isset($this->status)) {
|
'objecttype' => $this->element,
|
||||||
$label .= ' '.$this->getLibStatut(5);
|
'option' => $option,
|
||||||
|
];
|
||||||
|
$classfortooltip = 'classfortooltip';
|
||||||
|
$dataparams = '';
|
||||||
|
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||||
|
$classfortooltip = 'classforajaxtooltip';
|
||||||
|
$dataparams = ' data-params='.json_encode($params);
|
||||||
|
// $label = $langs->trans('Loading');
|
||||||
}
|
}
|
||||||
$label .= '<br>';
|
$label = implode($this->getTooltipContentArray($params));
|
||||||
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
|
||||||
|
|
||||||
$url = dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$this->id;
|
$url = dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$this->id;
|
||||||
|
|
||||||
@ -816,18 +822,6 @@ class MyObject extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
$linkclose = '';
|
$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)) {
|
if (empty($notooltip)) {
|
||||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||||
$label = $langs->trans("ShowMyObject");
|
$label = $langs->trans("ShowMyObject");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user