From c7d2608cce2b50c45d3f83076ebf9eead151d23f Mon Sep 17 00:00:00 2001 From: ma0068 Date: Thu, 17 Aug 2023 11:10:09 +0200 Subject: [PATCH] =?UTF-8?q?Adaptierung=20Buttons:=20Zur=C3=BCckziehen=20St?= =?UTF-8?q?gl=20und=20Ausblenden=20Antr=C3=A4ge=20STGL=20nicht=20genehmigt?= =?UTF-8?q?=20Studentview?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/lehre/Studierendenantrag.php | 3 +++ application/models/education/Studierendenantrag_model.php | 1 + public/js/components/Studierendenantrag/Leitung/Table.js | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) 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";