diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php
index 4420950af30..8746999e00b 100644
--- a/htdocs/bom/class/bom.class.php
+++ b/htdocs/bom/class/bom.class.php
@@ -1121,24 +1121,20 @@ class BOM extends CommonObject
}
$result = '';
+ $params = [
+ 'id' => $this->id,
+ 'objecttype' => $this->element,
+ 'option' => $option,
+ ];
+ $classfortooltip = 'classfortooltip';
+ $dataparams = '';
+ if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
+ $classfortooltip = 'classforajaxtooltip';
+ $dataparams = ' data-params='.json_encode($params);
+ // $label = $langs->trans('Loading');
+ }
- $label = img_picto('', $this->picto).' '.$langs->trans("BillOfMaterials").'';
- if (isset($this->status)) {
- $label .= ' '.$this->getLibStatut(5);
- }
- $label .= '
';
- $label .= ''.$langs->trans('Ref').': '.$this->ref;
- if (isset($this->label)) {
- $label .= '
'.$langs->trans('Label').': '.$this->label;
- }
- if (!empty($this->fk_product) && $this->fk_product > 0) {
- include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
- $product = new Product($db);
- $resultFetch = $product->fetch($this->fk_product);
- if ($resultFetch > 0) {
- $label .= "
".$langs->trans("Product").': '.$product->ref.' - '.$product->label;
- }
- }
+ $label = implode($this->getTooltipContentArray($params));
$url = DOL_URL_ROOT.'/bom/bom_card.php?id='.$this->id;
@@ -1155,18 +1151,6 @@ class BOM extends CommonObject
}
$linkclose = '';
- $classfortooltip = 'classfortooltip';
- $dataparams = '';
- if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
- $params = [
- 'id' => $this->id,
- 'objecttype' => $this->element,
- 'option' => $option,
- ];
- $classfortooltip = 'classforajaxtooltip';
- $dataparams = ' data-params='.json_encode($params);
- // $label = $langs->trans('Loading');
- }
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$label = $langs->trans("ShowBillOfMaterials");
diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php
index f57bca581bd..592b0204983 100644
--- a/htdocs/categories/class/categorie.class.php
+++ b/htdocs/categories/class/categorie.class.php
@@ -1605,7 +1605,7 @@ class Categorie extends CommonObject
*/
public function getTooltipContentArray($params)
{
- global $conf, $langs, $user;
+ global $langs;
$datas = [];
@@ -1629,7 +1629,19 @@ class Categorie extends CommonObject
global $langs, $hookmanager;
$result = '';
- $label = $langs->trans("ShowCategory").': '.($this->ref ? $this->ref : $this->label);
+ $params = [
+ 'id' => $this->id,
+ 'objecttype' => $this->element,
+ 'option' => $option,
+ ];
+ $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));
// Check contrast with background and correct text color
$forced_color = 'categtextwhite';
@@ -1638,18 +1650,6 @@ class Categorie extends CommonObject
$forced_color = 'categtextblack';
}
}
- $classfortooltip = 'classfortooltip';
- $dataparams = '';
- if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
- $params = [
- 'id' => $this->id,
- 'objecttype' => $this->element,
- 'option' => $option,
- ];
- $classfortooltip = 'classforajaxtooltip';
- $dataparams = ' data-params='.json_encode($params);
- // $label = $langs->trans('Loading');
- }
$link = '';
$linkend = '';
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index d0e9a2200f3..b44d22da312 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -133,6 +133,11 @@ class Contact extends CommonObject
public $civility_code;
public $civility;
+ /**
+ * @var string gender
+ */
+ public $gender;
+
/**
* @var int egroupware_id
*/
@@ -193,6 +198,11 @@ class Contact extends CommonObject
public $socid; // both socid and fk_soc are used
public $fk_soc; // both socid and fk_soc are used
+ /**
+ * @var string thirdparty name
+ */
+ public $socname;
+
/**
* @var int 0=inactive, 1=active
*/
@@ -206,6 +216,14 @@ class Contact extends CommonObject
*/
public $email;
+ /**
+ * Email
+ * @var string
+ * @deprecated
+ * @see $email
+ */
+ public $mail;
+
/**
* URL
* @var string
@@ -1045,12 +1063,12 @@ class Contact extends CommonObject
$this->country_id = $obj->country_id;
$this->country_code = $obj->country_id ? $obj->country_code : '';
- $this->country = $obj->country_id ? ($langs->trans('Country'.$obj->country_code) != 'Country'.$obj->country_code ? $langs->transnoentities('Country'.$obj->country_code) : $obj->country) : '';
+ $this->country = $obj->country_id ? ($langs->trans('Country'.$obj->country_code) != 'Country'.$obj->country_code ? $langs->transnoentities('Country'.$obj->country_code) : $obj->country) : '';
- $this->fk_soc = $obj->fk_soc; // Both fk_soc and socid are used
- $this->socid = $obj->fk_soc; // Both fk_soc and socid are used
- $this->socname = $obj->socname;
- $this->poste = $obj->poste;
+ $this->fk_soc = $obj->fk_soc; // Both fk_soc and socid are used
+ $this->socid = $obj->fk_soc; // Both fk_soc and socid are used
+ $this->socname = $obj->socname;
+ $this->poste = $obj->poste;
$this->statut = $obj->statut;
$this->fk_prospectlevel = $obj->fk_prospectlevel;
@@ -1066,22 +1084,22 @@ class Contact extends CommonObject
$this->phone_perso = trim($obj->phone_perso);
$this->phone_mobile = trim($obj->phone_mobile);
- $this->email = $obj->email;
+ $this->email = $obj->email;
$this->socialnetworks = ($obj->socialnetworks ? (array) json_decode($obj->socialnetworks, true) : array());
- $this->photo = $obj->photo;
- $this->priv = $obj->priv;
- $this->mail = $obj->email;
+ $this->photo = $obj->photo;
+ $this->priv = $obj->priv;
+ $this->mail = $obj->email;
$this->birthday = $this->db->jdate($obj->birthday);
- $this->note = $obj->note_private; // deprecated
- $this->note_private = $obj->note_private;
+ $this->note = $obj->note_private; // deprecated
+ $this->note_private = $obj->note_private;
$this->note_public = $obj->note_public;
- $this->default_lang = $obj->default_lang;
+ $this->default_lang = $obj->default_lang;
$this->user_id = $obj->user_id;
- $this->user_login = $obj->user_login;
+ $this->user_login = $obj->user_login;
$this->canvas = $obj->canvas;
- $this->import_key = $obj->import_key;
+ $this->import_key = $obj->import_key;
// Define gender according to civility
$this->setGenderFromCivility();
@@ -1468,35 +1486,19 @@ class Contact extends CommonObject
global $conf, $langs, $hookmanager;
$result = '';
- $label = '';
- if (!empty($this->photo) && class_exists('Form')) {
- $label .= '