From 7eb0b712520f97e84a2c6ebb76ca0116d08ab79f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 31 Jan 2023 22:43:54 +0100 Subject: [PATCH] work on ajax tooltip --- htdocs/commande/class/commande.class.php | 8 ++++---- htdocs/core/ajax/ajaxtooltip.php | 4 ---- htdocs/core/class/commonobject.class.php | 4 ++-- htdocs/product/class/product.class.php | 2 +- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 4dcae469aaa..16f22c80c91 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3716,11 +3716,11 @@ class Commande extends CommonOrder /** * getTooltipContentArray - * @param array $parameters + * @param array $params params to construct tooltip data * @since v18 * @return array */ - public function getTooltipContentArray($parameters) + public function getTooltipContentArray($params) { global $conf, $langs, $user; @@ -3730,7 +3730,7 @@ class Commande extends CommonOrder return ['optimize' => $langs->trans("Order")]; } - if ($user->rights->commande->lire) { + if ($user->hasRight('commande', 'lire')) { $datas['picto'] = img_picto('', $this->picto).' '.$langs->trans("Order").''; if (isset($this->statut)) { $datas[] = ' '.$this->getLibStatut(5); @@ -3807,7 +3807,7 @@ class Commande extends CommonOrder $label = ''; - if ($user->rights->commande->lire) { + if ($user->hasRight('commande', 'lire')) { $label = img_picto('', $this->picto).' '.$langs->trans("Order").''; if (isset($this->statut)) { $label .= ' '.$this->getLibStatut(5); diff --git a/htdocs/core/ajax/ajaxtooltip.php b/htdocs/core/ajax/ajaxtooltip.php index 2342bcf35f1..569f2fc6ad7 100644 --- a/htdocs/core/ajax/ajaxtooltip.php +++ b/htdocs/core/ajax/ajaxtooltip.php @@ -106,10 +106,6 @@ if ($objecttype == 'facture' || $objecttype == 'invoice') { $classpath = 'adherents/class'; $module = 'adherent'; $myobject = 'adherent'; -} elseif ($objecttype == 'cabinetmed_cons') { - $classpath = 'cabinetmed/class'; - $module = 'cabinetmed'; - $myobject = 'cabinetmedcons'; } elseif ($objecttype == 'fichinter') { $langs->load('interventions'); $classpath = 'fichinter/class'; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 416e1ca737b..b209d7450f4 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -668,7 +668,7 @@ abstract class CommonObject * getTooltipContentArray * * @since v18 - * @param array $params + * @param array $params params to construct tooltip data * @return array */ public function getTooltipContentArray($params) @@ -679,7 +679,7 @@ abstract class CommonObject /** * getTooltipContent * - * @param array $params + * @param array $params params * @since v18 * @return string */ diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index e7160ef467a..ab9d33a0500 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5001,7 +5001,7 @@ class Product extends CommonObject /** * getTooltipContentArray - * @param array $params + * @param array $params params to construct tooltip data * @since v18 * @return array */