From eee3aa08e4e1b0eb35a22777dd5104146074bcdf Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Mon, 10 Jul 2023 13:52:05 +0200 Subject: [PATCH] =?UTF-8?q?Zugriffsrechte=20f=C3=BCr=20Abbrecher=20&=20Unt?= =?UTF-8?q?erbrecher?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/libraries/AntragLib.php | 2 +- application/models/education/Studierendenantrag_model.php | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/application/libraries/AntragLib.php b/application/libraries/AntragLib.php index 6fda962ed..2b920bfcd 100644 --- a/application/libraries/AntragLib.php +++ b/application/libraries/AntragLib.php @@ -912,7 +912,7 @@ class AntragLib $datumStatus = $result->datum; if (!in_array($result->status_kurzbz, $this->_ci->config->item('antrag_prestudentstatus_whitelist'))) { - $result = $this->_ci->StudierendenantragModel->loadWithStatusWhere(['prestudent_id' => $prestudent_id, 'typ IN' => [Studierendenantrag_model::TYP_ABMELDUNG, Studierendenantrag_model::TYP_ABMELDUNG_STGL], 'campus.get_status_studierendenantrag(studierendenantrag_id)' => Studierendenantragstatus_model::STATUS_APPROVED]); + $result = $this->_ci->StudierendenantragModel->loadWithStatusWhere(['prestudent_id' => $prestudent_id, 'campus.get_status_studierendenantrag(studierendenantrag_id)' => Studierendenantragstatus_model::STATUS_APPROVED], [Studierendenantrag_model::TYP_ABMELDUNG, Studierendenantrag_model::TYP_ABMELDUNG_STGL]); if (isError($result)) return $result; if (hasData($result)) diff --git a/application/models/education/Studierendenantrag_model.php b/application/models/education/Studierendenantrag_model.php index 1d2537a92..d9313263f 100644 --- a/application/models/education/Studierendenantrag_model.php +++ b/application/models/education/Studierendenantrag_model.php @@ -84,7 +84,7 @@ class Studierendenantrag_model extends DB_Model return $this->loadWhere($where); } - public function loadWithStatusWhere($where) + public function loadWithStatusWhere($where, $types = null) { $lang = 'SELECT index FROM public.tbl_sprache WHERE sprache=' . $this->escape(getUserLanguage()); @@ -97,6 +97,10 @@ class Studierendenantrag_model extends DB_Model 'campus.get_status_studierendenantrag(studierendenantrag_id)=t.studierendenantrag_statustyp_kurzbz' ); + if ($types && is_array($types)) { + $this->db->where_in('typ' => $types); + } + $this->addOrder('datum', 'DESC'); return $this->loadWhere($where); @@ -187,8 +191,6 @@ class Studierendenantrag_model extends DB_Model $this->addJoin('bis.tbl_orgform', 'orgform_kurzbz'); $this->addJoin('campus.tbl_studierendenantrag_statustyp st', 'campus.get_status_studierendenantrag(studierendenantrag_id)=st.studierendenantrag_statustyp_kurzbz','LEFT'); - $this->db->where_in('public.get_rolle_prestudent(p.prestudent_id, null)', $this->config->item('antrag_prestudentstatus_whitelist')); - return $this->loadWhere([ 'p.person_id' => $person_id ]);