From bb47f70e00ad7643f56804d71a38805a54bdea94 Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Wed, 20 Nov 2024 12:40:08 -0500 Subject: [PATCH 1/2] Improve Petition index and add a label prefix config for index view (CFM-428) --- app/templates/Petitions/columns.inc | 21 +++++++++++---------- app/templates/Standard/index.php | 7 ++++++- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/app/templates/Petitions/columns.inc b/app/templates/Petitions/columns.inc index 747ab724..d97da248 100644 --- a/app/templates/Petitions/columns.inc +++ b/app/templates/Petitions/columns.inc @@ -28,16 +28,8 @@ $indexColumns = [ // We start with id to ensure there is a clickable field in the row 'id' => [ - 'type' => 'link' - ], - 'enrollee_person_id' => [ - 'type' => 'relatedLink', - 'action' => 'edit', - 'label' => __d('field', 'Petitions.enrollee_person_id'), - 'model' => 'enrollee_person', - 'submodel' => 'primary_name', - 'field' => 'full_name', - 'default' => __d('field', 'Petitions.enrollee.new') + 'type' => 'link', + 'labelPrefix' => __d('controller','Petitions',[1]) ], 'status' => [ 'type' => 'enum', @@ -49,6 +41,15 @@ $indexColumns = [ 'model' => 'enrollment_flow', 'field' => 'name' ], + 'enrollee_person_id' => [ + 'type' => 'relatedLink', + 'action' => 'edit', + 'label' => __d('field', 'Petitions.enrollee_person_id'), + 'model' => 'enrollee_person', + 'submodel' => 'primary_name', + 'field' => 'full_name', + 'default' => __d('field', 'Petitions.enrollee.new') + ], 'cou_id' => [ 'type' => 'relatedLink', 'model' => 'cou', diff --git a/app/templates/Standard/index.php b/app/templates/Standard/index.php index 6abbbca9..1d07fe39 100644 --- a/app/templates/Standard/index.php +++ b/app/templates/Standard/index.php @@ -386,8 +386,13 @@ ?> > $col . $suffix; + $label = $prefix . $entity->$col . $suffix; // If there is no calculated default value but a default is configured, // use that instead From 37cb359c439e3461c99d11b77afeb7ee81a64e3a Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Wed, 20 Nov 2024 12:44:09 -0500 Subject: [PATCH 2/2] Swap column order for enrollee and enrollment flow (CFM-428) --- app/templates/Petitions/columns.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/templates/Petitions/columns.inc b/app/templates/Petitions/columns.inc index d97da248..8c8634a9 100644 --- a/app/templates/Petitions/columns.inc +++ b/app/templates/Petitions/columns.inc @@ -36,11 +36,6 @@ $indexColumns = [ 'class' => 'PetitionStatusEnum', 'sortable' => true ], - 'enrollment_flow_id' => [ - 'type' => 'relatedLink', - 'model' => 'enrollment_flow', - 'field' => 'name' - ], 'enrollee_person_id' => [ 'type' => 'relatedLink', 'action' => 'edit', @@ -50,6 +45,11 @@ $indexColumns = [ 'field' => 'full_name', 'default' => __d('field', 'Petitions.enrollee.new') ], + 'enrollment_flow_id' => [ + 'type' => 'relatedLink', + 'model' => 'enrollment_flow', + 'field' => 'name' + ], 'cou_id' => [ 'type' => 'relatedLink', 'model' => 'cou',