FIX Computed field were not calculated into lists.
This commit is contained in:
parent
694be619b2
commit
b1e21ed5fc
@ -1627,6 +1627,8 @@ 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 ($computed) $value = // $value is already calculated into $value before calling this method
|
||||||
|
|
||||||
$showsize=0;
|
$showsize=0;
|
||||||
if ($type == 'date')
|
if ($type == 'date')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -40,7 +40,17 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_
|
|||||||
{
|
{
|
||||||
$value = $obj->$tmpkey;
|
$value = $obj->$tmpkey;
|
||||||
}
|
}
|
||||||
|
// If field is a computed field, we make computation to get value
|
||||||
|
if ($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key])
|
||||||
|
{
|
||||||
|
//global $obj, $object;
|
||||||
|
//var_dump($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]);
|
||||||
|
//var_dump($obj);
|
||||||
|
//var_dump($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]);
|
||||||
|
$value = dol_eval($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key], 1);
|
||||||
|
//var_dump($value);
|
||||||
|
}
|
||||||
|
|
||||||
print $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey);
|
print $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user