fix deployment db issue and widthrawal administration page
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 47s
Tests / PHPUnit (push) Failing after 1m19s

This commit is contained in:
root
2026-08-20 20:18:00 -04:00
parent 889c037660
commit d3da699e55
19 changed files with 1170 additions and 194 deletions
@@ -44,6 +44,10 @@
.enrollment-admin .email-check .email-check-body {
flex: 1 1 auto;
}
.enrollment-admin .issue-badge {
white-space: normal;
text-align: left;
}
</style>
<?= $this->endSection() ?>
@@ -59,16 +63,61 @@ if (!function_exists('enrollment_admin_flag_label')) {
'LATE_REGISTRATION_EXCEPTION' => 'Late registration',
'FINANCIAL_REVIEW_REQUIRED' => 'Finance review',
'CLASS_CAPACITY_EXCEPTION_REQUIRED' => 'Class capacity',
'DEFERRED_DELIBERATION' => 'Missing decision',
'DEFERRED_DELIBERATION' => 'Decision review',
'RESTRICTED_ADMINISTRATIVE_REVIEW' => 'Restricted review',
'WITHDRAWAL_REVIEW_REQUIRED' => 'Withdrawal review',
'COMPLETION_OR_EXIT_PROCESS_REQUIRED' => 'Exit / completion',
'ADULT_STUDENT_ACTION_REQUIRED' => 'Adult student',
'SIBLING_LAST_NAME_MISMATCH' => 'Sibling last names',
'NO_FINAL_DECISION' => 'No final decision',
'UNRECOGNIZED_DECISION' => 'Unrecognized decision',
'DEFERRED_DECISION' => 'Deferred decision',
'EXPELLED' => 'Expelled',
'WITHDRAWN' => 'Withdrawn',
'DENIED' => 'Denied',
'MAKE_UP_EXAM' => 'Makeup exam',
default => $type !== '' ? ucwords(strtolower(str_replace('_', ' ', $type))) : 'Unknown',
};
}
}
if (!function_exists('enrollment_admin_issue_code')) {
function enrollment_admin_issue_code(array $flag): string
{
$type = strtoupper(trim((string) ($flag['flag_type'] ?? '')));
$details = is_array($flag['details'] ?? null) ? $flag['details'] : [];
$ruleCode = strtoupper(trim((string) ($details['rule_code'] ?? '')));
if ($ruleCode !== '') {
return $ruleCode;
}
if ($type === 'DEFERRED_DELIBERATION') {
$reason = strtolower((string) ($details['reason'] ?? ''));
if (str_contains($reason, 'unrecognized')) {
return 'UNRECOGNIZED_DECISION';
}
if (str_contains($reason, 'missing') || str_contains($reason, 'no final')) {
return 'NO_FINAL_DECISION';
}
}
return $type;
}
}
if (!function_exists('enrollment_admin_issue_badge_class')) {
function enrollment_admin_issue_badge_class(string $code): string
{
return match (strtoupper($code)) {
'NO_FINAL_DECISION', 'UNRECOGNIZED_DECISION', 'EXPELLED', 'DENIED', 'RESTRICTED_ADMINISTRATIVE_REVIEW' => 'bg-danger',
'DEFERRED_DECISION', 'DEFERRED_DELIBERATION', 'FINANCIAL_REVIEW_REQUIRED', 'OUTSTANDING_BALANCE_BLOCKED', 'FINANCE_APPROVAL_REQUIRED' => 'bg-warning text-dark',
'PENDING_MAKE_UP_EXAM_PROMOTION', 'MAKE_UP_EXAM', 'AGE_EXCEPTION_REQUIRED', 'ADULT_STUDENT_ACTION_REQUIRED' => 'bg-info text-dark',
'CLASS_REASSIGNMENT_REQUIRED', 'CLASS_CAPACITY_EXCEPTION_REQUIRED' => 'bg-primary',
'WITHDRAWN', 'WITHDRAWAL_REVIEW_REQUIRED', 'COMPLETION_OR_EXIT_PROCESS_REQUIRED' => 'bg-dark',
'SIBLING_LAST_NAME_MISMATCH', 'LATE_REGISTRATION_EXCEPTION' => 'bg-secondary',
default => 'bg-secondary',
};
}
}
if (!function_exists('enrollment_admin_placement_label')) {
function enrollment_admin_placement_label(string $status): string
{
@@ -128,16 +177,6 @@ if (!function_exists('enrollment_admin_decision_label')) {
};
}
}
if (!function_exists('enrollment_admin_priority_label')) {
function enrollment_admin_priority_label(string $priority): string
{
return match (strtolower($priority)) {
'high' => 'High',
'low' => 'Low',
default => 'Normal',
};
}
}
if (!function_exists('enrollment_admin_exception_status_label')) {
function enrollment_admin_exception_status_label(string $status): string
{
@@ -308,7 +347,6 @@ $reasonCodes = is_array($exceptionReasonCodes ?? null) ? $exceptionReasonCodes :
<th>Student</th>
<th>School ID</th>
<th>Issue</th>
<th>Priority</th>
<th>Details</th>
<th>Assigned</th>
<th>Created</th>
@@ -322,8 +360,8 @@ $reasonCodes = is_array($exceptionReasonCodes ?? null) ? $exceptionReasonCodes :
$flagId = (int) ($flag['id'] ?? 0);
$flagTypeValue = (string) ($flag['flag_type'] ?? '');
$details = is_array($flag['details'] ?? null) ? $flag['details'] : [];
$priorityValue = (string) ($flag['priority'] ?? 'normal');
$priorityClass = strtolower($priorityValue) === 'high' ? 'bg-danger' : 'bg-secondary';
$issueCode = enrollment_admin_issue_code($flag);
$issueClass = enrollment_admin_issue_badge_class($issueCode);
?>
<tr>
<td>
@@ -331,8 +369,7 @@ $reasonCodes = is_array($exceptionReasonCodes ?? null) ? $exceptionReasonCodes :
<?= student_enrollment_status_button($flag, $schoolYear ?? null) ?>
</td>
<td><?= esc($flag['school_id'] ?? '') ?></td>
<td><span class="badge bg-secondary"><?= esc(enrollment_admin_flag_label($flagTypeValue)) ?></span></td>
<td><span class="badge <?= esc($priorityClass) ?>"><?= esc(enrollment_admin_priority_label($priorityValue)) ?></span></td>
<td><span class="badge issue-badge <?= esc($issueClass) ?>"><?= esc(enrollment_admin_flag_label($issueCode)) ?></span></td>
<td>
<?php if ($details !== []): ?>
<?php foreach ($details as $key => $value): ?>