Skip to content

Commit

Permalink
Better var name
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Feb 1, 2019
1 parent b14a16a commit ae81bba
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions htdocs/core/class/commonobject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -6284,11 +6284,12 @@ function showOptionals($extrafields, $mode='view', $params=null, $keysuffix='',
if (is_array($params) && array_key_exists('onlykey',$params) && $key != $params['onlykey']) continue;

// @TODO Add test also on 'enabled' (different than 'list' that is 'visibility')

$enabled = 1;
if ($enabled && isset($extrafields->attributes[$this->table_element]['list'][$key]))

$visibility = 1;
if ($visibility && isset($extrafields->attributes[$this->table_element]['list'][$key]))
{
$enabled = dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1);
$visibility = dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1);
}

$perms = 1;
Expand All @@ -6297,7 +6298,7 @@ function showOptionals($extrafields, $mode='view', $params=null, $keysuffix='',
$perms = dol_eval($extrafields->attributes[$this->table_element]['perms'][$key], 1);
}

if (($mode == 'create' || $mode == 'edit') && abs($enabled) != 1 && abs($enabled) != 3) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list
if (($mode == 'create' || $mode == 'edit') && abs($visibility) != 1 && abs($visibility) != 3) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list
if (empty($perms)) continue;

// Load language if required
Expand Down

0 comments on commit ae81bba

Please sign in to comment.