Compute extrafields after having set all others
This commit is contained in:
parent
f50de03585
commit
23438b1f48
@ -4852,11 +4852,6 @@ abstract class CommonObject
|
|||||||
//var_dump($extrafields->attributes[$this->table_element]['type'][$key]);
|
//var_dump($extrafields->attributes[$this->table_element]['type'][$key]);
|
||||||
$this->array_options["options_".$key]=$this->db->jdate($value);
|
$this->array_options["options_".$key]=$this->db->jdate($value);
|
||||||
}
|
}
|
||||||
// If field is a computed field, value must become result of compute
|
|
||||||
else if (! empty($extrafields) && !empty($extrafields->attributes[$this->table_element]['computed'][$key]))
|
|
||||||
{
|
|
||||||
$this->array_options["options_".$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->array_options["options_".$key]=$value;
|
$this->array_options["options_".$key]=$value;
|
||||||
@ -4865,6 +4860,14 @@ abstract class CommonObject
|
|||||||
//var_dump('key '.$key.' '.$value.' type='.$extrafields->attributes[$this->table_element]['type'][$key].' '.$this->array_options["options_".$key]);
|
//var_dump('key '.$key.' '.$value.' type='.$extrafields->attributes[$this->table_element]['type'][$key].' '.$this->array_options["options_".$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If field is a computed field, value must become result of compute
|
||||||
|
foreach ($tab as $key => $value) {
|
||||||
|
if (! empty($extrafields) && !empty($extrafields->attributes[$this->table_element]['computed'][$key]))
|
||||||
|
{
|
||||||
|
$this->array_options["options_".$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user