diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 5df317c0a2a..40e8fe385d7 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -3726,11 +3726,20 @@ class Propal extends CommonObject
if (empty($this->thirdparty)) {
$this->fetch_thirdparty();
}
- $datas['customer'] = '
'.$langs->trans('Customer').': '.$this->thirdparty->name;
+ $datas['customer'] = '
'.$langs->trans('Customer').': '.$this->thirdparty->getNomUrl(1, '', 0, 1);
}
if (!empty($this->ref_client)) {
$datas['refcustomer'] = '
'.$langs->trans('RefCustomer').': '.$this->ref_client;
}
+ if (!$nofetch) {
+ $langs->load('project');
+ if (empty($this->project)) {
+ $res = $this->fetch_project();
+ if ($res > 0) {
+ $datas['project'] = '
'.$langs->trans('Project').': '.$this->project->getNomUrl(1, '', 0, 1);
+ }
+ }
+ }
if (!empty($this->total_ht)) {
$datas['amountht'] = '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
}
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 590a7fbe132..026d931a89a 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -3745,9 +3745,18 @@ class Commande extends CommonOrder
if (empty($this->thirdparty)) {
$this->fetch_thirdparty();
}
- $datas['customer'] = '
'.$langs->trans('Customer').': '.$this->thirdparty->name;
+ $datas['customer'] = '
'.$langs->trans('Customer').': '.$this->thirdparty->getNomUrl(1, '', 0, 1);
}
$datas['RefCustomer'] = '
'.$langs->trans('RefCustomer').': '.(empty($this->ref_customer) ? (empty($this->ref_client) ? '' : $this->ref_client) : $this->ref_customer);
+ if (!$nofetch) {
+ $langs->load('project');
+ if (empty($this->project)) {
+ $res = $this->fetch_project();
+ if ($res > 0) {
+ $datas['project'] = '
'.$langs->trans('Project').': '.$this->project->getNomUrl(1, '', 0, 1);
+ }
+ }
+ }
if (!empty($this->total_ht)) {
$datas['AmountHT'] = '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
}
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index 3e3678fbcad..8e6c2ea0161 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -1995,6 +1995,7 @@ class Contrat extends CommonObject
$langs->load('contracts');
$datas = [];
+ $nofetch = !empty($params['nofetch']);
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
return ['optimize' => $langs->trans("ShowContract")];
@@ -2006,7 +2007,23 @@ class Contrat extends CommonObject
$label .= ' '.$this->getLibStatut(5);
}*/
$datas['ref'] = '
'.$langs->trans('Ref').': '.($this->ref ? $this->ref : $this->id);
+ if (!$nofetch) {
+ $langs->load('companies');
+ if (empty($this->thirdparty)) {
+ $this->fetch_thirdparty();
+ }
+ $datas['customer'] = '
'.$langs->trans('Customer').': '.$this->thirdparty->getNomUrl(1, '', 0, 1);
+ }
$datas['refcustomer'] = '
'.$langs->trans('RefCustomer').': '. $this->ref_customer;
+ if (!$nofetch) {
+ $langs->load('project');
+ if (empty($this->project)) {
+ $res = $this->fetch_project();
+ if ($res > 0) {
+ $datas['project'] = '
'.$langs->trans('Project').': '.$this->project->getNomUrl(1, '', 0, 1);
+ }
+ }
+ }
$datas['refsupplier'] = '
'.$langs->trans('RefSupplier').': '.$this->ref_supplier;
if (!empty($this->total_ht)) {
$datas['amountht'] = '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
@@ -2052,6 +2069,7 @@ class Contrat extends CommonObject
$params = [
'id' => $this->id,
'objecttype' => $this->element,
+ 'nofetch' => 1,
];
$classfortooltip = 'classfortooltip';
$dataparams = '';