From 021309d7617dcc9fe20b4febc53e6190f4662965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 29 Mar 2023 18:22:36 +0200 Subject: [PATCH 1/3] fix shipping ajax tooltip --- htdocs/core/lib/functions.lib.php | 5 +++++ htdocs/expedition/class/expedition.class.php | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f8074ffcd46..2852de2ccf3 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -11280,6 +11280,11 @@ function getElementProperties($element_type) $subelement = 'commande'; } elseif ($element_type == 'propal') { $classpath = 'comm/propal/class'; + } elseif ($element_type == 'shipping') { + $classpath = 'expedition/class'; + $classfile = 'expedition'; + $classname = 'Expedition'; + $module = 'expedition'; } elseif ($element_type == 'supplier_proposal') { $classpath = 'supplier_proposal/class'; $module = 'supplier_proposal'; diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 7b1c8ae6df7..dcd567908f6 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1834,7 +1834,8 @@ class Expedition extends CommonObject { global $conf, $langs; - $langs->load('shipping'); + $langs->load('sendings'); + $nofetch = !empty($params['nofetch']); $datas = array(); From 8165b2eba86efba1150268345c2b3235cd472d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 29 Mar 2023 18:25:53 +0200 Subject: [PATCH 2/3] fix shipping ajax tooltip --- htdocs/expedition/class/expedition.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index dcd567908f6..6e987b38050 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1845,6 +1845,13 @@ class Expedition extends CommonObject } $datas['ref'] = '
'.$langs->trans('Ref').': '.$this->ref; $datas['refcustomer'] = '
'.$langs->trans('RefCustomer').': '.($this->ref_customer ? $this->ref_customer : $this->ref_client); + if (!$nofetch) { + $langs->load('companies'); + if (empty($this->thirdparty)) { + $this->fetch_thirdparty(); + } + $datas['customer'] = '
'.$langs->trans('Customer').': '.$this->thirdparty->getNomUrl(1, '', 0, 1); + } return $datas; } From 0349b1095a6657238109cdbe57da459196b48910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 29 Mar 2023 20:06:11 +0200 Subject: [PATCH 3/3] fix ajax tooltip --- htdocs/core/ajax/ajaxtooltip.php | 2 +- htdocs/core/lib/functions.lib.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/ajax/ajaxtooltip.php b/htdocs/core/ajax/ajaxtooltip.php index 90c416100cb..9a4d42ce5bb 100644 --- a/htdocs/core/ajax/ajaxtooltip.php +++ b/htdocs/core/ajax/ajaxtooltip.php @@ -79,7 +79,7 @@ top_httphead(); $html = ''; if (is_object($object)) { - if ($object->id > 0) { + if ($object->id > 0 || !empty($object->ref)) { $html = $object->getTooltipContent($params); } elseif ($res == 0) { $html = $langs->trans('Deleted'); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2852de2ccf3..17a9bb30e0d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -11323,6 +11323,10 @@ function getElementProperties($element_type) $classpath = 'comm/propal/class'; $module = 'propal'; $subelement = 'propaleligne'; + } elseif ($element_type == 'opensurvey_sondage') { + $classpath = 'opensurvey/class'; + $module = 'opensurvey'; + $subelement = 'opensurveysondage'; } elseif ($element_type == 'order_supplier') { $classpath = 'fourn/class'; $module = 'fournisseur'; @@ -11340,7 +11344,7 @@ function getElementProperties($element_type) } elseif ($element_type == "service") { $classpath = 'product/class'; $subelement = 'product'; - } elseif ($objecttype == 'salary') { + } elseif ($element_type == 'salary') { $classpath = 'salaries/class'; $module = 'salaries'; }