From b0b3fe845a28b4fe7a4080bc093d764ec144ea99 Mon Sep 17 00:00:00 2001 From: oesi Date: Wed, 1 Jun 2016 13:55:42 +0200 Subject: [PATCH] =?UTF-8?q?Aliqoute=20Reduktion=20verwendet=20die=20Master?= =?UTF-8?q?ZGV=20bei=20Masterstudieng=C3=A4ngen=20zur=20Reihung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/prestudent.class.php | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/include/prestudent.class.php b/include/prestudent.class.php index a6d16ff89..17f84fd32 100755 --- a/include/prestudent.class.php +++ b/include/prestudent.class.php @@ -1756,7 +1756,38 @@ class prestudent extends person return false; } - $qry = "SELECT DISTINCT prestudent_id, vorname, nachname, gebdatum, rt_gesamtpunkte, tbl_prestudent.studiengang_kz, bis.tbl_zgvgruppe.bezeichnung, get_rolle_prestudent(prestudent_id, null) as laststatus + $stg_obj = new studiengang(); + $stg_obj->load($studiengang_kz); + + if($stg_obj->typ=='m') + { + $qry = "SELECT DISTINCT prestudent_id, vorname, nachname, gebdatum, rt_gesamtpunkte, tbl_prestudent.studiengang_kz, bis.tbl_zgvgruppe.bezeichnung, get_rolle_prestudent(prestudent_id, null) as laststatus + FROM + public.tbl_prestudent + JOIN public.tbl_person USING(person_id) + LEFT JOIN bis.tbl_zgvgruppe_zuordnung USING(zgvmas_code) + LEFT JOIN bis.tbl_zgvgruppe USING(gruppe_kurzbz) + WHERE + tbl_prestudent.studiengang_kz=". $this->db_add_param($studiengang_kz)." + AND EXISTS( + SELECT + 1 + FROM + public.tbl_prestudentstatus + WHERE + tbl_prestudent.prestudent_id=tbl_prestudentstatus.prestudent_id + AND studiensemester_kurzbz=". $this->db_add_param($studiensemester_kurzbz)." + AND status_kurzbz='Bewerber' + AND ( + studienplan_id=". $this->db_add_param($studienplan_id)." + OR + (anmerkung like '%' || (SELECT orgform_kurzbz || '_' || sprache FROM lehre.tbl_studienplan WHERE studienplan_id=". $this->db_add_param($studienplan_id).") || '%') + ) + );"; + } + else + { + $qry = "SELECT DISTINCT prestudent_id, vorname, nachname, gebdatum, rt_gesamtpunkte, tbl_prestudent.studiengang_kz, bis.tbl_zgvgruppe.bezeichnung, get_rolle_prestudent(prestudent_id, null) as laststatus FROM public.tbl_prestudent JOIN public.tbl_person USING(person_id) @@ -1779,6 +1810,7 @@ class prestudent extends person (anmerkung like '%' || (SELECT orgform_kurzbz || '_' || sprache FROM lehre.tbl_studienplan WHERE studienplan_id=". $this->db_add_param($studienplan_id).") || '%') ) );"; + } if($result = $this->db_query($qry))