diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index dd6dfee55b1..812547ed317 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -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).' '.$langs->trans("Shipment").'';
+ if (isset($this->statut)) {
+ $datas['picto'] .= ' '.$this->getLibStatut(5);
+ }
+ $datas['ref'] = '
'.$langs->trans('Ref').': '.$this->ref;
+ $datas['refcustomer'] = '
'.$langs->trans('RefCustomer').': '.($this->ref_customer ? $this->ref_customer : $this->ref_client);
+
+ return $datas;
+ }
+
/**
* Return clicable link of object (with eventually picto)
*
@@ -1800,9 +1824,20 @@ class Expedition extends CommonObject
global $langs, $conf, $hookmanager;
$result = '';
- $label = ''.$langs->trans("Shipment").'';
- $label .= '
'.$langs->trans('Ref').': '.$this->ref;
- $label .= '
'.$langs->trans('RefCustomer').': '.($this->ref_customer ? $this->ref_customer : $this->ref_client);
+ $params = [
+ 'id' => $this->id,
+ '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;
@@ -1827,8 +1862,8 @@ class Expedition extends CommonObject
$label = $langs->trans("Shipment");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
- $linkclose .= ' class="classfortooltip"';
+ $linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' class="'.$classfortooltip.'"';
}
$linkstart = '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;
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 985bd288e30..c6cc2acc722 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -2740,7 +2740,7 @@ class FactureFournisseur extends CommonInvoice
$alreadypaid = $this->alreadypaid;
}
- $datas['picto'] .= ' '.$this->getLibStatut(5, $alreadypaid);
+ $$datas['picto'] .= ' '.$this->getLibStatut(5, $alreadypaid);
}
if ($moretitle) {
$datas['picto'] .= ' - '.$moretitle;
diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php
index e3a605a09aa..1b857f2a640 100644
--- a/htdocs/holiday/class/holiday.class.php
+++ b/htdocs/holiday/class/holiday.class.php
@@ -1317,7 +1317,7 @@ class Holiday extends CommonObject
if (isset($this->statut)) {
$datas['picto'] .= ' '.$this->getLibStatut(5);
}
- $datas['label'] = '
'.$langs->trans('Ref').': '.$this->ref;
+ $datas['ref'] = '
'.$langs->trans('Ref').': '.$this->ref;
return $datas;
}