diff --git a/application/controllers/lehre/Studierendenantrag.php b/application/controllers/lehre/Studierendenantrag.php index 482216518..a7c818920 100644 --- a/application/controllers/lehre/Studierendenantrag.php +++ b/application/controllers/lehre/Studierendenantrag.php @@ -67,6 +67,9 @@ class Studierendenantrag extends FHC_Controller } if ($antrag->studierendenantrag_id == null) continue; + if ($antrag->typ == Studierendenantrag_model::TYP_ABMELDUNG_STGL && (!$antrag->isapproved)) + continue; + $prestudentenArr[$antrag->prestudent_id]['antraege'][] = $antrag; } diff --git a/application/models/education/Studierendenantrag_model.php b/application/models/education/Studierendenantrag_model.php index 13a60faac..e1b386f2e 100644 --- a/application/models/education/Studierendenantrag_model.php +++ b/application/models/education/Studierendenantrag_model.php @@ -188,6 +188,7 @@ class Studierendenantrag_model extends DB_Model $this->addSelect($this->dbTable . '.datum_wiedereinstieg'); $this->addSelect($this->dbTable . '.grund'); $this->addSelect($this->dbTable . '.dms_id'); + $this->addSelect("(SELECT count(1) FROM campus.tbl_studierendenantrag_status WHERE studierendenantrag_id = " . $this->dbTable . ".studierendenantrag_id AND studierendenantrag_statustyp_kurzbz = 'Genehmigt') AS isapproved", false); $this->addJoin('public.tbl_prestudent p', 'prestudent_id', 'RIGHT'); $this->addJoin('public.tbl_studiengang stg', 'p.studiengang_kz=stg.studiengang_kz'); diff --git a/public/js/components/Studierendenantrag/Leitung/Table.js b/public/js/components/Studierendenantrag/Leitung/Table.js index daadc5b3e..01ca0c1ed 100644 --- a/public/js/components/Studierendenantrag/Leitung/Table.js +++ b/public/js/components/Studierendenantrag/Leitung/Table.js @@ -274,7 +274,7 @@ export default { container.append(button); } // NOTE(chris): Cancel - if (data.typ == 'AbmeldungStgl' && data.status == 'Erstellt') { + if (data.typ == 'AbmeldungStgl' && (data.status == 'Erstellt' || data.status == 'Genehmigt' )) { let button = document.createElement('button'); button.innerHTML = this.p.t('studierendenantrag', 'btn_cancel'); button.className = "btn btn-outline-secondary";