Skip to content

Commit

Permalink
Merge pull request #7798 from hregis/develop_extrafields
Browse files Browse the repository at this point in the history
Fix: missing status 3 (only on form)
  • Loading branch information
eldy committed Nov 11, 2017
2 parents 7c4cbdc + 3ffe1b6 commit 0cd8aa8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion htdocs/core/class/commonobject.class.php
Expand Up @@ -5620,7 +5620,7 @@ function showOptionals($extrafields, $mode='view', $params=null, $keysuffix='',
foreach($extrafields->attribute_label as $key=>$label)
{
if (empty($extrafields->attribute_list[$key])) continue; // 0 = Never visible field
if (($mode == 'create' || $mode == 'edit') && abs($extrafields->attribute_list[$key]) != 1) continue; // <> -1 and <> 1 = not visible on forms, only on list
if (($mode == 'create' || $mode == 'edit') && abs($extrafields->attribute_list[$key]) != 1 && abs($extrafields->attribute_list[$key]) != 3) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list

// Load language if required
if (! empty($extrafields->attributes[$this->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]);
Expand Down
3 changes: 2 additions & 1 deletion htdocs/core/tpl/extrafields_view.tpl.php
Expand Up @@ -43,7 +43,8 @@
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label)
{
// Discard if extrafield is a hidden field on form
if (abs($extrafields->attributes[$object->table_element]['list'][$key]) != 1) continue;
if (empty($extrafields->attributes[$object->table_element]['list'][$key])) continue; // 0 = Never visible field
if (abs($extrafields->attributes[$object->table_element]['list'][$key]) != 1 && abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list

// Load language if required
if (! empty($extrafields->attributes[$object->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$object->table_element]['langfile'][$key]);
Expand Down

0 comments on commit 0cd8aa8

Please sign in to comment.