mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-18 12:39:29 +00:00
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:
@@ -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>
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user