diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 3ce244a4bb1..080abfa6605 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -689,6 +689,32 @@ class Entrepot extends CommonObject } + /** + * getTooltipContentArray + * @param array $params params to construct tooltip data + * @since v18 + * @return array + */ + public function getTooltipContentArray($params) + { + global $conf, $langs, $user; + $langs->load('stocks'); + $datas = []; + if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { + return ['optimize' => $langs->trans("Warehouse")]; + } + $datas['picto'] = img_picto('', $this->picto).' '.$langs->trans("Warehouse").''; + if (isset($this->statut)) { + $datas['picto'] .= ' '.$this->getLibStatut(5); + } + $datas['ref'] .= '
'.$langs->trans('Ref').': '.(empty($this->ref) ? $this->label : $this->ref); + if (!empty($this->lieu)) { + $datas['locationsummary'] .= '
'.$langs->trans('LocationSummary').': '.$this->lieu; + } + + return $datas; + } + /** * Return clickable name (possibility with the pictogram) * @@ -743,8 +769,18 @@ class Entrepot extends CommonObject $label = $langs->trans("Warehouse"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="classfortooltip"'; + 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"'; + } } $linkstart = '