From b6b21d54fc2261b4b6d51d4b22e97a2f00209ad8 Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Wed, 6 Dec 2023 14:26:59 +0100 Subject: [PATCH] =?UTF-8?q?Pre-Abbrecher=20Statusgrund=20nach=20zur=C3=BCc?= =?UTF-8?q?kgezogen=20wieder=20r=C3=BCckg=C3=A4ngig=20machen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/libraries/AntragLib.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/application/libraries/AntragLib.php b/application/libraries/AntragLib.php index ff4d5dc63..6b5462b31 100644 --- a/application/libraries/AntragLib.php +++ b/application/libraries/AntragLib.php @@ -62,6 +62,24 @@ class AntragLib 'insertvon' => $insertvon ]); + // NOTE(chris): remove "preabbrecher" statusgrund for Stgl-Abmeldungen if set + $res = $this->_ci->StudierendenantragModel->load($antrag_id); + if (hasData($res) && current(getData($res))->typ == Studierendenantrag_model::TYP_ABMELDUNG_STGL) { + $this->_ci->PrestudentstatusModel->addSelect('tbl_status_grund.statusgrund_kurzbz'); + $res = $this->_ci->PrestudentstatusModel->getLastStatusWithStgEmail(current(getData($res))->prestudent_id, '', 'Student'); + if (hasData($res) && current(getData($res))->statusgrund_kurzbz == 'preabbrecher') { + $prestudentstatus = current(getData($res)); + $this->_ci->PrestudentstatusModel->update([ + 'prestudent_id' => $prestudentstatus->prestudent_id, + 'status_kurzbz'=>$prestudentstatus->status_kurzbz, + 'studiensemester_kurzbz'=>$prestudentstatus->studiensemester_kurzbz, + 'ausbildungssemester'=>$prestudentstatus->ausbildungssemester + ], [ + 'statusgrund_id' => null + ]); + } + } + return $result; }