From b04318a099a8427fd3abc60e0884ab86d1f93ebd Mon Sep 17 00:00:00 2001 From: ralf Date: Mon, 1 Apr 2024 12:42:56 +0200 Subject: [PATCH] WIP allow to place custom-fields in tabs: adding cfDisabled="true" to disable automatic adding of custom-fields, e.g. for templates not showing an entry --- api/src/Etemplate/Widget/Tabbox.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/src/Etemplate/Widget/Tabbox.php b/api/src/Etemplate/Widget/Tabbox.php index e37244e6ff..f3dbce4cdd 100644 --- a/api/src/Etemplate/Widget/Tabbox.php +++ b/api/src/Etemplate/Widget/Tabbox.php @@ -30,6 +30,7 @@ use EGroupware\Api; * + id: id of tab * + content: optional namespace (content attribute of template) * + statustext: tooltip of label + * - cfDisabled: true: disable adding custom-fields e.g. for templates not showing an entry, false (default): add custom-fields automatic * - cfTypeFilter: optional type-filter for automatic created custom-fields tabs * - cfPrivateTab: true: create an extra tab for private custom-fields, false (default): show private ones together with non-private ones * - cfPrepend: value for prepend tab-attribute for dynamic generated custom-field tabs, default "history" @@ -163,6 +164,11 @@ class Tabbox extends Etemplate\Widget { $prepend = in_array($prepend, ['true', '1']); } + // is adding of CFs disabled --> exit + if (!empty($this->attrs['cfDisabled'])) + { + return; + } // check if template still contains a legacy customfield tab $have_legacy_cf_tab = $this->haveLegacyCfTab();