From 093219c9b46e0d39e4648c79cb9f69c2c5f5eb2f Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Wed, 24 Sep 2025 14:25:16 -0400 Subject: [PATCH] Simplify fields.inc configuration. (CFM-218) --- .../templates/Passwords/fields.inc | 4 +- .../templates/SqlProvisioners/fields.inc | 4 +- .../templates/SqlSources/fields.inc | 4 +- .../templates/EmailVerifiers/fields.inc | 59 +++++------- .../templates/EnrollmentAttributes/fields.inc | 29 ++---- .../templates/InvitationAccepters/fields.inc | 4 +- .../MatchServerAttributes/fields.inc | 4 +- .../templates/Oauth2Servers/fields.inc | 14 +-- .../templates/SmtpServers/fields.inc | 8 +- .../EnvSource/templates/EnvSources/fields.inc | 4 +- .../templates/OrcidSources/fields.inc | 29 ++---- .../templates/SshKeys/fields.inc | 4 +- app/resources/locales/en_US/field.po | 3 + app/src/View/Helper/FieldHelper.php | 94 ++++++++++++++++++- app/templates/Addresses/fields.inc | 5 +- app/templates/CoSettings/fields.inc | 29 ++---- app/templates/EmailAddresses/fields.inc | 15 +-- .../ExternalIdentitySources/fields.inc | 5 +- app/templates/GroupMembers/fields.inc | 8 +- app/templates/Groups/fields.inc | 33 ++----- app/templates/Identifiers/fields.inc | 5 +- app/templates/Jobs/fields.inc | 7 +- app/templates/MessageTemplates/fields.inc | 10 +- app/templates/MostlyStaticPages/fields.inc | 10 +- app/templates/Names/fields.inc | 11 +-- app/templates/People/fields.inc | 19 ++-- app/templates/PersonRoles/fields.inc | 4 +- app/templates/Pronouns/fields.inc | 5 +- app/templates/ProvisioningTargets/fields.inc | 10 +- app/templates/TelephoneNumbers/fields.inc | 5 +- app/templates/Types/fields.inc | 5 +- app/templates/Urls/fields.inc | 5 +- app/templates/element/form/fieldDiv.php | 7 +- .../element/form/infoDiv/grouped.php | 3 + 34 files changed, 203 insertions(+), 262 deletions(-) diff --git a/app/availableplugins/PasswordAuthenticator/templates/Passwords/fields.inc b/app/availableplugins/PasswordAuthenticator/templates/Passwords/fields.inc index 98924df7e..6d4863354 100644 --- a/app/availableplugins/PasswordAuthenticator/templates/Passwords/fields.inc +++ b/app/availableplugins/PasswordAuthenticator/templates/Passwords/fields.inc @@ -39,9 +39,7 @@ if(!$vv_status->locked) { $fields = [ 'password', 'password2' => [ - 'fieldOptions' => [ - 'type' => 'password' - ] + 'type' => 'password' ] ]; } diff --git a/app/availableplugins/SqlConnector/templates/SqlProvisioners/fields.inc b/app/availableplugins/SqlConnector/templates/SqlProvisioners/fields.inc index 5f96d7057..d398d50ee 100644 --- a/app/availableplugins/SqlConnector/templates/SqlProvisioners/fields.inc +++ b/app/availableplugins/SqlConnector/templates/SqlProvisioners/fields.inc @@ -28,9 +28,7 @@ $fields = [ 'server_id', 'table_prefix' => [ - 'fieldOptions' => [ - 'default' => 'sp_' - ] + 'default' => 'sp_' ] ]; diff --git a/app/availableplugins/SqlConnector/templates/SqlSources/fields.inc b/app/availableplugins/SqlConnector/templates/SqlSources/fields.inc index 98018d745..b25664add 100644 --- a/app/availableplugins/SqlConnector/templates/SqlSources/fields.inc +++ b/app/availableplugins/SqlConnector/templates/SqlSources/fields.inc @@ -43,9 +43,7 @@ foreach([ 'url_type_id' ] as $field) { $fields[$field] = [ - 'fieldOptions' => [ - 'required' => false - ] + 'required' => false ]; } diff --git a/app/plugins/CoreEnroller/templates/EmailVerifiers/fields.inc b/app/plugins/CoreEnroller/templates/EmailVerifiers/fields.inc index d3b08e4cb..46ed063d5 100644 --- a/app/plugins/CoreEnroller/templates/EmailVerifiers/fields.inc +++ b/app/plugins/CoreEnroller/templates/EmailVerifiers/fields.inc @@ -30,25 +30,17 @@ if($vv_action !== 'edit') { return; } +// Used for placeholders $defaultValues = array_combine( array_values($defaults), array_keys($defaults) ); -$fields = [ - 'mode', - 'message_template_id', - 'request_validity' => [ - 'fieldOptions' => [ - 'placeholder' => $defaultValues['DefaultVerificationValidity'] - ] - ] -]; - +// Establish the before and after field-supplements for the 'verification_code_regex' $checked = !empty($vv_obj?->verification_code_charset) ? 'checked' : ''; $otherLabel = __d('core_enroller','field.EmailVerifiers.verification_code_charset.other_value'); $beforeField = << +
@@ -91,21 +83,26 @@ document.addEventListener('DOMContentLoaded', function() { JS; $regexDisplayFirstTime = empty($vv_obj?->verification_code_charset) && empty($vv_obj?->verification_code_regex); -$fields['verification_code_regex'] = [ - 'fieldLabel' => __d('core_enroller','field.EmailVerifiers.verification_code_charset'), - 'groupedControls' => [ - 'verification_code_regex' => [ - 'fieldOptions' => [ + +// List the fields +$fields = [ + 'mode', + 'message_template_id', + 'request_validity' => [ + 'placeholder' => $defaultValues['DefaultVerificationValidity'] + ], + 'verification_code_regex' => [ + 'fieldLabel' => __d('core_enroller','field.EmailVerifiers.verification_code_charset'), + 'groupedControls' => [ + 'verification_code_regex' => [ 'id' => 'verification-code-regex', 'required' => false, 'empty' => true, 'style' => $regexDisplayFirstTime || !empty($vv_obj?->verification_code_regex) ? '' : 'display: none;', + 'fieldType' => 'select', + 'fieldSelectOptions' => $permittedCharacters ], - 'fieldType' => 'select', - 'fieldSelectOptions' => $permittedCharacters, - ], - 'verification_code_charset' => [ - 'fieldOptions' => [ + 'verification_code_charset' => [ 'type' => 'text', 'label' => false, 'id' => 'verification-code-charset', @@ -113,21 +110,15 @@ $fields['verification_code_regex'] = [ 'required' => false, 'checked' => !empty($vv_obj?->verification_code_charset) ? 'checked' : '' ] - ] + ], + 'beforeField' => $beforeField, + 'afterField' => $afterField ], - 'beforeField' => $beforeField, - 'afterField' => $afterField -]; - -$fields['verification_code_length'] = [ - 'fieldOptions' => [ + 'verification_code_length' => [ 'required' => false, 'placeholder' => $defaultValues['DefaultCodeLength'] - ] -]; - -$fields['enable_blockonfailure'] = [ - 'fieldOptions' => [ - 'default' => true, + ], + 'enable_blockonfailure' => [ + 'default' => true ] ]; diff --git a/app/plugins/CoreEnroller/templates/EnrollmentAttributes/fields.inc b/app/plugins/CoreEnroller/templates/EnrollmentAttributes/fields.inc index e6476fac7..83c8b676c 100644 --- a/app/plugins/CoreEnroller/templates/EnrollmentAttributes/fields.inc +++ b/app/plugins/CoreEnroller/templates/EnrollmentAttributes/fields.inc @@ -68,10 +68,7 @@ $fields = [ 'status', 'ordr', 'required' => [ - // XXX flatten fieldOptions - 'fieldOptions' => [ - 'default' => true - ] + 'default' => true ] ]; @@ -91,9 +88,7 @@ if ( && count($vv_supported_attributes[$attribute_type]['mveaParents']) > 0 ) { $fields['attribute_mvea_parent'] = [ - 'fieldOptions' => [ - 'empty' => false - ], + 'empty' => false, 'fieldType' => 'select', 'fieldSelectOptions' => array_combine( $vv_supported_attributes[$attribute_type]['mveaParents'], @@ -110,9 +105,7 @@ if ( if ($this->get($mveaAutoPopulatedVariable) !== null) { $fields['attribute_type'] = [ 'fieldLabel' => $attributes[$attribute_type] . ' Type', - 'fieldOptions' => [ - 'empty' => false - ], + 'empty' => false, 'fieldType' => 'select', 'fieldSelectOptions' => $this->get($mveaAutoPopulatedVariable) ]; @@ -129,9 +122,7 @@ if(str_ends_with($attribute_type, '_id')) { $defaultValuesPopulated = 'defaultValue' . $suffix; if ($this->get($defaultValuesPopulated) !== null) { $fields['default_value'] = [ - 'fieldOptions' => [ - 'empty' => true - ], + 'empty' => true, 'fieldType' => 'select', 'fieldSelectOptions' => $this->get($defaultValuesPopulated) ]; @@ -145,9 +136,7 @@ if(str_ends_with($attribute_type, '_id')) { */ if (\in_array($attribute_type, ['adHocAttribute'], true)) { $fields['attribute_tag'] = [ - 'fieldOptions' => [ - 'required' => true - ] + 'required' => true ]; } @@ -195,9 +184,7 @@ if($attribute_type === 'valid_from') { if($attribute_type === 'valid_through') { $fields['default_value'] = [ 'fieldDescription' => __d('core_enroller', 'field.AttributeCollectors.valid_through.default.after.desc'), - 'fieldOptions' => [ - 'type' => 'number' - ] + 'type' => 'number' ]; } @@ -210,9 +197,7 @@ if ( && \in_array($vv_supported_attributes[$attribute_type]['model'], ['PersonRole', 'Person', 'Group'], true) ) { $fields['modifiable'] = [ - 'fieldOptions' => [ - 'default' => true - ] + 'default' => true ]; $fields[] = 'hidden'; diff --git a/app/plugins/CoreEnroller/templates/InvitationAccepters/fields.inc b/app/plugins/CoreEnroller/templates/InvitationAccepters/fields.inc index f021b65df..d254122f5 100644 --- a/app/plugins/CoreEnroller/templates/InvitationAccepters/fields.inc +++ b/app/plugins/CoreEnroller/templates/InvitationAccepters/fields.inc @@ -32,9 +32,7 @@ if($vv_action !== 'edit') { $fields = [ 'invitation_validity' => [ - 'fieldOptions' => [ - 'default' => 1440 - ] + 'default' => 1440 ], 'welcome_message' ]; diff --git a/app/plugins/CoreServer/templates/MatchServerAttributes/fields.inc b/app/plugins/CoreServer/templates/MatchServerAttributes/fields.inc index 4eb06c9ba..94082ad77 100644 --- a/app/plugins/CoreServer/templates/MatchServerAttributes/fields.inc +++ b/app/plugins/CoreServer/templates/MatchServerAttributes/fields.inc @@ -28,9 +28,7 @@ $fields = [ 'attribute', 'type_id' => [ // type_id is a hidden field used to persist the type - 'fieldOptions' => [ - 'type' => 'integer' - ] + 'type' => 'integer' ] ]; diff --git a/app/plugins/CoreServer/templates/Oauth2Servers/fields.inc b/app/plugins/CoreServer/templates/Oauth2Servers/fields.inc index 7dc4b2fa9..ed4416964 100644 --- a/app/plugins/CoreServer/templates/Oauth2Servers/fields.inc +++ b/app/plugins/CoreServer/templates/Oauth2Servers/fields.inc @@ -33,25 +33,19 @@ if($vv_action !== 'edit') { // Render the Redirect URI $fields = [ 'redirect_uri' => [ - 'fieldOptions' => [ - 'readOnly' => true, - 'default' => $vv_redirect_uri - ] + 'readonly' => true, + 'default' => $vv_redirect_uri ], 'url', 'access_grant_type' => [ 'fieldSelectOptions' => $types, 'fieldType' => 'select', - 'fieldOptions' => [ - 'empty' => false, - ] + 'empty' => false ], 'clientid', 'client_secret', 'scope' => [ - 'fieldOptions' => [ - 'placeholder' => '/authenticate', - ] + 'placeholder' => '/authenticate', ] ]; diff --git a/app/plugins/CoreServer/templates/SmtpServers/fields.inc b/app/plugins/CoreServer/templates/SmtpServers/fields.inc index 34054a886..dc1d57f69 100644 --- a/app/plugins/CoreServer/templates/SmtpServers/fields.inc +++ b/app/plugins/CoreServer/templates/SmtpServers/fields.inc @@ -33,16 +33,12 @@ if($vv_action !== 'edit') { $fields = [ 'hostname', 'port' => [ - 'fieldOptions' => [ - 'default' => 587 - ] + 'default' => 587 ], 'username', 'password', 'use_tls' => [ - 'fieldOptions' => [ - 'default' => true - ] + 'default' => true ], 'default_from', 'default_reply_to', diff --git a/app/plugins/EnvSource/templates/EnvSources/fields.inc b/app/plugins/EnvSource/templates/EnvSources/fields.inc index c5c35e70e..c15613e99 100644 --- a/app/plugins/EnvSource/templates/EnvSources/fields.inc +++ b/app/plugins/EnvSource/templates/EnvSources/fields.inc @@ -101,8 +101,6 @@ foreach([ 'env_title' ] as $field) { $fields[$field] = [ - 'fieldOptions' => [ - 'default' => $defaultNames[$field] - ] + 'default' => $defaultNames[$field] ]; } diff --git a/app/plugins/OrcidSource/templates/OrcidSources/fields.inc b/app/plugins/OrcidSource/templates/OrcidSources/fields.inc index 3024e83b7..98acdcab4 100644 --- a/app/plugins/OrcidSource/templates/OrcidSources/fields.inc +++ b/app/plugins/OrcidSource/templates/OrcidSources/fields.inc @@ -40,40 +40,29 @@ if (filter_var($vv_obj->scope_inherit, FILTER_VALIDATE_BOOLEAN)) { $fields = [ // Render the Redirect URI 'redirect_uri' => [ - 'fieldOptions' => [ - 'readOnly' => true, - 'default' => $vv_redirect_uri - ] + 'readonly' => true, + 'default' => $vv_redirect_uri ], 'server_id' => [ - 'fieldOptions' => [ - 'empty' => false, - 'required' => true, - ] + 'empty' => false, + 'required' => true ], 'api_type' => [ 'fieldSelectOptions' => $api_types, 'fieldType' => 'select', - 'fieldOptions' => [ - 'empty' => false, - 'required' => true, - ] + 'empty' => false, + 'required' => true ], 'api_tier' => [ 'fieldSelectOptions' => $api_tiers, 'fieldType' => 'select', - 'fieldOptions' => [ - 'empty' => false, - 'required' => true, - ] + 'empty' => false, + 'required' => true ], 'scope_inherit', // Render active scopes 'Scope' => [ - 'fieldOptions' => [ - 'readOnly' => true, - 'default' => $vv_inherited_scopes - ] + 'readonly' => true, ], 'SUBTITLE' => [ 'subtitle' => __d('orcid_source', 'information.OrcidSources.default.types') diff --git a/app/plugins/SshKeyAuthenticator/templates/SshKeys/fields.inc b/app/plugins/SshKeyAuthenticator/templates/SshKeys/fields.inc index e82af1307..674c57e26 100644 --- a/app/plugins/SshKeyAuthenticator/templates/SshKeys/fields.inc +++ b/app/plugins/SshKeyAuthenticator/templates/SshKeys/fields.inc @@ -43,9 +43,7 @@ if($vv_action == 'add') { // As of v3.2.0, we only allow uploading of SSH Keys, not manually adding or editing $fields = [ 'keyFile' => [ - 'fieldOptions' => [ - 'type' => 'file' - ] + 'type' => 'file' ] ]; } elseif($vv_action == 'view') { diff --git a/app/resources/locales/en_US/field.po b/app/resources/locales/en_US/field.po index 4385417e4..3c67c4d22 100644 --- a/app/resources/locales/en_US/field.po +++ b/app/resources/locales/en_US/field.po @@ -597,6 +597,9 @@ msgstr "{0} MFA Exemptions" msgid "Groups.group_type" msgstr "Group Type" +msgid "Groups.members_group_id" +msgstr "Members Group" + msgid "Groups.nesting_mode_all" msgstr "Nesting Mode: All" diff --git a/app/src/View/Helper/FieldHelper.php b/app/src/View/Helper/FieldHelper.php index 9960ced48..25e7dd66f 100644 --- a/app/src/View/Helper/FieldHelper.php +++ b/app/src/View/Helper/FieldHelper.php @@ -704,13 +704,99 @@ public function getElementsForDisabledInput(string $element, array $formArgument */ function includesFileField(array $array): bool { foreach ($array as $subarray) { - // XXX flatten fieldOptions for all $fields[] --- then update this search. - if (is_array($subarray) - && isset($subarray['fieldOptions']['type']) - && $subarray['fieldOptions']['type'] === 'file') { + if (is_array($subarray) + && isset($subarray['type']) + && $subarray['type'] === 'file') { return true; } } return false; } + + /** + * Reconstruct the array of field arguments with specific top-level items becoming + * part of the fieldOptions subarray that is passed to CakePHP. We do this + * to keep the top-level array flat and abstracted away from the CakePHP + * specifics. + * + * This function will look for these top-level fields: + * 'empty', 'required', 'default', 'readonly', 'value', 'type', 'options', placeholder, + * 'class', 'id', 'style', 'checked', and 'label' + * + * These fields will be restructured into the subarray named "fieldOptions" that + * make up the CakePHP options array when the field is processed. The rest of the $fields[] + * array is returned as-is. + * + * @param array $fieldArgs The array of field arguments. + * @return array The reconstructed array of field arguments. + * @since COmanage Registry v5.2.0 + */ + function restructureFieldArguments(array $fieldArgs) { + $fieldOptions = []; + + // Pull out the top-level field options that are intended for Cake, and + // insert them into the $fieldOptions array. + if(isset($fieldArgs['empty'])) { + $fieldOptions['empty'] = $fieldArgs['empty']; + unset($fieldArgs['empty']); + } + if(isset($fieldArgs['required'])) { + $fieldOptions['required'] = $fieldArgs['required']; + unset($fieldArgs['required']); + } + if(isset($fieldArgs['default'])) { + $fieldOptions['default'] = $fieldArgs['default']; + unset($fieldArgs['default']); + } + if(isset($fieldArgs['readonly'])) { + $fieldOptions['readonly'] = $fieldArgs['readonly']; + unset($fieldArgs['readonly']); + } + if(isset($fieldArgs['value'])) { + $fieldOptions['value'] = $fieldArgs['value']; + unset($fieldArgs['value']); + } + if(isset($fieldArgs['type'])) { + $fieldOptions['type'] = $fieldArgs['type']; + unset($fieldArgs['type']); + } + if(isset($fieldArgs['options'])) { + // select options that are set explicitly + $fieldOptions['options'] = $fieldArgs['options']; + unset($fieldArgs['options']); + } + if(isset($fieldArgs['placeholder'])) { + $fieldOptions['placeholder'] = $fieldArgs['placeholder']; + unset($fieldArgs['placeholder']); + } + if(isset($fieldArgs['class'])) { + $fieldOptions['class'] = $fieldArgs['class']; + unset($fieldArgs['class']); + } + if(isset($fieldArgs['id'])) { + $fieldOptions['id'] = $fieldArgs['id']; + unset($fieldArgs['id']); + } + if(isset($fieldArgs['style'])) { + $fieldOptions['style'] = $fieldArgs['style']; + unset($fieldArgs['style']); + } + if(isset($fieldArgs['checked'])) { + $fieldOptions['checked'] = $fieldArgs['checked']; + unset($fieldArgs['checked']); + } + if(isset($fieldArgs['label'])) { + // The label field maps to the CakePHP label field (can be "false" to hide the label) + $fieldOptions['label'] = $fieldArgs['label']; + unset($fieldArgs['label']); + } + + // Insert the fieldOptions into the arguments array. + if(!empty($fieldOptions)) { + $fieldArgs['fieldOptions'] = $fieldOptions; + } + + // Return the restructured array + return $fieldArgs; + } } \ No newline at end of file diff --git a/app/templates/Addresses/fields.inc b/app/templates/Addresses/fields.inc index 6db71119e..f7e77fa19 100644 --- a/app/templates/Addresses/fields.inc +++ b/app/templates/Addresses/fields.inc @@ -35,10 +35,7 @@ $fields = [ 'postal_code', 'country', 'type_id' => [ - // XXX fix fieldOptions - just make this flat - 'fieldOptions' => [ - 'default' => $vv_default_type - ] + 'default' => $vv_default_type ], 'language', 'description', diff --git a/app/templates/CoSettings/fields.inc b/app/templates/CoSettings/fields.inc index d675a4d30..ef11c8177 100644 --- a/app/templates/CoSettings/fields.inc +++ b/app/templates/CoSettings/fields.inc @@ -27,26 +27,22 @@ $fields = [ 'required_fields_address' => [ - // XXX flatten fieldOptions - 'fieldOptions' => ['empty' => false] + 'empty' => false ], 'default_address_type_id', 'default_email_address_type_id', 'default_identifier_type_id', 'default_name_type_id', 'permitted_fields_name' => [ - // XXX flatten fieldOptions - 'fieldOptions' => ['empty' => false] + 'empty' => false ], 'required_fields_name' => [ - // XXX flatten fieldOptions - 'fieldOptions' => ['empty' => false] + 'empty' => false ], 'default_pronoun_type_id', 'default_telephone_number_type_id', 'permitted_fields_telephone_number' => [ - // XXX flatten fieldOptions - 'fieldOptions' => ['empty' => false] + 'empty' => false ], 'default_url_type_id', 'search_global_limit', @@ -54,20 +50,15 @@ $fields = [ 'person_picker_display_fields' => [ 'labelIsTextOnly' => true, 'groupedControls' => [ - // each key is the fieldName of the control we are going to create 'person_picker_email_address_type_id' => [ - 'fieldOptions' => [ - 'label' => __d('field', 'mail'), - 'empty' => '(' . __d('operation', 'all') . ')', -// 'all' => '(' . __d('operation', 'all') . ')' - ], + 'label' => __d('field', 'mail'), + 'empty' => '(' . __d('operation', 'all') . ')', +// 'all' => '(' . __d('operation', 'all') . ')' ], 'person_picker_identifier_type_id' => [ - 'fieldOptions' => [ - 'label' => __d('field', 'identifier'), - 'empty' => '(' . __d('operation', 'all') . ')', -// 'all' => '(' . __d('operation', 'all') . ')', - ], + 'label' => __d('field', 'identifier'), + 'empty' => '(' . __d('operation', 'all') . ')', +// 'all' => '(' . __d('operation', 'all') . ')', ], 'person_picker_display_types' => [ 'singleRowItem' => true, diff --git a/app/templates/EmailAddresses/fields.inc b/app/templates/EmailAddresses/fields.inc index 11ca71589..d67040d39 100644 --- a/app/templates/EmailAddresses/fields.inc +++ b/app/templates/EmailAddresses/fields.inc @@ -30,20 +30,14 @@ use \App\Lib\Enum\VerificationMethodEnum; $fields = [ 'mail', 'type_id' => [ - // XXX flatten fieldOptions - 'fieldOptions' => [ - 'default' => $vv_default_type - ] + 'default' => $vv_default_type ], 'description' ]; if($vv_obj->verified && !empty($vv_obj->verification)) { $fields['verified'] = [ - // XXX flatten fieldOptions - 'fieldOptions' => [ - 'readonly' => true - ], + 'readonly' => true, 'status' => __d('result', 'Verifications.status', [ VerificationMethodEnum::getLocalization($vv_obj->verification->method), $this->Time->nice($vv_obj->verification->verification_time, $vv_tz) @@ -51,10 +45,7 @@ if($vv_obj->verified && !empty($vv_obj->verification)) { ]; } else { $fields['verified'] = [ - // XXX flatten fieldOptions - 'fieldOptions' => [ - 'readonly' => true - ], + 'readonly' => true, 'status' => __d('enumeration', 'YesBooleanEnum.0') ]; } diff --git a/app/templates/ExternalIdentitySources/fields.inc b/app/templates/ExternalIdentitySources/fields.inc index 36b192c6d..fedf293fd 100644 --- a/app/templates/ExternalIdentitySources/fields.inc +++ b/app/templates/ExternalIdentitySources/fields.inc @@ -28,10 +28,7 @@ $fields = [ 'description', 'status' => [ - // XXX flatten fieldOptions - 'fieldOptions' => [ - 'default' => \App\Lib\Enum\SyncModeEnum::Disabled - ] + 'default' => \App\Lib\Enum\SyncModeEnum::Disabled ], 'plugin', 'pipeline_id', diff --git a/app/templates/GroupMembers/fields.inc b/app/templates/GroupMembers/fields.inc index 0533e5bed..3919bd871 100644 --- a/app/templates/GroupMembers/fields.inc +++ b/app/templates/GroupMembers/fields.inc @@ -44,11 +44,9 @@ if($vv_action == 'add') { } else { // Produce the autocomplete people selector on 'add' $fields['person_id'] = [ - 'fieldOptions' => [ - 'class' => 'form-control people-autocomplete', - 'placeholder' => __d('operation','autocomplete.people.placeholder'), - 'id' => 'person_id', - ], + 'class' => 'form-control people-autocomplete', + 'placeholder' => __d('operation','autocomplete.people.placeholder'), + 'id' => 'person_id', 'autocomplete' => [ 'configuration' => [ 'for' => 'GroupMembers', diff --git a/app/templates/Groups/fields.inc b/app/templates/Groups/fields.inc index 69309f430..6b08fa060 100644 --- a/app/templates/Groups/fields.inc +++ b/app/templates/Groups/fields.inc @@ -33,41 +33,22 @@ if($vv_obj->isOwners()) { } $fields = [ - 'name' => [ - // XXX flatten fieldOptions - 'fieldOptions' => $options - ], - 'description' => [ - // XXX flatten fieldOptions - 'fieldOptions' => $options - ], - 'status' => [ - // XXX flatten fieldOptions - 'fieldOptions' => $options - ], - 'open' => [ - // XXX flatten fieldOptions - 'fieldOptions' => $options - ], - 'nesting_mode_all' => [ - // XXX flatten fieldOptions - 'fieldOptions' => $options - ] + 'name' => $options, + 'description' => $options, + 'status' => $options, + 'open' => $options, + 'nesting_mode_all' => $options ]; if($vv_action != 'add') { $fields['group_type'] = [ - // XXX flatten fieldOptions - 'fieldOptions' => [ - 'readonly' => true - ] + 'readonly' => true ]; if($vv_obj->isOwners()) { // Link to the main group if(!empty($vv_obj->owners_for_group)) { - $fields['owners_group_id'] = [ - 'fieldLabel' => 'Members Group', + $fields['members_group_id'] = [ 'status' => $vv_obj->owners_for_group->name, 'link' => ['url' => ['controller' => 'groups', 'action' => 'edit', $vv_obj->owners_for_group->id]], 'labelIsTextOnly' => true diff --git a/app/templates/Identifiers/fields.inc b/app/templates/Identifiers/fields.inc index 5633b81f1..ebd84d9e7 100644 --- a/app/templates/Identifiers/fields.inc +++ b/app/templates/Identifiers/fields.inc @@ -28,10 +28,7 @@ $fields = [ 'identifier', 'type_id' => [ - // XXX flatten fieldOptions - 'fieldOptions' => [ - 'default' => $vv_default_type - ] + 'default' => $vv_default_type ] ]; diff --git a/app/templates/Jobs/fields.inc b/app/templates/Jobs/fields.inc index b876c0742..375a50798 100644 --- a/app/templates/Jobs/fields.inc +++ b/app/templates/Jobs/fields.inc @@ -40,10 +40,7 @@ if($vv_action == 'add') { $fields = [ 'plugin' => [ 'fieldLabel' => __d('controller', 'Jobs', [1]), - // XXX flatten fieldOptions - 'fieldOptions' => [ - 'type' => 'text' - ] + 'type' => 'text' ] ]; @@ -59,7 +56,7 @@ if($vv_action == 'add') { 'parameters' => [ // Establish the supplemental field wrappers for the parameters field 'beforeField' => - '
+ '
diff --git a/app/templates/MessageTemplates/fields.inc b/app/templates/MessageTemplates/fields.inc index 745c39721..8487854e8 100644 --- a/app/templates/MessageTemplates/fields.inc +++ b/app/templates/MessageTemplates/fields.inc @@ -32,10 +32,7 @@ $fields = [ 'format', 'subject', 'body_text' => [ - // XXX flatten fieldOptions - 'fieldOptions' => [ - 'class' => 'big-textarea' - ] + 'class' => 'big-textarea' ], 'body_html' => [ 'afterField' => @@ -43,10 +40,7 @@ $fields = [ ' ' . ' ' . __d('information','html.sanitization') . '' . '
', - // XXX flatten fieldOptions - 'fieldOptions' => [ - 'class' => 'big-textarea' - ] + 'class' => 'big-textarea' ], 'cc', 'bcc', diff --git a/app/templates/MostlyStaticPages/fields.inc b/app/templates/MostlyStaticPages/fields.inc index b0d79180b..8e154f785 100644 --- a/app/templates/MostlyStaticPages/fields.inc +++ b/app/templates/MostlyStaticPages/fields.inc @@ -29,19 +29,13 @@ $fields = [ 'title', 'name', 'pageUrl' => [ - // XXX flatten fieldOptions - 'fieldOptions' => [ - 'readOnly' => true - ] + 'readonly' => true ], 'description', 'status', 'context', 'body' => [ - // XXX flatten fieldOptions - 'fieldOptions' => [ - 'class' => 'big-textarea' - ], + 'class' => 'big-textarea', 'afterField' => '