diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index dd7fe7f33b5..4dffa624719 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -2377,7 +2377,7 @@ class Adherent extends CommonObject
'objecttype' => $this->element,
'option' => $option,
];
- $linkclose .= ' data-params='.json_encode($params).' id="' . uniqid('member') . '" title="' . $langs->trans('Loading') . '"';
+ $linkclose .= ' data-params='.json_encode($params).' title="' . $langs->trans('Loading') . '"';
$linkclose .= ' class="classforajaxtooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php
index 639f417bb94..5543a6e8e76 100644
--- a/htdocs/adherents/class/adherent_type.class.php
+++ b/htdocs/adherents/class/adherent_type.class.php
@@ -752,7 +752,7 @@ class AdherentType extends CommonObject
'objecttype' => $this->element,
'option' => $option,
];
- $linkstart = '';
+ $linkstart = '';
} else {
$linkstart = '';
}
diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php
index d96274ede59..39fcb1650f0 100644
--- a/htdocs/bom/class/bom.class.php
+++ b/htdocs/bom/class/bom.class.php
@@ -1166,7 +1166,7 @@ class BOM extends CommonObject
'objecttype' => $this->element,
'option' => $option,
];
- $linkclose .= ' data-params='.json_encode($params).' id="' . uniqid('bom') . '" title="' . $langs->trans('Loading') . '"';
+ $linkclose .= ' data-params='.json_encode($params).' title="' . $langs->trans('Loading') . '"';
$linkclose .= ' class="classforajaxtooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php
index 5dcad42d936..618a31df34f 100644
--- a/htdocs/categories/class/categorie.class.php
+++ b/htdocs/categories/class/categorie.class.php
@@ -1646,14 +1646,10 @@ class Categorie extends CommonObject
'objecttype' => $this->element,
'option' => $option,
];
- $link2 = $link;
- $link .= '" data-params='.json_encode($params).' id="' . uniqid('category') . '" title="' . $langs->trans('Loading') . '"';
+ $link .= '" data-params='.json_encode($params).' title="' . $langs->trans('Loading') . '"';
$link .= ' class="classforajaxtooltip '.$forced_color.'">';
- $link2 .= '" data-params='.json_encode($params).' id="' . uniqid('category') . '" title="' . $langs->trans('Loading') . '"';
- $link2 .= ' class="classforajaxtooltip '.$forced_color.'">';
} else {
$link .= '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip '.$forced_color.'">';
- $link2 = $link;
}
$linkend = '';
@@ -1667,7 +1663,7 @@ class Categorie extends CommonObject
$result .= ' ';
}
if ($withpicto != 2) {
- $result .= $link2.dol_trunc(($this->ref ? $this->ref : $this->label), $maxlength).$linkend;
+ $result .= $link.dol_trunc(($this->ref ? $this->ref : $this->label), $maxlength).$linkend;
}
global $action;
$hookmanager->initHooks(array($this->element . 'dao'));
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index dba4e0e84d6..0876b3ea6d6 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -3820,7 +3820,7 @@ class Propal extends CommonObject
'objecttype' => $this->element,
'option' => $option,
];
- $linkclose .= ' data-params='.json_encode($params).' id="propal-' . uniqid() . '" title="' . $langs->trans('Loading') . '"';
+ $linkclose .= ' data-params='.json_encode($params).' title="' . $langs->trans('Loading') . '"';
$linkclose .= ' class="classforajaxtooltip"';
} else {
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 16f22c80c91..f14989ab3ea 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -3843,7 +3843,7 @@ class Commande extends CommonOrder
'objecttype' => $this->element,
'option' => $option,
];
- $linkclose .= ' data-params='.json_encode($params).' id="order-' . uniqid() . '" title="' . $langs->trans('Loading') . '"';
+ $linkclose .= ' data-params='.json_encode($params).' title="' . $langs->trans('Loading') . '"';
$linkclose .= ' class="classforajaxtooltip"';
} else {
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php
index b72767fdcc4..ed44d13dfae 100644
--- a/htdocs/compta/bank/class/account.class.php
+++ b/htdocs/compta/bank/class/account.class.php
@@ -1443,7 +1443,7 @@ class Account extends CommonObject
'objecttype' => $this->element,
'option' => $option,
];
- $linkclose = '" data-params='.json_encode($params).' id="' . uniqid('member') . '" title="' . $langs->trans('Loading') . '"';
+ $linkclose = '" data-params='.json_encode($params).' title="' . $langs->trans('Loading') . '"';
$linkclose .= ' class="classforajaxtooltip"';
} else {
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index 9d585245f0f..c6bf780be8b 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -1525,7 +1525,7 @@ class Contact extends CommonObject
'objecttype' => $this->element,
'option' => $option,
];
- $linkclose .= ' data-params='.json_encode($params).' id="contact-' . uniqid() . '" title="' . $langs->trans('Loading') . '"';
+ $linkclose .= ' data-params='.json_encode($params).' title="' . $langs->trans('Loading') . '"';
$linkclose .= ' class="classforajaxtooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index 66b7bd083bf..b3da9b1ad49 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -2082,7 +2082,7 @@ class Contrat extends CommonObject
'id' => $this->id,
'objecttype' => $this->element,
];
- $linkclose .= '" data-params='.json_encode($params).' id="' . uniqid('contract') . '" title="' . $langs->trans('Loading') . '"';
+ $linkclose .= '" data-params='.json_encode($params).' title="' . $langs->trans('Loading') . '"';
$linkclose .= ' class="classforajaxtooltip"';
} else {
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
@@ -3158,7 +3158,7 @@ class ContratLigne extends CommonObjectLine
'id' => $this->fk_contrat,
'objecttype' => $this->element,
];
- $link .= '" data-params='.json_encode($params).' id="' . uniqid('contract') . '" title="' . $langs->trans('Loading') . '"';
+ $link .= '" data-params='.json_encode($params).' title="' . $langs->trans('Loading') . '"';
$link .= ' class="classforajaxtooltip"';
} else {
$link = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php
index 7ec398f3368..8efda4e3812 100644
--- a/htdocs/core/js/lib_foot.js.php
+++ b/htdocs/core/js/lib_foot.js.php
@@ -84,7 +84,7 @@ if (empty($conf->dol_no_mouse_hover)) {
hide: { delay: 250, duration: 20 },
tooltipClass: "mytooltip",
open: function (event, ui) {
- var id = $(this).attr("id");
+ var elem = $(this);
var params = $(this).attr("data-params");
$.ajax({
url:"' . dol_buildpath('/core/ajax/ajaxtooltip.php', 1) . '",
@@ -92,7 +92,7 @@ if (empty($conf->dol_no_mouse_hover)) {
data: JSON.parse(params),
success: function(response){
// Setting content option
- $("#"+id).tooltip("option","content",response);
+ elem.tooltip("option","content",response);
}
});
console.log(event);
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index 1ae0991b5f2..3fd978e2069 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -827,7 +827,7 @@ class MyObject extends CommonObject
'objecttype' => $this->element,
'option' => $option,
];
- $linkclose .= ' data-params='.json_encode($params).' id="propal-' . uniqid() . '" title="' . $langs->trans('Loading') . '"';
+ $linkclose .= ' data-params='.json_encode($params).' title="' . $langs->trans('Loading') . '"';
$linkclose .= ' class="classforajaxtooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index ab9d33a0500..e585d35ebae 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -5231,7 +5231,7 @@ class Product extends CommonObject
'objecttype' => $this->element,
'option' => $option,
];
- $linkclose .= ' data-params='.json_encode($params).' id="product-' . uniqid() . '" title="' . $langs->trans('Loading') . '"';
+ $linkclose .= ' data-params='.json_encode($params).' title="' . $langs->trans('Loading') . '"';
$linkclose .= ' class="nowraponall classforajaxtooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose .= ' title="'.dol_escape_htmltag($label, 1, 1).'"';
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 13da1bd6c03..269bae466bd 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -2927,7 +2927,7 @@ class Societe extends CommonObject
'objecttype' => $this->element,
'option' => $option,
];
- $linkclose .= ' data-params='.json_encode($params).' id="' . uniqid('societe-') . '" title="' . $langs->trans('Loading') . '"';
+ $linkclose .= ' data-params='.json_encode($params).' title="' . $langs->trans('Loading') . '"';
$linkclose .= ' class="classforajaxtooltip refurl valignmiddle"';
} else {
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 0a963da1f5d..1516769f387 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -2977,7 +2977,7 @@ class User extends CommonObject
'infologin' => $infologin,
'option' => $option,
];
- $linkclose .= ' data-params='.json_encode($params).' id="user-' . uniqid() . '" title="' . $langs->trans('Loading') . '"';
+ $linkclose .= ' data-params='.json_encode($params).' title="' . $langs->trans('Loading') . '"';
$linkclose .= ' class="classforajaxtooltip'.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';