diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 47e178292eb..40e8fe385d7 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3708,6 +3708,7 @@ class Propal extends CommonObject global $conf, $langs, $user; $datas = []; + $nofetch = !empty($params['nofetch']); if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { return ['optimize' => $langs->trans("Proposal")]; @@ -3720,9 +3721,25 @@ class Propal extends CommonObject if (!empty($this->ref)) { $datas['ref'] = '
'.$langs->trans('Ref').': '.$this->ref; } + if (!$nofetch) { + $langs->load('companies'); + if (empty($this->thirdparty)) { + $this->fetch_thirdparty(); + } + $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); } @@ -3767,6 +3784,7 @@ class Propal extends CommonObject 'id' => $this->id, 'objecttype' => $this->element, 'option' => $option, + 'nofetch' => 1, ]; $classfortooltip = 'classfortooltip'; $dataparams = ''; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6348d8e1325..026d931a89a 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3728,6 +3728,7 @@ class Commande extends CommonOrder global $conf, $langs, $user; $datas = []; + $nofetch = !empty($params['nofetch']); if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { return ['optimize' => $langs->trans("Order")]; @@ -3739,7 +3740,23 @@ class Commande extends CommonOrder $datas[] = ' '.$this->getLibStatut(5); } $datas['Ref'] = '
'.$langs->trans('Ref').': '.$this->ref; + 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').': '.(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); } @@ -3811,6 +3828,7 @@ class Commande extends CommonOrder 'id' => $this->id, 'objecttype' => $this->element, 'option' => $option, + 'nofetch' => 1, ]; $classfortooltip = 'classfortooltip'; $dataparams = ''; 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 = ''; diff --git a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql index 54d1d4cb33c..9732c2d5386 100644 --- a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql +++ b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql @@ -37,7 +37,7 @@ -- VMYSQL4.3 ALTER TABLE llx_hrm_skillrank CHANGE COLUMN `rank` rankorder integer; -- VPGSQL8.2 ALTER TABLE llx_hrm_skillrank CHANGE COLUMN rank rankorder integer; -ALTER TABLE llx_accounting_system CHANGE COLUMN fk_pays fk_country integer; +ALTER TABLE llx_accounting_system CHANGE COLUMN fk_pays fk_country integer; ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN ref varchar(128); ALTER TABLE llx_facture_fourn_det MODIFY COLUMN ref varchar(128); @@ -376,4 +376,3 @@ UPDATE llx_c_country SET numeric_code = '716' WHERE code_iso = 'ZWE'; -- Generate documents on product batch ALTER TABLE llx_product_lot ADD COLUMN model_pdf varchar(255) AFTER scrapping_date; ALTER TABLE llx_product_lot ADD COLUMN last_main_doc varchar(255) AFTER model_pdf; -