Skip to content

Ensure a title exists on Petition start, dispatch, and resume (CFM-31) #222

Merged
merged 1 commit into from Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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');
}
Expand Down
6 changes: 6 additions & 0 deletions app/src/Controller/EnrollmentFlowsController.php
Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions app/templates/EnrollmentFlows/start.php
Expand Up @@ -27,6 +27,15 @@

declare(strict_types = 1);

?>

<div class="page-title-container">
<div class="page-title">
<h1><?= $vv_title; ?></h1>
</div>
</div>

<?php
// Enrollment Flow Start has its own file of fields
$this->set('vv_fields_inc', 'start.inc');
// Set form edit ability
Expand Down
2 changes: 1 addition & 1 deletion app/templates/Petitions/resume.php
Expand Up @@ -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)
];
Expand Down
2 changes: 1 addition & 1 deletion app/templates/layout/default.php
Expand Up @@ -197,7 +197,7 @@
<?php endif; ?>

<div id="main-wrapper">
<?php if(!empty($vv_user) && !empty($vv_cur_co) && !$isCoSelectView &&!$isActivePetition): ?>
<?php if(!empty($vv_user) && !empty($vv_cur_co) && !$isCoSelectView && !$isActivePetition): ?>
<?= $this->element('menuMain') ?>
<?php endif ?>

Expand Down