FIX Computed field were not calculated into lists.

This commit is contained in:
Laurent Destailleur 2019-07-11 22:18:44 +02:00
parent 694be619b2
commit b1e21ed5fc
2 changed files with 13 additions and 1 deletions

View File

@ -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 ($computed) $value = // $value is already calculated into $value before calling this method
$showsize=0;
if ($type == 'date')
{

View File

@ -40,7 +40,17 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_
{
$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 '</td>';
if (! $i) $totalarray['nbfield']++;