From 22fb5a4e6a8d1930cf8ebc2034e29adb2e026291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 2 Feb 2023 23:12:54 +0100 Subject: [PATCH] add ajax tooltip on delivery --- htdocs/delivery/class/delivery.class.php | 30 ++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 3b560ce1026..717696ac430 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -720,6 +720,24 @@ class Delivery extends CommonObject } } + /** + * getTooltipContentArray + * @param array $params params to construct tooltip data + * @since v18 + * @return array + */ + public function getTooltipContentArray($params) + { + global $conf, $langs; + + $datas = []; + + $datas['picto'] = img_picto('', $this->picto).' '.$langs->trans("ShowReceiving").':
'; + $datas['picto'] .= ''.$langs->trans("Status").': '.$this->ref; + + return $datas; + } + /** * Return clicable name (with picto eventually) * @@ -750,8 +768,16 @@ class Delivery extends CommonObject } //} - - $linkstart = ''; + if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { + $params = [ + 'id' => $this->id, + 'objecttype' => $this->element, + ]; + $linkstart = ''; + } $linkend = ''; if ($withpicto) {