fiw visibility can be an expression and can return 0

This commit is contained in:
atm-greg 2022-02-28 18:37:47 +01:00
parent b989c257ad
commit 5eef80750a

View File

@ -18,13 +18,12 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table
if (empty($extrafieldsobjectprefix)) {
$extrafieldsobjectprefix = 'ef.';
}
foreach ($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val) {
if (!empty($extrafields->attributes[$extrafieldsobjectkey]['list'][$key])) {
$arrayfields[$extrafieldsobjectprefix.$key] = array(
'label' => $extrafields->attributes[$extrafieldsobjectkey]['label'][$key],
'type' => $extrafields->attributes[$extrafieldsobjectkey]['type'][$key],
'checked' => (($extrafields->attributes[$extrafieldsobjectkey]['list'][$key] < 0) ? 0 : 1),
'checked' => ((dol_eval($extrafields->attributes[$extrafieldsobjectkey]['list'][$key],1) <= 0) ? 0 : 1),
'position' => $extrafields->attributes[$extrafieldsobjectkey]['pos'][$key],
'enabled' => (abs((int) $extrafields->attributes[$extrafieldsobjectkey]['list'][$key]) != 3 && $extrafields->attributes[$extrafieldsobjectkey]['perms'][$key]),
'langfile' => $extrafields->attributes[$extrafieldsobjectkey]['langfile'][$key],