From 15ba3602f738fd7a7c6a5fac5f5431b3a51b544b Mon Sep 17 00:00:00 2001 From: ma0048 Date: Mon, 25 Oct 2021 13:22:44 +0200 Subject: [PATCH 1/3] job fixed --- application/models/crm/Prestudent_model.php | 58 +++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php index 2d8ac4a7e..b4692c864 100644 --- a/application/models/crm/Prestudent_model.php +++ b/application/models/crm/Prestudent_model.php @@ -665,4 +665,62 @@ class Prestudent_model extends DB_Model return $this->execQuery($query, array($prestudent_id)); } + + public function getSchool($semester, $studiengang_typ) + { + if (!$this->udfsExistAndDefined()) + return error('No UDF definition'); + + $query = 'SELECT DISTINCT p.person_id, + ps.prestudent_id, + ps.udf_values, + ( + SELECT ssps.udf_values->>\'udf_schule\' + FROM public.tbl_prestudent ssps + WHERE ssps.person_id = p.person_id AND ssps.udf_values->>\'udf_schule\' IS NOT NULL + LIMIT 1 + ) AS "Schule" + FROM + public.tbl_person p + JOIN public.tbl_prestudent ps USING (person_id) + JOIN public.tbl_prestudentstatus pss USING (prestudent_id) + JOIN public.tbl_studiengang sg ON ps.studiengang_kz = sg.studiengang_kz + WHERE + EXISTS ( + SELECT 1 + FROM public.tbl_prestudentstatus spss + JOIN public.tbl_prestudent sps ON spss.prestudent_id = sps.prestudent_id + JOIN public.tbl_studiengang ssg ON sps.studiengang_kz = ssg.studiengang_kz + WHERE sps.person_id = p.person_id + AND ssg.typ = \'' . $studiengang_typ . '\' + AND spss.studiensemester_kurzbz IN (' . $semester . ') + AND sps.udf_values->>\'udf_schule\' IS NOT NULL + LIMIT 1 + ) + AND sg.typ = \''. $studiengang_typ .'\' + AND pss.studiensemester_kurzbz IN (' . $semester . ') + AND ps.udf_values->>\'udf_schule\' IS NULL + AND \'Abgewiesener\' != ( + SELECT sspss.status_kurzbz + FROM public.tbl_prestudentstatus sspss + WHERE sspss.prestudent_id = ps.prestudent_id + ORDER BY sspss.datum DESC, sspss.insertamum DESC, sspss.ext_id DESC + LIMIT 1 + ) + ORDER BY p.person_id'; + + return $this->execQuery($query); + } + + public function updateSchool($udf, $prestudent) + { + if (!$this->udfsExistAndDefined()) + return error('No UDF definition'); + + $query = 'UPDATE public.tbl_prestudent + SET udf_values = \'' . $udf . '\' + WHERE prestudent_id = ' . $prestudent; + + return $this->execQuery($query); + } } From d269fd003d544222a5bc015501c7a60602a7b393 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Mon, 25 Oct 2021 14:03:30 +0200 Subject: [PATCH 2/3] added new log to logdataname --- application/views/system/infocenter/infocenterData.php | 2 +- .../views/system/infocenter/infocenterFreigegebenData.php | 2 +- .../system/infocenter/infocenterReihungstestAbsolviertData.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index c49a1c6cc..3ee4db220 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -6,7 +6,7 @@ $INTERESSENT_STATUS = '\'Interessent\''; $STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; - $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'Interessent rejected\''; + $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'Interessent rejected\', \'Attempt to register with existing mailadress\''; $LOGDATA_NAME_PARKED = '\'Parked\''; $LOGDATA_NAME_ONHOLD = '\'Onhold\''; $LOGTYPE_KURZBZ = '\'Processstate\''; diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index 9078c13db..e649fe54a 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -5,7 +5,7 @@ $INTERESSENT_STATUS = '\'Interessent\''; $STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; - $LOGDATA_NAME = '\'Login with code\', \'Login with user\''; + $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'Attempt to register with existing mailadress\''; $REJECTED_STATUS = '\'Abgewiesener\''; $ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz'); $STATUS_KURZBZ = '\'Wartender\', \'Bewerber\', \'Aufgenommener\', \'Student\''; diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php index 5aa664a97..dbc0124bc 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php @@ -5,7 +5,7 @@ $INTERESSENT_STATUS = '\'Interessent\''; $STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; - $LOGDATA_NAME = '\'Login with code\', \'Login with user\''; + $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'Attempt to register with existing mailadress\''; $ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz'); $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; $ORG_NAME = '\'InfoCenter\''; From a31d33bcf9dd4b40baf4c69e785e46c174f9d13a Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 27 Oct 2021 17:59:52 +0200 Subject: [PATCH 3/3] in eigenes model --- application/models/crm/Prestudent_model.php | 57 --------------------- 1 file changed, 57 deletions(-) diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php index b4692c864..5db9a98f1 100644 --- a/application/models/crm/Prestudent_model.php +++ b/application/models/crm/Prestudent_model.php @@ -666,61 +666,4 @@ class Prestudent_model extends DB_Model return $this->execQuery($query, array($prestudent_id)); } - public function getSchool($semester, $studiengang_typ) - { - if (!$this->udfsExistAndDefined()) - return error('No UDF definition'); - - $query = 'SELECT DISTINCT p.person_id, - ps.prestudent_id, - ps.udf_values, - ( - SELECT ssps.udf_values->>\'udf_schule\' - FROM public.tbl_prestudent ssps - WHERE ssps.person_id = p.person_id AND ssps.udf_values->>\'udf_schule\' IS NOT NULL - LIMIT 1 - ) AS "Schule" - FROM - public.tbl_person p - JOIN public.tbl_prestudent ps USING (person_id) - JOIN public.tbl_prestudentstatus pss USING (prestudent_id) - JOIN public.tbl_studiengang sg ON ps.studiengang_kz = sg.studiengang_kz - WHERE - EXISTS ( - SELECT 1 - FROM public.tbl_prestudentstatus spss - JOIN public.tbl_prestudent sps ON spss.prestudent_id = sps.prestudent_id - JOIN public.tbl_studiengang ssg ON sps.studiengang_kz = ssg.studiengang_kz - WHERE sps.person_id = p.person_id - AND ssg.typ = \'' . $studiengang_typ . '\' - AND spss.studiensemester_kurzbz IN (' . $semester . ') - AND sps.udf_values->>\'udf_schule\' IS NOT NULL - LIMIT 1 - ) - AND sg.typ = \''. $studiengang_typ .'\' - AND pss.studiensemester_kurzbz IN (' . $semester . ') - AND ps.udf_values->>\'udf_schule\' IS NULL - AND \'Abgewiesener\' != ( - SELECT sspss.status_kurzbz - FROM public.tbl_prestudentstatus sspss - WHERE sspss.prestudent_id = ps.prestudent_id - ORDER BY sspss.datum DESC, sspss.insertamum DESC, sspss.ext_id DESC - LIMIT 1 - ) - ORDER BY p.person_id'; - - return $this->execQuery($query); - } - - public function updateSchool($udf, $prestudent) - { - if (!$this->udfsExistAndDefined()) - return error('No UDF definition'); - - $query = 'UPDATE public.tbl_prestudent - SET udf_values = \'' . $udf . '\' - WHERE prestudent_id = ' . $prestudent; - - return $this->execQuery($query); - } }