diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 0b645571947..e2b7cda5e07 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -2319,33 +2319,21 @@ class Adherent extends CommonObject
}
$result = '';
- $label = '';
$linkstart = '';
$linkend = '';
-
- if (!empty($this->photo)) {
- $label .= '
';
- $label .= Form::showphoto('memberphoto', $this, 80, 0, 0, 'photoref photowithmargin photologintooltip', 'small', 0, 1);
- $label .= '
';
- //$label .= '';
+ $classfortooltip = 'classfortooltip';
+ $dataparams = '';
+ $params = [
+ 'id' => $this->id,
+ 'objecttype' => $this->element,
+ 'option' => $option,
+ ];
+ if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
+ $classfortooltip = 'classforajaxtooltip';
+ $dataparams = ' data-params='.json_encode($params);
+ // $label = $langs->trans('Loading');
}
-
- $label .= '';
- $label .= img_picto('', $this->picto).' '.$langs->trans("Member").'';
- $label .= ' '.$this->getLibStatut(4);
- if (!empty($this->ref)) {
- $label .= '
'.$langs->trans('Ref').': '.$this->ref;
- }
- if (!empty($this->login)) {
- $label .= '
'.$langs->trans('Login').': '.$this->login;
- }
- if (!empty($this->firstname) || !empty($this->lastname)) {
- $label .= '
'.$langs->trans('Name').': '.$this->getFullName($langs);
- }
- if (!empty($this->company)) {
- $label .= '
'.$langs->trans('Company').': '.$this->company;
- }
- $label .= '
';
+ $label = implode($this->getTooltipContentArray($params));
$url = DOL_URL_ROOT.'/adherents/card.php?rowid='.((int) $this->id);
if ($option == 'subscription') {
@@ -2365,18 +2353,6 @@ class Adherent extends CommonObject
$linkstart .= ' $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)) {
$langs->load("users");
diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php
index 1a8c6c7b26c..9819110e6bc 100644
--- a/htdocs/adherents/class/adherent_type.class.php
+++ b/htdocs/adherents/class/adherent_type.class.php
@@ -724,29 +724,24 @@ class AdherentType extends CommonObject
global $langs;
$result = '';
-
- $label = img_picto('', $this->picto).' '.$langs->trans("MemberType").'';
- $label .= ' '.$this->getLibStatut(4);
- $label .= '
'.$langs->trans("Label").': '.$this->label;
- if (isset($this->subscription)) {
- $label .= '
'.$langs->trans("SubscriptionRequired").': '.yn($this->subscription);
- }
-
$option = '';
- $url = DOL_URL_ROOT.'/adherents/type.php?rowid='.((int) $this->id);
$classfortooltip = 'classfortooltip';
$dataparams = '';
+ $params = [
+ 'id' => $this->id,
+ 'objecttype' => $this->element,
+ 'option' => $option,
+ ];
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');
+ // $label = $langs->trans('Loading');
}
+
+ $label = implode($this->getTooltipContentArray($params));
+
+ $url = DOL_URL_ROOT.'/adherents/type.php?rowid='.((int) $this->id);
if ($option != 'nolink') {
// Add param to save lastsearch_values or not
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);