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;

This commit is contained in:
Johann Hoffmann
2026-02-17 17:32:11 +01:00
parent ee7254a964
commit a6daa7bf0c
6 changed files with 62 additions and 6 deletions
@@ -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
@@ -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>
</VueDatePicker>
@@ -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>
</VueDatePicker>
@@ -931,7 +933,9 @@ export const AbgabeMitarbeiterDetail = {
v-model="termin.abgabedatum"
:clearable="false"
:disabled="true"
:format="formatDate">
locale="de"
format="dd.MM.yyyy"
>
</VueDatePicker>
</div>
@@ -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>
</VueDatePicker>
@@ -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>
</VueDatePicker>
@@ -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>
</VueDatePicker>
+20
View File
@@ -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',