fetch thirdparty in order tooltip only in ajax request
This commit is contained in:
parent
2660948778
commit
a551919f90
@ -3728,6 +3728,7 @@ class Commande extends CommonOrder
|
|||||||
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("Order")];
|
return ['optimize' => $langs->trans("Order")];
|
||||||
@ -3739,7 +3740,13 @@ class Commande extends CommonOrder
|
|||||||
$datas[] = ' '.$this->getLibStatut(5);
|
$datas[] = ' '.$this->getLibStatut(5);
|
||||||
}
|
}
|
||||||
$datas['Ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
$datas['Ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||||
$datas['RefCustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '.(empty($this->ref_customer) ? (empty($this->ref_client) ? '' : $this->ref_client) : $this->ref_customer);
|
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->total_ht)) {
|
if (!empty($this->total_ht)) {
|
||||||
$datas['AmountHT'] = '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
$datas['AmountHT'] = '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||||
}
|
}
|
||||||
@ -3811,6 +3818,7 @@ class Commande extends CommonOrder
|
|||||||
'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