From b26eba9f4799432765cdd59487579f9df84538b7 Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Fri, 10 May 2024 13:43:51 -0400 Subject: [PATCH] UI updates for Message Templates (CFM-390) (#199) * Add Message Templates to menu panels (CFM-390) * Show hide message template body fields based on format (CFM-390) --- app/src/Controller/DashboardsController.php | 2 +- app/templates/MessageTemplates/fields.inc | 45 +++++++++++++++++++-- app/templates/element/menuPanel.php | 26 +++++++++--- 3 files changed, 64 insertions(+), 9 deletions(-) diff --git a/app/src/Controller/DashboardsController.php b/app/src/Controller/DashboardsController.php index 4875fc867..c06e4ee40 100644 --- a/app/src/Controller/DashboardsController.php +++ b/app/src/Controller/DashboardsController.php @@ -103,7 +103,7 @@ public function configuration() { 'action' => 'index' ], __d('controller', 'MessageTemplates', [99]) => [ - 'icon' => 'message', + 'icon' => 'email', 'controller' => 'message_templates', 'action' => 'index' ], diff --git a/app/templates/MessageTemplates/fields.inc b/app/templates/MessageTemplates/fields.inc index a88f5e691..6a7f49e68 100644 --- a/app/templates/MessageTemplates/fields.inc +++ b/app/templates/MessageTemplates/fields.inc @@ -25,6 +25,30 @@ * @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) */ ?> + + + element('form/listItem', [ + 'arguments' => [ + 'fieldName' => $field + ]]); + } + + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'format', + 'fieldOptions' => [ + 'onChange' => 'updateGadgets()' + ], + 'fieldType' => 'select' + ] + ]); + + foreach ([ 'subject', -// XXX auto show/hide based on format 'body_text', -// XXX auto show/hide based on format 'body_html', 'cc', 'bcc', diff --git a/app/templates/element/menuPanel.php b/app/templates/element/menuPanel.php index 8790380c3..5ee0ca11a 100644 --- a/app/templates/element/menuPanel.php +++ b/app/templates/element/menuPanel.php @@ -434,16 +434,16 @@ ?> - Types + -