diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 51c8c4518b5..3a48230de40 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -3756,36 +3756,22 @@ class Propal extends CommonObject
}
$result = '';
- $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));
+
$url = '';
-
if ($user->rights->propal->lire) {
- $label = img_picto('', $this->picto).' '.$langs->trans("Proposal").'';
- if (isset($this->statut)) {
- $label .= ' '.$this->getLibStatut(5);
- }
- if (!empty($this->ref)) {
- $label .= '
'.$langs->trans('Ref').': '.$this->ref;
- }
- if (!empty($this->ref_client)) {
- $label .= '
'.$langs->trans('RefCustomer').': '.$this->ref_client;
- }
- 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 (!empty($this->date)) {
- $label .= '
'.$langs->trans('Date').': '.dol_print_date($this->date, 'day');
- }
- if (!empty($this->delivery_date)) {
- $label .= '
'.$langs->trans('DeliveryDate').': '.dol_print_date($this->delivery_date, 'dayhour');
- }
-
if ($option == '') {
$url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id.$get_params;
} elseif ($option == 'compta') { // deprecated
@@ -3809,18 +3795,6 @@ class Propal 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) && $user->rights->propal->lire) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$label = $langs->trans("Proposal");
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 5f810a8610a..5b111f67e6c 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -3804,46 +3804,22 @@ class Commande extends CommonOrder
if ($short) {
return $url;
}
-
- $label = '';
-
- if ($user->hasRight('commande', 'lire')) {
- $label = img_picto('', $this->picto).' '.$langs->trans("Order").'';
- if (isset($this->statut)) {
- $label .= ' '.$this->getLibStatut(5);
- }
- $label .= '
'.$langs->trans('Ref').': '.$this->ref;
- $label .= '
'.$langs->trans('RefCustomer').': '.(empty($this->ref_customer) ? (empty($this->ref_client) ? '' : $this->ref_client) : $this->ref_customer);
- 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 (!empty($this->date)) {
- $label .= '
'.$langs->trans('Date').': '.dol_print_date($this->date, 'day');
- }
- if (!empty($this->delivery_date)) {
- $label .= '
'.$langs->trans('DeliveryDate').': '.dol_print_date($this->delivery_date, 'dayhour');
- }
- }
-
- $linkclose = '';
+ $params = [
+ 'id' => $this->id,
+ 'objecttype' => $this->element,
+ 'option' => $option,
+ ];
$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');
}
+
+ $label = implode($this->getTooltipContentArray($params));
+
+ $linkclose = '';
if (empty($notooltip) && $user->rights->commande->lire) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$label = $langs->trans("Order");
diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php
index 3ea38f28251..ddfd8a7f57b 100644
--- a/htdocs/mrp/class/mo.class.php
+++ b/htdocs/mrp/class/mo.class.php
@@ -1123,16 +1123,20 @@ class Mo 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("ManufacturingOrder").'';
- 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;
- }
+ $label = implode($this->getTooltipContentArray($params));
$url = DOL_URL_ROOT.'/mrp/mo_card.php?id='.$this->id;
if ($option == 'production') {
@@ -1151,18 +1155,6 @@ class Mo 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("ShowMo");
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 877bcedecdd..6686b4fce8d 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -5125,114 +5125,28 @@ class Product extends CommonObject
global $conf, $langs, $hookmanager;
include_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
- $result = ''; $label = '';
+ $result = '';
$newref = $this->ref;
if ($maxlength) {
$newref = dol_trunc($newref, $maxlength, 'middle');
}
-
- if (!empty($this->entity)) {
- $tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80);
- if ($this->nbphoto > 0) {
- $label .= '