fetch optional extrafeild lines on propal fetch

This commit is contained in:
Florian HENRY 2015-01-31 13:52:23 +01:00
parent d39439437e
commit 1eb73d0e49
2 changed files with 9 additions and 8 deletions

View File

@ -1196,6 +1196,11 @@ class Propal extends CommonObject
$result = $this->db->query($sql);
if ($result)
{
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafieldsline=new ExtraFields($this->db);
$line = new PropaleLigne($this->db);
$extralabelsline=$extrafieldsline->fetch_name_optionals_label($line->table_element,true);
$num = $this->db->num_rows($result);
$i = 0;
@ -1205,7 +1210,8 @@ class Propal extends CommonObject
$line = new PropaleLigne($this->db);
$line->rowid = $objp->rowid;
$line->rowid = $objp->rowid; //Deprecated
$line->id = $objp->rowid;
$line->fk_propal = $objp->fk_propal;
$line->fk_parent_line = $objp->fk_parent_line;
$line->product_type = $objp->product_type;
@ -1246,6 +1252,8 @@ class Propal extends CommonObject
$line->date_start = $objp->date_start;
$line->date_end = $objp->date_end;
$line->fetch_optionals($line->id,$extralabelsline);
$this->lines[$i] = $line;
//dol_syslog("1 ".$line->fk_product);
//print "xx $i ".$this->lines[$i]->fk_product;
@ -1259,12 +1267,6 @@ class Propal extends CommonObject
return -1;
}
// Retreive all extrafield for propal
// fetch optionals attributes and labels
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields=new ExtraFields($this->db);
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
$this->fetch_optionals($this->id,$extralabels);
return 1;
}

View File

@ -726,7 +726,6 @@ class Contrat extends CommonObject
// Retreive all extrafield for propal
// fetch optionals attributes and labels
$line->fetch_optionals($line->id,$extralabelsline);
$this->lines[] = $line;