Update contrat.class.php

This commit is contained in:
ptibogxiv 2019-06-25 15:48:41 +02:00 committed by GitHub
parent df0d540ffb
commit a9adccabc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -718,8 +718,9 @@ class Contrat extends CommonObject
*
* @return ContratLigne[] Return array of contract lines
*/
public function fetch_lines()
public function fetch_lines($loadalsotranslation = 0)
{
global $langs, $conf;
// phpcs:enable
$this->nbofserviceswait=0;
$this->nbofservicesopened=0;
@ -828,6 +829,13 @@ class Contrat extends CommonObject
// Retreive all extrafields for contract
// fetch optionals attributes and labels
$line->fetch_optionals();
// multilangs
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) {
$line = new Product($this->db);
$line->fetch($objp->fk_product);
$line->getMultiLangs();
}
$this->lines[$pos] = $line;
$this->lines_id_index_mapper[$line->id] = $pos;