From d80764a1791f147cf20b2f079b23b593ea5bebb8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Jan 2020 12:39:05 +0100 Subject: [PATCH] Fix column not visible after switching column when visibility=3 --- htdocs/core/tpl/commonfields_view.tpl.php | 4 +++- htdocs/modulebuilder/template/myobject_card.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php index 2eae2655fbb..7971a8dc85c 100644 --- a/htdocs/core/tpl/commonfields_view.tpl.php +++ b/htdocs/core/tpl/commonfields_view.tpl.php @@ -84,7 +84,9 @@ foreach ($object->fields as $key => $val) continue; } - if (abs($val['visible']) != 1) continue; // Discard such field from form + // Discard if extrafield is a hidden field on form + if (abs($val['visible']) != 1 && abs($val['visible']) != 3 && abs($val['visible']) != 4) continue; + if (array_key_exists('enabled', $val) && isset($val['enabled']) && !$val['enabled']) continue; // We don't want this field if (in_array($key, array('ref', 'status'))) continue; // Ref and status are already in dol_banner diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 7b4a2abc50d..2d28495cdc3 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -371,7 +371,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''."\n"; // Common attributes - //$keyforbreak='fieldkeytoswitchonsecondcolumn'; + //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just after this field //unset($object->fields['fk_project']); // Hide field already shown in banner //unset($object->fields['fk_soc']); // Hide field already shown in banner include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';