From d6d6d0ac48a2c5c5fea4bc16790c66ea134e31d4 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 16 Sep 2024 18:22:28 +0200 Subject: [PATCH 01/26] Added phrases for softwarebereitstellung app --- system/phrasesupdate.php | 64 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index a6fbf4f4d..9a99b21ec 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -28826,13 +28826,13 @@ array( 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'Softwareanforderung und Lizenzmanagement für die Lehre', + 'text' => 'Softwareanforderung für die Lehre', 'description' => '', 'insertvon' => 'system' ), array( 'sprache' => 'English', - 'text' => 'Software Request and License management for Education', + 'text' => 'Software Request for Education', 'description' => '', 'insertvon' => 'system' ) @@ -30605,6 +30605,66 @@ array( ) ) ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'userAnzahl', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'User-Anzahl', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'User Number', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'userAnzahlAendern', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'User-Anzahl ändern', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Change User Number', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'userAnzahlNeu', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'User-Anzahl NEU', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'NEW User Number', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), ); From 11b0e770a2aae6ec0d64629ce3859b48976cdcf3 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 7 Oct 2024 16:29:53 +0200 Subject: [PATCH 02/26] Added filter lehrtyp_kurzbz to getAutocompleteSuggestions in Lehrveranstaltung_model.php --- .../education/Lehrveranstaltung_model.php | 34 ++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index de8ebc5c9..f10ba5423 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -20,19 +20,45 @@ class Lehrveranstaltung_model extends DB_Model * @param $eventQuery String * @param string $studiensemester_kurzbz Filter by Studiensemester * @param array $oes Filter by Organisationseinheiten + * @param null $lehrtyp_kurzbz Filter by Lehrtyp 'lv' or 'modul' * @return array */ - public function getAutocompleteSuggestions($eventQuery, $studiensemester_kurzbz = null, $oes = null) + public function getAutocompleteSuggestions($eventQuery, $studiensemester_kurzbz = null, $oes = null, $lehrtyp_kurzbz = null) { - $subQry = $this->_getQryLvsByStudienplan($studiensemester_kurzbz, $oes); + // Subquery + $subQry = $this->_getQryLvsByStudienplan(); $params = []; - /* filter by input string */ - if (is_string($eventQuery)) { + if (isset($studiensemester_kurzbz) && is_string($studiensemester_kurzbz)) + { + /* filter by studiensemester */ + $subQry.= ' AND stplsem.studiensemester_kurzbz = ?'; + $params[] = $studiensemester_kurzbz; + } + + if (isset($oes) && is_array($oes)) + { + /* filter by organisationseinheit */ + $subQry.= ' AND lv.oe_kurzbz IN ?'; + $params[]= $oes; + } + + if (isset($lehrtyp_kurzbz) && is_string($lehrtyp_kurzbz)) + { + /* filter by lehrtyp_kurzbz */ + $subQry .= ' AND lehrtyp_kurzbz = ?'; + $params[] = $lehrtyp_kurzbz; + } + + + if (is_string($eventQuery)) + { + /* filter by input string */ $subQry.= ' AND lv.bezeichnung ILIKE ?'; $params[] = '%' . $eventQuery . '%'; } + // Final Query $qry = 'SELECT DISTINCT ON (lehrveranstaltung_id) * FROM ('. $subQry. ') AS tmp'; return $this->execQuery($qry, $params); From 8744a00ce7e42afe54806d260136302525503731 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 7 Oct 2024 16:34:41 +0200 Subject: [PATCH 03/26] Added filter lehrtyp_kurzbz and $oe_column to getLvsByStudienplan in Lehrveranstaltung_model.php .lehrtyp_kurzbz filters by Lehrtyp 'lv' or 'modul' (default no filter) .oe_column is used when filtering $oes: Filter by lv.oe_kurzbz or stg.oe_kurzbz (the stg joined to lv) --- .../education/Lehrveranstaltung_model.php | 49 ++++++++++++++++--- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index f10ba5423..1fb949d7b 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -67,15 +67,50 @@ class Lehrveranstaltung_model extends DB_Model /** * Get Lehrveranstaltungen with its Stg, OE and OE-type. * Filter by Studiensemester and Organisationseinheiten if necessary. - * @param $eventQuery String - * @param string $studiensemester_kurzbz Filter by Studiensemester - * @param array $oes Filter by Organisationseinheiten - * @param array $lv_ids Filter by Lehrveranstaltung-Ids + * @param null|string $studiensemester_kurzbz Filter by Studiensemester + * @param null|array $oes Filter by Organisationseinheiten + * @param null|string $lehrtyp_kurzbz Filter by Lehrtyp 'lv' or 'modul' + * @param null|array $lv_ids Filter by Lehrveranstaltung-Ids + * @param string $oe_column 'lv'|'stg' Used when filtering $oes: Filter by lv.oe_kurzbz or stg.oe_kurzbz (the stg joined to lv) * @return array */ - public function getLvsByStudienplan($studiensemester_kurzbz = null, $oes = null, $lv_ids = null) + public function getLvsByStudienplan($studiensemester_kurzbz = null, $oes = null, $lehrtyp_kurzbz = null, $lv_ids = null, $oe_column = 'lv') { - $subQry = $this->_getQryLvsByStudienplan($studiensemester_kurzbz, $oes); + // Subquery LVs + $subQry = $this->_getQryLvsByStudienplan(); + $params = []; + + if (isset($studiensemester_kurzbz) && is_string($studiensemester_kurzbz)) + { + /* filter by studiensemester */ + $subQry.= ' AND stplsem.studiensemester_kurzbz = ?'; + $params[] = $studiensemester_kurzbz; + } + + if (isset($oes) && is_array($oes)) + { + if ($oe_column === 'lv') + { + /* filter by lv organisationseinheit (Standard behaviour) */ + $subQry.= ' AND lv.oe_kurzbz IN ?'; + } + elseif ($oe_column === 'stg') + { + /* filter by lv studiengangs organisationseinheit () */ + $subQry.= ' AND stg.oe_kurzbz IN ?'; + } + + $params[]= $oes; + } + + if (isset($lehrtyp_kurzbz) && is_string($lehrtyp_kurzbz)) + { + /* filter by lehrtyp_kurzbz */ + $subQry .= ' AND lehrtyp_kurzbz = ?'; + $params[] = $lehrtyp_kurzbz; + } + + // Final Query $qry = 'SELECT * FROM ('. $subQry. ') AS tmp'; if (isset($lv_ids) && is_array($lv_ids)) @@ -87,7 +122,7 @@ class Lehrveranstaltung_model extends DB_Model $qry.= ' ORDER BY stg_typ_kurzbz, orgform_kurzbz DESC'; - return $this->execQuery($qry); + return $this->execQuery($qry, $params); } /** From b08e01f72f8589c0790856b1d656d6ac9df0f252 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 7 Oct 2024 16:37:07 +0200 Subject: [PATCH 04/26] Added columns to and moved where-clauses from _getQryLvsByStudienplan to calling methods in Lehrveranstaltung_model.php .added cols lehrtyp_kurzbz and lehrveranstaltung_template_id --- .../education/Lehrveranstaltung_model.php | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index 1fb949d7b..1c601a291 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -130,7 +130,7 @@ class Lehrveranstaltung_model extends DB_Model * * @return string */ - private function _getQryLvsByStudienplan($studiensemester_kurzbz = null, $oes = null, $lehrtyp_kurzbz = 'lv') + private function _getQryLvsByStudienplan() { $qry = ' SELECT @@ -152,6 +152,8 @@ class Lehrveranstaltung_model extends DB_Model lv.lehrveranstaltung_id, lv.semester, lv.bezeichnung AS lv_bezeichnung, + lv.lehrtyp_kurzbz, + lv.lehrveranstaltung_template_id, ( -- comma seperated string of all lehreinheitgruppen SELECT string_agg(bezeichnung, \', \') AS lehreinheitgruppe_bezeichnung @@ -186,23 +188,8 @@ class Lehrveranstaltung_model extends DB_Model JOIN public.tbl_organisationseinheit oe USING (oe_kurzbz) JOIN public.tbl_studiengang stg ON stg.studiengang_kz = sto.studiengang_kz JOIN public.tbl_studiengangstyp stgtyp ON stgtyp.typ = stg.typ - /* filter by lehrtyp_kurzbz, default is lvs only */ - WHERE - lehrtyp_kurzbz = '. $this->db->escape($lehrtyp_kurzbz); - - if (isset($studiensemester_kurzbz) && is_string($studiensemester_kurzbz)) - { - /* filter by studiensemester */ - $qry.= ' AND stplsem.studiensemester_kurzbz = '. $this->db->escape($studiensemester_kurzbz); - - } - - if (isset($oes) && is_array($oes)) - { - /* filter by organisationseinheit */ - $implodedOes = "'". implode("', '", $oes). "'"; - $qry.= ' AND lv.oe_kurzbz IN ('. $implodedOes. ')'; - } + WHERE 1 = 1 + '; return $qry; } From 7096bba958ed8db567532d6812764bda07ccfa48 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 7 Oct 2024 16:37:45 +0200 Subject: [PATCH 05/26] Added phrases for Softwarebereitstellung --- system/phrasesupdate.php | 80 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 9a99b21ec..89dc427c3 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -30665,6 +30665,86 @@ array( ) ) ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'standardLvTemplate', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Standard LV-Template', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Standard Course Template', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'anforderungNachStandardLvTemplate', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anforderung nach Standard LV-Template', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Request by Standard Course Template', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'swAnforderungUeberAuswahlVonStandardisiertenLvTemplates', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Softwareanforderung über die Auswahl von standardisierten LV-Templates (Quellkurse)", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Software Requirements based on the Selection of Standardized Course-Templates", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'swFuerLvAnfordern', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Software für LV anfordern", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Request software for courses", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), ); From dcb24415fcb75f75f920ad0bffb1f61135f41559 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 21 Oct 2024 14:02:25 +0200 Subject: [PATCH 06/26] Added phrases 'errorConfigFehlt' and 'errorUnbekannteUrl' --- system/phrasesupdate.php | 42 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 59c4a2246..a8d80a4af 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -31165,7 +31165,47 @@ array( 'insertvon' => 'system' ) ) - ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'errorConfigFehlt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Config-Eintrag fehlt", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Missing config entry", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'errorUnbekannteUrl', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Unbekannte URL. Seite bzw. Link kann nicht geöffnet werden.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Unknown URL. Cannot open to site or link", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), ); From 8614e4301fba5444c2f1bd36c0ada99aa8ddb890 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 20 Nov 2024 13:54:05 +0100 Subject: [PATCH 07/26] Added getStudienjahrByStudiensemester method to Studiensemester API Controller --- .../v1/organisation/Studiensemester.php | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/application/controllers/api/frontend/v1/organisation/Studiensemester.php b/application/controllers/api/frontend/v1/organisation/Studiensemester.php index 72a449aaa..bb56ea71a 100644 --- a/application/controllers/api/frontend/v1/organisation/Studiensemester.php +++ b/application/controllers/api/frontend/v1/organisation/Studiensemester.php @@ -24,7 +24,8 @@ class Studiensemester extends FHCAPI_Controller parent::__construct( array( 'getAll' => self::PERM_LOGGED, - 'getAktNext' => self::PERM_LOGGED + 'getAktNext' => self::PERM_LOGGED, + 'getStudienjahrByStudiensemester' => self::PERM_LOGGED ) ); // Load model StudiensemesterModel @@ -115,4 +116,40 @@ class Studiensemester extends FHCAPI_Controller $this->terminateWithSuccess((getData($result) ?: '')); } + + /** + * Get Studienjahr by Studiensemester. + * input param semester: studiensemester_kurzbz + */ + public function getStudienjahrByStudiensemester() + { + $semester = $this->input->get('semester'); + + $studienjahrObj = null; + + if (!is_numeric($semester)) + { + $this->StudiensemesterModel->addSelect('studienjahr_kurzbz'); + $result = $this->StudiensemesterModel->loadWhere(array('studiensemester_kurzbz =' => $semester)); + } + + if (hasData($result)) + { + $studienjahr = getData($result)[0]->studienjahr_kurzbz; + $startstudienjahr = substr($studienjahr, 0, 4); + $endstudienjahr = substr($studienjahr, 0, 2) . substr($studienjahr, -2); + + $studienjahrObj = new StdClass(); + + $studienjahrObj->studienjahr_kurzbz = $studienjahr; + $studienjahrObj->startstudienjahr = $startstudienjahr; + $studienjahrObj->endstudienjahr= $endstudienjahr; + } + + if (isError($result)) { + $this->terminateWithError(getError($result), self::ERROR_TYPE_DB); + } + + $this->terminateWithSuccess((getData(success($studienjahrObj)))); + } } From 933af943448aa4e05da36d3e83e042e95f08a0e3 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 20 Nov 2024 13:55:11 +0100 Subject: [PATCH 08/26] Added checkIsTemplate method to Lehrveranstaltung Model Checks if given LV is a template (Quellkurs) --- .../education/Lehrveranstaltung_model.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index 1c601a291..f7860f470 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -716,6 +716,28 @@ class Lehrveranstaltung_model extends DB_Model return $this->execQuery($qry); } + /** + * Check if given LV is a template (Quellkurs) + * + * @param $lehrveranstaltung_id + * @return array|stdClass|void + */ + public function checkIsTemplate($lehrveranstaltung_id) + { + $this->addSelect('lehrtyp_kurzbz, lehrveranstaltung_template_id'); + $result = $this->load($lehrveranstaltung_id); + + if (isError($result)) + return error(getError($result)); + + if (hasData($result)) + { + return success( + getData($result)[0]->lehrtyp_kurzbz === 'tpl' && + getData($result)[0]->lehrveranstaltung_template_id === null + ); + } + } /** * Get ECTS Summe pro angerechnetes Quereinstiegssemester. From ae94daa4a66cca8a04fcedbc73bed7abce3fdc5c Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 20 Nov 2024 13:57:30 +0100 Subject: [PATCH 09/26] Added getStudienjahrByStudiensemester method to Studiensemester Model --- .../organisation/Studiensemester_model.php | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/application/models/organisation/Studiensemester_model.php b/application/models/organisation/Studiensemester_model.php index c59c9d343..93cc6c014 100644 --- a/application/models/organisation/Studiensemester_model.php +++ b/application/models/organisation/Studiensemester_model.php @@ -253,4 +253,40 @@ class Studiensemester_model extends DB_Model if (is_numeric($studienjahrNumber) && mb_substr($studiensemester_kurzbz, 0, 2) == 'SS') (int)$studienjahrNumber -= 1; return $studienjahrNumber; } + + /** + * Get Studienjahr by Studiensemester. + * + * @param $studiensemester_kurzbz + * @return array|stdClass + */ + public function getStudienjahrByStudiensemester($studiensemester_kurzbz) + { + $studienjahrObj = null; + + if (!is_numeric($studiensemester_kurzbz)) + { + $this->StudiensemesterModel->addSelect('studienjahr_kurzbz'); + $result = $this->StudiensemesterModel->loadWhere(array('studiensemester_kurzbz =' => $studiensemester_kurzbz)); + } + + if (hasData($result)) + { + $studienjahr = getData($result)[0]->studienjahr_kurzbz; + $startstudienjahr = substr($studienjahr, 0, 4); + $endstudienjahr = substr($studienjahr, 0, 2) . substr($studienjahr, -2); + + $studienjahrObj = new StdClass(); + + $studienjahrObj->studienjahr_kurzbz = $studienjahr; + $studienjahrObj->startstudienjahr = $startstudienjahr; + $studienjahrObj->endstudienjahr= $endstudienjahr; + } + + if (isError($result)) { + return error(getError($result)); + } + + return success($studienjahrObj); + } } From e94e9ceff212f604199ac59e3d3f242ba7a590b6 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 20 Nov 2024 14:07:43 +0100 Subject: [PATCH 10/26] Added phrases 'zuordnungExistiertBereits' and 'swFuerLvAendern' --- system/phrasesupdate.php | 41 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 925f88bba..2f80e27aa 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -31346,7 +31346,46 @@ array( ) ) ), - + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'zuordnungExistiertBereits', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Zuordnung existiert bereits.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Assignment already exists.", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'swFuerLvAendern', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Software für LV ändern", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Change Software for courses", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ) ); From 1159b0dad5d3d62fa3d2ffbff897c571d603f629 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 27 Nov 2024 17:28:54 +0100 Subject: [PATCH 11/26] Refactored getLvs method in Lehrveranstaltung_model.php --- .../education/Lehrveranstaltung_model.php | 40 ++++++++----------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index f7860f470..28b44a177 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -66,18 +66,21 @@ class Lehrveranstaltung_model extends DB_Model /** * Get Lehrveranstaltungen with its Stg, OE and OE-type. - * Filter by Studiensemester and Organisationseinheiten if necessary. + * Can be filtered by Studienesemester, lv oes or lv's stg oes, and also by specific lvs. * @param null|string $studiensemester_kurzbz Filter by Studiensemester - * @param null|array $oes Filter by Organisationseinheiten - * @param null|string $lehrtyp_kurzbz Filter by Lehrtyp 'lv' or 'modul' - * @param null|array $lv_ids Filter by Lehrveranstaltung-Ids - * @param string $oe_column 'lv'|'stg' Used when filtering $oes: Filter by lv.oe_kurzbz or stg.oe_kurzbz (the stg joined to lv) + * @param null $lv_oes Filter oes by lv oe (default behaviour) + * @param null $stg_oes Filter oes by lv's stg oe + * @param null|array $lv_ids Filter by Lehrveranstaltungen * @return array */ - public function getLvsByStudienplan($studiensemester_kurzbz = null, $oes = null, $lehrtyp_kurzbz = null, $lv_ids = null, $oe_column = 'lv') + public function getLvs($studiensemester_kurzbz = null, $lv_oes = null, $stg_oes = null, $lv_ids = null) { // Subquery LVs $subQry = $this->_getQryLvsByStudienplan(); + + /* filter by lehrtyp_kurzbz 'lv' */ + $subQry .= ' AND lehrtyp_kurzbz = \'lv\''; + $params = []; if (isset($studiensemester_kurzbz) && is_string($studiensemester_kurzbz)) @@ -87,27 +90,18 @@ class Lehrveranstaltung_model extends DB_Model $params[] = $studiensemester_kurzbz; } - if (isset($oes) && is_array($oes)) + if (isset($lv_oes) && is_array($lv_oes)) { - if ($oe_column === 'lv') - { - /* filter by lv organisationseinheit (Standard behaviour) */ - $subQry.= ' AND lv.oe_kurzbz IN ?'; - } - elseif ($oe_column === 'stg') - { - /* filter by lv studiengangs organisationseinheit () */ - $subQry.= ' AND stg.oe_kurzbz IN ?'; - } - - $params[]= $oes; + /* filter by lv organisationseinheit */ + $subQry.= ' AND lv.oe_kurzbz IN ?'; + $params[]= $lv_oes; } - if (isset($lehrtyp_kurzbz) && is_string($lehrtyp_kurzbz)) + if (isset($stg_oes) && is_array($stg_oes)) { - /* filter by lehrtyp_kurzbz */ - $subQry .= ' AND lehrtyp_kurzbz = ?'; - $params[] = $lehrtyp_kurzbz; + /* filter by lv studiengangs organisationseinheit */ + $subQry.= ' AND stg.oe_kurzbz IN ?'; + $params[]= $stg_oes; } // Final Query From c94a2d2d0caa3481b27bbb3a257a254cb2d30972 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 27 Nov 2024 17:31:02 +0100 Subject: [PATCH 12/26] Added param lehrveranstaltung_id to getTemplateLvTree method in Lehrveranstaltung_model.php and enhanced order Now ordering extra templates to appear first and directly after the assigned lvs --- .../education/Lehrveranstaltung_model.php | 33 ++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index 28b44a177..aa68f7f69 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -189,14 +189,15 @@ class Lehrveranstaltung_model extends DB_Model } /** - * Get all Templates and union with all Lehrveranstaltungen of given Studiensemester and Oes, that are assigned to - * a template. This data structure can be used for nested tabulator data tree. + * Get all Templates and its assigned Lehrveranstaltungen of given Studiensemester and Oes. + * Lvs are queried via actual Studienordnung and Studienplan. * * @param null|string $studiensemester_kurzbz * @param null|array $oes + * @param null $lehrveranstaltung_id Queries certain LV only * @return array|stdClass|null */ - public function getTemplateLvTree($studiensemester_kurzbz = null, $oes = null){ + public function getTemplateLvTree($studiensemester_kurzbz = null, $oes = null, $lehrveranstaltung_id = null){ $params = []; $qry = ' WITH @@ -223,6 +224,13 @@ class Lehrveranstaltung_model extends DB_Model -- filter lvs assigned to template (= standardisierte lv) AND lehrveranstaltung_template_id IS NOT NULL'; + if (is_numeric($lehrveranstaltung_id)) + { + /* filter by studiensemester */ + $params[]= $lehrveranstaltung_id; + $qry.= ' AND lv.lehrveranstaltung_template_id = ? '; + } + if (is_string($studiensemester_kurzbz)) { /* filter by studiensemester */ @@ -266,6 +274,13 @@ class Lehrveranstaltung_model extends DB_Model WHERE std.lehrveranstaltung_template_id = lv.lehrveranstaltung_id )'; + if (is_numeric($lehrveranstaltung_id)) + { + /* filter by studiensemester */ + $params[]= $lehrveranstaltung_id; + $qry.= ' AND lv.lehrveranstaltung_id = ? '; + } + if (is_array($oes)) { /* filter by organisationseinheit */ @@ -342,7 +357,17 @@ class Lehrveranstaltung_model extends DB_Model JOIN public.tbl_studiengangstyp stgtyp ON stgtyp.typ = stg.typ JOIN public.tbl_organisationseinheit oe ON oe.oe_kurzbz = lv.oe_kurzbz ORDER BY - oe.bezeichnung, lv.semester, lv.bezeichnung + -- Sort by organisationseinheit, semester, and lv.bezeichnung + oe.bezeichnung, + lv.semester, + lv.bezeichnung, + -- Within each group, ensure templates appear first + CASE + WHEN lv.lehrtyp_kurzbz = \'tpl\' THEN 0 + ELSE 1 + END, + -- Ensure assigend lvs follow their template, grouped by lehrveranstaltung_template_id + COALESCE(lv.lehrveranstaltung_template_id, lv.lehrveranstaltung_id) '; return $this->execQuery($qry, $params); From 3ec748e6fbbbb501d795515ec32b71d8c50d7195 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 27 Nov 2024 17:31:48 +0100 Subject: [PATCH 13/26] Added new phrases for Softwarebereitstellung --- system/phrasesupdate.php | 86 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 3 deletions(-) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 2f80e27aa..b1e80f803 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -29361,18 +29361,18 @@ array( array( 'app' => 'softwarebereitstellung', 'category' => 'global', - 'phrase' => 'softwareanforderungSubtitle', + 'phrase' => 'softwarebereitstellungSubtitle', 'insertvon' => 'system', 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'Softwareanforderung und Lizenzmanagement für die Lehre', + 'text' => 'Softwarebereitstellung für die Lehre', 'description' => '', 'insertvon' => 'system' ), array( 'sprache' => 'English', - 'text' => 'Software Request and License management for Education', + 'text' => 'Software delivery for Education', 'description' => '', 'insertvon' => 'system' ) @@ -31385,6 +31385,86 @@ array( 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'anforderungNachQuellkurs', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anforderung nach Quellkurs', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Request by Course-Template', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'swAnforderungFuerQuellkurs', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Softwareanforderung für Quellkurse", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Software Requirements for Course-Templates", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'swAnforderungFuerEinzelneLvs', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Softwareanforderung für einzelne Lehrveranstaltungen", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Software Requirements for individual Courses", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'softwarebereitstellung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Softwarebereitstellung", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Software Delivery", + 'description' => '', + 'insertvon' => 'system' + ) + ) ) ); From aab0dd7fc7c21d0db9164d37291734c64d116fbb Mon Sep 17 00:00:00 2001 From: Cristina Date: Thu, 6 Mar 2025 09:40:40 +0100 Subject: [PATCH 14/26] Added / Adapted Model queries and api Controller regarding for Lehrveranstaltung- and Studienjahr Model --- .../frontend/v1/organisation/Studienjahr.php | 80 ++++++++++++ .../education/Lehrveranstaltung_model.php | 115 ++++++++++-------- .../models/organisation/Studienjahr_model.php | 23 +++- 3 files changed, 161 insertions(+), 57 deletions(-) create mode 100644 application/controllers/api/frontend/v1/organisation/Studienjahr.php diff --git a/application/controllers/api/frontend/v1/organisation/Studienjahr.php b/application/controllers/api/frontend/v1/organisation/Studienjahr.php new file mode 100644 index 000000000..cdbb524c7 --- /dev/null +++ b/application/controllers/api/frontend/v1/organisation/Studienjahr.php @@ -0,0 +1,80 @@ + self::PERM_LOGGED, + 'getNext' => self::PERM_LOGGED + ) + ); + // Load model StudiensemesterModel + $this->load->model('organisation/studienjahr_model', 'StudienjahrModel'); + } + + /** + * Get all Studienjahre. + * + * @param null|string $order Sorting order for the Studienjahr, 'asc' or 'desc'. Defaults to 'asc'. + * @param null|string $start Starting Studienjahre with given studienjahr_kurzbz + */ + public function getAll() + { + $order = $this->input->get('order'); + $start = $this->input->get('studienjahr_kurzbz'); + + if (strcasecmp($order, 'DESC') == 0) { + $this->StudienjahrModel->addOrder('studienjahr_kurzbz', 'DESC'); + } else { + $this->StudienjahrModel->addOrder('studienjahr_kurzbz', 'ASC'); + } + + if ($start) { + $result = $this->StudienjahrModel->loadWhere([ + 'studienjahr_kurzbz >= ' => $start + ]); + } else { + $result = $this->StudienjahrModel->load(); + } + + if (isError($result)) { + $this->terminateWithError(getError($result), self::ERROR_TYPE_DB); + } + + $this->terminateWithSuccess((getData($result) ?: [])); + } + + public function getNext() + { + $this->StudienjahrModel->addJoin('public.tbl_studiensemester', 'studienjahr_kurzbz'); + $this->StudienjahrModel->addOrder('start'); + $this->StudienjahrModel->addLimit(1); + + $result = $this->StudienjahrModel->loadWhere(['start >' => 'NOW()']); + + if (isError($result)) { + $this->terminateWithError(getError($result), self::ERROR_TYPE_DB); + } + + $this->terminateWithSuccess(current(getData($result))); + } +} diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index 202df7525..9a82f6dfc 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -19,38 +19,42 @@ class Lehrveranstaltung_model extends DB_Model * Get Lehrveranstaltungen by eventQuery string. Use with autocomplete event queries. * @param $eventQuery String * @param string $studiensemester_kurzbz Filter by Studiensemester - * @param array $oes Filter by Organisationseinheiten + * @param array $oes Filter by Organisationseinheiten. Checks against STG OE * @param null $lehrtyp_kurzbz Filter by Lehrtyp 'lv' or 'modul' * @return array */ - public function getAutocompleteSuggestions($eventQuery, $studiensemester_kurzbz = null, $oes = null, $lehrtyp_kurzbz = null) + public function getNonQuellkursLvsAutocompleteSuggestions($eventQuery, $studienjahr_kurzbz = null, $oes = null) { // Subquery $subQry = $this->_getQryLvsByStudienplan(); $params = []; - if (isset($studiensemester_kurzbz) && is_string($studiensemester_kurzbz)) + // filter lvs only (no templates) + $subQry .= ' + AND lehrtyp_kurzbz = \'lv\' + AND lehrveranstaltung_template_id IS NULL'; + + if (isset($studienjahr_kurzbz) && is_string($studienjahr_kurzbz)) { - /* filter by studiensemester */ - $subQry.= ' AND stplsem.studiensemester_kurzbz = ?'; - $params[] = $studiensemester_kurzbz; + /* filter by studienjahr*/ + $params[] = $studienjahr_kurzbz; + $subQry.= ' + AND stplsem.studiensemester_kurzbz IN + ( + SELECT studiensemester_kurzbz + FROM public.tbl_studiensemester + WHERE studienjahr_kurzbz = ? + ) + '; } if (isset($oes) && is_array($oes)) { - /* filter by organisationseinheit */ - $subQry.= ' AND lv.oe_kurzbz IN ?'; + /* filter by STG organisationseinheit */ + $subQry.= ' AND stg.oe_kurzbz IN ?'; $params[]= $oes; } - if (isset($lehrtyp_kurzbz) && is_string($lehrtyp_kurzbz)) - { - /* filter by lehrtyp_kurzbz */ - $subQry .= ' AND lehrtyp_kurzbz = ?'; - $params[] = $lehrtyp_kurzbz; - } - - if (is_string($eventQuery)) { /* filter by input string */ @@ -59,42 +63,44 @@ class Lehrveranstaltung_model extends DB_Model } // Final Query - $qry = 'SELECT DISTINCT ON (lehrveranstaltung_id) * FROM ('. $subQry. ') AS tmp'; + $qry = 'SELECT * FROM ('. $subQry. ') AS tmp + ORDER BY lv_bezeichnung'; return $this->execQuery($qry, $params); } /** * Get Lehrveranstaltungen with its Stg, OE and OE-type. - * Can be filtered by Studienesemester, lv oes or lv's stg oes, and also by specific lvs. - * @param null|string $studiensemester_kurzbz Filter by Studiensemester - * @param null $lv_oes Filter oes by lv oe (default behaviour) + * @param null|string $studienjahr_kurzbz Filter by Studienjahr * @param null $stg_oes Filter oes by lv's stg oe * @param null|array $lv_ids Filter by Lehrveranstaltungen * @return array */ - public function getLvs($studiensemester_kurzbz = null, $lv_oes = null, $stg_oes = null, $lv_ids = null) + public function getNonQuellkursLvs($studienjahr_kurzbz = null, $stg_oes = null, $lv_ids = null) { // Subquery LVs $subQry = $this->_getQryLvsByStudienplan(); - /* filter by lehrtyp_kurzbz 'lv' */ - $subQry .= ' AND lehrtyp_kurzbz = \'lv\''; + /* filter by lehrtyp_kurzbz 'lv' and that are not assigned to a Quellkurs */ + $subQry .= ' + AND lehrtyp_kurzbz = \'lv\' + AND lehrveranstaltung_template_id IS NULL + '; $params = []; - if (isset($studiensemester_kurzbz) && is_string($studiensemester_kurzbz)) + if (is_string($studienjahr_kurzbz)) { - /* filter by studiensemester */ - $subQry.= ' AND stplsem.studiensemester_kurzbz = ?'; - $params[] = $studiensemester_kurzbz; - } - - if (isset($lv_oes) && is_array($lv_oes)) - { - /* filter by lv organisationseinheit */ - $subQry.= ' AND lv.oe_kurzbz IN ?'; - $params[]= $lv_oes; + /* filter by studienjahr */ + $params[] = $studienjahr_kurzbz; + $subQry .= ' + AND stplsem.studiensemester_kurzbz IN + ( + SELECT studiensemester_kurzbz + FROM public.tbl_studiensemester + WHERE studienjahr_kurzbz = ? + ) + '; } if (isset($stg_oes) && is_array($stg_oes)) @@ -114,7 +120,7 @@ class Lehrveranstaltung_model extends DB_Model $qry.= ' WHERE lehrveranstaltung_id IN ('. $implodedLvIds. ')'; } - $qry.= ' ORDER BY stg_typ_kurzbz, orgform_kurzbz DESC'; + $qry.= ' ORDER BY lv_bezeichnung'; return $this->execQuery($qry, $params); } @@ -138,10 +144,12 @@ class Lehrveranstaltung_model extends DB_Model studienordnung_id, sto.studiengang_kz, stpl.studienplan_id, + stpl.bezeichnung AS studienplan_bezeichnung, stplsem.semester, stpl.orgform_kurzbz, upper(stg.typ || stg.kurzbz) AS stg_typ_kurzbz, stg.bezeichnung AS stg_bezeichnung, + stg.oe_kurzbz AS stg_oe_kurzbz, stgtyp.bezeichnung AS stg_typ_bezeichnung, lv.lehrveranstaltung_id, lv.semester, @@ -197,7 +205,13 @@ class Lehrveranstaltung_model extends DB_Model * @param null $lehrveranstaltung_id Queries certain LV only * @return array|stdClass|null */ - public function getTemplateLvTree($studiensemester_kurzbz = null, $oes = null, $lehrveranstaltung_id = null){ + public function getTemplateLvTree($studiensemester_kurzbz = null, $oes = null, $studienjahr_kurzbz = null){ + + if (is_string($studiensemester_kurzbz) && is_string($studienjahr_kurzbz)) + { + return error('Query not possible for both studiensemester and studienjahr'); + } + $params = []; $qry = ' WITH @@ -224,13 +238,6 @@ class Lehrveranstaltung_model extends DB_Model -- filter lvs assigned to template (= standardisierte lv) AND lehrveranstaltung_template_id IS NOT NULL'; - if (is_numeric($lehrveranstaltung_id)) - { - /* filter by studiensemester */ - $params[]= $lehrveranstaltung_id; - $qry.= ' AND lv.lehrveranstaltung_template_id = ? '; - } - if (is_string($studiensemester_kurzbz)) { /* filter by studiensemester */ @@ -239,6 +246,17 @@ class Lehrveranstaltung_model extends DB_Model } + if (is_string($studienjahr_kurzbz)) { + /* filter by studiensemester */ + $params[] = $studienjahr_kurzbz; + $qry .= ' + AND stplsem.studiensemester_kurzbz IN ( + SELECT studiensemester_kurzbz + FROM public.tbl_studiensemester + WHERE studienjahr_kurzbz = ? + )'; + } + if (is_array($oes)) { /* filter by organisationseinheit */ @@ -274,13 +292,6 @@ class Lehrveranstaltung_model extends DB_Model WHERE std.lehrveranstaltung_template_id = lv.lehrveranstaltung_id )'; - if (is_numeric($lehrveranstaltung_id)) - { - /* filter by studiensemester */ - $params[]= $lehrveranstaltung_id; - $qry.= ' AND lv.lehrveranstaltung_id = ? '; - } - if (is_array($oes)) { /* filter by organisationseinheit */ @@ -357,9 +368,7 @@ class Lehrveranstaltung_model extends DB_Model JOIN public.tbl_studiengangstyp stgtyp ON stgtyp.typ = stg.typ JOIN public.tbl_organisationseinheit oe ON oe.oe_kurzbz = lv.oe_kurzbz ORDER BY - -- Sort by organisationseinheit, semester, and lv.bezeichnung - oe.bezeichnung, - lv.semester, + -- Sort by lv.bezeichnung lv.bezeichnung, -- Within each group, ensure templates appear first CASE diff --git a/application/models/organisation/Studienjahr_model.php b/application/models/organisation/Studienjahr_model.php index a6e1bc575..1686ddc48 100644 --- a/application/models/organisation/Studienjahr_model.php +++ b/application/models/organisation/Studienjahr_model.php @@ -1,4 +1,5 @@ execQuery($query); } + public function getNextStudienjahr() + { + $this->addJoin('public.tbl_studiensemester', 'studienjahr_kurzbz'); + $this->addOrder('start'); + $this->addLimit(1); + + return $this->loadWhere(['start >' => 'NOW()']); + } + public function getNextFrom($studienjahr_kurzbz) + { + $this->addLimit(1); + + return $this->loadWhere([ + 'studienjahr_kurzbz >' => $studienjahr_kurzbz + ]); + } /** * Get the current Studienjahr. During the summer term, continue using the previous Studienjahr. @@ -38,8 +55,7 @@ class Studienjahr_model extends DB_Model */ public function getLastOrAktStudienjahr($days = 60) { - if (!is_numeric($days)) - { + if (!is_numeric($days)) { $days = 60; } @@ -63,8 +79,7 @@ class Studienjahr_model extends DB_Model */ public function getAktOrNextStudienjahr($days = 62) { - if (!is_numeric($days)) - { + if (!is_numeric($days)) { $days = 62; } From eedbab21a2f8c9a5b2213fe4229c083c8c0894c8 Mon Sep 17 00:00:00 2001 From: Cristina Date: Thu, 6 Mar 2025 09:58:15 +0100 Subject: [PATCH 15/26] Added phrases for Softwarebereitstellung --- system/phrasesupdate.php | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 59f713ccc..b4d79aea3 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -40613,6 +40613,66 @@ array( ) ), // FHC4 Phrases Mobility End + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'swAendern', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'SW ändern', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Change SW', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'quellkurs', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Quellkurs', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Source Course', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'softwareAbbestellt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Software wurde abbestellt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Software was cancelled', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ) ); From 83fe68c04ef608e586889fbe6b5ad5998dded2ad Mon Sep 17 00:00:00 2001 From: Cristina Date: Thu, 6 Mar 2025 10:39:00 +0100 Subject: [PATCH 16/26] Removed 2 methods getNonQuellkursLvs and getNonQuellkursLvsAutocompleteSuggestions from Lehrveranstaltung_model.php --- .../education/Lehrveranstaltung_model.php | 181 ------------------ 1 file changed, 181 deletions(-) diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index 0d2373836..056fb45d7 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -15,187 +15,6 @@ class Lehrveranstaltung_model extends DB_Model $this->load->model('organisation/studiensemester_model', 'StudiensemesterModel'); } - /** - * Get Lehrveranstaltungen by eventQuery string. Use with autocomplete event queries. - * @param $eventQuery String - * @param string $studiensemester_kurzbz Filter by Studiensemester - * @param array $oes Filter by Organisationseinheiten. Checks against STG OE - * @param null $lehrtyp_kurzbz Filter by Lehrtyp 'lv' or 'modul' - * @return array - */ - public function getNonQuellkursLvsAutocompleteSuggestions($eventQuery, $studienjahr_kurzbz = null, $oes = null) - { - // Subquery - $subQry = $this->_getQryLvsByStudienplan(); - $params = []; - - // filter lvs only (no templates) - $subQry .= ' - AND lehrtyp_kurzbz = \'lv\' - AND lehrveranstaltung_template_id IS NULL'; - - if (isset($studienjahr_kurzbz) && is_string($studienjahr_kurzbz)) - { - /* filter by studienjahr*/ - $params[] = $studienjahr_kurzbz; - $subQry.= ' - AND stplsem.studiensemester_kurzbz IN - ( - SELECT studiensemester_kurzbz - FROM public.tbl_studiensemester - WHERE studienjahr_kurzbz = ? - ) - '; - } - - if (isset($oes) && is_array($oes)) - { - /* filter by STG organisationseinheit */ - $subQry.= ' AND stg.oe_kurzbz IN ?'; - $params[]= $oes; - } - - if (is_string($eventQuery)) - { - /* filter by input string */ - $subQry.= ' AND lv.bezeichnung ILIKE ?'; - $params[] = '%' . $eventQuery . '%'; - } - - // Final Query - $qry = 'SELECT * FROM ('. $subQry. ') AS tmp - ORDER BY lv_bezeichnung'; - - return $this->execQuery($qry, $params); - } - - /** - * Get Lehrveranstaltungen with its Stg, OE and OE-type. - * @param null|string $studienjahr_kurzbz Filter by Studienjahr - * @param null $stg_oes Filter oes by lv's stg oe - * @param null|array $lv_ids Filter by Lehrveranstaltungen - * @return array - */ - public function getNonQuellkursLvs($studienjahr_kurzbz = null, $stg_oes = null, $lv_ids = null) - { - // Subquery LVs - $subQry = $this->_getQryLvsByStudienplan(); - - /* filter by lehrtyp_kurzbz 'lv' and that are not assigned to a Quellkurs */ - $subQry .= ' - AND lehrtyp_kurzbz = \'lv\' - AND lehrveranstaltung_template_id IS NULL - '; - - $params = []; - - if (is_string($studienjahr_kurzbz)) - { - /* filter by studienjahr */ - $params[] = $studienjahr_kurzbz; - $subQry .= ' - AND stplsem.studiensemester_kurzbz IN - ( - SELECT studiensemester_kurzbz - FROM public.tbl_studiensemester - WHERE studienjahr_kurzbz = ? - ) - '; - } - - if (isset($stg_oes) && is_array($stg_oes)) - { - /* filter by lv studiengangs organisationseinheit */ - $subQry.= ' AND stg.oe_kurzbz IN ?'; - $params[]= $stg_oes; - } - - // Final Query - $qry = 'SELECT * FROM ('. $subQry. ') AS tmp'; - - if (isset($lv_ids) && is_array($lv_ids)) - { - /* filter by lv_ids */ - $implodedLvIds = "'". implode("', '", $lv_ids). "'"; - $qry.= ' WHERE lehrveranstaltung_id IN ('. $implodedLvIds. ')'; - } - - $qry.= ' ORDER BY lv_bezeichnung'; - - return $this->execQuery($qry, $params); - } - - /** - * Get basic query to retrieve Lehrveranstaltungen according to the Orgforms and Ausbildungssemesters actual Studienplan. - * - * @return string - */ - private function _getQryLvsByStudienplan() - { - $qry = ' - SELECT - lv.oe_kurzbz AS lv_oe_kurzbz, - CASE - WHEN oe.organisationseinheittyp_kurzbz = \'Kompetenzfeld\' THEN (\'KF \' || oe.bezeichnung) - WHEN oe.organisationseinheittyp_kurzbz = \'Department\' THEN (\'DEP \' || oe.bezeichnung) - ELSE (oe.organisationseinheittyp_kurzbz || \' \' || oe.bezeichnung) - END AS lv_oe_bezeichnung, - stplsem.studiensemester_kurzbz, - studienordnung_id, - sto.studiengang_kz, - stpl.studienplan_id, - stpl.bezeichnung AS studienplan_bezeichnung, - stplsem.semester, - stpl.orgform_kurzbz, - upper(stg.typ || stg.kurzbz) AS stg_typ_kurzbz, - stg.bezeichnung AS stg_bezeichnung, - stg.oe_kurzbz AS stg_oe_kurzbz, - stgtyp.bezeichnung AS stg_typ_bezeichnung, - lv.lehrveranstaltung_id, - lv.semester, - lv.bezeichnung AS lv_bezeichnung, - lv.lehrtyp_kurzbz, - lv.lehrveranstaltung_template_id, - ( - -- comma seperated string of all lehreinheitgruppen - SELECT string_agg(bezeichnung, \', \') AS lehreinheitgruppe_bezeichnung - FROM( - -- distinct bezeichnung, as may come multiple times from different lehreinheiten - SELECT DISTINCT ON (studiengang_kz, bezeichnung) studiengang_kz, bezeichnung FROM - ( - -- distinct lehreinheitgruppe, as may come multiple times from different lehrform - SELECT DISTINCT ON (legr.lehreinheitgruppe_id) legr.studiengang_kz, - -- get Spezialgruppe or Lehrverbandgruppe - COALESCE( - legr.gruppe_kurzbz, - CONCAT( UPPER(stg1.typ), UPPER(stg1.kurzbz), \'-\', legr.semester, legr.verband, legr.gruppe ) - ) as bezeichnung - FROM lehre.tbl_lehreinheitgruppe legr - JOIN lehre.tbl_lehreinheit le USING (lehreinheit_id) - JOIN lehre.tbl_lehrveranstaltung lv1 USING (lehrveranstaltung_id) - JOIN public.tbl_studiengang stg1 ON stg1.studiengang_kz = legr.studiengang_kz - WHERE lv1.lehrveranstaltung_id = lv.lehrveranstaltung_id - AND le.studiensemester_kurzbz = stplsem.studiensemester_kurzbz - ) AS lehreinheitgruppen - GROUP BY studiengang_kz, bezeichnung - ORDER BY studiengang_kz DESC - ) AS uniqueLehreinheitgruppen_bezeichnung - ) AS lehreinheitgruppen_bezeichnung - FROM - lehre.tbl_studienplan stpl - JOIN lehre.tbl_studienordnung sto USING (studienordnung_id) - JOIN lehre.tbl_studienplan_semester stplsem USING (studienplan_id) - JOIN lehre.tbl_studienplan_lehrveranstaltung stpllv ON (stpllv.studienplan_id = stpl.studienplan_id AND stpllv.semester = stplsem.semester) - JOIN lehre.tbl_lehrveranstaltung lv USING (lehrveranstaltung_id) - JOIN public.tbl_organisationseinheit oe USING (oe_kurzbz) - JOIN public.tbl_studiengang stg ON stg.studiengang_kz = sto.studiengang_kz - JOIN public.tbl_studiengangstyp stgtyp ON stgtyp.typ = stg.typ - WHERE 1 = 1 - '; - - return $qry; - } - /** * Get all Templates and its assigned Lehrveranstaltungen of given Studiensemester and Oes. * Lvs are queried via actual Studienordnung and Studienplan. From b8417869b5943e7cb05174ee8b75a4a669b02273 Mon Sep 17 00:00:00 2001 From: Cristina Date: Thu, 20 Mar 2025 11:18:26 +0100 Subject: [PATCH 17/26] Added phrase lizenzkategorie to Softwarebereitstellung app --- system/phrasesupdate.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 9067927da..ce2c01957 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -40792,6 +40792,26 @@ array( 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'lizenzkategorie', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Lizenz-Kategorie', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'License category', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) ); From 2a4f1af69ff523d8a95d0bac8919f4a6df95e758 Mon Sep 17 00:00:00 2001 From: Cristina Date: Thu, 20 Mar 2025 11:18:26 +0100 Subject: [PATCH 18/26] Added phrase lizenzkategorie to Softwarebereitstellung app --- system/phrasesupdate.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 9067927da..c2f3fed3b 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -40792,6 +40792,46 @@ array( 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'lizenzkategorie', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Lizenz-Kategorie', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'License category', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), +array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'lizenzkategorieKurzbz', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Lizenz-Kategorie Kurzbz', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'License category short', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) ); From a6ee6a8c0ff3b9adbbcd4038482e806ac158d498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Mon, 24 Mar 2025 11:45:58 +0100 Subject: [PATCH 19/26] =?UTF-8?q?ReihungstestJob=20angepasst=20damit=20Dri?= =?UTF-8?q?ttstaatenkaution=20ber=C3=BCcksichtigt=20wird.=20Fehler=20behob?= =?UTF-8?q?en=20beim=20setzen=20des=20Abgewiesenen=20Status=20das=20nicht?= =?UTF-8?q?=20in=20allen=20F=C3=A4llen=20funktioniert=20hat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/jobs/ReihungstestJob.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/controllers/jobs/ReihungstestJob.php b/application/controllers/jobs/ReihungstestJob.php index 9b2532b4b..6dd214fbb 100644 --- a/application/controllers/jobs/ReihungstestJob.php +++ b/application/controllers/jobs/ReihungstestJob.php @@ -821,7 +821,7 @@ class ReihungstestJob extends JOB_Controller JOIN lehre.tbl_studienordnung USING (studienordnung_id) JOIN PUBLIC.tbl_studiengang ON (tbl_studienordnung.studiengang_kz = tbl_studiengang.studiengang_kz) WHERE get_rolle_prestudent (tbl_prestudent.prestudent_id, ?) IN ('Aufgenommener','Bewerber','Wartender','Abgewiesener') - AND studiensemester_kurzbz = ? + AND studiensemester_kurzbz = ? AND tbl_studiengang.typ IN ('b', 'm') ) SELECT * FROM prst @@ -861,7 +861,7 @@ class ReihungstestJob extends JOB_Controller { // Alle niedrigeren Prios laden $qryNiedrPrios = " - SELECT DISTINCT + SELECT DISTINCT ON(prestudent_id) get_rolle_prestudent (tbl_prestudent.prestudent_id, '".$row_ps->studiensemester_kurzbz."') AS laststatus, tbl_studienplan.orgform_kurzbz, tbl_person.nachname, @@ -880,7 +880,7 @@ class ReihungstestJob extends JOB_Controller AND studiensemester_kurzbz = '".$row_ps->studiensemester_kurzbz."' AND tbl_studiengang.typ IN ('b', 'm') AND priorisierung > ".$row_ps->priorisierung." - ORDER BY studiengang_kz, laststatus + ORDER BY prestudent_id, studiengang_kz, laststatus, tbl_prestudentstatus.datum DESC "; // Wenn der letzte Status "Aufgenommener" ist, alle niedrigeren Prios auf "Abgewiesen" setzen @@ -976,7 +976,7 @@ class ReihungstestJob extends JOB_Controller FROM public.tbl_konto WHERE person_id = " . $row_ps->person_id . " AND studiensemester_kurzbz = '" . $row_ps->studiensemester_kurzbz . "' - AND buchungstyp_kurzbz = 'StudiengebuehrAnzahlung'"; + AND buchungstyp_kurzbz IN ('StudiengebuehrAnzahlung','KautionDrittStaat')"; $resultKautionExists = $db->execReadOnlyQuery($qryKautionExists); if (hasdata($resultKautionExists)) From 7126ab4561f6d5203fa4863d44b8db182b01faa0 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Mon, 24 Mar 2025 14:33:34 +0100 Subject: [PATCH 20/26] - "Kaution" - column: buchungstyp von anzahlung auf kaution geandert --- .../views/system/infocenter/infocenterAbgewiesenData.php | 4 ++-- application/views/system/infocenter/infocenterData.php | 4 ++-- .../views/system/infocenter/infocenterFreigegebenData.php | 5 +++-- .../infocenter/infocenterReihungstestAbsolviertData.php | 5 +++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/application/views/system/infocenter/infocenterAbgewiesenData.php b/application/views/system/infocenter/infocenterAbgewiesenData.php index da816b2c7..03397ff31 100644 --- a/application/views/system/infocenter/infocenterAbgewiesenData.php +++ b/application/views/system/infocenter/infocenterAbgewiesenData.php @@ -8,7 +8,7 @@ $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; $LOGDATA_NAME = '\'Message sent\''; $LOGDATA_VON = '\'online\''; - $STUDIENGEBUEHR_ANZAHLUNG = '\'StudiengebuehrAnzahlung\''; + $KAUTION_DRITT_STAAT = '\'KautionDrittStaat\''; $query = ' SELECT @@ -62,7 +62,7 @@ $query = ' FROM public.tbl_konto konto WHERE konto.person_id = p.person_id AND konto.studiensemester_kurzbz = '. $STUDIENSEMESTER .' - AND konto.buchungstyp_kurzbz = '. $STUDIENGEBUEHR_ANZAHLUNG .' + AND konto.buchungstyp_kurzbz = '. $KAUTION_DRITT_STAAT .' ) AS "Kaution" FROM public.tbl_prestudentstatus pss diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 956ad80d4..ebfd1db37 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -13,7 +13,7 @@ $ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz'); $AKTE_TYP = '\'identity\', \'zgv_bakk\''; $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; - $STUDIENGEBUEHR_ANZAHLUNG = '\'StudiengebuehrAnzahlung\''; + $KAUTION_DRITT_STAAT = '\'KautionDrittStaat\''; $ORG_NAME = '\'InfoCenter\''; $ONLINE = '\'online\''; @@ -302,7 +302,7 @@ FROM public.tbl_konto konto WHERE konto.person_id = p.person_id AND konto.studiensemester_kurzbz = '. $STUDIENSEMESTER .' - AND konto.buchungstyp_kurzbz = '. $STUDIENGEBUEHR_ANZAHLUNG .' + AND konto.buchungstyp_kurzbz = '. $KAUTION_DRITT_STAAT .' ) AS "Kaution" FROM public.tbl_person p LEFT JOIN ( diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index 8003b42e0..27738719c 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -13,7 +13,8 @@ $ORG_NAME = '\'InfoCenter\''; $IDENTITY = '\'identity\''; $ONLINE = '\'online\''; - $STUDIENGEBUEHR_ANZAHLUNG = '\'StudiengebuehrAnzahlung\''; + $KAUTION_DRITT_STAAT = '\'KautionDrittStaat\''; + $query = ' SELECT @@ -275,7 +276,7 @@ $query = ' FROM public.tbl_konto konto WHERE konto.person_id = p.person_id AND konto.studiensemester_kurzbz = '. $STUDIENSEMESTER .' - AND konto.buchungstyp_kurzbz = '. $STUDIENGEBUEHR_ANZAHLUNG .' + AND konto.buchungstyp_kurzbz = '. $KAUTION_DRITT_STAAT .' ) AS "Kaution" FROM public.tbl_person p LEFT JOIN ( diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php index 7f9ee1288..c19b139b3 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php @@ -9,7 +9,8 @@ $ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz'); $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; $ORG_NAME = '\'InfoCenter\''; - $STUDIENGEBUEHR_ANZAHLUNG = '\'StudiengebuehrAnzahlung\''; + $KAUTION_DRITT_STAAT = '\'KautionDrittStaat\''; + $query = ' SELECT @@ -206,7 +207,7 @@ $query = ' FROM public.tbl_konto konto WHERE konto.person_id = p.person_id AND konto.studiensemester_kurzbz = '. $STUDIENSEMESTER .' - AND konto.buchungstyp_kurzbz = '. $STUDIENGEBUEHR_ANZAHLUNG .' + AND konto.buchungstyp_kurzbz = '. $KAUTION_DRITT_STAAT .' ) AS "Kaution" FROM public.tbl_person p LEFT JOIN ( From 742ae40d981d6b17dc462360b1c679e2f26df00f Mon Sep 17 00:00:00 2001 From: kindlm Date: Tue, 25 Mar 2025 15:56:30 +0100 Subject: [PATCH 21/26] =?UTF-8?q?Link=20Zugangscode=20=C3=B6ffnet=20nicht?= =?UTF-8?q?=20sondern=20kopiert=20in=20zwischenablage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/functions.js.php | 18 ++++++++++++++++++ content/student/studentdetailoverlay.xul.php | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/content/functions.js.php b/content/functions.js.php index 9b75718d1..65622f9ae 100644 --- a/content/functions.js.php +++ b/content/functions.js.php @@ -217,6 +217,24 @@ function getDataFromClipboard() return pastetext; } +// **** +// * Kopiert Inhalte in die Zwischenablage +// **** +function copyToClipboard(link) +{ + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); + try { + const clipboard = Components.classes["@mozilla.org/widget/clipboardhelper;1"] + .getService(Components.interfaces.nsIClipboardHelper); + clipboard.copyString(link); + + // Erfolgsmeldung anzeigen + alert("Link erfolgreich in die Zwischenablage kopiert.\nBitte in anderem Browser einfügen und öffnen."); + } catch (e) { + alert("Fehler beim Kopieren in die Zwischenablage: " + e); + } +} + // **** // * Oeffnet ein neues Fenster welches dann die Datei 'action' mit dem POST Parameter 'data' aufruft // **** diff --git a/content/student/studentdetailoverlay.xul.php b/content/student/studentdetailoverlay.xul.php index 4b4fbdd63..132667395 100644 --- a/content/student/studentdetailoverlay.xul.php +++ b/content/student/studentdetailoverlay.xul.php @@ -74,7 +74,7 @@ echo '';