diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 7d3c1030678..410f6f0961e 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -721,7 +721,7 @@ abstract class CommonObject
if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
$datas[$key]= '
'. $labelextra . '';
} else {
- $value = $this->array_options['options_' . $key];
+ $value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]);
$datas[$key]= '
'. $labelextra . ': ' . $extrafields->showOutputField($key, $value, '', $this->table_element);
}
}
diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php
index 963e357199a..297a33b93f5 100644
--- a/htdocs/core/js/lib_foot.js.php
+++ b/htdocs/core/js/lib_foot.js.php
@@ -85,12 +85,13 @@ if (empty($conf->dol_no_mouse_hover)) {
tooltipClass: "mytooltip",
open: function (event, ui) {
var elem = $(this);
- var params = $(this).attr("data-params");
+ var params = JSON.parse($(this).attr("data-params"));
+ params.token = "'.currentToken().'";
$.ajax({
url:"' . dol_buildpath('/core/ajax/ajaxtooltip.php', 1) . '",
type: "post",
async: false,
- data: JSON.parse(params),
+ data: params,
success: function(response){
// Setting content option
elem.tooltip("option","content",response);
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 7572c00c455..9a08f01d27b 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -873,6 +873,8 @@ class CommandeFournisseur extends CommonOrder
$langs->loadLangs(['bills', 'orders']);
$datas = [];
+ $nofetch = !empty($params['nofetch']);
+
if ($user->hasRight("fournisseur", "commande", "read")) {
$datas['picto'] = ''.$langs->trans("SupplierOrder").'';
if (isset($this->statut)) {
@@ -884,6 +886,13 @@ class CommandeFournisseur extends CommonOrder
if (!empty($this->ref_supplier)) {
$datas['refsupplier'] = '
'.$langs->trans('RefSupplier').': '.$this->ref_supplier;
}
+ if (!$nofetch) {
+ $langs->load('companies');
+ if (empty($this->thirdparty)) {
+ $this->fetch_thirdparty();
+ }
+ $datas['supplier'] = '
'.$langs->trans('Supplier').': '.$this->thirdparty->getNomUrl(1, '', 0, 1);
+ }
if (!empty($this->total_ht)) {
$datas['totalht'] = '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
}
@@ -922,6 +931,7 @@ class CommandeFournisseur extends CommonOrder
'id' => $this->id,
'objecttype' => $this->element,
'option' => $option,
+ 'nofetch' => 1
];
$classfortooltip = 'classfortooltip';
$dataparams = '';