fetch thirdparty in propal tooltip only in ajax request
This commit is contained in:
parent
1da5de8326
commit
045d4284f5
@ -3708,6 +3708,7 @@ class Propal extends CommonObject
|
|||||||
global $conf, $langs, $user;
|
global $conf, $langs, $user;
|
||||||
|
|
||||||
$datas = [];
|
$datas = [];
|
||||||
|
$nofetch = !empty($params['nofetch']);
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||||
return ['optimize' => $langs->trans("Proposal")];
|
return ['optimize' => $langs->trans("Proposal")];
|
||||||
@ -3720,6 +3721,13 @@ class Propal extends CommonObject
|
|||||||
if (!empty($this->ref)) {
|
if (!empty($this->ref)) {
|
||||||
$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||||
}
|
}
|
||||||
|
if (!$nofetch) {
|
||||||
|
$langs->load('companies');
|
||||||
|
if (empty($this->thirdparty)) {
|
||||||
|
$this->fetch_thirdparty();
|
||||||
|
}
|
||||||
|
$datas['customer'] = '<br><b>'.$langs->trans('Customer').':</b> '.$this->thirdparty->name;
|
||||||
|
}
|
||||||
if (!empty($this->ref_client)) {
|
if (!empty($this->ref_client)) {
|
||||||
$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_client;
|
$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_client;
|
||||||
}
|
}
|
||||||
@ -3767,6 +3775,7 @@ class Propal extends CommonObject
|
|||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'objecttype' => $this->element,
|
'objecttype' => $this->element,
|
||||||
'option' => $option,
|
'option' => $option,
|
||||||
|
'nofetch' => 1,
|
||||||
];
|
];
|
||||||
$classfortooltip = 'classfortooltip';
|
$classfortooltip = 'classfortooltip';
|
||||||
$dataparams = '';
|
$dataparams = '';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user