This commit is contained in:
@@ -57,6 +57,7 @@ class LandingPageController extends BaseController
|
||||
// Fetch Enrollment and Refund Deadlines from Configuration
|
||||
$this->schoolYear = $this->configModel->getConfig('school_year');
|
||||
$this->semester = $this->configModel->getConfig('semester');
|
||||
$this->schoolYear = $this->selectedSchoolYearName((string) ($this->schoolYear ?? ''));
|
||||
$this->lastDayOfRegistration = $this->configModel->getConfig('enrollment_deadline') ?? 'Not set';
|
||||
$this->refundDeadline = $this->configModel->getConfig('refund_deadline') ?? 'Not set';
|
||||
|
||||
@@ -103,7 +104,7 @@ class LandingPageController extends BaseController
|
||||
// Get all class assignments for this teacher in the current term
|
||||
$assignments = $this->teacherClassModel->getClassAssignmentsByUserId(
|
||||
(int)$user_id,
|
||||
(string)$this->schoolYear,
|
||||
$this->selectedSchoolYearName((string) ($this->schoolYear ?? '')),
|
||||
(string)$this->semester
|
||||
);
|
||||
|
||||
@@ -126,6 +127,15 @@ class LandingPageController extends BaseController
|
||||
return $chosen;
|
||||
}
|
||||
|
||||
private function selectedSchoolYearName(string $fallback): string
|
||||
{
|
||||
try {
|
||||
return service('schoolYearContext')->resolve(service('request'))->yearName();
|
||||
} catch (\Throwable) {
|
||||
return $fallback;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function administrator()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user