From a6daa7bf0ca7444d1336ac6138a336d49cd6fa03 Mon Sep 17 00:00:00 2001 From: Johann Hoffmann Date: Tue, 17 Feb 2026 17:32:11 +0100 Subject: [PATCH] all abgabetool datepickers use date format via format="dd.MM.yyyy" instead of :format="formatDate" to enable text-input + autoapply; backend deadline datetime check for endupload; --- .../controllers/api/frontend/v1/Abgabe.php | 29 +++++++++++++++++++ .../Cis/Abgabetool/AbgabeMitarbeiterDetail.js | 10 +++++-- .../Cis/Abgabetool/AbgabeStudentDetail.js | 3 +- .../Cis/Abgabetool/AbgabetoolAssistenz.js | 3 +- .../Cis/Abgabetool/AbgabetoolMitarbeiter.js | 3 +- system/phrasesupdate.php | 20 +++++++++++++ 6 files changed, 62 insertions(+), 6 deletions(-) diff --git a/application/controllers/api/frontend/v1/Abgabe.php b/application/controllers/api/frontend/v1/Abgabe.php index b37c64713..23e11c202 100644 --- a/application/controllers/api/frontend/v1/Abgabe.php +++ b/application/controllers/api/frontend/v1/Abgabe.php @@ -373,6 +373,8 @@ class Abgabe extends FHCAPI_Controller $this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general'); } + $this->checkPaabgabeDeadline($paabgabe_id); + $this->checkProjektarbeitForFinishedStatus($projektarbeit_id); $zugeordnet = $this->checkZuordnung($projektarbeit_id, getAuthUID()); @@ -444,6 +446,33 @@ class Abgabe extends FHCAPI_Controller } } + + // validate paabgabe deadline against servertime just in case a student spoofs their local clock and thus + // unlocks the upload ui + private function checkPaabgabeDeadline($paabgabe_id) { + $this->load->model('education/Paabgabe_model', 'PaabgabeModel'); + + $result = $this->PaabgabeModel->load($paabgabe_id); + $paabgabeArr = $this->getDataOrTerminateWithError($result, 'general'); + + if (count($paabgabeArr) > 0) { + $paabgabe = $paabgabeArr[0]; + } else { + $this->terminateWithError($this->p->t('abgabetool', 'c4projektabgabeNichtGefunden'), 'general'); + } + + $tz = new DateTimeZone('Europe/Berlin'); + $now = new DateTimeImmutable('now', $tz); + $deadline = DateTimeImmutable::createFromFormat( + 'Y-m-d H:i:s', + $paabgabe->datum . ' 23:59:59', + $tz + ); + + if($now >= $deadline) { + $this->terminateWithError($this->p->t('abgabetool', 'c4deadlineExceeded')); + } + } /** * tabulator tabledata fetch for abgabetool/mitarbeiter diff --git a/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js b/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js index 971783746..ad740e978 100644 --- a/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js +++ b/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js @@ -715,7 +715,8 @@ export const AbgabeMitarbeiterDetail = { v-model="newTermin.datum" :clearable="false" :enable-time-picker="false" - :format="formatDate" + locale="de" + format="dd.MM.yyyy" :text-input="true" auto-apply> @@ -864,7 +865,8 @@ export const AbgabeMitarbeiterDetail = { :clearable="false" :disabled="!termin.allowedToSave" :enable-time-picker="false" - :format="formatDate" + locale="de" + format="dd.MM.yyyy" :text-input="true" auto-apply> @@ -931,7 +933,9 @@ export const AbgabeMitarbeiterDetail = { v-model="termin.abgabedatum" :clearable="false" :disabled="true" - :format="formatDate"> + locale="de" + format="dd.MM.yyyy" + > diff --git a/public/js/components/Cis/Abgabetool/AbgabeStudentDetail.js b/public/js/components/Cis/Abgabetool/AbgabeStudentDetail.js index 55120e223..9c14c2948 100644 --- a/public/js/components/Cis/Abgabetool/AbgabeStudentDetail.js +++ b/public/js/components/Cis/Abgabetool/AbgabeStudentDetail.js @@ -423,7 +423,8 @@ export const AbgabeStudentDetail = { :clearable="false" :disabled="true" :enable-time-picker="false" - :format="formatDate" + locale="de" + format="dd.MM.yyyy" :text-input="true" auto-apply> diff --git a/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js b/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js index e09171c25..db2eebaa8 100644 --- a/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js +++ b/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js @@ -1189,8 +1189,9 @@ export const AbgabetoolAssistenz = { style="width: 95%;" v-model="serienTermin.datum" :clearable="false" + locale="de" + format="dd.MM.yyyy" :enable-time-picker="false" - :format="formatDate" :text-input="true" auto-apply> diff --git a/public/js/components/Cis/Abgabetool/AbgabetoolMitarbeiter.js b/public/js/components/Cis/Abgabetool/AbgabetoolMitarbeiter.js index 1b8eff3e2..8ee12bf79 100644 --- a/public/js/components/Cis/Abgabetool/AbgabetoolMitarbeiter.js +++ b/public/js/components/Cis/Abgabetool/AbgabetoolMitarbeiter.js @@ -525,7 +525,8 @@ export const AbgabetoolMitarbeiter = { v-model="serienTermin.datum" :clearable="false" :enable-time-picker="false" - :format="formatDate" + locale="de" + format="dd.MM.yyyy" :text-input="true" auto-apply> diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 45e977987..8860e2cf6 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -46373,6 +46373,26 @@ array( ) ) ), + array( + 'app' => 'core', + 'category' => 'abgabetool', + 'phrase' => 'c4deadlineExceeded', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Nicht rechtzeitig abgegeben!', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Deadline exceeded!', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), // ABGABETOOL PHRASEN END array( 'app' => 'core',