Compute value of computed extrafield on fetch, not on show
This commit is contained in:
parent
45ea1647d0
commit
c0b0d5484c
@ -4744,6 +4744,11 @@ 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;
|
||||||
|
|||||||
@ -1468,14 +1468,6 @@ class ExtraFields
|
|||||||
|
|
||||||
if ($hidden) return ''; // This is a protection. If field is hidden, we should just not call this method.
|
if ($hidden) return ''; // This is a protection. If field is hidden, we should just not call this method.
|
||||||
|
|
||||||
// If field is a computed field, value must become result of compute
|
|
||||||
if ($computed)
|
|
||||||
{
|
|
||||||
// Make the eval of compute string
|
|
||||||
//var_dump($computed);
|
|
||||||
$value = dol_eval($computed, 1, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
$showsize=0;
|
$showsize=0;
|
||||||
if ($type == 'date')
|
if ($type == 'date')
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user