From 3e9dcf2911aaae2b735ff04a187f8e766e918da2 Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Wed, 6 Dec 2023 09:46:34 +0100 Subject: [PATCH] =?UTF-8?q?task-35010:=20Abmeldung=20d.=20StG=20Pre-Abbrec?= =?UTF-8?q?her=20Statusgrund=20nach=20zur=C3=BCckgezogen=20wieder=20r?= =?UTF-8?q?=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 e3cc5bf14..cb7431952 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; }