From ce0ffc2a61598eb62602f40546b2dc397e818e64 Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Fri, 27 Sep 2024 16:12:02 -0400 Subject: [PATCH] Ensure a title exists on Petition start, dispatch, and resume (CFM-31) --- .../src/Controller/AttributeCollectorsController.php | 6 ++++++ app/src/Controller/EnrollmentFlowsController.php | 6 ++++++ app/templates/EnrollmentFlows/start.php | 9 +++++++++ app/templates/Petitions/resume.php | 2 +- app/templates/layout/default.php | 2 +- 5 files changed, 23 insertions(+), 2 deletions(-) diff --git a/app/plugins/CoreEnroller/src/Controller/AttributeCollectorsController.php b/app/plugins/CoreEnroller/src/Controller/AttributeCollectorsController.php index 0e279be8e..7d19b315e 100644 --- a/app/plugins/CoreEnroller/src/Controller/AttributeCollectorsController.php +++ b/app/plugins/CoreEnroller/src/Controller/AttributeCollectorsController.php @@ -95,6 +95,12 @@ public function dispatch(string $id) { ->find() ->where(['petition_id' => $petition->id]) ->all()); + + // Get the title + // XXX Replace $petition->enrollment_flow_id with the Enrollment Flow "Name" (for now) + // XXX We should have a "Title" for end-users that is different from the Enrollment Flow "Name" + // for start and dispatch. + $this->set('vv_title', $petition->enrollment_flow_id); $this->render('/Standard/dispatch'); } diff --git a/app/src/Controller/EnrollmentFlowsController.php b/app/src/Controller/EnrollmentFlowsController.php index 940a69fef..79f043fbe 100644 --- a/app/src/Controller/EnrollmentFlowsController.php +++ b/app/src/Controller/EnrollmentFlowsController.php @@ -143,6 +143,12 @@ public function start(string $id) { // We need to render a form, so we'll delay creating the petition // until we come back from the form. Since there's no petition there's // no meaningful information to pass through and back. + + // Get the title + // XXX We should have a "Title" for end-users that is different from the Enrollment Flow "Name" + // for start and dispatch. + $this->set('vv_title', $flow->name); + } else { // No form, so just allocate a new Petition and set appropriate metadata diff --git a/app/templates/EnrollmentFlows/start.php b/app/templates/EnrollmentFlows/start.php index d6b5f5017..ecf30a486 100644 --- a/app/templates/EnrollmentFlows/start.php +++ b/app/templates/EnrollmentFlows/start.php @@ -27,6 +27,15 @@ declare(strict_types = 1); +?> + +
+
+

+
+
+ +set('vv_fields_inc', 'start.inc'); // Set form edit ability diff --git a/app/templates/Petitions/resume.php b/app/templates/Petitions/resume.php index 2a8b6ca6e..0dcb6c681 100644 --- a/app/templates/Petitions/resume.php +++ b/app/templates/Petitions/resume.php @@ -40,7 +40,7 @@ 'plugin' => null, 'controller' => 'Petitions', 'action' => 'index', - '?' => ['co_id' => $vv_cur_co->id] + '?' => ['enrollment_flow_id' => $vv_petition->enrollment_flow_id] ], 'label' => __d('controller', 'Petitions', 99) ]; diff --git a/app/templates/layout/default.php b/app/templates/layout/default.php index 83ef2aadc..7cf4e2471 100644 --- a/app/templates/layout/default.php +++ b/app/templates/layout/default.php @@ -197,7 +197,7 @@
- + element('menuMain') ?>