From bb47f70e00ad7643f56804d71a38805a54bdea94 Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Wed, 20 Nov 2024 12:40:08 -0500 Subject: [PATCH] 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 747ab724c..d97da248c 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 6abbbca90..1d07fe396 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