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
+10 -2
View File
@@ -60,7 +60,11 @@ switch ($role) {
}
} else {
$configModel = new \App\Models\ConfigurationModel();
$schoolYear = session()->get('school_year') ?? $configModel->getConfig('school_year');
try {
$schoolYear = service('schoolYearContext')->resolve(service('request'))->yearName();
} catch (\Throwable $e) {
$schoolYear = session()->get('school_year') ?? $configModel->getConfig('school_year');
}
$classSectionId = (int)($class_section_id ?? session()->get('class_section_id') ?? 0);
if ($classSectionId > 0 && !empty($schoolYear)) {
$scoreCardStudents = $studentModel->getByClassAndYear($classSectionId, $schoolYear);
@@ -267,7 +271,11 @@ switch ($role) {
if (!isset($activeEventCount) && ($role ?? '') === 'parent') {
$configModel = new \App\Models\ConfigurationModel();
$eventModel = new \App\Models\EventModel();
$year = $sess->get('school_year') ?? $configModel->getConfig('school_year');
try {
$year = service('schoolYearContext')->resolve(service('request'))->yearName();
} catch (\Throwable $e) {
$year = $sess->get('school_year') ?? $configModel->getConfig('school_year');
}
$semester = $sess->get('semester') ?? $configModel->getConfig('semester');
$activeEventCount = count($eventModel->getActiveEvents($year, $semester) ?? []);
}