From 877b5d270c58e68a5b845ada5a729c271235d0e1 Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Thu, 30 Jan 2025 12:35:42 -0500 Subject: [PATCH] Refactored form field generation for accessibility and restored beforeField and afterField supplements (CFM-446) --- app/src/Model/Table/PersonRolesTable.php | 10 ++++ app/src/View/Helper/FieldHelper.php | 11 +++- app/templates/Jobs/fields.inc | 45 +++++++++++--- app/templates/PersonRoles/fields.inc | 30 +++++++--- app/templates/element/form/fieldDiv.php | 47 +++++++++------ .../element/form/infoDiv/autocomplete.php | 8 +-- app/templates/element/form/infoDiv/check.php | 58 ------------------- .../element/form/infoDiv/default.php | 5 +- .../element/form/infoDiv/groupMember.php | 32 +++++----- .../element/form/infoDiv/grouped.php | 28 +++++---- app/templates/element/form/infoDiv/source.php | 6 +- app/templates/element/form/infoDiv/status.php | 5 +- .../element/form/infoDiv/withPrefix.php | 11 ++-- app/templates/element/form/listItem.php | 6 +- app/webroot/css/co-base.css | 5 ++ 15 files changed, 162 insertions(+), 145 deletions(-) delete mode 100644 app/templates/element/form/infoDiv/check.php diff --git a/app/src/Model/Table/PersonRolesTable.php b/app/src/Model/Table/PersonRolesTable.php index 324b81f0f..4c13a57ac 100644 --- a/app/src/Model/Table/PersonRolesTable.php +++ b/app/src/Model/Table/PersonRolesTable.php @@ -162,6 +162,16 @@ public function initialize(array $config): void { 'cous' => [ 'type' => 'select', 'model' => 'Cous' + ], + // Required for peoplePicker + 'cosettings' => [ + 'type' => 'auxiliary', + 'model' => 'CoSettings' + ], + // Required for peoplePicker + 'types' => [ + 'type' => 'auxiliary', + 'model' => 'Types' ] ]); diff --git a/app/src/View/Helper/FieldHelper.php b/app/src/View/Helper/FieldHelper.php index 90d6c0de8..09db6fa1c 100644 --- a/app/src/View/Helper/FieldHelper.php +++ b/app/src/View/Helper/FieldHelper.php @@ -370,12 +370,13 @@ public function dateField(string $fieldName, * @param string $fieldName Form field * @param array|null $fieldOptions The second parameter of the Form->control helper. List of element options * @param string|null $fieldLabel Custom label text. Applicable to checkboxes ONLY - * @param string $fieldPrefix If the field has a specil prefix provide the value + * @param string $fieldPrefix If the field has a special prefix provide the value * @param string|null $fieldType Field type to override the one calculated from the schema * @param array|null $fieldSelectOptions Options array to override the one calculated options from the AutoPopulate property * fieldType has to be 'select' * @param string|null $fieldNameAlias Used for the Petition Attribute Collection form. The form uses generic field name. * The variable is used to map the generic field name to the actual enrollment attribute name + * @oaran bool|null $labelIsTextOnly A parameter to force rending a field name/label as plain text with no