Add Config: stgtyp_blacklist

This commit is contained in:
cgfhtw
2023-10-17 09:29:47 +02:00
parent 1bc957821e
commit fb4164fd5c
5 changed files with 62 additions and 1 deletions
+32
View File
@@ -1122,6 +1122,16 @@ class AntragLib
if (in_array($stg_kz, $this->_ci->config->item('stgkz_blacklist_abmeldung')))
return success(-3);
$result = $this->_ci->StudiengangModel->load($stg_kz);
if (isError($result))
return $result;
if (!hasData($result))
return success(0);
$result = current(getData($result));
$stg_typ = $result->typ;
if (in_array($stg_typ, $this->_ci->config->item('stgtyp_blacklist_abmeldung')))
return success(-3);
$result = $this->_ci->PrestudentstatusModel->getLastStatus($prestudent_id);
if (isError($result))
return $result;
@@ -1195,6 +1205,16 @@ class AntragLib
if (in_array($stg_kz, $this->_ci->config->item('stgkz_blacklist_unterbrechung')))
return success(-3);
$result = $this->_ci->StudiengangModel->load($stg_kz);
if (isError($result))
return $result;
if (!hasData($result))
return success(0);
$result = current(getData($result));
$stg_typ = $result->typ;
if (in_array($stg_typ, $this->_ci->config->item('stgtyp_blacklist_unterbrechung')))
return success(-3);
$result = $this->_ci->PrestudentstatusModel->getLastStatus($prestudent_id);
if (isError($result))
return $result;
@@ -1269,6 +1289,16 @@ class AntragLib
if (in_array($stg_kz, $this->_ci->config->item('stgkz_blacklist_wiederholung')))
return success(-3);
$result = $this->_ci->StudiengangModel->load($stg_kz);
if (isError($result))
return $result;
if (!hasData($result))
return success(0);
$result = current(getData($result));
$stg_typ = $result->typ;
if (in_array($stg_typ, $this->_ci->config->item('stgtyp_blacklist_wiederholung')))
return success(-3);
$result = $this->getFailedExamForPrestudent($prestudent_id);
if (isError($result))
return $result;
@@ -1473,10 +1503,12 @@ class AntragLib
public function getAktivePrestudentenInStgs($studiengaenge, $query)
{
$blacklist = $this->_ci->config->item('stgkz_blacklist_abmeldung');
$blacklist_typ = $this->_ci->config->item('stgtyp_blacklist_abmeldung');
$studiengaenge = array_diff($studiengaenge, $blacklist);
return $this->_ci->StudiengangModel->getAktivePrestudenten(
$studiengaenge,
[ Studierendenantrag_model::TYP_ABMELDUNG ],
$blacklist_typ,
$query
);
}