Skip to content

Add top-level subnavigation to Enrollment Flow and Enrollment Flow Steps (CFM-31) #166

Merged
merged 1 commit into from Mar 7, 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
5 changes: 5 additions & 0 deletions app/templates/EnrollmentFlowSteps/columns.inc
Expand Up @@ -56,4 +56,9 @@ $rowActions = [
'label' => __d('operation', 'configure.plugin'),
'icon' => 'electrical_services'
]
];

$subnav = [
'name' => 'enrollment_flow',
'active' => 'steps'
];
5 changes: 5 additions & 0 deletions app/templates/EnrollmentFlows/fields-nav.inc
Expand Up @@ -47,3 +47,8 @@ $topLinks[] = [
],
'class' => ''
];

$subnav = [
'name' => 'enrollment_flow',
'active' => 'properties'
];
42 changes: 39 additions & 3 deletions app/templates/element/subnavigation.php
Expand Up @@ -69,6 +69,8 @@
$linkFilter = ['person_id' => $curId];
} elseif ($name == 'group') {
$linkFilter = ['group_id' => $curId];
} elseif ($name == 'enrollment_flow') {
$linkFilter = ['enrollment_flow_id' => $curId];
}
} elseif(!empty($vv_bc_title_links)) {
// All else fails? Use the breadcrumb which has figured this out.
Expand Down Expand Up @@ -100,6 +102,8 @@
$supertitle = $vv_obj->$vv_display_field;
} elseif(!empty($vv_bc_parent_obj)) {
$supertitle = $vv_bc_parent_obj->$vv_bc_parent_displayfield;
} elseif(!empty($vv_primary_link_obj)) {
$supertitle = $vv_primary_link_obj->name;
} elseif(!empty($vv_bc_title_links)) {
// All else fails? Use the breadcrumb which has figured this out.
// XXX We might just be able to do this and skip all the above after breadcrumbs have been refactored
Expand Down Expand Up @@ -282,8 +286,8 @@
*/ ?>
<?php endif; // person ?>

<?php if ($name == 'group'): ?>
<!-- Group Subnavigation -->
<?php if($name == 'group'): ?>
<!-- Group Subnavigation -->
<li class="nav-item">
<?php
$linkClass = ($active == 'properties') ? 'nav-link active' : 'nav-link';
Expand Down Expand Up @@ -326,7 +330,39 @@
</li>
<?php endif; // group ?>

<?php if ($name == 'plugin'): ?>
<?php if($name == 'enrollment_flow'): ?>
<!-- Enrollment Flow (Configuration) Subnavigation -->
<li class="nav-item">
<?php
$linkClass = ($active == 'properties') ? 'nav-link active' : 'nav-link';
print $this->Html->link(
__d('controller', 'Properties', [99]),
[
'controller' => 'enrollment-flows',
'action' => $curAction == 'view' ? 'view' : 'edit',
$curId
],
['class' => $linkClass]
);
?>
</li>
<li class="nav-item">
<?php
$linkClass = ($active == 'steps') ? 'nav-link active' : 'nav-link';
print $this->Html->link(
__d('controller', 'EnrollmentFlowSteps', [99]),
[
'controller' => 'enrollment_flow_steps',
'action' => 'index',
'?' => $linkFilter
],
['class' => $linkClass]
);
?>
</li>
<?php endif; // enrollment_flow ?>

<?php if($name == 'plugin'): ?>
<!-- General Plugin Configuration Subnavigation -->
<!-- Used for all plugins that have a parent object with a child plugin config -->
<li class="nav-item">
Expand Down