Skip to content

Commit

Permalink
Ensure a title exists on Petition start, dispatch, and resume (CFM-31) (
Browse files Browse the repository at this point in the history
  • Loading branch information
arlen authored Sep 27, 2024
1 parent 27fc36e commit bfe37bd
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit bfe37bd

Please sign in to comment.