From 7af9834a0c7b99ebc13794747afd5d3b1a76c8f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 13 Feb 2023 21:28:20 +0100 Subject: [PATCH 01/13] enhance member tooltip --- htdocs/adherents/class/adherent.class.php | 4 ++++ htdocs/core/ajax/ajaxtooltip.php | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 6e77fd3fa95..b84d622094d 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2287,6 +2287,7 @@ class Adherent extends CommonObject global $conf, $langs; $datas = []; + $langs->loadLangs(['members', 'companies']); $nofetch = empty($params['nofetch']) ? false : true; if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { @@ -2303,6 +2304,9 @@ class Adherent extends CommonObject $datas['divopen'] = '
'; $datas['picto'] = img_picto('', $this->picto).' '.$langs->trans("Member").' '.$this->getLibStatut(4); + if (!empty($this->morphy)) { + $datas['picto'] .= ' ' . $this->getmorphylib('', 1); + } if (!empty($this->ref)) { $datas['ref'] = '
'.$langs->trans('Ref').': '.$this->ref; } diff --git a/htdocs/core/ajax/ajaxtooltip.php b/htdocs/core/ajax/ajaxtooltip.php index 3933f03533b..8652908eced 100644 --- a/htdocs/core/ajax/ajaxtooltip.php +++ b/htdocs/core/ajax/ajaxtooltip.php @@ -118,7 +118,6 @@ if ($objecttype == 'facture' || $objecttype == 'invoice') { $module = 'contrat'; $myobject = 'contrat'; } elseif ($objecttype == 'member') { - $langs->load('members'); $classpath = 'adherents/class'; $module = 'adherent'; $myobject = 'adherent'; From e54020ea153b9dd8e49b13bebf68d36bb142a92c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 13 Feb 2023 21:32:43 +0100 Subject: [PATCH 02/13] enhance membertype tooltip --- htdocs/adherents/class/adherent_type.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index a744ce71bdc..9534ed639ae 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -706,6 +706,9 @@ class AdherentType extends CommonObject if (isset($this->subscription)) { $datas['subscription'] = '
'.$langs->trans("SubscriptionRequired").': '.yn($this->subscription); } + if (isset($this->vote)) { + $datas['vote'] = '
'.$langs->trans("VoteAllowed").': '.yn($this->vote); + } return $datas; } From bd1d487c382a1d12f098145f07d264b8a33af0e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 13 Feb 2023 21:40:48 +0100 Subject: [PATCH 03/13] enhance membertype tooltip --- htdocs/adherents/class/adherent_type.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 9534ed639ae..ebf0a6fdb7a 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -709,6 +709,15 @@ class AdherentType extends CommonObject if (isset($this->vote)) { $datas['vote'] = '
'.$langs->trans("VoteAllowed").': '.yn($this->vote); } + if (isset($this->duration)) { + $datas['duration'] = '
'.$langs->trans("Duration").': '.$this->duration_value; + if ($this->duration_value > 1) { + $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years")); + } elseif ($this->duration_value > 0) { + $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year")); + } + $datas['duration'] .= " " . (!empty($this->duration_unit) && isset($dur[$this->duration_unit]) ? $langs->trans($dur[$this->duration_unit]) : ''); + } return $datas; } @@ -736,6 +745,7 @@ class AdherentType extends CommonObject 'id' => $this->id, 'objecttype' => $this->element, 'option' => $option, + 'nofetch' => 1, ]; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; From 364e8a554ab0489a6506caae8529351010db81fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 13 Feb 2023 21:47:44 +0100 Subject: [PATCH 04/13] enhance membertype tooltip --- htdocs/adherents/class/adherent_type.class.php | 2 +- htdocs/adherents/type.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index ebf0a6fdb7a..eda018e6dca 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -712,7 +712,7 @@ class AdherentType extends CommonObject if (isset($this->duration)) { $datas['duration'] = '
'.$langs->trans("Duration").': '.$this->duration_value; if ($this->duration_value > 1) { - $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years")); + $dur = array("i"=>$langs->trans("Minutes"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years")); } elseif ($this->duration_value > 0) { $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year")); } diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index c91915f7bdb..8b459e2c7b6 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -522,7 +522,7 @@ if ($rowid > 0) { print ''.$langs->trans("Duration").''.$object->duration_value.' '; if ($object->duration_value > 1) { - $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years")); + $dur = array("i"=>$langs->trans("Minutes"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years")); } elseif ($object->duration_value > 0) { $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year")); } From 3e91a4b1d142d48f47f911c5a471ecdf5a8232c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 13 Feb 2023 22:51:46 +0100 Subject: [PATCH 05/13] enhance membertype tooltip --- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index c6cc2acc722..985bd288e30 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; From b9243376afb35086d1282f73570f9e86a4a7fc58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 13 Feb 2023 23:29:10 +0100 Subject: [PATCH 06/13] enhance shipping tooltip --- htdocs/expedition/class/expedition.class.php | 47 ++++++++++++++++--- .../fourn/class/fournisseur.facture.class.php | 2 +- htdocs/holiday/class/holiday.class.php | 2 +- 3 files changed, 43 insertions(+), 8 deletions(-) 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; } From adc7d1fae2f079f1f44fdd4b9cc53cf635c46348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 13 Feb 2023 23:42:08 +0100 Subject: [PATCH 07/13] enhance shipping tooltip --- htdocs/expedition/class/expedition.class.php | 37 ++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 812547ed317..0592b5cfdcf 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -90,6 +90,15 @@ class Expedition extends CommonObject */ public $fields = array(); + /** + * @var int ID of user author + */ + public $user_author_id; + + /** + * @var int ID of user author + */ + public $fk_user_author; public $socid; @@ -175,8 +184,35 @@ class Expedition extends CommonObject public $meths; public $listmeths; // List of carriers + /** + * @var int ID of order + */ + public $commande_id; + + /** + * @var Commande order + */ + public $commande; + + /** + * @var ExpeditionLigne[] array of shipping lines + */ public $lines = array(); + // Multicurrency + /** + * @var int Currency ID + */ + public $fk_multicurrency; + + /** + * @var string multicurrency code + */ + public $multicurrency_code; + public $multicurrency_tx; + public $multicurrency_total_ht; + public $multicurrency_total_tva; + public $multicurrency_total_ttc; /** * Draft status @@ -565,6 +601,7 @@ class Expedition extends CommonObject $this->ref_ext = $obj->ref_ext; $this->statut = $obj->fk_statut; $this->user_author_id = $obj->fk_user_author; + $this->fk_user_author = $obj->fk_user_author; $this->date_creation = $this->db->jdate($obj->date_creation); $this->date_valid = $this->db->jdate($obj->date_valid); $this->date = $this->db->jdate($obj->date_expedition); // TODO deprecated From 6745860cac8cc01d263f847c835808af529c48c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 14 Feb 2023 20:24:07 +0100 Subject: [PATCH 08/13] clean code --- htdocs/societe/class/societe.class.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index e180d9ab13e..37d383e69a7 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2716,25 +2716,28 @@ class Societe extends CommonObject if (!empty($this->code_client) && ($this->client == 1 || $this->client == 3)) { $datas['customercode'] = '
'.$langs->trans('CustomerCode').': '.$this->code_client; } + if (isModEnabled('accounting') && ($this->client == 1 || $this->client == 3)) { + $langs->load('compta'); + $datas['accountancycustomercode'] = '
'.$langs->trans('CustomerAccountancyCode').': '.($this->code_compta ? $this->code_compta : $this->code_compta_client); + } + // show categories for this record only in ajax to not overload lists + if (!$nofetch && isModEnabled('categorie') && $this->client) { + require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; + $form = new Form($this->db); + $datas['categories_customer'] = '
' . $form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1, 1); + } if (!empty($this->code_fournisseur) && $this->fournisseur) { $datas['suppliercode'] = '
'.$langs->trans('SupplierCode').': '.$this->code_fournisseur; } - if (isModEnabled('accounting') && ($this->client == 1 || $this->client == 3)) { - $datas['accountancycustomercode'] = '
'.$langs->trans('CustomerAccountancyCode').': '.($this->code_compta ? $this->code_compta : $this->code_compta_client); - } if (isModEnabled('accounting') && $this->fournisseur) { + $langs->load('compta'); $datas['accountancysuppliercode'] = '
'.$langs->trans('SupplierAccountancyCode').': '.$this->code_compta_fournisseur; } // show categories for this record only in ajax to not overload lists - if (isModEnabled('categorie') && !$nofetch) { + if (!$nofetch && isModEnabled('categorie') && $this->fournisseur) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $form = new Form($this->db); - if ($this->client) { - $datas['categories_customer'] = '
' . $form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1); - } - if ($this->fournisseur) { - $datas['categories_supplier'] = '
' . $form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1); - } + $datas['categories_supplier'] = '
' . $form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1, 1); } $datas['divclose'] = '
'; From bd5dc3dbcc7bbf94f405de31c386fa181a5cdc2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 14 Feb 2023 21:00:34 +0100 Subject: [PATCH 09/13] add ajaxtooltip on expensereport --- .../class/expensereport.class.php | 76 ++++++++++++++----- 1 file changed, 55 insertions(+), 21 deletions(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index a3c726ef521..9e60ac4b8c7 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1693,6 +1693,44 @@ class ExpenseReport extends CommonObject } } + /** + * getTooltipContentArray + * + * @param array $params ex option, infologin + * @since v18 + * @return array + */ + public function getTooltipContentArray($params) + { + global $conf, $langs; + + $langs->load('expensereport'); + $nofetch = empty($params['nofetch']) ? false : true; + $moretitle = $params['moretitle'] ?? ''; + $datas = []; + $datas['picto'] = img_picto('', $this->picto).' '.$langs->trans("ExpenseReport").''; + if (isset($this->status)) { + $datas['picto'] .= ' '.$this->getLibStatut(5); + } + if ($moretitle) { + $datas['picto'] .= ' - '.$moretitle; + } + if (!empty($this->ref)) { + $datas['ref'] = '
'.$langs->trans('Ref').': '.$this->ref; + } + if (!empty($this->total_ht)) { + $datas['total_ht'] = '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); + } + if (!empty($this->total_tva)) { + $datas['total_tva'] = '
'.$langs->trans('VAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); + } + if (!empty($this->total_ttc)) { + $datas['total_ttc'] = '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); + } + + return $datas; + } + /** * Return clicable name (with picto eventually) * @@ -1717,25 +1755,21 @@ class ExpenseReport extends CommonObject return $url; } - $label = img_picto('', $this->picto).' '.$langs->trans("ExpenseReport").''; - if (isset($this->status)) { - $label .= ' '.$this->getLibStatut(5); - } - if (!empty($this->ref)) { - $label .= '
'.$langs->trans('Ref').': '.$this->ref; - } - if (!empty($this->total_ht)) { - $label .= '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); - } - if (!empty($this->total_tva)) { - $label .= '
'.$langs->trans('VAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); - } - if (!empty($this->total_ttc)) { - $label .= '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); - } - if ($moretitle) { - $label .= ' - '.$moretitle; + $params = [ + 'id' => $this->id, + 'objecttype' => $this->element, + 'option' => $option, + 'moretitle' => $moretitle, + '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)); if ($option != 'nolink') { // Add param to save lastsearch_values or not @@ -1759,8 +1793,8 @@ class ExpenseReport extends CommonObject $label = $langs->trans("ShowExpenseReport"); $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 .= ($max ? dol_trunc($ref, $max) : $ref); From 8e9db307074ceea7678e6587aaffa68b641b6290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 15 Feb 2023 08:52:15 +0100 Subject: [PATCH 10/13] add ajax tooltip on mailing --- htdocs/comm/mailing/class/mailing.class.php | 55 ++++++++++++++++++--- htdocs/holiday/class/holiday.class.php | 1 - 2 files changed, 47 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 75cf669d3c8..32c3126c7a5 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -726,6 +726,36 @@ class Mailing extends CommonObject return 1; } + /** + * getTooltipContentArray + * + * @param array $params ex option, infologin + * @since v18 + * @return array + */ + public function getTooltipContentArray($params) + { + global $conf, $langs; + + $nofetch = empty($params['nofetch']) ? false : true; + $langs->load('mails'); + + $datas = []; + $datas['picto'] = img_picto('', $this->picto).' '.$langs->trans("ShowEMailing").''; + if (isset($this->statut)) { + $datas['picto'] .= ' '.$this->getLibStatut(5); + } + $datas['ref'] = '
'.$langs->trans('Ref').': '.$this->ref; + if (isset($this->title)) { + $datas['title'] .= '
'.$langs->trans('MailTitle').': '.$this->title; + } + if (isset($this->sujet)) { + $datas['subject'] .= '
'.$langs->trans('MailTopic').': '.$this->sujet; + } + + return $datas; + } + /** * Return a link to the object card (with optionally the picto) * @@ -747,11 +777,20 @@ class Mailing extends CommonObject } $result = ''; - $companylink = ''; - - $label = ''.$langs->trans("ShowEMailing").''; - $label .= '
'; - $label .= ''.$langs->trans('Ref').': '.$this->ref; + $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.'/comm/mailing/card.php?id='.$this->id; @@ -772,8 +811,8 @@ class Mailing extends CommonObject $label = $langs->trans("ShowEMailing"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; + $linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; } else { $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); } @@ -784,7 +823,7 @@ class Mailing extends CommonObject $result .= $linkstart; if ($withpicto) { - $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); + $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($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/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 1b857f2a640..0b34b19a1a2 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1345,7 +1345,6 @@ class Holiday extends CommonObject if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; $dataparams = ' data-params='.json_encode($params); - // $label = $langs->trans('Loading'); } $label = implode($this->getTooltipContentArray($params)); From d990b9361199666d1d091b947de106ce980a680d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 15 Feb 2023 15:47:03 +0100 Subject: [PATCH 11/13] fix merge --- htdocs/langs/fr_FR/errors.lang | 4 ---- 1 file changed, 4 deletions(-) diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index 803bebf310e..939c070008d 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -348,11 +348,7 @@ WarningPaypalPaymentNotCompatibleWithStrict=La valeur 'Strict' fait que les fonc WarningThemeForcedTo=Attention, le choix du thème a été forcé à %s par la constante cachée MAIN_FORCETHEME WarningPagesWillBeDeleted=Attention, cela supprimera également toutes les pages/conteneurs existants du site. Vous devriez exporter votre site Web avant, afin d'avoir une sauvegarde pour le réimporter plus tard. WarningAutoValNotPossibleWhenStockIsDecreasedOnInvoiceVal=La validation automatique est désactivée lorsque l'option de diminution du stock est définie sur "Validation de la facture". -<<<<<<< HEAD -WarningModuleNeedRefrech = Module %s desactivé. N'oublier pas de le réactivé -======= WarningModuleNeedRefrech = Le module %s a été désactivé. N'oubliez pas de le réactiver ->>>>>>> branch '17.0' of git@github.com:Dolibarr/dolibarr.git # Validate RequireValidValue = Valeur non valide From 26452c96440b9d1ddc803309408ee741f7304a68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 15 Feb 2023 22:02:45 +0100 Subject: [PATCH 12/13] fix tooltip project --- htdocs/projet/class/project.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 2e2c2f45284..606730300a7 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1323,8 +1323,7 @@ class Project extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); - // $label = $langs->trans('Loading'); + $dataparams = " data-params='".json_encode($params)."'"; } $label = implode($this->getTooltipContentArray($params)); From c1882425db8c58959d1508097ea8146affab847a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 15 Feb 2023 22:26:16 +0100 Subject: [PATCH 13/13] fix tooltip --- htdocs/expensereport/class/expensereport.class.php | 2 +- htdocs/fichinter/class/fichinter.class.php | 2 +- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- htdocs/holiday/class/holiday.class.php | 2 +- htdocs/knowledgemanagement/class/knowledgerecord.class.php | 2 +- htdocs/modulebuilder/template/class/myobject.class.php | 2 +- htdocs/mrp/class/mo.class.php | 2 +- htdocs/opensurvey/class/opensurveysondage.class.php | 2 +- htdocs/partnership/class/partnership.class.php | 2 +- htdocs/product/class/product.class.php | 2 +- htdocs/product/stock/class/entrepot.class.php | 2 +- htdocs/product/stock/class/productlot.class.php | 2 +- htdocs/projet/class/task.class.php | 2 +- htdocs/resource/class/dolresource.class.php | 2 +- htdocs/salaries/class/salary.class.php | 2 +- htdocs/societe/class/societe.class.php | 2 +- htdocs/societe/class/societeaccount.class.php | 2 +- htdocs/supplier_proposal/class/supplier_proposal.class.php | 2 +- htdocs/ticket/class/ticket.class.php | 2 +- htdocs/user/class/user.class.php | 2 +- htdocs/user/class/usergroup.class.php | 2 +- htdocs/workstation/class/workstation.class.php | 2 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 9e60ac4b8c7..84094914107 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1766,7 +1766,7 @@ class ExpenseReport extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } $label = implode($this->getTooltipContentArray($params)); diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 7070f94ab23..62f05f8750d 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -815,7 +815,7 @@ class Fichinter extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } $label = implode($this->getTooltipContentArray($params)); diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 335bd6b2df4..86be26b17ef 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -914,7 +914,7 @@ class CommandeFournisseur extends CommonOrder $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index c6cc2acc722..6f4ba3024e1 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2831,7 +2831,7 @@ class FactureFournisseur extends CommonInvoice $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 0b34b19a1a2..174f79b099e 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1344,7 +1344,7 @@ class Holiday extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; } $label = implode($this->getTooltipContentArray($params)); diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index f85b2f8e9cf..13efabac856 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -777,7 +777,7 @@ class KnowledgeRecord extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; } $label = implode($this->getTooltipContentArray($params)); diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index e4594e6d615..5143f8a9790 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -803,7 +803,7 @@ class MyObject extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } $label = implode($this->getTooltipContentArray($params)); diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index afdac2d16a8..452a87b6ab8 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -1169,7 +1169,7 @@ class Mo extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index b141da8d392..9c3ced9be54 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -474,7 +474,7 @@ class Opensurveysondage extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } $label = implode($this->getTooltipContentArray($params)); diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 840569082b2..a6df07655ed 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -990,7 +990,7 @@ class Partnership extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } $label = implode($this->getTooltipContentArray($params)); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 74025356811..a18a7796541 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5149,7 +5149,7 @@ class Product extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index d201463b169..a165bf79038 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -748,7 +748,7 @@ class Entrepot extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 39a8d5721a9..371eb85c040 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -641,7 +641,7 @@ class Productlot extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 1a4f96bacc6..9d0fee6323e 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -753,7 +753,7 @@ class Task extends CommonObjectLine $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } $label = implode($this->getTooltipContentArray($params)); diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 5d0c0481b98..a2d8863f8ed 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -815,7 +815,7 @@ class Dolresource extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } $label = implode($this->getTooltipContentArray($params)); diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index acf811b4f88..90666a6853d 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -539,7 +539,7 @@ class Salary extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 37d383e69a7..9586b8a6096 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2810,7 +2810,7 @@ class Societe extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } $label = implode($this->getTooltipContentArray($params)); diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index a10fee1666e..c5ffa20aebb 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -435,7 +435,7 @@ class SocieteAccount extends CommonObject 'option' => $option, ]; $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } if (empty($notooltip)) { diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 6d7d7bc3720..38ae47dc691 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2538,7 +2538,7 @@ class SupplierProposal extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index bc50c0e31f8..f54f13f0828 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1488,7 +1488,7 @@ class Ticket extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } $label = implode($this->getTooltipContentArray($params)); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index ff92cc54ede..c60f854840a 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2860,7 +2860,7 @@ class User extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } $label = implode($this->getTooltipContentArray($params)); diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 04554b282d0..60f92f0d40c 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -782,7 +782,7 @@ class UserGroup extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } $label = implode($this->getTooltipContentArray($params)); diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index 3adf2f3cd8a..dcb966daa6c 100644 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -734,7 +734,7 @@ class Workstation extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = " data-params='".json_encode($params)."'"; // $label = $langs->trans('Loading'); } $label = implode($this->getTooltipContentArray($params));