fix enrollment for the new school-year
Tests / PHPUnit (push) Successful in 1m26s

This commit is contained in:
root
2026-08-07 23:43:31 -04:00
parent b6f3b14e7b
commit 1ef2800f12
66 changed files with 8997 additions and 498 deletions
+16 -4
View File
@@ -8,6 +8,7 @@ $semester = 'year';
$schoolYear = $schoolYear ?? '';
$schoolYears = $schoolYears ?? [];
$isEditable = (bool)($isEditable ?? true);
if (empty($schoolYears) && $schoolYear !== '') {
$schoolYears = [$schoolYear];
@@ -102,6 +103,12 @@ if (empty($schoolYears) && $schoolYear !== '') {
</div>
<?php endif; ?>
<?php if (!$isEditable): ?>
<div class="alert alert-warning" role="alert">
This school year is closed. Decisions are read-only.
</div>
<?php endif; ?>
<?php
$decisionOptions = [
'' => '— No decision yet —',
@@ -214,11 +221,13 @@ if (empty($schoolYears) && $schoolYear !== '') {
<textarea name="notes"
class="form-control form-control-sm decision-notes"
rows="3"
placeholder="Add comments or rationale…"><?= esc($currentNotes) ?></textarea>
placeholder="Add comments or rationale…"
<?= $isEditable ? '' : 'readonly' ?>><?= esc($currentNotes) ?></textarea>
<div class="d-flex gap-2 mt-2 align-items-center">
<select name="decision"
class="form-select form-select-sm decision-select flex-grow-1">
class="form-select form-select-sm decision-select flex-grow-1"
<?= $isEditable ? '' : 'disabled' ?>>
<?php foreach ($decisionOptions as $val => $label): ?>
<option value="<?= esc($val) ?>" <?= $currentDecision === $val ? 'selected' : '' ?>>
<?= esc($label) ?>
@@ -226,7 +235,9 @@ if (empty($schoolYears) && $schoolYear !== '') {
<?php endforeach; ?>
</select>
<button type="submit" class="btn btn-sm btn-primary">
<button type="submit"
class="btn btn-sm btn-primary"
<?= $isEditable ? '' : 'disabled' ?>>
Save
</button>
</div>
@@ -243,7 +254,8 @@ if (empty($schoolYears) && $schoolYear !== '') {
class="btn btn-sm btn-outline-primary btn-send-email"
data-student-id="<?= (int)($row['student_id'] ?? 0) ?>"
data-semester="year"
data-school-year="<?= esc((string)$schoolYear) ?>">
data-school-year="<?= esc((string)$schoolYear) ?>"
<?= $isEditable ? '' : 'disabled' ?>>
Send Email
</button>
<?php else: ?>