This commit is contained in:
@@ -17,6 +17,13 @@
|
||||
<?php
|
||||
$query = service('request')->getUri()->getQuery();
|
||||
$returnTo = current_url() . ($query !== '' ? '?' . $query : '');
|
||||
$activeSchoolYearId = null;
|
||||
foreach ($schoolYearOptions as $year) {
|
||||
if (strtolower((string) ($year['status'] ?? '')) === 'active') {
|
||||
$activeSchoolYearId = (int) ($year['id'] ?? 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="school-year-context-bar border-bottom bg-light py-2">
|
||||
<div class="container-fluid px-3">
|
||||
@@ -55,10 +62,11 @@
|
||||
|
||||
<span class="text-muted small"><?= esc($schoolYearContext->yearName()) ?></span>
|
||||
</form>
|
||||
<?php if ($schoolYearContext->isExplicitSelection()): ?>
|
||||
<form method="post" action="<?= site_url('school-year/reset') ?>" class="d-inline-block mt-2 mt-sm-0 ms-sm-2">
|
||||
<?php if ($schoolYearContext->isExplicitSelection() && $activeSchoolYearId !== null): ?>
|
||||
<form method="post" action="<?= site_url('school-year/select') ?>" class="d-inline-block mt-2 mt-sm-0 ms-sm-2">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="return_to" value="<?= esc($returnTo) ?>">
|
||||
<input type="hidden" name="school_year_id" value="<?= (int) $activeSchoolYearId ?>">
|
||||
<button type="submit" class="btn btn-outline-secondary btn-sm">
|
||||
Active year
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user