From 5330e2b250715f3551cdd48d145d08054743f09f Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 1 Jun 2021 11:13:23 +0200 Subject: [PATCH] beim abweisen das studiensemester hinzugefuegt --- application/controllers/system/infocenter/InfoCenter.php | 3 ++- application/models/crm/Prestudent_model.php | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index fd3f98320..40ff3ceff 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -1713,13 +1713,14 @@ class InfoCenter extends Auth_Controller $statusgrund = $this->input->post('statusgrund'); $studiengang = $this->input->post('studiengang'); $personen = $this->input->post('personen'); + $studienSemester = $this->variablelib->getVar('infocenter_studiensemester'); if ($statusgrund === 'null' || $studiengang === 'null' || empty($personen)) $this->terminateWithJsonError("Bitte Statusgrund, Studiengang und Personen auswählen."); foreach($personen as $person) { - $prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person); + $prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester); if(!hasData($prestudent)) continue; diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php index 41639d0ac..52ba4d9f3 100644 --- a/application/models/crm/Prestudent_model.php +++ b/application/models/crm/Prestudent_model.php @@ -582,7 +582,7 @@ class Prestudent_model extends DB_Model return $this->execQuery($query, array($person_id)); } - public function getPrestudentByStudiengangAndPerson($studiengang, $person) + public function getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester) { $query = "SELECT ps.prestudent_id FROM public.tbl_prestudentstatus pss @@ -590,8 +590,10 @@ class Prestudent_model extends DB_Model JOIN public.tbl_studiengang sg USING(studiengang_kz) JOIN lehre.tbl_studienplan sp USING(studienplan_id) WHERE ps.person_id = ? - AND UPPER((sg.typ || sg.kurzbz) || ':' || sp.orgform_kurzbz) = ?"; + AND UPPER((sg.typ || sg.kurzbz) || ':' || sp.orgform_kurzbz) = ? + AND pss.studiensemester_kurzbz = ? + "; - return $this->execQuery($query, array($person, $studiengang)); + return $this->execQuery($query, array($person, $studiengang, $studienSemester)); } }