diff --git a/application/libraries/AntragLib.php b/application/libraries/AntragLib.php index 298c3652f..f094440e2 100644 --- a/application/libraries/AntragLib.php +++ b/application/libraries/AntragLib.php @@ -1413,6 +1413,16 @@ class AntragLib if (hasData($result)) return success(-1); + $result = $this->_ci->StudierendenantragModel->loadWithStatusWhere([ + 'prestudent_id' => $prestudent_id, + 'typ' => Studierendenantrag_model::TYP_WIEDERHOLUNG, + 'campus.get_status_studierendenantrag(studierendenantrag_id)' => Studierendenantragstatus_model::STATUS_DEREGISTERED + ]); + if (isError($result)) + return $result; + if (hasData($result)) + return success(-1); + return success(0); } $result = $this->_ci->StudierendenantragModel->loadWithStatusWhere(['prestudent_id' => $prestudent_id]); diff --git a/application/models/education/Pruefung_model.php b/application/models/education/Pruefung_model.php index 4debc3e28..1f7df2366 100644 --- a/application/models/education/Pruefung_model.php +++ b/application/models/education/Pruefung_model.php @@ -180,7 +180,11 @@ class Pruefung_model extends DB_Model $this->addJoin('bis.tbl_orgform o', 'COALESCE(plan.orgform_kurzbz, pss.orgform_kurzbz, g.orgform_kurzbz)=o.orgform_kurzbz'); $this->addJoin('campus.tbl_studierendenantrag a', 'ps.prestudent_id=a.prestudent_id and a.typ=' . $this->escape(Studierendenantrag_model::TYP_WIEDERHOLUNG), 'LEFT'); + $this->db->group_start(); $this->db->where_in("get_rolle_prestudent(ps.prestudent_id, null)", $this->config->item('antrag_prestudentstatus_whitelist')); + // NOTE(chris): If the status of the Antrag is DEREGISTERED the prestudentstatus must be Abbrecher which is not in the whitelist + $this->db->or_where("campus.get_status_studierendenantrag(a.studierendenantrag_id)", Studierendenantragstatus_model::STATUS_DEREGISTERED); + $this->db->group_end(); $this->db->where("g.aktiv", true);