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/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index a744ce71bdc..eda018e6dca 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -706,6 +706,18 @@ 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); + } + if (isset($this->duration)) { + $datas['duration'] = '
'.$langs->trans("Duration").': '.$this->duration_value; + if ($this->duration_value > 1) { + $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")); + } + $datas['duration'] .= " " . (!empty($this->duration_unit) && isset($dur[$this->duration_unit]) ? $langs->trans($dur[$this->duration_unit]) : ''); + } return $datas; } @@ -733,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'; 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")); } 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/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'; diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index dd6dfee55b1..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 @@ -1784,6 +1821,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 +1861,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 +1899,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/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index a3c726ef521..84094914107 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); 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 e3a605a09aa..174f79b099e 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; } @@ -1344,8 +1344,7 @@ class Holiday 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)); 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/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)); 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 cf8fd42c6d8..932f2083194 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2715,25 +2715,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'] = '
'; @@ -2806,7 +2809,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 138aaec5313..bd42149ea07 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));