add ajax tooltip on intervention
This commit is contained in:
parent
2c7a01848c
commit
dc97584f87
@ -770,6 +770,29 @@ class Fichinter extends CommonObject
|
|||||||
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statuscode, $mode);
|
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statuscode, $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getTooltipContentArray
|
||||||
|
*
|
||||||
|
* @param array $params ex option, infologin
|
||||||
|
* @since v18
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getTooltipContentArray($params)
|
||||||
|
{
|
||||||
|
global $conf, $langs;
|
||||||
|
|
||||||
|
$langs->load('fichinter');
|
||||||
|
|
||||||
|
$datas = [];
|
||||||
|
$datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Intervention").'</u>';
|
||||||
|
if (isset($this->status)) {
|
||||||
|
$datas['picto'] .= ' '.$this->getLibStatut(5);
|
||||||
|
}
|
||||||
|
$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||||
|
|
||||||
|
return $datas;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return clicable name (with picto eventually)
|
* Return clicable name (with picto eventually)
|
||||||
*
|
*
|
||||||
@ -784,12 +807,18 @@ class Fichinter extends CommonObject
|
|||||||
global $conf, $langs, $hookmanager;
|
global $conf, $langs, $hookmanager;
|
||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
|
$params = [
|
||||||
$label = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Intervention").'</u>';
|
'id' => $this->id,
|
||||||
if (isset($this->status)) {
|
'objecttype' => $this->element,
|
||||||
$label .= ' '.$this->getLibStatut(5);
|
];
|
||||||
|
$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.'/fichinter/card.php?id='.$this->id;
|
$url = DOL_URL_ROOT.'/fichinter/card.php?id='.$this->id;
|
||||||
|
|
||||||
@ -810,15 +839,8 @@ class Fichinter extends CommonObject
|
|||||||
$label = $langs->trans("ShowIntervention");
|
$label = $langs->trans("ShowIntervention");
|
||||||
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||||
}
|
}
|
||||||
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
|
$linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"';
|
||||||
$linkclose .= ' class="classfortooltip"';
|
$linkclose .= ' class="'.$classfortooltip.'"';
|
||||||
|
|
||||||
/*
|
|
||||||
$hookmanager->initHooks(array('fichinterdao'));
|
|
||||||
$parameters=array('id'=>$this->id);
|
|
||||||
$reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if ($reshook > 0) $linkclose = $hookmanager->resPrint;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$linkstart = '<a href="'.$url.'"';
|
$linkstart = '<a href="'.$url.'"';
|
||||||
@ -827,7 +849,7 @@ class Fichinter 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;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user