apply the school year concept
Tests / PHPUnit (push) Failing after 1m19s

This commit is contained in:
root
2026-07-14 00:59:00 -04:00
parent 504c3bc9f9
commit feb1b29a32
73 changed files with 4288 additions and 620 deletions
@@ -46,7 +46,7 @@ class AssignmentController extends BaseController
// Apply school year filter (default to current config) but avoid semester filtering so the full year is visible
$selectedSemester = (string)($this->request->getGet('semester') ?? $this->semester ?? '');
$year = (string)($this->request->getGet('school_year') ?? $this->schoolYear ?? '');
$year = (string)($this->schoolYear ?? '');
$tcQ = $this->teacherClassModel;
if ($year !== '') {
@@ -172,11 +172,11 @@ class AssignmentController extends BaseController
}
$schoolYearsList = [];
try {
$db = Database::connect();
$yearsQuery = $db->table('teacher_class')
->select('DISTINCT school_year', false)
->where('school_year IS NOT NULL', null, false)
try {
$db = Database::connect();
$yearsQuery = $db->table('teacher_class')
->select('DISTINCT school_year', false)
->where('school_year IS NOT NULL', null, false)
->orderBy('school_year', 'DESC')
->get()
->getResultArray();
@@ -189,8 +189,8 @@ class AssignmentController extends BaseController
} catch (\Throwable $e) {
// ignore fallback below
}
if (empty($schoolYearsList) && $this->schoolYear !== null && $this->schoolYear !== '') {
$schoolYearsList[] = (string)$this->schoolYear;
if ($this->schoolYear !== null && $this->schoolYear !== '' && !in_array((string)$this->schoolYear, $schoolYearsList, true)) {
array_unshift($schoolYearsList, (string)$this->schoolYear);
}
// Sort sections