From 43f75e772a4e912d3281664a808800b2e5070486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Tue, 11 Jan 2022 19:05:12 +0100 Subject: [PATCH] =?UTF-8?q?Problem=20behoben=20wodurch=20Reihungstestanmel?= =?UTF-8?q?dungen=20nicht=20gespeichert=20werden=20k=C3=B6nnen=20wenn=20da?= =?UTF-8?q?s=20Config=20FAS=5FREIHUNGSTEST=5FEXCLUDE=5FGEBIETE=20leer=20ge?= =?UTF-8?q?setzt=20wurde?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/pruefling.class.php | 41 ++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/include/pruefling.class.php b/include/pruefling.class.php index 764900b0b..17fe48789 100644 --- a/include/pruefling.class.php +++ b/include/pruefling.class.php @@ -361,13 +361,13 @@ class pruefling extends basis_db $qry = " SELECT DISTINCT ON (vw_auswertung_ablauf.gebiet_id) gebiet_id, - vw_auswertung_ablauf.*, + vw_auswertung_ablauf.*, tbl_studiengang.typ - FROM + FROM testtool.vw_auswertung_ablauf - JOIN + JOIN public.tbl_studiengang USING (studiengang_kz) - WHERE + WHERE reihungstest_id = ".$this->db_add_param($reihungstest_id, FHC_INTEGER); // Ggf. die Basis-Fragengebiete ermitteln (ohne Quereinsteigergebiete) @@ -387,8 +387,8 @@ class pruefling extends basis_db if (!empty($basis_gebiet_id_toString)) { $qry .= " - AND - gebiet_id IN (". $basis_gebiet_id_toString. ") + AND + gebiet_id IN (". $basis_gebiet_id_toString. ") "; } } @@ -400,13 +400,16 @@ class pruefling extends basis_db { $excluded_gebiete = unserialize(FAS_REIHUNGSTEST_EXCLUDE_GEBIETE); $exclude_gebiet_id_arr = $excluded_gebiete; - $exclude_gebiet_id_toString = implode(', ', $exclude_gebiet_id_arr); - $qry .= " - AND - gebiet_id NOT IN (". $exclude_gebiet_id_toString. ") - AND - typ = 'b' - "; + if (is_array($exclude_gebiet_id_arr) && count($exclude_gebiet_id_arr) > 0) + { + $exclude_gebiet_id_toString = implode(', ', $exclude_gebiet_id_arr); + $qry .= " + AND + gebiet_id NOT IN (". $exclude_gebiet_id_toString. ") + AND + typ = 'b' + "; + } } } @@ -421,21 +424,21 @@ class pruefling extends basis_db prestudent_id FROM public.tbl_rt_person - JOIN + JOIN public.tbl_prestudent USING(person_id) JOIN public.tbl_prestudentstatus USING (prestudent_id, studienplan_id) - JOIN + JOIN tbl_reihungstest ON ( - tbl_rt_person.rt_id = tbl_reihungstest.reihungstest_id + tbl_rt_person.rt_id = tbl_reihungstest.reihungstest_id ) WHERE tbl_rt_person.person_id = ".$this->db_add_param($person_id, FHC_INTEGER)." - AND + AND tbl_rt_person.rt_id = ".$this->db_add_param($reihungstest_id, FHC_INTEGER)." - AND + AND tbl_prestudentstatus.status_kurzbz='Interessent' - AND + AND tbl_prestudentstatus.studiensemester_kurzbz = tbl_reihungstest.studiensemester_kurzbz ORDER BY tbl_reihungstest.datum DESC, tbl_prestudent.priorisierung ASC LIMIT 1 )