From 9a4061910acfab05a8c1726a1f73f9198e2c818c Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Thu, 18 Jul 2024 13:51:44 +0200 Subject: [PATCH] Status insert-function: some updates --- application/controllers/api/frontend/v1/stv/Status.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/application/controllers/api/frontend/v1/stv/Status.php b/application/controllers/api/frontend/v1/stv/Status.php index 1229ae861..a55b3f19d 100644 --- a/application/controllers/api/frontend/v1/stv/Status.php +++ b/application/controllers/api/frontend/v1/stv/Status.php @@ -44,7 +44,7 @@ class Status extends FHCAPI_Controller // Load language phrases $this->loadPhrases([ - 'ui', 'bismeldestichtag','lehre','studierendenantrag' + 'global', 'ui', 'bismeldestichtag','lehre','studierendenantrag' ]); } @@ -76,9 +76,12 @@ class Status extends FHCAPI_Controller [ 'required', // In FAS empty datum results in todays 'is_valid_date', + // TODO(chris): before today ['meldestichtag_not_exceeded', function ($value) use ($isBerechtigtNoStudstatusCheck) { if ($isBerechtigtNoStudstatusCheck) return true; // Skip if access right says so + if (!$value) + return true; // Error will be handled by the required statement above $result = $this->prestudentstatuschecklib->checkIfMeldestichtagErreicht($value); @@ -122,7 +125,7 @@ class Status extends FHCAPI_Controller $result = $this->PrestudentstatusModel->load([$ausbildungssemester, $studiensemester_kurzbz, $status_kurzbz, $prestudent_id]); - return $this->getDataOrTerminateWithError($result); + return !$this->getDataOrTerminateWithError($result); }] ], [ 'rolle_doesnt_exist' => $this->p->t('lehre', 'error_rolleBereitsVorhanden')