diff --git a/app/plugins/CoreServer/templates/SmtpServers/fields.inc b/app/plugins/CoreServer/templates/SmtpServers/fields.inc index b77ac9220..bac623cdc 100644 --- a/app/plugins/CoreServer/templates/SmtpServers/fields.inc +++ b/app/plugins/CoreServer/templates/SmtpServers/fields.inc @@ -27,19 +27,48 @@ // This view does currently not support read-only, and add is not used if($vv_action == 'edit') { - print $this->Field->control('hostname'); + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'hostname', + ] + ]); - print $this->Field->control('port', ['default' => 587]); + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'port', + 'fieldOptions' => [ + 'default' => 587 + ] + ]]); - print $this->Field->control('username'); + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'username', + ] + ]); - print $this->Field->control('password'); + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'password', + ] + ]); - print $this->Field->control('use_tls', ['default' => true]); + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'use_tls', + 'fieldOptions' => [ + 'default' => true + ] + ]]); - print $this->Field->control('default_from'); - - print $this->Field->control('default_reply_to'); - - print $this->Field->control('override_to'); + foreach ([ + 'default_from', + 'default_reply_to', + 'override_to', + ] as $field) { + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => $field + ]]); + } } diff --git a/app/templates/MessageTemplates/fields.inc b/app/templates/MessageTemplates/fields.inc index c52d7e61b..a88f5e691 100644 --- a/app/templates/MessageTemplates/fields.inc +++ b/app/templates/MessageTemplates/fields.inc @@ -28,25 +28,23 @@ Field->control('description'); - - print $this->Field->control('status'); - - print $this->Field->control('context'); - - print $this->Field->control('format'); - - print $this->Field->control('subject'); - + foreach ([ + 'description', + 'status', + 'context', + 'format', + 'subject', // XXX auto show/hide based on format - print $this->Field->control('body_text'); - + 'body_text', // XXX auto show/hide based on format - print $this->Field->control('body_html'); - - print $this->Field->control('cc'); - - print $this->Field->control('bcc'); - - print $this->Field->control('reply_to'); + 'body_html', + 'cc', + 'bcc', + 'reply_to', + ] as $field) { + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => $field + ]]); + } } diff --git a/app/templates/Notifications/fields.inc b/app/templates/Notifications/fields.inc index 6409a736c..c6a5819bd 100644 --- a/app/templates/Notifications/fields.inc +++ b/app/templates/Notifications/fields.inc @@ -30,96 +30,109 @@ use \App\Lib\Enum\NotificationStatusEnum; Field->control('comment'); - - print $this->Field->control('action'); - - print $this->Field->control('source'); - - print $this->Field->control('created'); + foreach ([ + 'comment', + 'action', + 'source', + 'created', + ] as $field) { + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => $field + ]]); + } if($vv_obj->status == NotificationStatusEnum::PendingAcknowledgment) { - print $this->Field->statusControl( - fieldName: 'status', - status: __d('enumeration', 'NotificationStatusEnum.PA'), - link: [ - 'url' => [ - 'action' => 'acknowledge', - $vv_obj->id - ], - 'label' => __d('operation', 'acknowledge'), - 'confirm' => __d('operation', 'Notifications.acknowledge.confirm') - ] - ); + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'status', + 'status' => __d('enumeration', 'NotificationStatusEnum.PA'), + 'link' => [ + 'url' => [ + 'action' => 'acknowledge', + $vv_obj->id + ], + 'label' => __d('operation', 'acknowledge'), + 'confirm' => __d('operation', 'Notifications.acknowledge.confirm') + ] + ] + ]); } else { print $this->Field->control('status'); - } - - print $this->Field->statusControl( - fieldName: 'subject_person_id', - status: !empty($vv_obj->subject_person->primary_name) - ? $vv_obj->subject_person->primary_name->full_name - : "", - link: !empty($vv_obj->subject_person) - ? ['url' => [ - 'controller' => 'people', - 'action' => 'edit', - $vv_obj->subject_person->id - ]] - : [] - ); - - print $this->Field->statusControl( - fieldName: 'recipient_person_id', - status: !empty($vv_obj->recipient_person->primary_name) - ? $vv_obj->recipient_person->primary_name->full_name - : "", - link: !empty($vv_obj->recipient_person) - ? ['url' => [ - 'controller' => 'people', - 'action' => 'edit', - $vv_obj->recipient_person->id - ]] - : [] - ); - - print $this->Field->statusControl( - fieldName: 'actor_person_id', - status: !empty($vv_obj->actor_person->primary_name) - ? $vv_obj->actor_person->primary_name->full_name - : "", - link: !empty($vv_obj->actor_person) - ? ['url' => [ - 'controller' => 'people', - 'action' => 'edit', - $vv_obj->actor_person->id - ]] - : [] - ); - - print $this->Field->control('resolution_time'); + } - print $this->Field->statusControl( - fieldName: 'resolver_person_id', - status: !empty($vv_obj->resolver_person->primary_name) - ? $vv_obj->resolver_person->primary_name->full_name - : "", - link: !empty($vv_obj->resolver_person) - ? ['url' => [ - 'controller' => 'people', - 'action' => 'edit', - $vv_obj->resolver_person->id - ]] - : [] - ); + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'subject_person_id', + 'status' => $vv_obj->subject_person->primary_name?->full_name ?? '', + 'link' => !empty($vv_obj->subject_person) + ? ['url' => [ + 'controller' => 'people', + 'action' => 'edit', + $vv_obj->subject_person->id + ]] + : [] + ] + ]); - print $this->Field->control('notification_time'); + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'recipient_person_id', + 'status' => $vv_obj->recipient_person->primary_name?->full_name ?? '', + 'link' => !empty($vv_obj->recipient_person) + ? ['url' => [ + 'controller' => 'people', + 'action' => 'edit', + $vv_obj->recipient_person->id + ]] + : [] + ] + ]); - print $this->Field->control('email_subject'); + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'actor_person_id', + 'status' => $vv_obj->actor_person->primary_name?->full_name ?? '', + 'link' => !empty($vv_obj->actor_person) + ? ['url' => [ + 'controller' => 'people', + 'action' => 'edit', + $vv_obj->actor_person->id + ]] + : [] + ] + ]); - print $this->Field->control('email_body_text'); + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'resolution_time', + ] + ]); - print $this->Field->control('resolution_subject'); + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'resolver_person_id', + 'status' => $vv_obj->resolver_person->primary_name?->full_name ?? '', + 'link' => !empty($vv_obj->resolver_person) + ? ['url' => [ + 'controller' => 'people', + 'action' => 'edit', + $vv_obj->resolver_person->id + ]] + : [] + ] + ]); - print $this->Field->control('resolution_body'); + foreach ([ + 'notification_time', + 'email_subject', + 'email_body_text', + 'resolution_subject', + 'resolution_body', + ] as $field) { + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => $field + ]]); + } } diff --git a/app/templates/element/form/infoDiv/grouped.php b/app/templates/element/form/infoDiv/grouped.php index 96cb0f623..c0a89aaf7 100644 --- a/app/templates/element/form/infoDiv/grouped.php +++ b/app/templates/element/form/infoDiv/grouped.php @@ -34,7 +34,7 @@ ?>
- $fieldArguments): ?> + $fieldArguments): ?>