block the change of paabgabetyp if the termin has an upload associated (abgabedatum !== null) or has a note; TODO: block the same in multiedit!

This commit is contained in:
Johann Hoffmann
2026-06-01 12:56:55 +02:00
parent 60e36bb4b9
commit d0d590ff89
3 changed files with 31 additions and 1 deletions
@@ -854,6 +854,16 @@ class Abgabe extends FHCAPI_Controller
$existingPaabgabeArr = getData($existingResult);
if(count($existingPaabgabeArr) > 0) $existingPaabgabe = $existingPaabgabeArr[0];
if($existingPaabgabe->note !== null || $existingPaabgabe->abgabedatum !== null) {
// check if a change of paabgabetyp is being attempted -> not allowed at this point
if($paabgabetyp_kurzbz !== $existingPaabgabe->paabgabetyp_kurzbz) {
$this->terminateWithError($this->p->t('abgabetool', 'c4abgabetypAendernNichtErlaubt'));
}
// check if a change of deadline aka datum is being attempted -> should not be allowed at this point?
}
$result = $this->PaabgabeModel->update(
$paabgabe_id,
array(