enhance shipping tooltip
This commit is contained in:
parent
3e91a4b1d1
commit
b9243376af
@ -1784,6 +1784,30 @@ class Expedition extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getTooltipContentArray
|
||||||
|
*
|
||||||
|
* @param array $params ex option, infologin
|
||||||
|
* @since v18
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getTooltipContentArray($params)
|
||||||
|
{
|
||||||
|
global $conf, $langs;
|
||||||
|
|
||||||
|
$langs->load('shipping');
|
||||||
|
$nofetch = empty($params['nofetch']) ? false : true;
|
||||||
|
$datas = [];
|
||||||
|
$datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Shipment").'</u>';
|
||||||
|
if (isset($this->statut)) {
|
||||||
|
$datas['picto'] .= ' '.$this->getLibStatut(5);
|
||||||
|
}
|
||||||
|
$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||||
|
$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '.($this->ref_customer ? $this->ref_customer : $this->ref_client);
|
||||||
|
|
||||||
|
return $datas;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return clicable link of object (with eventually picto)
|
* Return clicable link of object (with eventually picto)
|
||||||
*
|
*
|
||||||
@ -1800,9 +1824,20 @@ class Expedition extends CommonObject
|
|||||||
global $langs, $conf, $hookmanager;
|
global $langs, $conf, $hookmanager;
|
||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
$label = '<u>'.$langs->trans("Shipment").'</u>';
|
$params = [
|
||||||
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
'id' => $this->id,
|
||||||
$label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.($this->ref_customer ? $this->ref_customer : $this->ref_client);
|
'objecttype' => $this->element,
|
||||||
|
'option' => $option,
|
||||||
|
'nofetch' => 1,
|
||||||
|
];
|
||||||
|
$classfortooltip = 'classfortooltip';
|
||||||
|
$dataparams = '';
|
||||||
|
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||||
|
$classfortooltip = 'classforajaxtooltip';
|
||||||
|
$dataparams = ' data-params='.json_encode($params);
|
||||||
|
// $label = $langs->trans('Loading');
|
||||||
|
}
|
||||||
|
$label = implode($this->getTooltipContentArray($params));
|
||||||
|
|
||||||
$url = DOL_URL_ROOT.'/expedition/card.php?id='.$this->id;
|
$url = DOL_URL_ROOT.'/expedition/card.php?id='.$this->id;
|
||||||
|
|
||||||
@ -1827,8 +1862,8 @@ class Expedition extends CommonObject
|
|||||||
$label = $langs->trans("Shipment");
|
$label = $langs->trans("Shipment");
|
||||||
$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.'"';
|
||||||
}
|
}
|
||||||
|
|
||||||
$linkstart = '<a href="'.$url.'"';
|
$linkstart = '<a href="'.$url.'"';
|
||||||
@ -1837,7 +1872,7 @@ class Expedition 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;
|
||||||
|
|||||||
@ -2740,7 +2740,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$alreadypaid = $this->alreadypaid;
|
$alreadypaid = $this->alreadypaid;
|
||||||
}
|
}
|
||||||
|
|
||||||
$datas['picto'] .= ' '.$this->getLibStatut(5, $alreadypaid);
|
$$datas['picto'] .= ' '.$this->getLibStatut(5, $alreadypaid);
|
||||||
}
|
}
|
||||||
if ($moretitle) {
|
if ($moretitle) {
|
||||||
$datas['picto'] .= ' - '.$moretitle;
|
$datas['picto'] .= ' - '.$moretitle;
|
||||||
|
|||||||
@ -1317,7 +1317,7 @@ class Holiday extends CommonObject
|
|||||||
if (isset($this->statut)) {
|
if (isset($this->statut)) {
|
||||||
$datas['picto'] .= ' '.$this->getLibStatut(5);
|
$datas['picto'] .= ' '.$this->getLibStatut(5);
|
||||||
}
|
}
|
||||||
$datas['label'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||||
|
|
||||||
return $datas;
|
return $datas;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user