From 3a16c4ebf329759096cf3eec0f81aa186317cfd1 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 26 Jun 2024 10:45:56 +0200 Subject: [PATCH 01/59] Added method getAutocompleteSuggestions to Lehrveranstaltung_model.php Get Lehrveranstaltungen by eventQuery string. Use with autocomplete event queries. --- .../education/Lehrveranstaltung_model.php | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index 1f1b90131..c7f32fef6 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -15,6 +15,71 @@ 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 + * @return array + */ + public function getAutocompleteSuggestions($eventQuery, $studiensemester_kurzbz = null, $oes = null) + { + $params = []; + + $eventQuery = '%' . $eventQuery . '%'; + + $qry = ' + SELECT DISTINCT ON (lv_oe_kurzbz, stg_bezeichnung, lehrveranstaltung_id) + le.studiensemester_kurzbz, + 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", + stg.studiengang_kz, + upper(stg.typ || stg.kurzbz) AS "stg_typ_kurzbz", + stg.bezeichnung AS "stg_bezeichnung", + lv.semester, + lv.lehrveranstaltung_id, + lv.bezeichnung AS "lv_bezeichnung" + FROM + lehre.tbl_lehrveranstaltung lv + JOIN lehre.tbl_lehreinheit le USING (lehrveranstaltung_id) + JOIN PUBLIC.tbl_organisationseinheit oe USING (oe_kurzbz) + JOIN PUBLIC.tbl_studiengang stg ON stg.studiengang_kz = lv.studiengang_kz + WHERE + /* filter negative studiengaenge */ + stg.studiengang_kz > 0 '; + + if (isset($studiensemester_kurzbz) && is_string($studiensemester_kurzbz)) + { + /* filter studiensemester */ + $qry.= ' AND le.studiensemester_kurzbz = ? '; + $params[]= $studiensemester_kurzbz; + } + + if (isset($oes) && is_array($oes)) + { + /* filter organisationseinheit */ + $qry.= ' AND lv.oe_kurzbz IN ? '; + $params[]= $oes; + } + + $qry.= ' + /* filter active lehrveranstaltungen */ + AND lv.aktiv = TRUE + /* filter active organisationseinheiten */ + AND oe.aktiv = TRUE + /* filter by search entry */ + AND lv.bezeichnung ILIKE ? + '; + + $params[]= $eventQuery; + + return $this->execQuery($qry, $params); + } + /** * Gets unique Groupstrings for Lehrveranstaltungen, e.g. WS2018_BIF_1_PRJM_VZ_LV12345 * @param string $studiensemester_kurzbz From 580f063efea0d35da04db86a1e8b78dc567a893b Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 26 Jun 2024 10:48:59 +0200 Subject: [PATCH 02/59] Updated phrases: Added phrases for Softwareanforderung in category Softwarebereitstellung --- system/phrasesupdate.php | 200 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 20f155afe..1aa798586 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -26139,6 +26139,206 @@ array( ) ) ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'softwareanforderung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Softwareanforderung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Software Request', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'softwareanforderungSubtitle', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Softwareanforderung und Lizenzmanagement für die Lehre', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Software Request and License management for Education', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'swAnforderungenUndLizenen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Softwareanforderungen & Lizenzen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Software Requirements & Licenses', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'anforderungNachSw', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anforderung nach Software', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Request by Software', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'anforderungNachLv', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anforderung nach LV', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Request by Course', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'swNichtGefundenHierBestellen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Software nicht gefunden?
Hier bei IT-Services bestellen", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Software not found?
Order here from IT Services", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'bereitsAngefordert', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Bereits angefordert", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Requested already", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'mindEineZuorndungExistiertBereits', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Mindestens eine Zuordnung existiert bereits.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "At least one assignment already exists.", + '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' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'swWurdeBereitsAngefordert', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Software wurde bereits angefordert", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Software has already been requested", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), ); From 4e053a4769183e5287d1a6aa562cc0d34790b348 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 8 Jul 2024 12:24:44 +0200 Subject: [PATCH 03/59] Updated phrases: Added phrases for Softwareanforderung in category Softwarebereitstellung --- system/phrasesupdate.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 0c9b70261..1f6b19418 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -26700,6 +26700,46 @@ array( ) ) ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'swAnforderungUeberAuswahlVonSw', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Softwareanforderung über die Auswahl von Software", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Software Requirements based on the Selection of Software", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'swAnforderungUeberAuswahlVonLvs', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Softwareanforderung über die Auswahl von Lehrveranstaltungen", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Software Requirements based on the Selection of Courses", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), ); From 4d48dfe0181dc43f78a6a518239a90381fb93f41 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 8 Jul 2024 12:26:41 +0200 Subject: [PATCH 04/59] Added method getLvsByStudiensemesterAndOes to Lehrveranstaltung_model.php getLvsByStudiensemesterAndOes: Gets Lehrveranstaltungen with its Stg, OE and OE-type and filters by Studiensemester and Organisationseinheiten if necessary. --- .../education/Lehrveranstaltung_model.php | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index c7f32fef6..129e2af41 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -80,6 +80,65 @@ class Lehrveranstaltung_model extends DB_Model return $this->execQuery($qry, $params); } + /** + * 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 + * @return array + */ + public function getLvsByStudiensemesterAndOes($studiensemester_kurzbz = null, $oes = null) + { + $params = []; + $qry = ' + SELECT DISTINCT ON (lv_oe_kurzbz, stg_bezeichnung, lehrveranstaltung_id) + le.studiensemester_kurzbz, + 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", + stg.studiengang_kz, + upper(stg.typ || stg.kurzbz) AS "stg_typ_kurzbz", + stg.bezeichnung AS "stg_bezeichnung", + lv.semester, + lv.lehrveranstaltung_id, + lv.bezeichnung AS "lv_bezeichnung" + FROM + lehre.tbl_lehrveranstaltung lv + JOIN lehre.tbl_lehreinheit le USING (lehrveranstaltung_id) + JOIN public.tbl_organisationseinheit oe USING (oe_kurzbz) + JOIN public.tbl_studiengang stg ON stg.studiengang_kz = lv.studiengang_kz + WHERE + /* filter negative studiengaenge */ + stg.studiengang_kz > 0 '; + + if (isset($studiensemester_kurzbz) && is_string($studiensemester_kurzbz)) + { + /* filter studiensemester */ + $qry.= ' AND le.studiensemester_kurzbz = ? '; + $params[]= $studiensemester_kurzbz; + } + + if (isset($oes) && is_array($oes)) + { + /* filter organisationseinheit */ + $qry.= ' AND lv.oe_kurzbz IN ? '; + $params[]= $oes; + } + + $qry.= ' + /* filter active lehrveranstaltungen */ + AND lv.aktiv = TRUE + /* filter active organisationseinheiten */ + AND oe.aktiv = TRUE + '; + + return $this->execQuery($qry, $params); + } + /** * Gets unique Groupstrings for Lehrveranstaltungen, e.g. WS2018_BIF_1_PRJM_VZ_LV12345 * @param string $studiensemester_kurzbz From eead73f10cb69a2820cce9f294bb44a517808fdc Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 10 Jul 2024 14:44:01 +0200 Subject: [PATCH 05/59] Added phrases for core and softwarebereitstellung to phrasesupdate.php --- system/phrasesupdate.php | 80 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 1f6b19418..6b1c0134d 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -26740,6 +26740,86 @@ array( ) ) ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'lizenzAnzahlNeu', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Lizenz-Anzahl NEU", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "License Number NEW", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'lizenzanzahlAendern', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Lizenzanzahl ändern", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Change Number of Licenses", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'eingabeFehlt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Eingabe fehlt", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Input missing", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'unveraendert', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Unverändert", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Unchanged", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), ); From ce7b368a8eae38fa7b16de08d8f922d85bc40ba4 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 11 Jul 2024 14:33:38 +0200 Subject: [PATCH 06/59] Adapted lv.orgform_kurzbz to selects in Lehrveranstaltung_model.php --- application/models/education/Lehrveranstaltung_model.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index 129e2af41..de0bcbdbb 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -42,7 +42,8 @@ class Lehrveranstaltung_model extends DB_Model stg.bezeichnung AS "stg_bezeichnung", lv.semester, lv.lehrveranstaltung_id, - lv.bezeichnung AS "lv_bezeichnung" + lv.bezeichnung AS "lv_bezeichnung", + lv.orgform_kurzbz FROM lehre.tbl_lehrveranstaltung lv JOIN lehre.tbl_lehreinheit le USING (lehrveranstaltung_id) @@ -105,7 +106,8 @@ class Lehrveranstaltung_model extends DB_Model stg.bezeichnung AS "stg_bezeichnung", lv.semester, lv.lehrveranstaltung_id, - lv.bezeichnung AS "lv_bezeichnung" + lv.bezeichnung AS "lv_bezeichnung", + lv.orgform_kurzbz FROM lehre.tbl_lehrveranstaltung lv JOIN lehre.tbl_lehreinheit le USING (lehrveranstaltung_id) From 0df9385f3360a82aedb45235a8061c4d8f06e2d8 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 22 Jul 2024 12:02:08 +0200 Subject: [PATCH 07/59] Adapted DB query to filter only Lehrveranstaltungen with lehrtyp_kurzbz 'lv' --- application/models/education/Lehrveranstaltung_model.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index de0bcbdbb..0889232a9 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -68,6 +68,8 @@ class Lehrveranstaltung_model extends DB_Model } $qry.= ' + /* filter lv type only */ + AND lv.lehrtyp_kurzbz = \'lv\' /* filter active lehrveranstaltungen */ AND lv.aktiv = TRUE /* filter active organisationseinheiten */ @@ -132,6 +134,8 @@ class Lehrveranstaltung_model extends DB_Model } $qry.= ' + /* filter lv type only */ + AND lv.lehrtyp_kurzbz = \'lv\' /* filter active lehrveranstaltungen */ AND lv.aktiv = TRUE /* filter active organisationseinheiten */ From 414a0d7d6e55daf6d7e875cc744bae477344eb1b Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 30 Jul 2024 15:36:16 +0200 Subject: [PATCH 08/59] Changed filter SoftwareManagement to display column anzahl_lizenzen --- system/filtersupdate.php | 1 + 1 file changed, 1 insertion(+) diff --git a/system/filtersupdate.php b/system/filtersupdate.php index fa8a361f4..915a59343 100644 --- a/system/filtersupdate.php +++ b/system/filtersupdate.php @@ -1298,6 +1298,7 @@ $filters = array( {"name": "os"}, {"name": "lizenzserver_kurzbz"}, {"name": "lizenzserver_port"}, + {"name": "anzahl_lizenzen"}, {"name": "softwarestatus_kurzbz"} ], "filters": [] From 49bd14496aeba86338101bc0d96f2f0e2af29a85 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 30 Jul 2024 15:38:02 +0200 Subject: [PATCH 09/59] Adapted db query to get Lehrveranstaltungen via Studienplan instead of Lehreinheit --- .../education/Lehrveranstaltung_model.php | 142 +++++++----------- 1 file changed, 54 insertions(+), 88 deletions(-) diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index 0889232a9..5a9053f73 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -24,61 +24,16 @@ class Lehrveranstaltung_model extends DB_Model */ public function getAutocompleteSuggestions($eventQuery, $studiensemester_kurzbz = null, $oes = null) { + $subQry = $this->_getQryLvsByStudienplan($studiensemester_kurzbz, $oes); $params = []; - $eventQuery = '%' . $eventQuery . '%'; + /* filter by input string */ + if (is_string($eventQuery)) { + $subQry.= ' AND lv.bezeichnung ILIKE ?'; + $params[] = '%' . $eventQuery . '%'; + } - $qry = ' - SELECT DISTINCT ON (lv_oe_kurzbz, stg_bezeichnung, lehrveranstaltung_id) - le.studiensemester_kurzbz, - 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", - stg.studiengang_kz, - upper(stg.typ || stg.kurzbz) AS "stg_typ_kurzbz", - stg.bezeichnung AS "stg_bezeichnung", - lv.semester, - lv.lehrveranstaltung_id, - lv.bezeichnung AS "lv_bezeichnung", - lv.orgform_kurzbz - FROM - lehre.tbl_lehrveranstaltung lv - JOIN lehre.tbl_lehreinheit le USING (lehrveranstaltung_id) - JOIN PUBLIC.tbl_organisationseinheit oe USING (oe_kurzbz) - JOIN PUBLIC.tbl_studiengang stg ON stg.studiengang_kz = lv.studiengang_kz - WHERE - /* filter negative studiengaenge */ - stg.studiengang_kz > 0 '; - - if (isset($studiensemester_kurzbz) && is_string($studiensemester_kurzbz)) - { - /* filter studiensemester */ - $qry.= ' AND le.studiensemester_kurzbz = ? '; - $params[]= $studiensemester_kurzbz; - } - - if (isset($oes) && is_array($oes)) - { - /* filter organisationseinheit */ - $qry.= ' AND lv.oe_kurzbz IN ? '; - $params[]= $oes; - } - - $qry.= ' - /* filter lv type only */ - AND lv.lehrtyp_kurzbz = \'lv\' - /* filter active lehrveranstaltungen */ - AND lv.aktiv = TRUE - /* filter active organisationseinheiten */ - AND oe.aktiv = TRUE - /* filter by search entry */ - AND lv.bezeichnung ILIKE ? - '; - - $params[]= $eventQuery; + $qry = 'SELECT DISTINCT ON (lehrveranstaltung_id) * FROM ('. $subQry. ') AS tmp'; return $this->execQuery($qry, $params); } @@ -91,58 +46,69 @@ class Lehrveranstaltung_model extends DB_Model * @param array $oes Filter by Organisationseinheiten * @return array */ - public function getLvsByStudiensemesterAndOes($studiensemester_kurzbz = null, $oes = null) + public function getLvsByStudienplan($studiensemester_kurzbz = null, $oes = null) + { + $subQry = $this->_getQryLvsByStudienplan($studiensemester_kurzbz, $oes); + $qry = 'SELECT DISTINCT ON (lehrveranstaltung_id) * FROM ('. $subQry. ') AS tmp ORDER BY lehrveranstaltung_id, orgform_kurzbz DESC'; // TODO: hier VZ zuerst. aber eig nicht relevant...check + + return $this->execQuery($qry); + } + + /** + * Get basic query to retrieve Lehrveranstaltungen according to the Orgforms and Ausbildungssemesters actual Studienplan. + * + * @return string + */ + private function _getQryLvsByStudienplan($studiensemester_kurzbz = null, $oes = null, $lehrtyp_kurzbz = 'lv') { - $params = []; $qry = ' - SELECT DISTINCT ON (lv_oe_kurzbz, stg_bezeichnung, lehrveranstaltung_id) - le.studiensemester_kurzbz, - lv.oe_kurzbz AS "lv_oe_kurzbz", - CASE + 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", - stg.studiengang_kz, - upper(stg.typ || stg.kurzbz) AS "stg_typ_kurzbz", - stg.bezeichnung AS "stg_bezeichnung", - lv.semester, - lv.lehrveranstaltung_id, - lv.bezeichnung AS "lv_bezeichnung", - lv.orgform_kurzbz + stplsem.studiensemester_kurzbz, + studienordnung_id, + sto.studiengang_kz, + stpl.studienplan_id, + stplsem.semester, + stpl.orgform_kurzbz, + upper(stg.typ || stg.kurzbz) AS "stg_typ_kurzbz", + stg.bezeichnung AS "stg_bezeichnung", + stgtyp.bezeichnung AS "stg_typ_bezeichnung", + lv.lehrveranstaltung_id, + lv.semester, + lv.bezeichnung AS "lv_bezeichnung" FROM - lehre.tbl_lehrveranstaltung lv - JOIN lehre.tbl_lehreinheit le USING (lehrveranstaltung_id) - JOIN public.tbl_organisationseinheit oe USING (oe_kurzbz) - JOIN public.tbl_studiengang stg ON stg.studiengang_kz = lv.studiengang_kz - WHERE - /* filter negative studiengaenge */ - stg.studiengang_kz > 0 '; + 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 + /* 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 studiensemester */ - $qry.= ' AND le.studiensemester_kurzbz = ? '; - $params[]= $studiensemester_kurzbz; + /* filter by studiensemester */ + $qry.= ' AND stplsem.studiensemester_kurzbz = '. $this->db->escape($studiensemester_kurzbz); + } if (isset($oes) && is_array($oes)) { - /* filter organisationseinheit */ - $qry.= ' AND lv.oe_kurzbz IN ? '; - $params[]= $oes; + /* filter by organisationseinheit */ + $implodedOes = "'". implode("', '", $oes). "'"; + $qry.= ' AND lv.oe_kurzbz IN ('. $implodedOes. ')'; } - $qry.= ' - /* filter lv type only */ - AND lv.lehrtyp_kurzbz = \'lv\' - /* filter active lehrveranstaltungen */ - AND lv.aktiv = TRUE - /* filter active organisationseinheiten */ - AND oe.aktiv = TRUE - '; - - return $this->execQuery($qry, $params); + return $qry; } /** From 6f216dbe520b5f6cb6cf98a9279de773aeaaef3d Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 30 Jul 2024 15:38:36 +0200 Subject: [PATCH 10/59] Added phrases to Softwarebereitstellung --- system/phrasesupdate.php | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 6b1c0134d..75b8ce435 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -26820,6 +26820,66 @@ array( ) ) ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'anforderungenVorruecken', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Anforderungen vorrücken", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Take over Requirements", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'vorrueckenInStudiensemester', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Vorrücken in Studiensemester", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Take over to semester", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'softwarebereitstellung', + 'category' => 'global', + 'phrase' => 'anteiligInProzent', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Anteilig in %", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Percentage share", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), ); From 085ca2a16d0f27da9ed14c881a1b575c22cf98c3 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 31 Jul 2024 11:44:42 +0200 Subject: [PATCH 11/59] Adapted getLvsByStudienplan query to get all LVs, not only VZ --- application/models/education/Lehrveranstaltung_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index 5a9053f73..09b635a58 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -49,7 +49,7 @@ class Lehrveranstaltung_model extends DB_Model public function getLvsByStudienplan($studiensemester_kurzbz = null, $oes = null) { $subQry = $this->_getQryLvsByStudienplan($studiensemester_kurzbz, $oes); - $qry = 'SELECT DISTINCT ON (lehrveranstaltung_id) * FROM ('. $subQry. ') AS tmp ORDER BY lehrveranstaltung_id, orgform_kurzbz DESC'; // TODO: hier VZ zuerst. aber eig nicht relevant...check + $qry = 'SELECT * FROM ('. $subQry. ') AS tmp ORDER BY stg_typ_kurzbz, orgform_kurzbz DESC'; return $this->execQuery($qry); } From c9471c344d146b4cb07969e6267409f58006e7a2 Mon Sep 17 00:00:00 2001 From: Johann Hoffmann Date: Wed, 31 Jul 2024 14:37:26 +0200 Subject: [PATCH 12/59] added unruly person boolean column to tbl_person; studStatus/leitung added a checkbox to mark persons as unruly unrelated to studstatus datastate; --- .../api/frontend/v1/studstatus/Abmeldung.php | 5 +- .../frontend/v1/unrulyperson/UnrulyPerson.php | 51 ++++++++++++ .../controllers/lehre/Studierendenantrag.php | 8 +- .../system/infocenter/InfoCenter.php | 10 ++- application/libraries/AntragLib.php | 22 ++--- .../models/crm/Prestudentstatus_model.php | 3 +- .../education/Studierendenantrag_model.php | 16 +++- application/models/person/Person_model.php | 26 +++++- application/views/lehre/Antrag/Create.php | 3 +- .../system/infocenter/infocenterDetails.php | 19 ++++- public/js/api/fhcapifactory.js | 6 +- public/js/api/unrulyperson.js | 13 +++ .../components/Studierendenantrag/Antrag.js | 6 +- .../Studierendenantrag/Form/AbmeldungStgl.js | 21 ++++- .../Studierendenantrag/Leitung/Table.js | 5 +- system/dbupdate_3.4.php | 5 +- .../40896_kennzeichnung_unruly_person.php | 17 ++++ system/phrasesupdate.php | 82 ++++++++++++++++++- 18 files changed, 283 insertions(+), 35 deletions(-) create mode 100644 application/controllers/api/frontend/v1/unrulyperson/UnrulyPerson.php create mode 100644 public/js/api/unrulyperson.js create mode 100644 system/dbupdate_3.4/40896_kennzeichnung_unruly_person.php diff --git a/application/controllers/api/frontend/v1/studstatus/Abmeldung.php b/application/controllers/api/frontend/v1/studstatus/Abmeldung.php index 875b6484c..87fec9918 100644 --- a/application/controllers/api/frontend/v1/studstatus/Abmeldung.php +++ b/application/controllers/api/frontend/v1/studstatus/Abmeldung.php @@ -136,6 +136,7 @@ class Abmeldung extends FHCAPI_Controller $grund = $this->input->post('grund'); $studiensemester = $this->input->post('studiensemester'); $prestudent_id = $this->input->post('prestudent_id'); + $unruly = $this->input->post('unruly'); $result = $this->antraglib->getPrestudentAbmeldeBerechtigt($prestudent_id); $result = $this->getDataOrTerminateWithError($result); @@ -146,7 +147,7 @@ class Abmeldung extends FHCAPI_Controller elseif ($result < 0) $this->terminateWithError($this->p->t('studierendenantrag', 'error_antrag_exists'), self::ERROR_TYPE_GENERAL); - $result = $this->antraglib->createAbmeldung($prestudent_id, $studiensemester, getAuthUID(), $grund); + $result = $this->antraglib->createAbmeldung($prestudent_id, $studiensemester, getAuthUID(), $grund, $unruly); $data = $this->getDataOrTerminateWithError($result); $result = $this->antraglib->getDetailsForAntrag($data); @@ -184,4 +185,4 @@ class Abmeldung extends FHCAPI_Controller $this->terminateWithSuccess($data); } -} +} \ No newline at end of file diff --git a/application/controllers/api/frontend/v1/unrulyperson/UnrulyPerson.php b/application/controllers/api/frontend/v1/unrulyperson/UnrulyPerson.php new file mode 100644 index 000000000..a1673739a --- /dev/null +++ b/application/controllers/api/frontend/v1/unrulyperson/UnrulyPerson.php @@ -0,0 +1,51 @@ +. + */ + +if (! defined('BASEPATH')) exit('No direct script access allowed'); + +class UnrulyPerson extends FHCAPI_Controller +{ + + // TODO: BERECHTIGUNGEN + public function __construct() + { + parent::__construct([ + 'updatePersonUnrulyStatus' => 'basis/mitarbeiter:rw' + ]); + + $this->_ci =& get_instance(); + $this->_ci->load->model('person/Person_model', 'PersonModel'); + } + + public function updatePersonUnrulyStatus() + { + $data = json_decode($this->input->raw_input_stream, true); + + $person_id = $data['person_id']; + $unruly = $data['unruly']; + + $result = $this->_ci->PersonModel->updateUnruly($person_id, $unruly); + + if(isError($result)) { + $this->terminateWithError($result); + } else if (isSuccess($result)) { + $this->terminateWithSuccess($result); + } + + } +} \ No newline at end of file diff --git a/application/controllers/lehre/Studierendenantrag.php b/application/controllers/lehre/Studierendenantrag.php index d6d6b2c50..3baf30355 100644 --- a/application/controllers/lehre/Studierendenantrag.php +++ b/application/controllers/lehre/Studierendenantrag.php @@ -21,6 +21,7 @@ class Studierendenantrag extends FHC_Controller // Load Models $this->load->model('education/Studierendenantrag_model', 'StudierendenantragModel'); + $this->load->model('person/Person_model', 'PersonModel'); // Load language phrases $this->loadPhrases([ @@ -102,10 +103,13 @@ class Studierendenantrag extends FHC_Controller public function abmeldungstgl($prestudent_id, $studierendenantrag_id = null) { + $unruly = getData($this->PersonModel->loadPrestudent($prestudent_id))[0]->unruly; + $this->load->view('lehre/Antrag/Create', [ 'prestudent_id' => $prestudent_id, 'studierendenantrag_id' => $studierendenantrag_id, - 'antrag_type' => 'AbmeldungStgl' + 'antrag_type' => 'AbmeldungStgl', + 'unruly' => $unruly ]); } @@ -185,4 +189,4 @@ class Studierendenantrag extends FHC_Controller return $strRequiredPermissions; } -} +} \ No newline at end of file diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index cf0c6755a..d5cb50a00 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -337,10 +337,13 @@ class InfoCenter extends Auth_Controller $persondata = $this->_loadPersonData($person_id); $checkPerson = $this->PersonModel->checkDuplicate($person_id); - if (isError($checkPerson)) show_error(getError($checkPerson)); + $checkUnruly = $this->PersonModel->checkUnruly($persondata['stammdaten']->vorname, $persondata['stammdaten']->nachname, $persondata['stammdaten']->gebdatum); + if (isError($checkUnruly)) show_error(getError($checkUnruly)); + $duplicate = array('duplicated' => getData($checkPerson)); + $unruly = array('unruly' => getData($checkUnruly)); $prestudentdata = $this->_loadPrestudentData($person_id); @@ -351,7 +354,8 @@ class InfoCenter extends Auth_Controller $persondata, $prestudentdata, $dokumentdata, - $duplicate + $duplicate, + $unruly ); $data[self::FHC_CONTROLLER_ID] = $this->getControllerId(); @@ -2383,4 +2387,4 @@ class InfoCenter extends Auth_Controller $this->outputJsonSuccess("Success"); } -} +} \ No newline at end of file diff --git a/application/libraries/AntragLib.php b/application/libraries/AntragLib.php index ce4485279..41b6e4ced 100644 --- a/application/libraries/AntragLib.php +++ b/application/libraries/AntragLib.php @@ -911,7 +911,7 @@ class AntragLib public function createWiederholung($prestudent_id, $studiensemester_kurzbz, $insertvon, $repeat) { $result = $this->_ci->StudierendenantragModel->loadIdAndStatusWhere([ - 'prestudent_id' => $prestudent_id, + 'tbl_studierendenantrag.prestudent_id' => $prestudent_id, 'studiensemester_kurzbz'=> $studiensemester_kurzbz, 'typ' => Studierendenantrag_model::TYP_WIEDERHOLUNG ]); @@ -1341,7 +1341,7 @@ class AntragLib if (!in_array($result->status_kurzbz, $this->_ci->config->item('antrag_prestudentstatus_whitelist_abmeldung'))) { $result = $this->_ci->StudierendenantragModel->loadWithStatusWhere([ - 'prestudent_id' => $prestudent_id, + 'tbl_studierendenantrag.prestudent_id' => $prestudent_id, 's.studierendenantrag_statustyp_kurzbz' => Studierendenantragstatus_model::STATUS_APPROVED ], [ Studierendenantrag_model::TYP_ABMELDUNG, @@ -1353,7 +1353,7 @@ class AntragLib return success(-1); $result = $this->_ci->StudierendenantragModel->loadWithStatusWhere([ - 'prestudent_id' => $prestudent_id, + 'tbl_studierendenantrag.prestudent_id' => $prestudent_id, 's.studierendenantrag_statustyp_kurzbz' => Studierendenantragstatus_model::STATUS_PAUSE ], [ Studierendenantrag_model::TYP_ABMELDUNG, @@ -1367,7 +1367,7 @@ class AntragLib return success(0); } - $result = $this->_ci->StudierendenantragModel->loadWithStatusWhere(['prestudent_id' => $prestudent_id]); + $result = $this->_ci->StudierendenantragModel->loadWithStatusWhere(['tbl_studierendenantrag.prestudent_id' => $prestudent_id]); if (isError($result)) return $result; if (!hasData($result)) @@ -1428,7 +1428,7 @@ class AntragLib && $result->status_kurzbz != 'Unterbrecher') { return success(0); } - $result = $this->_ci->StudierendenantragModel->loadWithStatusWhere(['prestudent_id' => $prestudent_id]); + $result = $this->_ci->StudierendenantragModel->loadWithStatusWhere(['tbl_studierendenantrag.prestudent_id' => $prestudent_id]); if (isError($result)) return $result; if (!hasData($result)) @@ -1510,7 +1510,7 @@ class AntragLib $datumStatus = $result->datum; if (!in_array($result->status_kurzbz, $this->_ci->config->item('antrag_prestudentstatus_whitelist'))) { $result = $this->_ci->StudierendenantragModel->loadWithStatusWhere([ - 'prestudent_id' => $prestudent_id, + 'tbl_studierendenantrag.prestudent_id' => $prestudent_id, 'typ' => Studierendenantrag_model::TYP_WIEDERHOLUNG, 's.studierendenantrag_statustyp_kurzbz' => Studierendenantragstatus_model::STATUS_APPROVED ]); @@ -1520,7 +1520,7 @@ class AntragLib return success(-1); $result = $this->_ci->StudierendenantragModel->loadWithStatusWhere([ - 'prestudent_id' => $prestudent_id, + 'tbl_studierendenantrag.prestudent_id' => $prestudent_id, 'typ' => Studierendenantrag_model::TYP_WIEDERHOLUNG, 's.studierendenantrag_statustyp_kurzbz' => Studierendenantragstatus_model::STATUS_DEREGISTERED ]); @@ -1530,7 +1530,7 @@ class AntragLib return success(-1); $result = $this->_ci->StudierendenantragModel->loadWithStatusWhere([ - 'prestudent_id' => $prestudent_id, + 'tbl_studierendenantrag.prestudent_id' => $prestudent_id, 'typ' => Studierendenantrag_model::TYP_WIEDERHOLUNG, 's.studierendenantrag_statustyp_kurzbz' => Studierendenantragstatus_model::STATUS_PAUSE ]); @@ -1541,7 +1541,7 @@ class AntragLib return success(0); } - $result = $this->_ci->StudierendenantragModel->loadWithStatusWhere(['prestudent_id' => $prestudent_id]); + $result = $this->_ci->StudierendenantragModel->loadWithStatusWhere(['tbl_studierendenantrag.prestudent_id' => $prestudent_id]); if (isError($result)) return $result; if (!hasData($result)) @@ -1594,7 +1594,7 @@ class AntragLib public function getDetailsForLastAntrag($prestudent_id, $typ = null) { $where = [ - 'prestudent_id' => $prestudent_id + 'tbl_studierendenantrag.prestudent_id' => $prestudent_id ]; $types = null; if ($typ) { @@ -2180,4 +2180,4 @@ class AntragLib $result = $this->_ci->StudierendenantraglehrveranstaltungModel->getLvsForPrestudent($prestudent_id, $studiensemester_kurzbz); return $result; } -} +} \ No newline at end of file diff --git a/application/models/crm/Prestudentstatus_model.php b/application/models/crm/Prestudentstatus_model.php index b3dc45321..f5435a1df 100644 --- a/application/models/crm/Prestudentstatus_model.php +++ b/application/models/crm/Prestudentstatus_model.php @@ -280,6 +280,7 @@ class Prestudentstatus_model extends DB_Model $this->addSelect('ss.studienjahr_kurzbz'); $this->addSelect('pers.vorname'); $this->addSelect('pers.nachname'); + $this->addSelect('pers.unruly'); $this->addSelect('TRIM(CONCAT(pers.vorname, \' \', pers.nachname)) AS name'); $this->addSelect('pers.person_id'); $this->addSelect('g.studiengang_kz'); @@ -339,4 +340,4 @@ class Prestudentstatus_model extends DB_Model return $this; } -} +} \ No newline at end of file diff --git a/application/models/education/Studierendenantrag_model.php b/application/models/education/Studierendenantrag_model.php index e138d1a1c..e86ef6be0 100644 --- a/application/models/education/Studierendenantrag_model.php +++ b/application/models/education/Studierendenantrag_model.php @@ -38,6 +38,7 @@ class Studierendenantrag_model extends DB_Model $this->addSelect('studienjahr_kurzbz'); $this->addSelect('vorname'); $this->addSelect('nachname'); + $this->addSelect('unruly'); $this->addSelect('p.prestudent_id'); $this->addSelect('p.studiengang_kz'); $this->addSelect('semester'); @@ -148,6 +149,7 @@ class Studierendenantrag_model extends DB_Model $this->addSelect('s.studierendenantrag_statustyp_kurzbz status'); $this->addSelect('s.insertvon status_insertvon'); $this->addSelect('t.bezeichnung[(' . $lang . ')] statustyp'); + $this->addSelect('p.unruly AS unruly'); $this->addJoin( 'campus.tbl_studierendenantrag_status s', @@ -157,6 +159,18 @@ class Studierendenantrag_model extends DB_Model 'campus.tbl_studierendenantrag_statustyp t', 's.studierendenantrag_statustyp_kurzbz=t.studierendenantrag_statustyp_kurzbz' ); + $this->addJoin( + 'public.tbl_student st', + 'st.prestudent_id=tbl_studierendenantrag.prestudent_id' + ); + $this->addJoin( + 'public.tbl_benutzer b', + 'st.student_uid=b.uid' + ); + $this->addJoin( + 'public.tbl_person p', + 'b.person_id=p.person_id' + ); if ($types && is_array($types)) { $this->db->where_in('typ', $types); @@ -471,4 +485,4 @@ class Studierendenantrag_model extends DB_Model return hasData($this->load()); } -} +} \ No newline at end of file diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index 88813220e..c3a6c34f1 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -374,5 +374,29 @@ class Person_model extends DB_Model 'prestudent_id' => $prestudent_id ]); } -} + public function checkUnruly($vorname, $nachname, $gebdatum) + { + $qry = "SELECT * + FROM tbl_person + WHERE tbl_person.vorname = ? + AND tbl_person.nachname = ? + AND tbl_person.gebdatum = ? + AND tbl_person.unruly = TRUE;"; + + return $this->execQuery($qry, [$vorname, $nachname, $gebdatum]); + } + + public function updateUnruly($person_id, $unruly) + { + $result = $this->update($person_id, array( + 'unruly' => $unruly + )); + + if (isError($result)) { + return error($result->msg, EXIT_ERROR); + } else if (isSuccess($result) && hasData($result)) { + return success($result); + } + } +} \ No newline at end of file diff --git a/application/views/lehre/Antrag/Create.php b/application/views/lehre/Antrag/Create.php index 91b20c9b7..f4a7d1c3c 100644 --- a/application/views/lehre/Antrag/Create.php +++ b/application/views/lehre/Antrag/Create.php @@ -35,6 +35,7 @@ $this->load->view( :prestudent-id="" antrag-type="" :studierendenantrag-id="" + :unruly="" v-model:info-array="infoArray" v-model:status-msg="status.msg" v-model:status-severity="status.severity" @@ -52,4 +53,4 @@ $this->load->view( $this->load->view( 'templates/FHC-Footer', $sitesettings -); +); \ No newline at end of file diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index a8e6e3e13..53fbda8b5 100644 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -74,6 +74,22 @@ + +
+

+ p->t('infocenter', 'unrulyPersonFound') . ':'; ?> +

+
+ person_id . '
'; + } + ?> +
+ +
+

@@ -201,5 +217,4 @@

-load->view('templates/FHC-Footer', $includesArray); ?> - +load->view('templates/FHC-Footer', $includesArray); ?> \ No newline at end of file diff --git a/public/js/api/fhcapifactory.js b/public/js/api/fhcapifactory.js index f496cd491..1448be1dd 100644 --- a/public/js/api/fhcapifactory.js +++ b/public/js/api/fhcapifactory.js @@ -21,6 +21,7 @@ import navigation from "./navigation.js"; import filter from "./filter.js"; import studstatus from "./studstatus.js"; import betriebsmittel from "./betriebsmittel.js"; +import unrulyperson from "./unrulyperson.js"; export default { search, @@ -28,5 +29,6 @@ export default { navigation, filter, studstatus, - betriebsmittel -}; + betriebsmittel, + unrulyperson +}; \ No newline at end of file diff --git a/public/js/api/unrulyperson.js b/public/js/api/unrulyperson.js new file mode 100644 index 000000000..361aecd43 --- /dev/null +++ b/public/js/api/unrulyperson.js @@ -0,0 +1,13 @@ +export default { + updatePersonUnrulyStatus(person_id, unrulyParam) { + + try { + const payload = {person_id, unruly: unrulyParam} + const url = '/api/frontend/v1/unrulyperson/UnrulyPerson/updatePersonUnrulyStatus'; + return this.$fhcApi.post(url, payload, null); + } catch (error) { + throw error; + } + + } +} \ No newline at end of file diff --git a/public/js/components/Studierendenantrag/Antrag.js b/public/js/components/Studierendenantrag/Antrag.js index 197fe2206..37de9314d 100644 --- a/public/js/components/Studierendenantrag/Antrag.js +++ b/public/js/components/Studierendenantrag/Antrag.js @@ -21,7 +21,8 @@ export default { studierendenantragId: Number, infoArray: Array, statusMsg: String, - statusSeverity: String + statusSeverity: String, + unruly: Boolean }, data() { return { @@ -49,10 +50,11 @@ export default { v-model:status="status" :prestudent-id="prestudentId" :studierendenantrag-id="studierendenantragId" + :unruly="unruly" @setInfos="$emit('update:infoArray', $event)" @setStatus="$emit('update:statusMsg', $event.msg);$emit('update:statusSeverity', $event.severity)" > ` -} +} \ No newline at end of file diff --git a/public/js/components/Studierendenantrag/Form/AbmeldungStgl.js b/public/js/components/Studierendenantrag/Form/AbmeldungStgl.js index 004f6f4d0..f7daa8d23 100644 --- a/public/js/components/Studierendenantrag/Form/AbmeldungStgl.js +++ b/public/js/components/Studierendenantrag/Form/AbmeldungStgl.js @@ -18,7 +18,8 @@ export default { ], props: { prestudentId: Number, - studierendenantragId: Number + studierendenantragId: Number, + unruly: Boolean }, data() { return { @@ -26,7 +27,8 @@ export default { saving: false, formData: { grund: '' - } + }, + unrulyInternal: this.unruly } }, computed: { @@ -107,6 +109,14 @@ export default { ? this.$p.t('studierendenantrag', event.target.value) : ''; }, + saveUnrulyPerson(event) { + this.$fhcApi.factory.unrulyperson.updatePersonUnrulyStatus(this.data.person_id, this.unrulyInternal).then( + (res)=> { + if(res?.meta?.status === "success") { + this.$fhcAlert.alertSuccess(this.$p.t('studierendenantrag', 'antrag_unruly_updated')) + } + }) + } }, created() { this.uuid = _uuid++; @@ -187,6 +197,11 @@ export default { +
+ + +
+
` -} +} \ No newline at end of file diff --git a/public/js/components/Studierendenantrag/Leitung/Table.js b/public/js/components/Studierendenantrag/Leitung/Table.js index 778f91c00..0f8b22540 100644 --- a/public/js/components/Studierendenantrag/Leitung/Table.js +++ b/public/js/components/Studierendenantrag/Leitung/Table.js @@ -230,6 +230,9 @@ export default { return val ? link : ' '; } + }, { + field: 'unruly', + title: this.$p.t('studierendenantrag', 'antrag_unruly') }, { field: 'dms_id', title: this.$p.t('studierendenantrag', 'antrag_dateianhaenge'), @@ -485,4 +488,4 @@ export default { ` -} +} \ No newline at end of file diff --git a/system/dbupdate_3.4.php b/system/dbupdate_3.4.php index 9fb7f0ee9..7406ff92a 100644 --- a/system/dbupdate_3.4.php +++ b/system/dbupdate_3.4.php @@ -56,6 +56,7 @@ require_once('dbupdate_3.4/36530_bis_internationsalisierung_codextabelle_neuerun require_once('dbupdate_3.4/34543_ux_template.php'); require_once('dbupdate_3.4/17513_Entwicklungsteam.php'); require_once('dbupdate_3.4/28575_softwarebereitstellung.php'); +require_once('dbupdate_3.4/40896_kennzeichnung_unruly_person.php'); // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; @@ -299,7 +300,7 @@ $tabellen=array( "public.tbl_ortraumtyp" => array("ort_kurzbz","hierarchie","raumtyp_kurzbz"), "public.tbl_organisationseinheit" => array("oe_kurzbz", "oe_parent_kurzbz", "bezeichnung","organisationseinheittyp_kurzbz", "aktiv","mailverteiler","freigabegrenze","kurzzeichen","lehre","standort","warn_semesterstunden_frei","warn_semesterstunden_fix","standort_id"), "public.tbl_organisationseinheittyp" => array("organisationseinheittyp_kurzbz", "bezeichnung", "beschreibung"), - "public.tbl_person" => array("person_id","staatsbuergerschaft","geburtsnation","sprache","anrede","titelpost","titelpre","nachname","vorname","vornamen","gebdatum","gebort","gebzeit","foto","anmerkung","homepage","svnr","ersatzkennzeichen","familienstand","geschlecht","anzahlkinder","aktiv","insertamum","insertvon","updateamum","updatevon","ext_id","bundesland_code","kompetenzen","kurzbeschreibung","zugangscode", "foto_sperre","matr_nr","zugangscode_timestamp","udf_values","bpk","matr_aktiv","wahlname"), + "public.tbl_person" => array("person_id","staatsbuergerschaft","geburtsnation","sprache","anrede","titelpost","titelpre","nachname","vorname","vornamen","gebdatum","gebort","gebzeit","foto","anmerkung","homepage","svnr","ersatzkennzeichen","familienstand","geschlecht","anzahlkinder","aktiv","insertamum","insertvon","updateamum","updatevon","ext_id","bundesland_code","kompetenzen","kurzbeschreibung","zugangscode", "foto_sperre","matr_nr","zugangscode_timestamp","udf_values","bpk","matr_aktiv","wahlname","unruly"), "public.tbl_person_fotostatus" => array("person_fotostatus_id","person_id","fotostatus_kurzbz","datum","insertamum","insertvon","updateamum","updatevon"), "public.tbl_personfunktionstandort" => array("personfunktionstandort_id","funktion_kurzbz","person_id","standort_id","position","anrede"), "public.tbl_preincoming" => array("preincoming_id","person_id","mobilitaetsprogramm_code","zweck_code","firma_id","universitaet","aktiv","bachelorthesis","masterthesis","von","bis","uebernommen","insertamum","insertvon","updateamum","updatevon","anmerkung","zgv","zgv_ort","zgv_datum","zgv_name","zgvmaster","zgvmaster_datum","zgvmaster_ort","zgvmaster_name","program_name","bachelor","master","jahre","person_id_emergency","person_id_coordinator_dep","person_id_coordinator_int","code","deutschkurs1","deutschkurs2","research_area","deutschkurs3","ext_id"), @@ -475,4 +476,4 @@ if (!$result=@$db->db_query($sql_query)) } if($error==false) echo '
Gegenpruefung fehlerfrei'; -?> +?> \ No newline at end of file diff --git a/system/dbupdate_3.4/40896_kennzeichnung_unruly_person.php b/system/dbupdate_3.4/40896_kennzeichnung_unruly_person.php new file mode 100644 index 000000000..32c01502c --- /dev/null +++ b/system/dbupdate_3.4/40896_kennzeichnung_unruly_person.php @@ -0,0 +1,17 @@ +db_query("SELECT 1 FROM information_schema.columns WHERE table_schema = 'public' + AND table_name = 'tbl_person' AND column_name = 'unruly'")) +{ + if($db->db_num_rows($result) === 0) + { + $qry = "ALTER TABLE tbl_person ADD COLUMN unruly BOOLEAN NOT NULL DEFAULT FALSE"; + + if(!$db->db_query($qry)) + echo 'Public Tabelle person: '.$db->db_last_error().'
'; + else + echo '
spalte unruly hinzugefuegt'; + } +} \ No newline at end of file diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index ad2b6aa57..d4a3777b1 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -4920,6 +4920,26 @@ The invoice will be sent to you again. The amount is only to be trans ) ) ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'unrulyPersonFound', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Unerwünschte Person wurde gefunden', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Unruly Person detected', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'password', @@ -20389,6 +20409,46 @@ array( ) ) ), + array( + 'app' => 'core', + 'category' => 'studierendenantrag', + 'phrase' => 'antrag_unruly', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Unerwünscht', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Unruly', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'studierendenantrag', + 'phrase' => 'antrag_unruly_updated', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Unerwünschte Person Status wurde aktualisiert.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Unruly person status has been updated.', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'studierendenantrag', @@ -22910,6 +22970,26 @@ array( ) ) ), + array( + 'app' => 'core', + 'category' => 'studierendenantrag', + 'phrase' => 'mark_person_as_unruly', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Person ist unerwünscht', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Person is unruly.', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'ui', @@ -27065,4 +27145,4 @@ foreach ($phrases as $phrase) } if(!$new) - echo 'Keine neuen Phrasen
'; + echo 'Keine neuen Phrasen
'; \ No newline at end of file From 3213c051b3f08a46006a533ea580d5f9e7a7cc5a Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 1 Aug 2024 13:48:06 +0200 Subject: [PATCH 13/59] Adapted getLvsByStudienplan query to get by given Lehrveranstaltungen --- .../models/education/Lehrveranstaltung_model.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index 09b635a58..928237118 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -44,12 +44,22 @@ class Lehrveranstaltung_model extends DB_Model * @param $eventQuery String * @param string $studiensemester_kurzbz Filter by Studiensemester * @param array $oes Filter by Organisationseinheiten + * @param array $lv_ids Filter by Lehrveranstaltung-Ids * @return array */ - public function getLvsByStudienplan($studiensemester_kurzbz = null, $oes = null) + public function getLvsByStudienplan($studiensemester_kurzbz = null, $oes = null, $lv_ids = null) { $subQry = $this->_getQryLvsByStudienplan($studiensemester_kurzbz, $oes); - $qry = 'SELECT * FROM ('. $subQry. ') AS tmp ORDER BY stg_typ_kurzbz, orgform_kurzbz DESC'; + $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 stg_typ_kurzbz, orgform_kurzbz DESC'; return $this->execQuery($qry); } From b0821be46541d7c6ca305388c4880e1bf683726b Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 5 Aug 2024 10:52:15 +0200 Subject: [PATCH 14/59] Added methods getLastOrAktStudienjahr / getAktOrNextStudienjahr to retrieve the last or next Studienjahr during the summer term --- .../models/organisation/Studienjahr_model.php | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/application/models/organisation/Studienjahr_model.php b/application/models/organisation/Studienjahr_model.php index 3bbe3a07f..a6e1bc575 100644 --- a/application/models/organisation/Studienjahr_model.php +++ b/application/models/organisation/Studienjahr_model.php @@ -29,4 +29,54 @@ class Studienjahr_model extends DB_Model return $this->execQuery($query); } + + /** + * Get the current Studienjahr. During the summer term, continue using the previous Studienjahr. + * + * @param int $days + * @return array|stdClass|null + */ + public function getLastOrAktStudienjahr($days = 60) + { + if (!is_numeric($days)) + { + $days = 60; + } + + $query = ' + SELECT * + FROM public.tbl_studienjahr + JOIN public.tbl_studiensemester USING (studienjahr_kurzbz) + WHERE start < NOW() - \'' . $days . ' DAYS\'::INTERVAL + ORDER by start DESC + LIMIT 1 + '; + + return $this->execQuery($query); + } + + /** + * Get the current Studienjahr. During the summer term, get the upcoming next Studienjahr. + * + * @param int $days + * @return array|stdClass|null + */ + public function getAktOrNextStudienjahr($days = 62) + { + if (!is_numeric($days)) + { + $days = 62; + } + + $query = ' + SELECT * + FROM public.tbl_studienjahr + JOIN public.tbl_studiensemester using(studienjahr_kurzbz) + WHERE start < NOW() + \'' . $days . ' DAYS\'::INTERVAL + ORDER by start DESC + LIMIT 1 + '; + + return $this->execQuery($query); + } } From 7abe95ba5f0d1d49fc4a6eb48ae2efa7a6e54143 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 6 Aug 2024 10:48:20 +0200 Subject: [PATCH 15/59] Adapted LvsByStudienplan query to retrieve also Lehreinheitgruppen --- .../education/Lehrveranstaltung_model.php | 37 ++++++++++++++++--- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index 928237118..904433439 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -73,24 +73,49 @@ class Lehrveranstaltung_model extends DB_Model { $qry = ' SELECT - lv.oe_kurzbz AS "lv_oe_kurzbz", + 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", + END AS lv_oe_bezeichnung, stplsem.studiensemester_kurzbz, studienordnung_id, sto.studiengang_kz, stpl.studienplan_id, stplsem.semester, stpl.orgform_kurzbz, - upper(stg.typ || stg.kurzbz) AS "stg_typ_kurzbz", - stg.bezeichnung AS "stg_bezeichnung", - stgtyp.bezeichnung AS "stg_typ_bezeichnung", + upper(stg.typ || stg.kurzbz) AS stg_typ_kurzbz, + stg.bezeichnung AS stg_bezeichnung, + stgtyp.bezeichnung AS stg_typ_bezeichnung, lv.lehrveranstaltung_id, lv.semester, - lv.bezeichnung AS "lv_bezeichnung" + lv.bezeichnung AS lv_bezeichnung, + ( + -- 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) From 3963358d95aa1f08ff413b7c176c38e4d4a82568 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 13 Aug 2024 14:01:57 +0200 Subject: [PATCH 16/59] Added getTemplateLvTree method to Lehrveranstaltung_model.php This method gets all Templates and unions 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. --- .../education/Lehrveranstaltung_model.php | 160 ++++++++++++++++++ 1 file changed, 160 insertions(+) diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index 904433439..50d7b9ad4 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -146,6 +146,166 @@ class Lehrveranstaltung_model extends DB_Model return $qry; } + /** + * 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. + * + * @param null|string $studiensemester_kurzbz + * @param null|array $oes + * @return array|stdClass|null + */ + public function getTemplateLvTree($studiensemester_kurzbz = null, $oes = null){ + $params = []; + $qry = ' + WITH + -- All Lvs that are assigned to a template in given Studiensemester for given Oes + -- joining via actual Studienplan + standardisierteLvs AS ( + SELECT + lv.*, + stpl.studienplan_id::text as studienplan_id, + stpl.bezeichnung AS studienplan_bezeichnung, + stplsem.studiensemester_kurzbz + 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 + -- filter type lv + lehrtyp_kurzbz = \'lv\' + -- filter lvs assigned to template (= standardisierte lv) + AND lehrveranstaltung_template_id IS NOT NULL'; + + if (is_string($studiensemester_kurzbz)) + { + /* filter by studiensemester */ + $params[]= $studiensemester_kurzbz; + $qry.= ' AND stplsem.studiensemester_kurzbz = ? '; + + } + + if (is_array($oes)) + { + /* filter by organisationseinheit */ + $params[]= $oes; + $qry.= ' AND lv.oe_kurzbz IN ? '; + } + $qry.= ' + ), + -- All templates + templateLvs AS ( + SELECT + lv.*, + NULL AS studienplan_id, + ( + SELECT string_agg(stpl_bezeichnung, \', \') + FROM + ( + SELECT stlv.studienplan_bezeichnung AS stpl_bezeichnung + FROM standardisierteLvs stlv + WHERE stlv.lehrveranstaltung_template_id = lv.lehrveranstaltung_id + ) AS studienplaene + ) AS studienplan_bezeichnung, + NULL AS studiensemester_kurzbz + FROM + lehre.tbl_lehrveranstaltung lv + WHERE + -- filter type template + lehrtyp_kurzbz = \'tpl\' + -- filter semester that were retrieved by standardisierte lvs semester for selected studiensemester + AND EXISTS ( + SELECT 1 + FROM standardisierteLvs std + WHERE std.lehrveranstaltung_template_id = lv.lehrveranstaltung_id + )'; + + if (is_array($oes)) + { + /* filter by organisationseinheit */ + $params[]= $oes; + $qry.= ' AND lv.oe_kurzbz IN ? '; + } + $qry.= ' + ) + '; + + $qry.= ' + SELECT + lv.lehrveranstaltung_id, + lv.kurzbz, + lv.lehrtyp_kurzbz, + lv.bezeichnung AS lv_bezeichnung, + lv.bezeichnung_english, + lv.studiengang_kz, + lv.semester, + lv.oe_kurzbz, + lv.ects, + lv.lehrform_kurzbz, + lv.orgform_kurzbz, + lv.sprache, + lv.aktiv, + lv.lehrveranstaltung_template_id, + lv.studienplan_id, + lv.studienplan_bezeichnung, + lv.studiensemester_kurzbz, + upper(stg.typ || stg.kurzbz) AS "stg_typ_kurzbz", + stg.bezeichnung AS "stg_bezeichnung", + stgtyp.bezeichnung AS "stg_typ_bezeichnung", + 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", + ( + -- 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 = lv.studiensemester_kurzbz + ) AS lehreinheitgruppen + GROUP BY studiengang_kz, bezeichnung + ORDER BY studiengang_kz DESC + ) AS uniqueLehreinheitgruppen_bezeichnung + ) AS lehreinheitgruppen_bezeichnung + FROM ( + SELECT + * + FROM + standardisierteLvs + UNION + SELECT + * + FROM templateLvs + ) AS lv + JOIN public.tbl_studiengang stg ON stg.studiengang_kz = lv.studiengang_kz + 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 + '; + + return $this->execQuery($qry, $params); + } + /** * Gets unique Groupstrings for Lehrveranstaltungen, e.g. WS2018_BIF_1_PRJM_VZ_LV12345 * @param string $studiensemester_kurzbz From 4dc698a6be000ae03bef6d36dbf421b847834724 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 21 Aug 2024 13:17:54 +0200 Subject: [PATCH 17/59] Added navigation menu item 'Lehrveranstaltungen' > 'LV Template Uebersicht' --- application/config/navigation.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/application/config/navigation.php b/application/config/navigation.php index 3680930d0..d57cd697a 100644 --- a/application/config/navigation.php +++ b/application/config/navigation.php @@ -55,6 +55,12 @@ $config['navigation_header'] = array( 'description' => 'CIS', 'sort' => 10 ), + 'lehrveranstaltungen' => array( + 'link' => site_url('lehre/lvplanung/LvTemplateUebersicht'), + 'icon' => '', + 'description' => 'Lehrveranstaltungen', + 'sort' => 15 + ), 'reihungstest' => array( 'link' => site_url('organisation/Reihungstest'), 'description' => 'Reihungstests', @@ -287,6 +293,15 @@ $config['navigation_menu']['lehre/lehrauftrag/LehrauftragErteilen/*'] = array( ) ); +$config['navigation_menu']['lehre/lvplanung/LvTemplateUebersicht/index'] = array( + 'lvTemplateUebersicht' => array( + 'link' => site_url('lehre/lvplanung/LvTemplateUebersicht'), + 'description' => 'LV Template Übersicht', + 'icon' => '', + 'sort' => 1 + ) +); + $config['navigation_menu']['system/issues/Issues/*'] = array( 'fehlerzustaendigkeiten' => array( 'link' => site_url('system/issues/IssuesZustaendigkeiten'), From bff5d4ffbe80bf72cee3a163235784dcd8f95c37 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 21 Aug 2024 13:22:15 +0200 Subject: [PATCH 18/59] Added api Controller Lehrveranstaltung.php + method getTemplateLvTree --- .../v1/education/Lehrveranstaltung.php | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 application/controllers/api/frontend/v1/education/Lehrveranstaltung.php diff --git a/application/controllers/api/frontend/v1/education/Lehrveranstaltung.php b/application/controllers/api/frontend/v1/education/Lehrveranstaltung.php new file mode 100644 index 000000000..20e36f461 --- /dev/null +++ b/application/controllers/api/frontend/v1/education/Lehrveranstaltung.php @@ -0,0 +1,63 @@ + self::PERM_LOGGED + )); + + // Load model LehrveranstaltungModel + $this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); + } + + /** + * Get all Templates and union with all Lehrveranstaltungen of given Studiensemester and Oes of given Berechtigung, + * that are assigned to a template. This data structure can be used for nested tabulators' data tree. + * + * @param null|string $studiensemester_kurzbz + * @param null|string $berechtigung + * @return array|stdClass|null + */ + public function getTemplateLvTree() + { + $studiensemester_kurzbz = $this->input->get('studiensemester_kurzbz'); + $berechtigung = $this->input->get('berechtigung'); + + if ($berechtigung) + { + $oe_permissions = $this->permissionlib->getOE_isEntitledFor($berechtigung); + if(!$oe_permissions) $oe_permissions = []; + + $result = $this->LehrveranstaltungModel->getTemplateLvTree($studiensemester_kurzbz, $oe_permissions); + } + else + { + $result = $this->LehrveranstaltungModel->getTemplateLvTree($studiensemester_kurzbz); + } + + if (isError($result)) { + $this->terminateWithError(getError($result), self::ERROR_TYPE_DB); + } + + $this->terminateWithSuccess((getData($result) ?: [])); + } +} From d07f19d8936dbc4e99c25c0341ea225bf43ff4cf Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 21 Aug 2024 13:23:26 +0200 Subject: [PATCH 19/59] Added api Controller Studiensemester.php + methods getAll and getAktNext --- .../v1/organisation/Studiensemester.php | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 application/controllers/api/frontend/v1/organisation/Studiensemester.php diff --git a/application/controllers/api/frontend/v1/organisation/Studiensemester.php b/application/controllers/api/frontend/v1/organisation/Studiensemester.php new file mode 100644 index 000000000..72a449aaa --- /dev/null +++ b/application/controllers/api/frontend/v1/organisation/Studiensemester.php @@ -0,0 +1,118 @@ + self::PERM_LOGGED, + 'getAktNext' => self::PERM_LOGGED + ) + ); + // Load model StudiensemesterModel + $this->load->model('organisation/studiensemester_model', 'StudiensemesterModel'); + } + + /** + * Get all Studiensemester. + * + * @param null|string $order Sorting order for the Studiensemester, 'asc' or 'desc'. Defaults to 'asc'. + * @param null|string $start Start date of the displayed Studiensemester in the format 'YYYY-MM-DD'. + * If provided, only Studiensemester starting from this date onwards will be returned. + * eg. '2020-09-01' will start with WS2020. + */ + public function getAll() + { + $order = $this->input->get('order'); + $start = $this->input->get('start'); + + if (strcasecmp($order, 'DESC') == 0) + { + $this->StudiensemesterModel->addOrder('ende', 'DESC'); + } + else + { + $this->StudiensemesterModel->addOrder('ende', 'ASC'); + } + + if ($start) + { + $result = $this->StudiensemesterModel->loadWhere([ + 'start >= ' => $start + ]); + } + else + { + $result = $this->StudiensemesterModel->load(); + } + + if (isError($result)) { + $this->terminateWithError(getError($result), self::ERROR_TYPE_DB); + } + + $this->terminateWithSuccess((getData($result) ?: [])); + } + + /** + * @return void + */ + public function getAktNext() + { + $semester = $this->input->get('semester'); + + $result = null; + + if (!is_numeric($semester)) + { + $result = $this->StudiensemesterModel->loadWhere(array('start <=' => 'NOW()', 'ende >=' => 'NOW()')); + } + + if (!hasData($result)) + { + $this->StudiensemesterModel->addOrder('ende'); + $this->StudiensemesterModel->addLimit(1); + + $whereArray = array('ende >=' => 'NOW()'); + + if (is_numeric($semester)) + { + if ($semester % 2 == 0) + { + $ss = 'SS'; + } + else + { + $ss = 'WS'; + } + + $whereArray['SUBSTRING(studiensemester_kurzbz FROM 1 FOR 2) ='] = $ss; + } + + $result = $this->StudiensemesterModel->loadWhere($whereArray); + } + + if (isError($result)) { + $this->terminateWithError(getError($result), self::ERROR_TYPE_DB); + } + + $this->terminateWithSuccess((getData($result) ?: '')); + } +} From 6168a6b806bef926ab69c93456d51ea37e9d764f Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 21 Aug 2024 13:26:20 +0200 Subject: [PATCH 20/59] Added Controller LvTemplateUebersicht.php --- .../lehre/lvplanung/LvTemplateUebersicht.php | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 application/controllers/lehre/lvplanung/LvTemplateUebersicht.php diff --git a/application/controllers/lehre/lvplanung/LvTemplateUebersicht.php b/application/controllers/lehre/lvplanung/LvTemplateUebersicht.php new file mode 100644 index 000000000..eb01d90c8 --- /dev/null +++ b/application/controllers/lehre/lvplanung/LvTemplateUebersicht.php @@ -0,0 +1,45 @@ + 'basis/vilesci:rw', + ) + ); + + // Load libraries + $this->load->library('AuthLib'); + + + // Load language phrases + $this->loadPhrases( + array( + 'global', + 'lehre' + ) + ); + + $this->_setAuthUID(); + } + + public function index() + { + $this->load->view('lehre/lvplanung/lvTemplateUebersicht.php'); + } + + + /** + * Retrieve the UID of the logged user and checks if it is valid + */ + private function _setAuthUID() + { + $this->_uid = getAuthUID(); + + if (!$this->_uid) show_error('User authentification failed'); + } +} \ No newline at end of file From eb308b78ef4691186f452172ac50a3c46ed6a95f Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 21 Aug 2024 13:28:56 +0200 Subject: [PATCH 21/59] Added App LvTemplates.js --- public/js/apps/lehre/lvplanung/LvTemplates.js | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 public/js/apps/lehre/lvplanung/LvTemplates.js diff --git a/public/js/apps/lehre/lvplanung/LvTemplates.js b/public/js/apps/lehre/lvplanung/LvTemplates.js new file mode 100644 index 000000000..b6ad3ae81 --- /dev/null +++ b/public/js/apps/lehre/lvplanung/LvTemplates.js @@ -0,0 +1,37 @@ +/** + * Copyright (C) 2023 fhcomplete.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import LvTemplateUebersicht from '../../../lehre/lvplanung/LvTemplateUebersicht.js'; +import {CoreNavigationCmpt} from '../../../components/navigation/Navigation.js'; +import FhcAlert from '../../../plugin/FhcAlert.js'; +import FhcApi from "../../../plugin/FhcApi.js"; +import Phrasen from "../../../plugin/Phrasen.js"; + + +const lvTemplatesApp = Vue.createApp({ + components: { + CoreNavigationCmpt, + LvTemplateUebersicht + } +}); + +lvTemplatesApp + .use(primevue.config.default,{zIndex: {overlay: 9999}}) + .use(FhcAlert) + .use(FhcApi) + .use(Phrasen) + .mount('#main') \ No newline at end of file From fc8c748bc4b0ba3bcfa18bb2d293534d58a4a27a Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 21 Aug 2024 13:32:14 +0200 Subject: [PATCH 22/59] Added View LvTemplateUebersicht.php --- .../lehre/lvplanung/lvTemplateUebersicht.php | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 application/views/lehre/lvplanung/lvTemplateUebersicht.php diff --git a/application/views/lehre/lvplanung/lvTemplateUebersicht.php b/application/views/lehre/lvplanung/lvTemplateUebersicht.php new file mode 100644 index 000000000..54afad0a5 --- /dev/null +++ b/application/views/lehre/lvplanung/lvTemplateUebersicht.php @@ -0,0 +1,26 @@ + 'LV Template Übersicht', + 'vue3' => true, + 'axios027' => true, + 'bootstrap5' => true, + 'tabulator5' => true, + 'fontawesome6' => true, + 'primevue3' => true, + 'navigationcomponent' => true, + 'filtercomponent' => true, + 'customJSModules' => array('public/js/apps/lehre/lvplanung/LvTemplates.js'), + 'customCSSs' => array('public/css/Fhc.css') +); + +$this->load->view('templates/FHC-Header', $includesArray); +?> + +
+ + + + +
+ +load->view('templates/FHC-Footer', $includesArray); ?> From e5e4bb2ea17fc0dda390595e285541efe03998dc Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 21 Aug 2024 13:32:37 +0200 Subject: [PATCH 23/59] Added Component LvTemplateUebersicht.js --- .../lehre/lvplanung/LvTemplateUebersicht.js | 267 ++++++++++++++++++ 1 file changed, 267 insertions(+) create mode 100644 public/js/lehre/lvplanung/LvTemplateUebersicht.js diff --git a/public/js/lehre/lvplanung/LvTemplateUebersicht.js b/public/js/lehre/lvplanung/LvTemplateUebersicht.js new file mode 100644 index 000000000..6ffc02881 --- /dev/null +++ b/public/js/lehre/lvplanung/LvTemplateUebersicht.js @@ -0,0 +1,267 @@ +import {CoreFilterCmpt} from '../../components/filter/Filter.js'; +import CoreFormInput from "../../components/Form/Input.js"; + +// Fields used to restructure table data for dataTree +const idField = 'lehrveranstaltung_id'; +const parentIdField = 'lehrveranstaltung_template_id'; +const STUDIENSEMESTER_DROPDOWN_STARTDATE = '2011-01-01'; + +export default { + components: { + CoreFilterCmpt, + CoreFormInput + }, + data: function() { + return { + table: null, + studiensemester: [], + selectedStudiensemester: '', + cbDataTreeStartExpanded: false, // checkbox expand dataTree or not + cbGroupStartOpen: true, // checkbox group organisationseinheit start open + } + }, + watch: { + cbGroupStartOpen(newVal){ + this.table.setGroupStartOpen(newVal); + this.table.setData(); + } + }, + computed: { + tabulatorOptions() { + const self = this; + return { + // NOTE: data is set on table built to await preselected actual Studiensemester + ajaxResponse(url, params, response) { + return self.prepDataTreeData(response.data) // Prepare data for dataTree view + }, + layout: 'fitColumns', + autoResize: false, // prevent auto resizing of table + resizableColumnFit: true, //maintain the fit of columns when resizing + index: 'lehrveranstaltung_id', + selectable: true, + selectableRangeMode: 'click', + dataTree: true, + dataTreeStartExpanded: self.cbDataTreeStartExpanded, + dataTreeChildIndent: 15, //indent child rows by 15 px + groupBy: ["lv_oe_bezeichnung"], + groupToggleElement:"header", //toggle group on click anywhere in the group header + groupStartOpen: self.cbGroupStartOpen, + persistence:{ + filter: false, //persist filter sorting + }, + columns: [ + {title: 'LV-ID', field: 'lehrveranstaltung_id', headerFilter: true, visible: false}, + {title: 'LV Kurzbz', field: 'kurzbz', headerFilter: true, visible:false, width: 70}, + {title: 'STG Kurzbz', field: 'stg_typ_kurzbz', headerFilter: true, visible:true, width: 80}, + {title: 'Lehrtyp Kurzbz', field: 'lehrtyp_kurzbz', headerFilter: true, visible:false, width: 70}, + {title: 'Studiengangtyp', field: 'stg_typ_bezeichnung', headerFilter: true, width: 250}, + {title: 'OrgForm', field: 'orgform_kurzbz', headerFilter: true, width: 70}, + {title: 'Semester', field: 'semester', headerFilter: true, width: 50}, + {title: 'Lehrveranstaltung', field: 'lv_bezeichnung', headerFilter: true, minWidth: 250}, + {title: 'Lehrveranstaltung ENG', field: 'bezeichnung_english', headerFilter: true, minWidth: 250}, + {title: 'ECTS', field: 'ects', headerFilter: true, width: 50, hozAlign: 'right'}, + {title: 'Lehrform', field: 'lehrform_kurzbz', headerFilter: true, width: 50}, + {title: 'Sprache', field: 'sprache', headerFilter: true, width: 100}, + {title: 'Aktiv', field: 'aktiv', width: 50, + formatter:"tickCross", + headerFilter:"tickCross", + headerFilterParams:{"tristate": true}, + hozAlign:"center", + formatterParams: { + tickElement: '', + crossElement: '' + } + }, + {title: 'Studienplan', field: 'studienplan_bezeichnung', headerFilter: true, visible:true, width: 220}, + {title: 'LE-Gruppen', field: 'lehreinheitgruppen_bezeichnung', headerFilter: true, width: 200}, + {title: 'OE Kurzbz', field: 'lv_oe_kurzbz', headerFilter: true, visible:false, minWidth: 80}, + { + title: this.$p.t('global/aktionen'), + field: 'actions', + width: 140, + formatter: (cell, formatterParams, onRendered) => { + let container = document.createElement('div'); + container.className = "d-flex gap-2"; + + let button = document.createElement('button'); + button.className = 'btn btn-outline-secondary'; + button.innerHTML = ' ' + this.$p.t('global/verwalten'); + button.addEventListener('click', (event) => this.openAdminLvTemplate(event, cell.getRow())); + container.append(button); + + return container; + }, + frozen: true + } + ] + } + }, + urlToAdminAllTemplates() { + return FHC_JS_DATA_STORAGE_OBJECT.app_root + + 'vilesci/lehre/lehrveranstaltung.php?stg_kz=99999&semester=-1&orgform=-1'; + } + }, + methods: { + async loadAndSetStudiensemester(){ + const result = await this.$fhcApi + .get('api/frontend/v1/organisation/Studiensemester/getAll', {start: STUDIENSEMESTER_DROPDOWN_STARTDATE}) + .then(result => this.studiensemester = result.data ) + .then(() => this.$fhcApi.get('api/frontend/v1/organisation/Studiensemester/getAktNext') ) // Get actual Studiensemester + .then(result => this.selectedStudiensemester = result.data[0].studiensemester_kurzbz ) // Preselect Studiensemester + .catch(error => this.$fhcAlert.handleSystemError(error) ); + }, + async onTableBuilt(){ + + this.table = this.$refs.lvTemplateUebersichtTable.tabulator; + + // Await Studiensemester + await this.loadAndSetStudiensemester(); + + // Set table data + // TODO change with brandnew FHCAPI getUrl after merge master + this.table.setData(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + + '/api/frontend/v1/education/Lehrveranstaltung/getTemplateLvTree' + + '?studiensemester_kurzbz=' + this.selectedStudiensemester + ); + + // Await phrases categories + await this.$p.loadCategory(['lehre']); + + // Replace column titles with phrasen + this.table.updateColumnDefinition('lv_bezeichnung', {title: this.$p.t('lehre', 'lehrveranstaltung')}); + + }, + onChangeStudiensemester(){ + // Reset table data + // TODO change with brandnew FHCAPI getUrl after merge master + // ...danach im SWB auch die core rest clients raus bzw. ggf änderung requests auf api/frontend/... wie hier und core rest client ggf raus. + this.table.setData(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + + '/api/frontend/v1/education/Lehrveranstaltung/getTemplateLvTree' + + '?studiensemester_kurzbz=' + this.selectedStudiensemester + ); + }, + openAdminLvTemplate(event, row){ + const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + + 'vilesci/lehre/lehrveranstaltung.php?stg_kz=&semester=-1&orgform=-1&lehrveranstaltung_id=' + row.getData().lehrveranstaltung_id; + + window.open(url, '_blank').focus(); + }, + prepDataTreeData(data){ + let toDelete = []; + + // loop through all data + for (let childIdx = 0; childIdx < data.length; childIdx++) + { + let child = data[childIdx]; + + // if it has parent id, it is a child + if (child[parentIdField]) + { + // append the child on the right place. If parent found, mark original sw child on 0 level for deleting + if (this._appendChild(data, child)) toDelete.push(childIdx); + } + } + + // delete the marked children from 0 level + for (let counter = 0; counter < toDelete.length; counter++) + { + // decrease index by counter as index of data array changes after every deletion + data.splice(toDelete[counter] - counter, 1); + } + + return data; + }, + _appendChild(data, child) { + // get parent id + let parentId = child[parentIdField]; + + // loop thorugh all data + for (let parentIdx = 0; parentIdx < data.length; parentIdx++) + { + let parent = data[parentIdx]; + + // if it's the parent + if (parent[idField] == parentId) + { + // create children array if not done yet + if (!parent._children) parent._children = []; + + // if child is not included in children array, append the child + if (!parent._children.includes(child)) parent._children.push(child); + + // parent found + return true; + } + // search children for parents + else if (parent._children) this._appendChild(parent._children, child); + } + + // parent not found + return false; + }, + reloadTabulator() { + if (this.table !== null && this.table !== undefined) + { + for (let option in this.tabulatorOptions) + { + if (this.table.options.hasOwnProperty(option)) + this.table.options[option] = this.tabulatorOptions[option]; + } + this.$refs.lvTemplateUebersichtTable.reloadTable(); + } + }, + }, + template: ` +
+
+
{{ $p.t('lehre/lvTemplatesUebersicht') }}
+
+ + + +
+
+
+
+ + + +
+
+ +
+` +}; From 7fb7263424d5ed7a40c337f58b30f6c7ed16cf6a Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 21 Aug 2024 13:34:11 +0200 Subject: [PATCH 24/59] Added phrases for LV Templates Overview --- system/phrasesupdate.php | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 2390b2261..8a9c72831 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -27322,6 +27322,66 @@ array( ) ) ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'verwalten', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Verwalten", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Administrate", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'lvTemplatesVerwalten', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "LV Templates verwalten", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Administrate Course Templates", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'lvTemplatesUebersicht', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "LV Templates Übersicht", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Course Templates Overview", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), ); From f2be396e7aa7518f384c74ec80d0678525bd6953 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 21 Aug 2024 13:53:49 +0200 Subject: [PATCH 25/59] Adapted to use new fhcApi.getUri method --- public/js/lehre/lvplanung/LvTemplateUebersicht.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/public/js/lehre/lvplanung/LvTemplateUebersicht.js b/public/js/lehre/lvplanung/LvTemplateUebersicht.js index 6ffc02881..9724fd42a 100644 --- a/public/js/lehre/lvplanung/LvTemplateUebersicht.js +++ b/public/js/lehre/lvplanung/LvTemplateUebersicht.js @@ -118,8 +118,8 @@ export default { await this.loadAndSetStudiensemester(); // Set table data - // TODO change with brandnew FHCAPI getUrl after merge master - this.table.setData(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + + this.table.setData( + this.$fhcApi.getUri() + '/api/frontend/v1/education/Lehrveranstaltung/getTemplateLvTree' + '?studiensemester_kurzbz=' + this.selectedStudiensemester ); @@ -133,16 +133,16 @@ export default { }, onChangeStudiensemester(){ // Reset table data - // TODO change with brandnew FHCAPI getUrl after merge master - // ...danach im SWB auch die core rest clients raus bzw. ggf änderung requests auf api/frontend/... wie hier und core rest client ggf raus. - this.table.setData(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + + this.table.setData( + this.$fhcApi.getUri() + '/api/frontend/v1/education/Lehrveranstaltung/getTemplateLvTree' + '?studiensemester_kurzbz=' + this.selectedStudiensemester ); }, openAdminLvTemplate(event, row){ const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + - 'vilesci/lehre/lehrveranstaltung.php?stg_kz=&semester=-1&orgform=-1&lehrveranstaltung_id=' + row.getData().lehrveranstaltung_id; + 'vilesci/lehre/lehrveranstaltung.php?stg_kz=&semester=-1&orgform=-1&lehrveranstaltung_id=' + + row.getData().lehrveranstaltung_id; window.open(url, '_blank').focus(); }, From d03678e3dc4d864a6743d0462d9051936b49b09d Mon Sep 17 00:00:00 2001 From: Johann Hoffmann Date: Tue, 27 Aug 2024 15:30:17 +0200 Subject: [PATCH 26/59] WIP --- .../Studierendenantrag/Leitung/Table.js | 3 --- system/phrasesupdate.php | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/public/js/components/Studierendenantrag/Leitung/Table.js b/public/js/components/Studierendenantrag/Leitung/Table.js index 0f8b22540..8201462b4 100644 --- a/public/js/components/Studierendenantrag/Leitung/Table.js +++ b/public/js/components/Studierendenantrag/Leitung/Table.js @@ -230,9 +230,6 @@ export default { return val ? link : ' '; } - }, { - field: 'unruly', - title: this.$p.t('studierendenantrag', 'antrag_unruly') }, { field: 'dms_id', title: this.$p.t('studierendenantrag', 'antrag_dateianhaenge'), diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index d4a3777b1..dce318771 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -2281,6 +2281,26 @@ $phrases = array( ) ) ), + array( + 'app' => 'core', + 'category' => 'person', + 'phrase' => 'unruly', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Unerwünscht', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Unruly', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), //**************** CORE/lehre array( From 6076d59c4b35d683e75d61080e5b0ff6f4c7fb44 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 4 Sep 2024 10:59:25 +0200 Subject: [PATCH 27/59] Removed Group by Organisationseinheit Instead added Organisationseinheit as column for filtering reasons. Column is invisible by default. --- .../lehre/lvplanung/LvTemplateUebersicht.js | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/public/js/lehre/lvplanung/LvTemplateUebersicht.js b/public/js/lehre/lvplanung/LvTemplateUebersicht.js index 9724fd42a..13efeb0e3 100644 --- a/public/js/lehre/lvplanung/LvTemplateUebersicht.js +++ b/public/js/lehre/lvplanung/LvTemplateUebersicht.js @@ -16,14 +16,7 @@ export default { table: null, studiensemester: [], selectedStudiensemester: '', - cbDataTreeStartExpanded: false, // checkbox expand dataTree or not - cbGroupStartOpen: true, // checkbox group organisationseinheit start open - } - }, - watch: { - cbGroupStartOpen(newVal){ - this.table.setGroupStartOpen(newVal); - this.table.setData(); + cbDataTreeStartExpanded: false // checkbox expand dataTree or not } }, computed: { @@ -43,9 +36,6 @@ export default { dataTree: true, dataTreeStartExpanded: self.cbDataTreeStartExpanded, dataTreeChildIndent: 15, //indent child rows by 15 px - groupBy: ["lv_oe_bezeichnung"], - groupToggleElement:"header", //toggle group on click anywhere in the group header - groupStartOpen: self.cbGroupStartOpen, persistence:{ filter: false, //persist filter sorting }, @@ -53,8 +43,9 @@ export default { {title: 'LV-ID', field: 'lehrveranstaltung_id', headerFilter: true, visible: false}, {title: 'LV Kurzbz', field: 'kurzbz', headerFilter: true, visible:false, width: 70}, {title: 'STG Kurzbz', field: 'stg_typ_kurzbz', headerFilter: true, visible:true, width: 80}, + {title: 'OrgEinheit', field: 'lv_oe_bezeichnung', headerFilter: true, visible: false, width: 250}, {title: 'Lehrtyp Kurzbz', field: 'lehrtyp_kurzbz', headerFilter: true, visible:false, width: 70}, - {title: 'Studiengangtyp', field: 'stg_typ_bezeichnung', headerFilter: true, width: 250}, + {title: 'Studiengangtyp', field: 'stg_typ_bezeichnung', headerFilter: true, width: 150}, {title: 'OrgForm', field: 'orgform_kurzbz', headerFilter: true, width: 70}, {title: 'Semester', field: 'semester', headerFilter: true, width: 50}, {title: 'Lehrveranstaltung', field: 'lv_bezeichnung', headerFilter: true, minWidth: 250}, @@ -241,13 +232,6 @@ export default { :tabulator-events="[{event: 'tableBuilt', handler: onTableBuilt}]"> ` -} +} \ No newline at end of file diff --git a/public/js/components/Studierendenantrag/Form/AbmeldungStgl.js b/public/js/components/Studierendenantrag/Form/AbmeldungStgl.js index f7daa8d23..16cf187b4 100644 --- a/public/js/components/Studierendenantrag/Form/AbmeldungStgl.js +++ b/public/js/components/Studierendenantrag/Form/AbmeldungStgl.js @@ -108,14 +108,6 @@ export default { this.formData.grund = event.target.value ? this.$p.t('studierendenantrag', event.target.value) : ''; - }, - saveUnrulyPerson(event) { - this.$fhcApi.factory.unrulyperson.updatePersonUnrulyStatus(this.data.person_id, this.unrulyInternal).then( - (res)=> { - if(res?.meta?.status === "success") { - this.$fhcAlert.alertSuccess(this.$p.t('studierendenantrag', 'antrag_unruly_updated')) - } - }) } }, created() { @@ -182,6 +174,8 @@ export default { + @@ -197,11 +191,6 @@ export default { -
- - -
-
'; + } + } + ] + }, + bismeldestichtagTabulatorEventHandlers: [ + { + event: "rowClick", + handler: function(e, row) { + if (e.target.nodeName == 'DIV') { + let data = row.getData(); + alert(data.studiensemester_kurzbz + ': ' + BismeldestichtagHelper.formatDate(data.meldestichtag)); + } + } + }, + { + event: "tableBuilt", + handler: () => { + this.handlerStudiensemester(); + } + } + ], meldestichtag: null, // date of Meldestichtag semList: null, // all Studiensemester for dropdown currSem: null, // selected Studiensemester @@ -47,9 +98,6 @@ const bismeldestichtagApp = Vue.createApp({ CoreFetchCmpt, "datepicker": VueDatePicker }, - created() { - this.handlerStudiensemester(); - }, methods: { /** * Define Studiensemester call and method to be executed after the call diff --git a/public/js/apps/Bismeldestichtag/BismeldestichtagHelper.js b/public/js/apps/Bismeldestichtag/BismeldestichtagHelper.js new file mode 100644 index 000000000..d51dc5134 --- /dev/null +++ b/public/js/apps/Bismeldestichtag/BismeldestichtagHelper.js @@ -0,0 +1,22 @@ +/** + * Copyright (C) 2022 fhcomplete.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +export const BismeldestichtagHelper = { + formatDate: function(date) { + return date.replace(/(.*)-(.*)-(.*)/, '$3.$2.$1'); + } +} diff --git a/public/js/apps/Bismeldestichtag/TabulatorSetup.js b/public/js/apps/Bismeldestichtag/TabulatorSetup.js deleted file mode 100644 index d98cc993c..000000000 --- a/public/js/apps/Bismeldestichtag/TabulatorSetup.js +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Copyright (C) 2022 fhcomplete.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * - */ -export const BismeldestichtagTabulatorOptions = { - maxHeight: "100%", - minHeight: 50, - layout: 'fitColumns', - index: 'meldestichtag_id', - columns: [ - {title: 'Meldestichtag',field: 'meldestichtag', headerFilter: true, formatter: function(cell){ - return BismeldestichtagTabulatorHelperFunctions._formatDate(cell.getValue()); - } - }, - {title: 'Studiensemester', field: 'studiensemester_kurzbz', headerFilter: true, sorter:function(a, b, aRow, bRow, column, dir, sorterParams) { - - //aRow, bRow - the row components for the values being compared - let semesterStartA = new Date(aRow.getData().semester_start); - let semesterStartB = new Date(bRow.getData().semester_start); - - return semesterStartA - semesterStartB; // difference between studiensemester start dates - } - }, - {title: 'Semesterstart',field: 'semester_start', headerFilter: true, visible: false, formatter: function(cell){ - return BismeldestichtagTabulatorHelperFunctions._formatDate(cell.getValue()); - } - }, - {title: 'ID', field: 'meldestichtag_id', headerFilter: true, visible: false}, - {title: 'Insertamum', field: 'insertamum', headerFilter: true, visible: false}, - {title: 'Insertvon', field: 'insertvon', headerFilter: true, visible: false}, - {title: 'Löschen', field: 'loeschen', headerFilter: false, formatter:function(cell){ - return ''; - } - } - ] -}; - -/** - * - */ -export const BismeldestichtagTabulatorEventHandlers = [ - { - event: "rowClick", - handler: function(e, row) { - if (e.target.nodeName == 'DIV') { - let data = row.getData(); - alert(data.studiensemester_kurzbz + ': ' + BismeldestichtagTabulatorHelperFunctions._formatDate(data.meldestichtag)); - } - } - } -]; - -let BismeldestichtagTabulatorHelperFunctions = { - _formatDate: function(date) { - return date.replace(/(.*)-(.*)-(.*)/, '$3.$2.$1'); - } -} From 3b20f5e45cce2d8aa989b767123fd6097434d113 Mon Sep 17 00:00:00 2001 From: Alexei Karpenko Date: Fri, 20 Sep 2024 16:12:14 +0200 Subject: [PATCH 37/59] Plausichecks: removed check BewerberNichtZumRtAngetreten --- application/libraries/issues/PlausicheckDefinitionLib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/libraries/issues/PlausicheckDefinitionLib.php b/application/libraries/issues/PlausicheckDefinitionLib.php index b44a5ce19..d8c26d43a 100644 --- a/application/libraries/issues/PlausicheckDefinitionLib.php +++ b/application/libraries/issues/PlausicheckDefinitionLib.php @@ -15,7 +15,6 @@ class PlausicheckDefinitionLib 'AktSemesterNull' => 'AktSemesterNull', 'AktiverStudentOhneStatus' => 'AktiverStudentOhneStatus', 'AusbildungssemPrestudentUngleichAusbildungssemStatus' => 'AusbildungssemPrestudentUngleichAusbildungssemStatus', - 'BewerberNichtZumRtAngetreten' => 'BewerberNichtZumRtAngetreten', 'DatumAbschlusspruefungFehlt' => 'DatumAbschlusspruefungFehlt', 'DatumSponsionFehlt' => 'DatumSponsionFehlt', 'DatumStudiensemesterFalscheReihenfolge' => 'DatumStudiensemesterFalscheReihenfolge', @@ -36,6 +35,7 @@ class PlausicheckDefinitionLib 'StudentstatusNachAbbrecher' => 'StudentstatusNachAbbrecher', 'DualesStudiumOhneMarkierung' => 'DualesStudiumOhneMarkierung' //'StudienplanUngueltig' => 'StudienplanUngueltig' + //'BewerberNichtZumRtAngetreten' => 'BewerberNichtZumRtAngetreten' ); /** From dbf59358971684c48b103adc48f4bc5197cf20f0 Mon Sep 17 00:00:00 2001 From: Johann Hoffmann Date: Thu, 3 Oct 2024 11:14:52 +0200 Subject: [PATCH 38/59] check correct grund phrase to trigger unruly api request; --- public/js/api/checkperson.js | 1 - public/js/components/Studierendenantrag/Form/AbmeldungStgl.js | 4 ++-- system/phrasesupdate.php | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/public/js/api/checkperson.js b/public/js/api/checkperson.js index 9cd85840a..7cad23c3d 100644 --- a/public/js/api/checkperson.js +++ b/public/js/api/checkperson.js @@ -15,7 +15,6 @@ export default { try { const url = base + '/api/frontend/v1/checkperson/CheckPerson/filterPerson'; return axios.post(url, payload) - // return this.$fhcApi.post(url, payload, null); } catch (error) { throw error; } diff --git a/public/js/components/Studierendenantrag/Form/AbmeldungStgl.js b/public/js/components/Studierendenantrag/Form/AbmeldungStgl.js index ca3bb9fbc..2dfd2a5e4 100644 --- a/public/js/components/Studierendenantrag/Form/AbmeldungStgl.js +++ b/public/js/components/Studierendenantrag/Form/AbmeldungStgl.js @@ -125,7 +125,7 @@ export default { }, watch: { 'formData.grund'(newVal) { - this.unrulyInternal = (newVal === this.$p.t('studierendenantrag', 'mark_person_as_unruly')) + this.unrulyInternal = (newVal === this.$p.t('studierendenantrag', 'textLong_unruly')) } }, template: ` @@ -190,7 +190,7 @@ export default { -
diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index fce61b736..8f1d2c491 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -23414,7 +23414,7 @@ array( array( 'app' => 'core', 'category' => 'studierendenantrag', - 'phrase' => 'mark_person_as_unruly', + 'phrase' => 'dropdown_unruly', 'insertvon' => 'system', 'phrases' => array( array( From a9d0f177dad639ea4dd4f8c6c3c0d9002c827358 Mon Sep 17 00:00:00 2001 From: Johann Hoffmann Date: Thu, 3 Oct 2024 13:25:02 +0200 Subject: [PATCH 39/59] remove unused unruly code; --- .../controllers/api/frontend/v1/studstatus/Abmeldung.php | 3 +-- application/controllers/lehre/Studierendenantrag.php | 4 +--- public/js/components/Studierendenantrag/Antrag.js | 4 +--- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/application/controllers/api/frontend/v1/studstatus/Abmeldung.php b/application/controllers/api/frontend/v1/studstatus/Abmeldung.php index 87fec9918..aada1f436 100644 --- a/application/controllers/api/frontend/v1/studstatus/Abmeldung.php +++ b/application/controllers/api/frontend/v1/studstatus/Abmeldung.php @@ -136,7 +136,6 @@ class Abmeldung extends FHCAPI_Controller $grund = $this->input->post('grund'); $studiensemester = $this->input->post('studiensemester'); $prestudent_id = $this->input->post('prestudent_id'); - $unruly = $this->input->post('unruly'); $result = $this->antraglib->getPrestudentAbmeldeBerechtigt($prestudent_id); $result = $this->getDataOrTerminateWithError($result); @@ -147,7 +146,7 @@ class Abmeldung extends FHCAPI_Controller elseif ($result < 0) $this->terminateWithError($this->p->t('studierendenantrag', 'error_antrag_exists'), self::ERROR_TYPE_GENERAL); - $result = $this->antraglib->createAbmeldung($prestudent_id, $studiensemester, getAuthUID(), $grund, $unruly); + $result = $this->antraglib->createAbmeldung($prestudent_id, $studiensemester, getAuthUID(), $grund); $data = $this->getDataOrTerminateWithError($result); $result = $this->antraglib->getDetailsForAntrag($data); diff --git a/application/controllers/lehre/Studierendenantrag.php b/application/controllers/lehre/Studierendenantrag.php index 3baf30355..107c9af96 100644 --- a/application/controllers/lehre/Studierendenantrag.php +++ b/application/controllers/lehre/Studierendenantrag.php @@ -103,13 +103,11 @@ class Studierendenantrag extends FHC_Controller public function abmeldungstgl($prestudent_id, $studierendenantrag_id = null) { - $unruly = getData($this->PersonModel->loadPrestudent($prestudent_id))[0]->unruly; $this->load->view('lehre/Antrag/Create', [ 'prestudent_id' => $prestudent_id, 'studierendenantrag_id' => $studierendenantrag_id, - 'antrag_type' => 'AbmeldungStgl', - 'unruly' => $unruly + 'antrag_type' => 'AbmeldungStgl' ]); } diff --git a/public/js/components/Studierendenantrag/Antrag.js b/public/js/components/Studierendenantrag/Antrag.js index 37de9314d..b04801075 100644 --- a/public/js/components/Studierendenantrag/Antrag.js +++ b/public/js/components/Studierendenantrag/Antrag.js @@ -21,8 +21,7 @@ export default { studierendenantragId: Number, infoArray: Array, statusMsg: String, - statusSeverity: String, - unruly: Boolean + statusSeverity: String }, data() { return { @@ -50,7 +49,6 @@ export default { v-model:status="status" :prestudent-id="prestudentId" :studierendenantrag-id="studierendenantragId" - :unruly="unruly" @setInfos="$emit('update:infoArray', $event)" @setStatus="$emit('update:statusMsg', $event.msg);$emit('update:statusSeverity', $event.severity)" > From 772fe616ff88597dbd6d206a31ff0722c73b2496 Mon Sep 17 00:00:00 2001 From: Johann Hoffmann Date: Thu, 3 Oct 2024 13:27:05 +0200 Subject: [PATCH 40/59] remove unused unruly code nr2; --- application/views/lehre/Antrag/Create.php | 1 - .../js/components/Studierendenantrag/Form/AbmeldungStgl.js | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/application/views/lehre/Antrag/Create.php b/application/views/lehre/Antrag/Create.php index f4a7d1c3c..7e8bda874 100644 --- a/application/views/lehre/Antrag/Create.php +++ b/application/views/lehre/Antrag/Create.php @@ -35,7 +35,6 @@ $this->load->view( :prestudent-id="" antrag-type="" :studierendenantrag-id="" - :unruly="" v-model:info-array="infoArray" v-model:status-msg="status.msg" v-model:status-severity="status.severity" diff --git a/public/js/components/Studierendenantrag/Form/AbmeldungStgl.js b/public/js/components/Studierendenantrag/Form/AbmeldungStgl.js index 2dfd2a5e4..c804b20d1 100644 --- a/public/js/components/Studierendenantrag/Form/AbmeldungStgl.js +++ b/public/js/components/Studierendenantrag/Form/AbmeldungStgl.js @@ -18,8 +18,7 @@ export default { ], props: { prestudentId: Number, - studierendenantragId: Number, - unruly: Boolean + studierendenantragId: Number }, data() { return { @@ -28,7 +27,7 @@ export default { formData: { grund: '' }, - unrulyInternal: this.unruly + unrulyInternal: false } }, computed: { From 455d154b6317808531270d893e5cf52b6daa3c8e Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 8 Oct 2024 16:19:57 +0200 Subject: [PATCH 41/59] =?UTF-8?q?recht=20lehre/lehrveranstaltung=20statt?= =?UTF-8?q?=20basis/vilesci,=20schriftgr=C3=B6=C3=9Fe=20verkleinern,=20men?= =?UTF-8?q?uepunkt=20in=20vilesci,=20headerfilter=20angepasst?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lehre/lvplanung/LvTemplateUebersicht.php | 2 +- .../lehre/lvplanung/lvTemplateUebersicht.php | 5 ++- include/tw/vilesci_menu_main.inc.php | 1 + public/css/lvTemplateUebersicht.css | 3 ++ .../lehre/lvplanung/LvTemplateUebersicht.js | 45 +++++++++++++++++-- 5 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 public/css/lvTemplateUebersicht.css diff --git a/application/controllers/lehre/lvplanung/LvTemplateUebersicht.php b/application/controllers/lehre/lvplanung/LvTemplateUebersicht.php index eb01d90c8..b1ab2fe26 100644 --- a/application/controllers/lehre/lvplanung/LvTemplateUebersicht.php +++ b/application/controllers/lehre/lvplanung/LvTemplateUebersicht.php @@ -8,7 +8,7 @@ class LvTemplateUebersicht extends Auth_Controller // Set required permissions parent::__construct( array( - 'index' => 'basis/vilesci:rw', + 'index' => 'lehre/lehrveranstaltung:rw', ) ); diff --git a/application/views/lehre/lvplanung/lvTemplateUebersicht.php b/application/views/lehre/lvplanung/lvTemplateUebersicht.php index 54afad0a5..5c873486c 100644 --- a/application/views/lehre/lvplanung/lvTemplateUebersicht.php +++ b/application/views/lehre/lvplanung/lvTemplateUebersicht.php @@ -10,7 +10,10 @@ $includesArray = array( 'navigationcomponent' => true, 'filtercomponent' => true, 'customJSModules' => array('public/js/apps/lehre/lvplanung/LvTemplates.js'), - 'customCSSs' => array('public/css/Fhc.css') + 'customCSSs' => array( + 'public/css/Fhc.css', + 'public/css/lvTemplateUebersicht.css' + ) ); $this->load->view('templates/FHC-Header', $includesArray); diff --git a/include/tw/vilesci_menu_main.inc.php b/include/tw/vilesci_menu_main.inc.php index 2aa2e67d3..2a1ca74ae 100644 --- a/include/tw/vilesci_menu_main.inc.php +++ b/include/tw/vilesci_menu_main.inc.php @@ -70,6 +70,7 @@ $menu=array 'link'=>'left.php?categorie=Lehre', 'target'=>'nav', 'Gruppenverwaltung'=>array('name'=>'Gruppen', 'permissions'=>array('admin','lv-plan','support','lehre/gruppe'), 'link'=>'stammdaten/lvbgruppenverwaltung.php', 'target'=>'main'), 'Lehrveranstaltung'=>array('name'=>'Lehrveranstaltung', 'link'=>'lehre/lehrveranstaltung_frameset.html', 'target'=>'main'), + 'lvTemplateUebersicht'=>array('name'=>'LV-Template Übersicht', 'link'=>'../index.ci.php/lehre/lvplanung/LvTemplateUebersicht', 'target'=>'_blank'), 'Studienordnung'=>array('name'=>'Studienordnung', 'link'=>'lehre/studienordnung.php', 'target'=>'_blank','permissions'=>array('lehre/studienordnung')), 'StudienplanGueltigkeit'=>array('name'=>'Studienplan Gültigkeit', 'link'=>'lehre/studienplan_gueltigkeit.php', 'target'=>'main','permissions'=>array('lehre/studienordnung')), 'StudienplanVorruecken'=>array('name'=>'Studienplan vorrücken', 'link'=>'lehre/studienplan_vorrueckung.php', 'target'=>'main','permissions'=>array('lehre/studienplan')), diff --git a/public/css/lvTemplateUebersicht.css b/public/css/lvTemplateUebersicht.css new file mode 100644 index 000000000..af279b8cb --- /dev/null +++ b/public/css/lvTemplateUebersicht.css @@ -0,0 +1,3 @@ +html { + font-size: .75em; +} \ No newline at end of file diff --git a/public/js/lehre/lvplanung/LvTemplateUebersicht.js b/public/js/lehre/lvplanung/LvTemplateUebersicht.js index 414434904..be0da75b8 100644 --- a/public/js/lehre/lvplanung/LvTemplateUebersicht.js +++ b/public/js/lehre/lvplanung/LvTemplateUebersicht.js @@ -21,6 +21,45 @@ export default { }, computed: { tabulatorOptions() { + const fhcValuesLookup = function(cell) { + var values = {}; + const field = cell.getField(); + const data = cell.getTable().getData(); + const collectvalues = function(rows, field) { + var values = {}; + var childvalues = {}; + for(const row of rows) { + const rowvalue = (row[field] !== null) ? row[field] : ''; + values[rowvalue] = rowvalue; + if(row['_children'] && row['_children'].length > 0) { + childvalues = collectvalues(row['_children'], field); + values = {...values, ...childvalues} + } + } + return values; + } + values = collectvalues(data, field); + const vals = Object.keys(values).sort(); + if(vals.indexOf('') === -1) { + vals.unshift(''); + } + return vals; + }; + const fhctreefilter = function(headerValue, rowValue, rowData, filterParams){ + if (rowData['_children'] && rowData['_children'].length > 0) { + for (var i in rowData['_children']) { + return rowValue == headerValue || + fhctreefilter( + headerValue, + rowData['_children'][i][filterParams.field], + rowData['_children'][i], + filterParams + ); + } + } + + return rowValue == headerValue; + }; const self = this; return { // NOTE: data is set on table built to await preselected actual Studiensemester @@ -42,11 +81,11 @@ export default { columns: [ {title: 'LV-ID', field: 'lehrveranstaltung_id', headerFilter: true, visible: false}, {title: 'LV Kurzbz', field: 'kurzbz', headerFilter: true, visible:false, width: 70}, - {title: 'STG Kurzbz', field: 'stg_typ_kurzbz', headerFilter: true, visible:true, width: 80}, + {title: 'STG Kurzbz', field: 'stg_typ_kurzbz', headerFilter: "list", headerFilterParams: {valuesLookup: fhcValuesLookup}, headerFilterFunc: fhctreefilter, headerFilterFuncParams: {field: 'stg_typ_kurzbz'}, visible:true, width: 80}, {title: 'OrgEinheit', field: 'lv_oe_bezeichnung', headerFilter: true, visible: false, width: 250}, {title: 'Lehrtyp Kurzbz', field: 'lehrtyp_kurzbz', headerFilter: true, visible:false, width: 70}, - {title: 'Studiengangtyp', field: 'stg_typ_bezeichnung', headerFilter: true, width: 150}, - {title: 'OrgForm', field: 'orgform_kurzbz', headerFilter: true, width: 70}, + {title: 'Studiengangtyp', field: 'stg_typ_bezeichnung', headerFilter: "list", headerFilterParams: {valuesLookup: fhcValuesLookup}, headerFilterFunc: fhctreefilter, headerFilterFuncParams: {field: 'stg_typ_bezeichnung'}, width: 150}, + {title: 'OrgForm', field: 'orgform_kurzbz', headerFilter: "list", headerFilterParams: {valuesLookup: fhcValuesLookup}, headerFilterFunc: fhctreefilter, headerFilterFuncParams: {field: 'orgform_kurzbz'}, width: 70}, {title: 'Semester', field: 'semester', headerFilter: true, width: 50}, {title: 'Lehrveranstaltung', field: 'lv_bezeichnung', headerFilter: true, minWidth: 250}, {title: 'Lehrveranstaltung ENG', field: 'bezeichnung_english', headerFilter: true, minWidth: 250}, From 3c4b4b6a5886607e23fbbbddd06c1271a75a09d4 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 8 Oct 2024 16:38:16 +0200 Subject: [PATCH 42/59] recht lehre/lehrveranstaltung auch am api endpunkt --- .../api/frontend/v1/education/Lehrveranstaltung.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/controllers/api/frontend/v1/education/Lehrveranstaltung.php b/application/controllers/api/frontend/v1/education/Lehrveranstaltung.php index 20e36f461..636c8e3f3 100644 --- a/application/controllers/api/frontend/v1/education/Lehrveranstaltung.php +++ b/application/controllers/api/frontend/v1/education/Lehrveranstaltung.php @@ -22,7 +22,9 @@ class Lehrveranstaltung extends FHCAPI_Controller public function __construct() { parent::__construct(array( - 'getTemplateLvTree' => self::PERM_LOGGED + 'getTemplateLvTree' => array( + 'lehre/lehrveranstaltung:rw' + ) )); // Load model LehrveranstaltungModel From b3258e017c04249d651639646fed7dd7c8f6deff Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Wed, 9 Oct 2024 13:14:54 +0200 Subject: [PATCH 43/59] add column path_kurzbz to view vw_oe_path --- system/dbupdate_3.4/41150_oe-pfad_db_view.php | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/system/dbupdate_3.4/41150_oe-pfad_db_view.php b/system/dbupdate_3.4/41150_oe-pfad_db_view.php index c108fcd77..65686dbcb 100644 --- a/system/dbupdate_3.4/41150_oe-pfad_db_view.php +++ b/system/dbupdate_3.4/41150_oe-pfad_db_view.php @@ -1,15 +1,11 @@ db_query("SELECT * FROM information_schema.views WHERE table_catalog = '" . DB_NAME . "' AND table_schema = 'public' AND table_name = 'vw_oe_path'")) -{ - if($db->db_num_rows($result) == 0) - { - $qry = " +$qry = " CREATE OR REPLACE VIEW public.vw_oe_path AS - WITH RECURSIVE vw_oe_path(oe_kurzbz, bezeichnung, oe_parent_kurzbz, organisationseinheittyp_kurzbz, oetyp_bezeichnung, depth, path) AS ( + WITH RECURSIVE vw_oe_path(oe_kurzbz, bezeichnung, oe_parent_kurzbz, organisationseinheittyp_kurzbz, oetyp_bezeichnung, depth, path, path_kurzbz) AS ( SELECT - oe.oe_kurzbz, oe.bezeichnung, oe.oe_parent_kurzbz, oe.organisationseinheittyp_kurzbz, oetyp.bezeichnung AS oetyp_bezeichnung, 0, '/' || oetyp.bezeichnung || ' ' || oe.bezeichnung AS path + oe.oe_kurzbz, oe.bezeichnung, oe.oe_parent_kurzbz, oe.organisationseinheittyp_kurzbz, oetyp.bezeichnung AS oetyp_bezeichnung, 0, '/' || oetyp.bezeichnung || ' ' || oe.bezeichnung AS path, '/' || oe.oe_kurzbz AS path_kurzbz FROM public.tbl_organisationseinheit oe JOIN @@ -18,7 +14,7 @@ if ($result = $db->db_query("SELECT * FROM information_schema.views WHERE table_ oe.oe_parent_kurzbz IS NULL UNION ALL SELECT - oe.oe_kurzbz, oe.bezeichnung, oe.oe_parent_kurzbz, oe.organisationseinheittyp_kurzbz, oetyp.bezeichnung AS oetyp_bezeichnung, depth + 1, oet.path || '/' || oetyp.bezeichnung || ' ' || oe.bezeichnung + oe.oe_kurzbz, oe.bezeichnung, oe.oe_parent_kurzbz, oe.organisationseinheittyp_kurzbz, oetyp.bezeichnung AS oetyp_bezeichnung, depth + 1, oet.path || '/' || oetyp.bezeichnung || ' ' || oe.bezeichnung, oet.path_kurzbz || '/' || oe.oe_kurzbz AS path_kurzbz FROM public.tbl_organisationseinheit oe, vw_oe_path oet JOIN @@ -29,11 +25,27 @@ if ($result = $db->db_query("SELECT * FROM information_schema.views WHERE table_ SELECT * FROM vw_oe_path ORDER BY path, depth; GRANT SELECT ON public.vw_oe_path TO vilesci; - "; - +"; + + +if ($result = $db->db_query("SELECT * FROM information_schema.views WHERE table_catalog = '" . DB_NAME . "' AND table_schema = 'public' AND table_name = 'vw_oe_path'")) +{ + if($db->db_num_rows($result) == 0) + { if (!$db->db_query($qry)) echo 'public.vw_oe_path: ' . $db->db_last_error() . '
'; else echo 'public.vw_oe_path: erstellt
'; } } + +if ($result = $db->db_query("SELECT * FROM information_schema.columns WHERE table_catalog = '" . DB_NAME . "' AND table_schema = 'public' AND table_name = 'vw_oe_path' AND column_name = 'path_kurzbz'")) +{ + if($db->db_num_rows($result) == 0) + { + if (!$db->db_query($qry)) + echo 'public.vw_oe_path: ' . $db->db_last_error() . '
'; + else + echo 'public.vw_oe_path: neu erstellt mit zusätzlicher spalte path_kurzbz
'; + } +} From 9ca59f792882ae704a3acaf61f98924c42736bca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Wed, 9 Oct 2024 15:22:41 +0200 Subject: [PATCH 44/59] =?UTF-8?q?Paragraph=20Verweis=20korrigiert=20f?= =?UTF-8?q?=C3=BCr=20Master=20Plagiatspr=C3=BCfung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/phrasesupdate.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 16631efa8..7ef0269c9 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -9987,13 +9987,13 @@ Any unusual occurrences 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'Der Plagiatscheck wurde durchgeführt und bestätigt, dass der zentrale Inhalt der Arbeit im erforderlichen Ausmaß eigenständig verfasst wurde (vgl. Satzungsteil Studienrechtliche Bestimmungen / Prüfungsordnung, § 18 Abs. 2 und 3).', + 'text' => 'Der Plagiatscheck wurde durchgeführt und bestätigt, dass der zentrale Inhalt der Arbeit im erforderlichen Ausmaß eigenständig verfasst wurde (vgl. Satzungsteil Studienrechtliche Bestimmungen / Prüfungsordnung, § 20 Abs. 2 und 3).', 'description' => '', 'insertvon' => 'system' ), array( 'sprache' => 'English', - 'text' => 'The plagiarism check has been carried out and confirms that the central content of the thesis has been written independently to the required extent (cf. part of the Statutes on Studies Act Provisions / Examination Regulations, § 18 Para. 2 and 3).', + 'text' => 'The plagiarism check has been carried out and confirms that the central content of the thesis has been written independently to the required extent (cf. part of the Statutes on Studies Act Provisions / Examination Regulations, § 20 Para. 2 and 3).', 'description' => '', 'insertvon' => 'system' ) From 469867e98c80451f884404f260c7e0d5ac729cde Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Thu, 10 Oct 2024 12:37:57 +0200 Subject: [PATCH 45/59] Studstatus: status "EmailVersandt" is not an active status --- application/models/education/Studierendenantrag_model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/models/education/Studierendenantrag_model.php b/application/models/education/Studierendenantrag_model.php index e138d1a1c..7595d8036 100644 --- a/application/models/education/Studierendenantrag_model.php +++ b/application/models/education/Studierendenantrag_model.php @@ -96,7 +96,8 @@ class Studierendenantrag_model extends DB_Model Studierendenantragstatus_model::STATUS_REJECTED, Studierendenantragstatus_model::STATUS_OBJECTION_DENIED, Studierendenantragstatus_model::STATUS_DEREGISTERED, - Studierendenantragstatus_model::STATUS_PAUSE + Studierendenantragstatus_model::STATUS_PAUSE, + Studierendenantragstatus_model::STATUS_REMINDERSENT ]); $this->db->or_group_start(); $this->db->where('s.studierendenantrag_statustyp_kurzbz', Studierendenantragstatus_model::STATUS_APPROVED); From 27e3f1d1bc2a91d1cd077e2512754dcd7ec5480c Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Mon, 14 Oct 2024 15:40:25 +0200 Subject: [PATCH 46/59] take status rejected into account when calculating available semster slots for unterbrechung --- application/libraries/AntragLib.php | 6 ------ application/models/education/Studierendenantrag_model.php | 7 +++++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/application/libraries/AntragLib.php b/application/libraries/AntragLib.php index c1649587d..e45c4ad34 100644 --- a/application/libraries/AntragLib.php +++ b/application/libraries/AntragLib.php @@ -1463,12 +1463,6 @@ class AntragLib elseif($antrag->status == Studierendenantragstatus_model::STATUS_APPROVED && $antrag->datum > $datumStatus) return success(-2); } - if ($antrag->typ == Studierendenantrag_model::TYP_UNTERBRECHUNG) - { - // NOTE(chris): Ignore canceled ones - if ($antrag->status == Studierendenantragstatus_model::STATUS_CANCELLED) - continue; - } if ($antrag->typ == Studierendenantrag_model::TYP_WIEDERHOLUNG) { if($antrag->status == Studierendenantragstatus_model::STATUS_PASS) diff --git a/application/models/education/Studierendenantrag_model.php b/application/models/education/Studierendenantrag_model.php index 7595d8036..43edb2449 100644 --- a/application/models/education/Studierendenantrag_model.php +++ b/application/models/education/Studierendenantrag_model.php @@ -411,7 +411,7 @@ class Studierendenantrag_model extends DB_Model FROM campus.tbl_studierendenantrag LEFT JOIN public.tbl_studiensemester USING(studiensemester_kurzbz) WHERE typ=? - AND campus.get_status_studierendenantrag(studierendenantrag_id) != ? + AND campus.get_status_studierendenantrag(studierendenantrag_id) NOT IN ? AND prestudent_id=? ) a ON (s.start < a.ende AND s.ende > a.start) WHERE s.start >= (" . $subquery . ") @@ -421,7 +421,10 @@ class Studierendenantrag_model extends DB_Model return $this->execQuery($sql, [ $max_length, self::TYP_UNTERBRECHUNG, - Studierendenantragstatus_model::STATUS_CANCELLED, + array( + Studierendenantragstatus_model::STATUS_CANCELLED, + Studierendenantragstatus_model::STATUS_REJECTED + ), $prestudent_id, $studiensemester ?: $prestudent_id, $max_length * $max_starters From 439ae5113d87d9e4b76bd76f83dbf8d5333ed8ac Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 15 Oct 2024 13:59:11 +0200 Subject: [PATCH 47/59] =?UTF-8?q?fix=20unterbrechung=20erstellen=20nicht?= =?UTF-8?q?=20m=C3=B6glich=20wenn=20ein=20abgelehnter=20unterbrechungsantr?= =?UTF-8?q?ag=20existiert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/models/education/Studierendenantrag_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/education/Studierendenantrag_model.php b/application/models/education/Studierendenantrag_model.php index 43edb2449..b7c0667cb 100644 --- a/application/models/education/Studierendenantrag_model.php +++ b/application/models/education/Studierendenantrag_model.php @@ -355,7 +355,7 @@ class Studierendenantrag_model extends DB_Model $this->db->where([ 'prestudent_id' => $prestudent_id, 'typ' => Studierendenantrag_model::TYP_UNTERBRECHUNG, - 'campus.get_status_studierendenantrag(studierendenantrag_id) !=' => Studierendenantragstatus_model::STATUS_CANCELLED, + 'campus.get_status_studierendenantrag(studierendenantrag_id) NOT IN (\'' . Studierendenantragstatus_model::STATUS_CANCELLED . '\', \'' . Studierendenantragstatus_model::STATUS_REJECTED . '\')' => null, 'start < ' . $end => null, 'datum_wiedereinstieg > ' . $start => null, ]); From 24ce443e95d7265a7fcb56186f11cf30dca3f0b7 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 15 Oct 2024 17:40:11 +0200 Subject: [PATCH 48/59] nur die letzte komm oder zusaetzlichen komm Pruefung einer LV beruecksichtigen --- application/models/education/Pruefung_model.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/models/education/Pruefung_model.php b/application/models/education/Pruefung_model.php index 214d6519f..409c0b733 100644 --- a/application/models/education/Pruefung_model.php +++ b/application/models/education/Pruefung_model.php @@ -175,6 +175,8 @@ class Pruefung_model extends DB_Model $this->addSelect('campus.get_status_studierendenantrag(a.studierendenantrag_id) status'); $this->addSelect('pss.ausbildungssemester'); + $this->addJoin('(SELECT MAX(datum) AS datum, lehreinheit_id AS le_id, student_uid AS stud_uid FROM lehre.tbl_pruefung p WHERE pruefungstyp_kurzbz IN (\'kommPruef\', \'zusKommPruef\') GROUP BY lehreinheit_id, student_uid) lpd', + 'p.datum = lpd.datum AND p.lehreinheit_id = lpd.le_id AND p.student_uid = lpd.stud_uid'); $this->addJoin('lehre.tbl_lehreinheit le', 'lehreinheit_id'); $this->addJoin('lehre.tbl_lehrveranstaltung lv', 'lehrveranstaltung_id'); $this->addJoin('public.tbl_student s', 'student_uid'); From 755e8dd222741d191028235b8ba069ff399883f2 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Thu, 17 Oct 2024 16:37:27 +0200 Subject: [PATCH 49/59] add provide to vuejs plugins FhcAlert, FhcApi and Phrasen so they are also useable with inject in composition api --- public/js/plugin/FhcAlert.js | 1 + public/js/plugin/FhcApi.js | 2 +- public/js/plugin/Phrasen.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/public/js/plugin/FhcAlert.js b/public/js/plugin/FhcAlert.js index 01fa12d82..b079bf98e 100644 --- a/public/js/plugin/FhcAlert.js +++ b/public/js/plugin/FhcAlert.js @@ -394,5 +394,6 @@ export default { } }; app.config.globalProperties.$fhcAlert = $fhcAlert; + app.provide('$fhcAlert', app.config.globalProperties.$fhcAlert); } } diff --git a/public/js/plugin/FhcApi.js b/public/js/plugin/FhcApi.js index 7be1a5b9f..88d2ac919 100644 --- a/public/js/plugin/FhcApi.js +++ b/public/js/plugin/FhcApi.js @@ -316,6 +316,6 @@ export default { const mergedFhcApiFactory = options?.factory ? {...FhcApiFactory, ...options.factory} : FhcApiFactory; app.config.globalProperties.$fhcApi.factory = new FhcApiFactoryWrapper(mergedFhcApiFactory); - + app.provide('$fhcApi', app.config.globalProperties.$fhcApi); } }; \ No newline at end of file diff --git a/public/js/plugin/Phrasen.js b/public/js/plugin/Phrasen.js index 277402639..5d861fce5 100644 --- a/public/js/plugin/Phrasen.js +++ b/public/js/plugin/Phrasen.js @@ -69,5 +69,6 @@ export default { loadCategory: cat => phrasen.loadCategory.call(app, cat), t_ref: phrasen.t_ref }; + app.provide('$p', app.config.globalProperties.$p); } } From 501784aba1eed510f94b78e8046407d14309d1e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Fri, 18 Oct 2024 14:24:16 +0200 Subject: [PATCH 50/59] =?UTF-8?q?Zus=C3=A4tzliche=20Reihungsteststufen=20h?= =?UTF-8?q?inzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vilesci/stammdaten/reihungstestverwaltung.php | 74 ++++++++++--------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/vilesci/stammdaten/reihungstestverwaltung.php b/vilesci/stammdaten/reihungstestverwaltung.php index 038c1977d..07e88183c 100644 --- a/vilesci/stammdaten/reihungstestverwaltung.php +++ b/vilesci/stammdaten/reihungstestverwaltung.php @@ -256,9 +256,9 @@ if(isset($_GET['excel'])) SELECT studiensemester_kurzbz FROM PUBLIC.tbl_studiensemester WHERE studiensemester_kurzbz = rt.studiensemester_kurzbz - + UNION - + ( SELECT studiensemester_kurzbz FROM PUBLIC.tbl_studiensemester @@ -269,9 +269,9 @@ if(isset($_GET['excel'])) ) ORDER BY ende DESC LIMIT 1 ) - + UNION - + ( SELECT studiensemester_kurzbz FROM PUBLIC.tbl_studiensemester @@ -820,8 +820,8 @@ if(isset($_GET['excel'])) Reihungstest - - @@ -951,15 +951,15 @@ if(isset($_GET['excel'])) }); $("#studienplan_autocomplete").autocomplete({ - source: function(request, response) + source: function(request, response) { - $.getJSON("reihungstestverwaltung_autocomplete.php", - { + $.getJSON("reihungstestverwaltung_autocomplete.php", + { autocomplete: 'studienplan', aktiv: 'true', studiensemester_kurzbz: $('#studiensemester_dropdown').val(), term: request.term - }, + }, response); }, minLength:2, @@ -1247,7 +1247,7 @@ if(isset($_GET['excel'])) }); window.location.href = "mailto:?bcc="+mailadressen; } - + function SendMessage() { // Wenn Checkboxen markiert sind, an diese senden, sonst an alle @@ -1411,7 +1411,7 @@ if(isset($_POST['speichern']) || isset($_POST['kopieren'])) $reihungstest->insertvon = $user; $reihungstest->insertamum = date('Y-m-d H:i:s'); } - + // OE über Studiengang des Reihungstests laden und Berechtigung prüfen $stg_rechtecheck = new studiengang($reihungstest->studiengang_kz); if(!$rechte->isBerechtigt('lehre/reihungstest', $stg_rechtecheck->oe_kurzbz, 'sui')) @@ -1439,7 +1439,7 @@ if(isset($_POST['speichern']) || isset($_POST['kopieren'])) $error = true; } } - + if (isset($_POST['zugangs_ueberpruefung']) && $_POST['zugangcode'] === '') { $messageError .= '

Der Zugangscode muss ausgefüllt sein, wenn die Zugangsüberprüfung aktiviert ist.

'; @@ -1548,7 +1548,7 @@ if(isset($_POST['speichern']) || isset($_POST['kopieren'])) $rt_stpl->new = true; $rt_stpl->reihungstest_id = $reihungstest->reihungstest_id; $rt_stpl->studienplan_id = $studienplan; - + if (!in_array($studienplan, $rt_stplaeneArray)) { if (!$rt_stpl->saveStudienplanReihungstest()) @@ -1572,7 +1572,7 @@ if(isset($_POST['speichern']) || isset($_POST['kopieren'])) $rt_studienplan = new reihungstest(); $rt_studienplan->getStudienplaeneReihungstest($_POST['reihungstest_id']); $error = false; - foreach ($rt_studienplan->result as $row) + foreach ($rt_studienplan->result as $row) { $rtKopieStudienplan = new reihungstest(); $rtKopieStudienplan->new = true; @@ -1609,7 +1609,7 @@ if(isset($_POST['speichern']) || isset($_POST['kopieren'])) { $messageSuccess .= '

Der Termin wurde erfolgreich kopiert

'; } - else + else { $messageSuccess .= '

Neuer Reihungstesttermin erfolgreich angelegt

'; } @@ -1666,14 +1666,14 @@ if(isset($_POST['raumzuteilung_speichern'])) { die($raumzuteilung->errormsg); } - + // OE über Studiengang des Reihungstests laden und Berechtigung prüfen $stg_rechtecheck = new studiengang($raumzuteilung->studiengang_kz); if(!$rechte->isBerechtigt('lehre/reihungstest', $stg_rechtecheck->oe_kurzbz, 'su')) { die($rechte->errormsg); } - + if (isset($_POST['checkbox'])) { $person_ids = $_POST['checkbox']; @@ -1914,7 +1914,7 @@ if(isset($_GET['type']) && $_GET['type']=='auffuellen') { die($rechte->errormsg); } - + $orte = new Reihungstest(); $orte->getOrteReihungstest($reihungstest_id); @@ -2001,7 +2001,7 @@ if(isset($_POST['aufsicht']) && $_POST['aufsicht']!='' && !isset($_POST['kopiere { die($rechte->errormsg); } - + //Reihungstest laden if(!$save_aufsicht->load($_POST['reihungstest_id'])) { @@ -2047,7 +2047,7 @@ if(isset($_POST['delete_ort'])) { die($rechte->errormsg); } - + $delete_ort = new reihungstest(); $delete_ort->getPersonReihungstestOrt($_POST['reihungstest_id'], $_POST['delete_ort']); @@ -2119,7 +2119,7 @@ echo "'; } - + if ($stg_kz == '') $stg_kz = $row->studiengang_kz; if ($row->studiengang_kz == $stg_kz) $selected = 'selected'; else $selected = ''; - + echo "" . "\n"; $typ = $row->typ; } @@ -2293,7 +2293,7 @@ $studienplaene_list = implode(',', array_keys($studienplaene_arr)); @@ -2575,7 +2577,7 @@ $studienplaene_list = implode(',', array_keys($studienplaene_arr)); - isBerechtigt('lehre/reihungstest', $stg_rechtecheck->oe_kurzbz, 'sui')) @@ -2588,7 +2590,7 @@ $studienplaene_list = implode(',', array_keys($studienplaene_arr)); { echo ''; } - + if($rechte->isBerechtigt('lehre/reihungstest', $stg_rechtecheck->oe_kurzbz, 'suid')) { $anzahl_teilnehmer = new reihungstest(); @@ -2701,9 +2703,9 @@ if($reihungstest_id!='') SELECT studiensemester_kurzbz FROM PUBLIC.tbl_studiensemester WHERE studiensemester_kurzbz = rt.studiensemester_kurzbz - + UNION - + ( SELECT studiensemester_kurzbz FROM PUBLIC.tbl_studiensemester @@ -2714,9 +2716,9 @@ if($reihungstest_id!='') ) ORDER BY ende DESC LIMIT 1 ) - + UNION - + ( SELECT studiensemester_kurzbz FROM PUBLIC.tbl_studiensemester @@ -3152,7 +3154,7 @@ if($reihungstest_id!='') echo ''; } } -} +} /** * Liefert die interne Empfangsadresse des Studiengangs fuer den Mailversand. @@ -3168,18 +3170,18 @@ if($reihungstest_id!='') function getMailEmpfaenger($studiengang_kz, $studienplan_id = null, $orgform_kurzbz = null) { $studiengang = new studiengang($studiengang_kz); - + if ($studienplan_id != '') { $studienplan = new studienplan(); $studienplan->loadStudienplan($studienplan_id); } - + $empf_array = array(); $empfaenger = ''; if(defined('BEWERBERTOOL_BEWERBUNG_EMPFAENGER')) $empf_array = unserialize(BEWERBERTOOL_BEWERBUNG_EMPFAENGER); - + // Umgehung für FHTW. Ausprogrammiert im Code if(defined('BEWERBERTOOL_MAILEMPFANG') && BEWERBERTOOL_MAILEMPFANG != '') { @@ -3199,7 +3201,7 @@ function getMailEmpfaenger($studiengang_kz, $studienplan_id = null, $orgform_kur } else $empfaenger = $studiengang->email; - + if ($empfaenger != '') return $empfaenger; else From fa0fe2a952ea99a6937b5b8781dac7d0a9ce59fe Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 22 Oct 2024 16:49:56 +0200 Subject: [PATCH 51/59] hide unruly option in AbmeldungStg for the moment --- .../js/components/Studierendenantrag/Form/AbmeldungStgl.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/js/components/Studierendenantrag/Form/AbmeldungStgl.js b/public/js/components/Studierendenantrag/Form/AbmeldungStgl.js index c804b20d1..450769362 100644 --- a/public/js/components/Studierendenantrag/Form/AbmeldungStgl.js +++ b/public/js/components/Studierendenantrag/Form/AbmeldungStgl.js @@ -189,8 +189,10 @@ export default { + ` -} \ No newline at end of file +} From f59bdf812a11b76ba1b4a78e9a1285ddfeba21de Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 22 Oct 2024 17:18:02 +0200 Subject: [PATCH 52/59] add phrase mark_person_as_unruly --- system/phrasesupdate.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 90a14938f..d9a72eaac 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -23831,6 +23831,26 @@ array( ) ) ), + array( + 'app' => 'core', + 'category' => 'studierendenantrag', + 'phrase' => 'mark_person_as_unruly', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Person ist unruly.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Person is unruly.', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'notiz', From 4789bfab42d92c254a691f8a0854e6232bd54ed8 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Thu, 24 Oct 2024 07:57:54 +0200 Subject: [PATCH 53/59] add columns gehaltsbestandteil_von and gehaltsbestandteil_bis to hr.tbl_gehaltshistorie --- system/dbupdate_3.4/28260_vertraege.php | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/system/dbupdate_3.4/28260_vertraege.php b/system/dbupdate_3.4/28260_vertraege.php index 8fc6be05f..9ce2ba29b 100644 --- a/system/dbupdate_3.4/28260_vertraege.php +++ b/system/dbupdate_3.4/28260_vertraege.php @@ -85,6 +85,8 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table betrag bytea, gehaltsbestandteil_id integer, mitarbeiter_uid character varying(32), + gehaltsbestandteil_von date, + gehaltsbestandteil_bis date, CONSTRAINT tbl_gehaltshistorie_pk PRIMARY KEY (gehaltshistorie_id) ); @@ -570,3 +572,37 @@ if ($result = $db->db_query("SELECT * FROM hr.tbl_vertragsart WHERE vertragsart_ echo 'Vertragsart "Dienstverhältnis zu einer anderen Bildungseinrichtung oder einem anderen Träger" erstellt.
'; } } + +if ($result = $db->db_query("SELECT * FROM information_schema.columns WHERE column_name='gehaltsbestandteil_von' AND table_name='tbl_gehaltshistorie' AND table_schema='hr'")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = " + ALTER TABLE + hr.tbl_gehaltshistorie + ADD COLUMN + gehaltsbestandteil_von date + "; + if (! $db->db_query($qry)) + echo 'Vertraege: ' . $db->db_last_error() . '
'; + else + echo 'Spalte gehaltsbestandteil_von wurde in hr.tbl_gehaltshistorie neu erstellt
'; + } +} + +if ($result = $db->db_query("SELECT * FROM information_schema.columns WHERE column_name='gehaltsbestandteil_bis' AND table_name='tbl_gehaltshistorie' AND table_schema='hr'")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = " + ALTER TABLE + hr.tbl_gehaltshistorie + ADD COLUMN + gehaltsbestandteil_bis date + "; + if (! $db->db_query($qry)) + echo 'Vertraege: ' . $db->db_last_error() . '
'; + else + echo 'Spalte gehaltsbestandteil_bis wurde in hr.tbl_gehaltshistorie neu erstellt
'; + } +} \ No newline at end of file From 2edfd1febcdf75a5550ad3b3a082dad25bdd027a Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Thu, 24 Oct 2024 11:03:28 +0200 Subject: [PATCH 54/59] Unterbrecher in serie problematik --- application/libraries/PrestudentLib.php | 31 ++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/application/libraries/PrestudentLib.php b/application/libraries/PrestudentLib.php index af62668cf..67d9b3450 100644 --- a/application/libraries/PrestudentLib.php +++ b/application/libraries/PrestudentLib.php @@ -254,7 +254,7 @@ class PrestudentLib $studiengang = current(getData($res)); $prestudent_status = current($result); - if($prestudent_status->ausbildungssemester + 1 < $studiengang->max_semester) + if ($prestudent_status->status_kurzbz != Prestudentstatus_model::STATUS_UNTERBRECHER && $prestudent_status->ausbildungssemester + 1 < $studiengang->max_semester) $ausbildungssemester_plus = 1; if(!$result) @@ -264,6 +264,35 @@ class PrestudentLib 'studiensemester_kurzbz' => $studiensemester_kurzbz ])); } + } elseif (current($result)->status_kurzbz == Prestudentstatus_model::STATUS_UNTERBRECHER) { + if ($studierendenantrag_id) + { + $resultAntrag = $this->_ci->StudierendenantragModel->load($studierendenantrag_id); + if (isError($resultAntrag)) + return $resultAntrag; + $resultAntrag = getData($resultAntrag); + if (!$resultAntrag) + return error($this->_ci->p->t('studierendenantrag', 'error_no_antrag_found', ['id' => $studierendenantrag_id])); + + $antrag = current($resultAntrag); + $anmerkung = current($result)->anmerkung . ' Wiedereinstieg ' . $antrag->datum_wiedereinstieg; + + $result = $this->_ci->PrestudentstatusModel->update([ + 'prestudent_id' => $prestudent_id, + 'status_kurzbz' => Prestudentstatus_model::STATUS_UNTERBRECHER, + 'studiensemester_kurzbz' => $studiensemester_kurzbz, + 'ausbildungssemester' => $semester + ], [ + 'updatevon' => $insertvon, + 'updateamum' => date('c'), + 'anmerkung'=> $anmerkung + ]); + + if (isError($result)) + return $result; + } + + return success(); } $prestudent_status = current($result); From 9eb91574c36f53157313720a10df517b3b75f61b Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Thu, 24 Oct 2024 11:08:22 +0200 Subject: [PATCH 55/59] semester --- application/libraries/PrestudentLib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/libraries/PrestudentLib.php b/application/libraries/PrestudentLib.php index 67d9b3450..ef5e2e3a9 100644 --- a/application/libraries/PrestudentLib.php +++ b/application/libraries/PrestudentLib.php @@ -281,7 +281,7 @@ class PrestudentLib 'prestudent_id' => $prestudent_id, 'status_kurzbz' => Prestudentstatus_model::STATUS_UNTERBRECHER, 'studiensemester_kurzbz' => $studiensemester_kurzbz, - 'ausbildungssemester' => $semester + 'ausbildungssemester' => current($result)->ausbildungssemester ], [ 'updatevon' => $insertvon, 'updateamum' => date('c'), From 1e55b13546826db2b12da607977b0fa00d112bb5 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Mon, 28 Oct 2024 15:58:20 +0100 Subject: [PATCH 56/59] force use of insertamum column from antrag table --- application/models/education/Studierendenantrag_model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/models/education/Studierendenantrag_model.php b/application/models/education/Studierendenantrag_model.php index 80804f49a..677d01f04 100644 --- a/application/models/education/Studierendenantrag_model.php +++ b/application/models/education/Studierendenantrag_model.php @@ -151,6 +151,7 @@ class Studierendenantrag_model extends DB_Model $this->addSelect('s.insertvon status_insertvon'); $this->addSelect('t.bezeichnung[(' . $lang . ')] statustyp'); $this->addSelect('p.unruly AS unruly'); + $this->addSelect($this->dbTable . '.insertamum AS insertamum'); $this->addJoin( 'campus.tbl_studierendenantrag_status s', @@ -489,4 +490,4 @@ class Studierendenantrag_model extends DB_Model return hasData($this->load()); } -} \ No newline at end of file +} From ae80c3415d60f7529bd9da7702a66b92563ae7d4 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 29 Oct 2024 10:37:00 +0100 Subject: [PATCH 57/59] betraege im Gehaltsbestandteil als string mit . als komma konvertieren, um zu verhindern, dass locale spezifische Betraege in der verschluesselten DB Spalte gespeichert werden --- .../libraries/vertragsbestandteil/Gehaltsbestandteil.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php b/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php index 22f8ee2ae..95bbdd908 100644 --- a/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php +++ b/application/libraries/vertragsbestandteil/Gehaltsbestandteil.php @@ -201,6 +201,10 @@ class Gehaltsbestandteil extends AbstractBestandteil implements \JsonSerializabl public function setGrundbetrag($grundbetrag) { + if(is_float($grundbetrag)) + { + $grundbetrag = number_format($grundbetrag, 2, '.', ''); + } $this->markDirty('grundbetrag', $this->grundbetrag, $grundbetrag); $this->grundbetrag = $grundbetrag; return $this; @@ -208,6 +212,10 @@ class Gehaltsbestandteil extends AbstractBestandteil implements \JsonSerializabl public function setBetrag_valorisiert($betrag_valorisiert) { + if(is_float($betrag_valorisiert)) + { + $betrag_valorisiert = number_format($betrag_valorisiert, 2, '.', ''); + } $this->markDirty('betrag_valorisiert', $this->betrag_valorisiert, $betrag_valorisiert); $this->betrag_valorisiert = $betrag_valorisiert; return $this; From 9b4fb2ac2c277a0151fcb4696dd7e07b089e3b17 Mon Sep 17 00:00:00 2001 From: Alexei Karpenko Date: Tue, 29 Oct 2024 16:28:17 +0100 Subject: [PATCH 58/59] bpk job: enabled getting vBPKs with new API version 0.8 --- config/vilesci.config-default.inc.php | 2 + include/dvb.class.php | 95 +++++++--- include/kennzeichen.class.php | 261 ++++++++++++++++++++++++++ include/person.class.php | 6 +- vilesci/cronjobs/bpk.php | 92 ++++++++- 5 files changed, 427 insertions(+), 29 deletions(-) create mode 100644 include/kennzeichen.class.php diff --git a/config/vilesci.config-default.inc.php b/config/vilesci.config-default.inc.php index a372bc9da..09f33ee31 100644 --- a/config/vilesci.config-default.inc.php +++ b/config/vilesci.config-default.inc.php @@ -266,6 +266,8 @@ define('BIS_FUNKTIONSCODE_6_ARR', array( // bPk Abfrage define('BPK_FUER_ALLE_BENUTZER_ABFRAGEN', false); +// bPk Typen in Form 'BEREICH' => 'kennzeichenTyp' +define('VBPK_TYPES', array('AS' => 'vbpkAs', 'BF' => 'vbpkBf', 'ZP-TD' => 'vbpkTd')); // Docsbox configs define('DOCSBOX_SERVER', 'http://docconverter.technikum-wien.at/'); diff --git a/include/dvb.class.php b/include/dvb.class.php index fbeb79afc..90eb8d306 100644 --- a/include/dvb.class.php +++ b/include/dvb.class.php @@ -29,6 +29,7 @@ require_once(dirname(__FILE__).'/studiensemester.class.php'); require_once(dirname(__FILE__).'/adresse.class.php'); require_once(dirname(__FILE__).'/webservicelog.class.php'); require_once(dirname(__FILE__).'/prestudent.class.php'); +require_once(dirname(__FILE__).'/kennzeichen.class.php'); require_once(dirname(__FILE__).'/errorhandler.class.php'); class dvb extends basis_db @@ -42,6 +43,7 @@ class dvb extends basis_db const DVB_URL_WEBSERVICE_RESERVIERUNG = DVB_PORTAL.'/rws/0.6/matrikelreservierung.xml'; const DVB_URL_WEBSERVICE_MELDUNG = DVB_PORTAL.'/rws/0.6/matrikelmeldung.xml'; const DVB_URL_WEBSERVICE_BPK = DVB_PORTAL.'/rws/0.6/pruefebpk.xml'; + const DVB_URL_WEBSERVICE_BPK_ALL = DVB_PORTAL.'/rws/0.8/pruefebpk.xml'; public $authentication; private $username; @@ -1149,15 +1151,29 @@ class dvb extends basis_db */ public function getBPK($person_id) { + $vbpkTypes = defined('VBPK_TYPES') && is_array(VBPK_TYPES) ? VBPK_TYPES : null; + $person = new person(); if ($person->load($person_id)) { if ($person->bpk != '') { - // BPK exisitert bereits $retval = new stdClass(); $retval->bpk = $person->bpk; - return ErrorHandler::success($retval); + + // BPK existiert bereits + if (!isset($vbpkTypes)) return ErrorHandler::success($retval); + + $kennzeichen = new kennzeichen(); + + if ($kennzeichen->load_pers($person_id, $vbpkTypes)) + { + if (array_unique(array_column($kennzeichen->result, 'kennzeichentyp_kurzbz')) == array_values($vbpkTypes)) + { + // BPKs exisiteren bereits + return ErrorHandler::success($retval); + } + } } if ($person->gebdatum == '') @@ -1178,7 +1194,8 @@ class dvb extends basis_db return ErrorHandler::error($errormsg); } - $geburtsdatum = str_replace("-", "", $person->gebdatum); + //$geburtsdatum = str_replace("-", "", $person->gebdatum); + $geburtsdatum = $person->gebdatum; $vorname = $person->vorname; $nachname = $person->nachname; $geschlecht = mb_strtoupper($person->geschlecht); @@ -1258,6 +1275,8 @@ class dvb extends basis_db */ public function pruefeBPK($geburtsdatum, $vorname, $nachname, $geschlecht, $plz = null, $strasse = null) { + $vbpkTypes = defined('VBPK_TYPES') && is_array(VBPK_TYPES) ? VBPK_TYPES : null; + if ($this->tokenIsExpired()) { $result = $this->authenticate(); @@ -1271,7 +1290,7 @@ class dvb extends basis_db $uuid = $this->getUUID(); - $url = self::DVB_URL_WEBSERVICE_BPK; + $url = self::DVB_URL_WEBSERVICE_BPK_ALL; $url .= '?geburtsdatum='.curl_escape($curl, $geburtsdatum); $url .= '&vorname='.curl_escape($curl, $vorname); $url .= '&nachname='.curl_escape($curl, $nachname); @@ -1311,24 +1330,15 @@ class dvb extends basis_db if ($curl_info['http_code'] == '200') { /* Example Response: - - - 12345ABCDEFGHXXXXXXX= - - - Hans - Huber - M - 1990-01-01 - - - - 1100 - - - - - + + + 5cc93441-a46a-4f97-a5e3-e64891b39f10 + 12345ABCDEFG + 12345ABCDEFG + 12345ABCDEFG + 12345ABCDEFG + true + Example Error: @@ -1369,10 +1379,30 @@ class dvb extends basis_db } $domnodes_bpk = $dom->getElementsByTagNameNS($namespace, 'bpk'); + if ($domnodes_bpk->length > 0) { $retval = new stdClass(); $retval->bpk = $domnodes_bpk->item(0)->textContent; + + // vbpks auslesen + $domnodes_vbpks = $dom->getElementsByTagNameNS($namespace, 'vbpk'); + + $retval->vbpks = array(); + if ($domnodes_vbpks->length > 0) + { + foreach ($domnodes_vbpks as $domnode_vbpk) + { + foreach ($domnode_vbpk->attributes as $attribute) + { + if ($attribute->nodeName == 'bereich' && isset($vbpkTypes[$attribute->nodeValue])) + { + $retval->vbpks[$vbpkTypes[$attribute->nodeValue]] = $domnode_vbpk->nodeValue; + } + } + } + } + return ErrorHandler::success($retval); } else @@ -1385,6 +1415,27 @@ class dvb extends basis_db $retval->multiple = true; return ErrorHandler::error(null, $retval); } + else + { + $errorTexts = array(); + $domnodes_fehler = $dom->getElementsByTagNameNS($namespace, 'fehlerliste'); + + if ($domnodes_fehler->length > 0) + { + foreach ($domnodes_fehler as $domnode_fehler) + { + if ($domnode_fehler->childNodes->length > 0) + { + foreach ($domnode_fehler->childNodes as $childNode) + { + $errorTexts[] = $childNode->nodeValue; + } + } + } + $this->errormsg = count($errorTexts) > 0 ? implode('; ', $errorTexts) : null; + return ErrorHandler::error(null); + } + } } return ErrorHandler::error(); } diff --git a/include/kennzeichen.class.php b/include/kennzeichen.class.php new file mode 100644 index 000000000..c21c5eee0 --- /dev/null +++ b/include/kennzeichen.class.php @@ -0,0 +1,261 @@ +, + */ +/** + * Klasse kennzeichen + */ +require_once(dirname(__FILE__).'/basis_db.class.php'); + +class kennzeichen extends basis_db +{ + public $new; // boolean + public $result = array(); // adresse Objekt + + //Tabellenspalten + public $kennzeichen_id; // integer + public $person_id; // integer + + public $kennzeichentyp_kurzbz; // string + public $inhalt; // string + public $aktiv; // boolean + public $insertamum; // timestamp + public $insertvon; // string + public $updateamum; // timestamp + public $updatevon; // string + + /** + * Konstruktor + * @param $kennzeichen_id ID des Kennzeichens das geladen werden soll (Default=null) + */ + public function __construct($kennzeichen_id=null) + { + parent::__construct(); + $this->new = true; + + if(!is_null($kennzeichen_id)) + $this->load($kennzeichen_id); + } + + /** + * Laedt ein Kennzeichen mit der ID $kennzeichen_id + * @param $kennzeichen_id ID des zu ladenden Kennzeichens + * @return true wenn ok, false im Fehlerfall + */ + public function load($kennzeichen_id) + { + if (!is_numeric($kennzeichen_id)) + { + $this->errormsg = 'Kennzeichen Id ist ungueltig'; + return false; + } + + $qry = "SELECT + * + FROM + public.tbl_kennzeichen + WHERE + kennzeichen_id = " . $this->db_add_param($kennzeichen_id, FHC_INTEGER) . ";"; + + if ($this->db_query($qry)) + { + if ($row = $this->db_fetch_object()) + { + $this->kennzeichen_id = $row->kennzeichen_id; + $this->person_id = $row->person_id; + $this->kennzeichentyp_kurzbz = $row->kennzeichentyp_kurzbz; + $this->inhalt = $row->inhalt; + $this->aktiv = $this->db_parse_bool($row->aktiv); + $this->updateamum = $row->updateamum; + $this->updatevon = $row->updatevon; + $this->insertamum = $row->insertamum; + $this->insertvon = $row->insertvon; + return true; + } + else + { + $this->errormsg = 'Datensatz wurde nicht gefunden'; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * Prueft die Kennzeichen auf Gueltigkeit + * @return true wenn ok, false im Fehlerfall + */ + public function validate() + { + //Gesamtlaenge pruefen + if(mb_strlen($this->kennzeichentyp_kurzbz)>32) + { + $this->errormsg = 'Kennzeichentyp darf nicht länger als 32 Zeichen sein'; + return false; + } + $this->errormsg = ''; + return true; + } + + /** + * Speichert den aktuellen Datensatz in die Datenbank + * Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt + * andernfalls wird der Datensatz mit der ID in $kennzeichen_id aktualisiert + * @return true wenn ok, false im Fehlerfall + */ + public function save($new = null) + { + if(!is_null($new)) + $this->new = $new; + + //Variablen pruefen + if(!$this->validate()) + return false; + + if($this->new) + { + //Neuen Datensatz einfuegen + $qry='BEGIN;INSERT INTO public.tbl_kennzeichen (person_id, kennzeichentyp_kurzbz, inhalt, aktiv, insertamum, insertvon) VALUES('. + $this->db_add_param($this->person_id, FHC_INTEGER).', '. + $this->db_add_param($this->kennzeichentyp_kurzbz).', '. + $this->db_add_param($this->inhalt).', '. + $this->db_add_param($this->aktiv, FHC_BOOLEAN).', now(), '. + $this->db_add_param($this->insertvon).');'; + } + else + { + //Updaten des bestehenden Datensatzes + + //Pruefen ob kennzeichen_id eine gueltige Zahl ist + if(!is_numeric($this->kennzeichen_id)) + { + $this->errormsg = 'kennzeichen_id muss eine gueltige Zahl sein'; + return false; + } + + $qry='UPDATE public.tbl_kennzeichen SET '. + 'person_id='.$this->db_add_param($this->person_id,FHC_INTEGER).', '. + 'kennzeichentyp_kurzbz='.$this->db_add_param($this->kennzeichentyp_kurzbz).', '. + 'aktiv='.$this->db_add_param($this->aktiv, FHC_BOOLEAN).', '. + 'updateamum= now(), '. + 'updatevon='.$this->db_add_param($this->updatevon).' '. + 'WHERE kennzeichen_id='.$this->db_add_param($this->kennzeichen_id, FHC_INTEGER).';'; + } + + if($this->db_query($qry)) + { + //Sequence auslesen um die eingefuegte ID zu ermitteln + if($this->new) + { + $qry = "SELECT currval('public.tbl_kennzeichen_id_seq') as id;"; + + if($this->db_query($qry)) + { + if($row = $this->db_fetch_object()) + { + $this->kennzeichen_id = $row->id; + $this->db_query('COMMIT;'); + return true; + } + else + { + $this->errormsg = 'Fehler beim Auslesen er Sequence'; + $this->db_query('ROLLBACK;'); + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Auslesen der Sequence'; + $this->db_query('ROLLBACK;'); + return false; + } + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Speichern der Daten'; + return false; + } + } + + /** + * Laedt Kennzeichen einer Person + * @param person_id + * @param kennzeichentyp_kurzbz_arr filtern nach Kennzeichentyp + * @return boolean + */ + public function load_pers($person_id, $kennzeichentyp_kurzbz_arr) + { + if(!is_numeric($person_id)) + { + $this->errormsg = 'Person_id ist ungueltig'; + return false; + } + if(!is_array($kennzeichentyp_kurzbz_arr)) + { + $this->errormsg = 'Kennzeichen sind ungueltig'; + return false; + } + + $qry = " + SELECT + kz.kennzeichen_id, kz.person_id, kz.kennzeichentyp_kurzbz, inhalt, aktiv, updateamum, updatevon, insertamum, insertvon + FROM + public.tbl_kennzeichen kz + WHERE + person_id=".$this->db_add_param($person_id, FHC_INTEGER)." + AND aktiv = TRUE + AND kennzeichentyp_kurzbz IN (".$this->implode4SQL($kennzeichentyp_kurzbz_arr).") + ORDER BY + kz.kennzeichentyp_kurzbz, kz.kennzeichen_id;"; + + if($this->db_query($qry)) + { + while($row = $this->db_fetch_object()) + { + $obj = new kennzeichen(); + + $obj->kennzeichen_id = $row->kennzeichen_id; + $obj->person_id = $row->person_id; + $obj->kennzeichentyp_kurzbz = $row->kennzeichentyp_kurzbz; + $obj->inhalt = $row->inhalt; + $obj->aktiv = $this->db_parse_bool($row->aktiv); + $obj->updateamum = $row->updateamum; + $obj->updatevon = $row->updatevon; + $obj->insertamum = $row->insertamum; + $obj->insertvon = $row->insertvon; + + $this->result[] = $obj; + } + + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } +} +?> diff --git a/include/person.class.php b/include/person.class.php index 95230ef3e..924c15ab6 100644 --- a/include/person.class.php +++ b/include/person.class.php @@ -97,10 +97,10 @@ class person extends basis_db familienstand, anzahlkinder, aktiv, insertamum, insertvon, updateamum, updatevon, ext_id, geschlecht, staatsbuergerschaft, geburtsnation, kurzbeschreibung, zugangscode, foto_sperre, matr_nr, bpk, wahlname"; - if ($hasUDF = $udf->personHasUDF()) - $qry .= ", udf_values "; + if ($hasUDF = $udf->personHasUDF() && false) + $qry .= ", udf_values"; - $qry .= "FROM public.tbl_person + $qry .= " FROM public.tbl_person WHERE person_id = " . $this->db_add_param($personId, FHC_INTEGER); if (!$this->db_query($qry)) diff --git a/vilesci/cronjobs/bpk.php b/vilesci/cronjobs/bpk.php index 3a7ac4395..75af4f9f8 100644 --- a/vilesci/cronjobs/bpk.php +++ b/vilesci/cronjobs/bpk.php @@ -27,6 +27,7 @@ require_once(dirname(__FILE__).'/../../include/basis_db.class.php'); require_once(dirname(__FILE__).'/../../include/dvb.class.php'); require_once(dirname(__FILE__).'/../../include/benutzerberechtigung.class.php'); require_once(dirname(__FILE__).'/../../include/datum.class.php'); +require_once(dirname(__FILE__).'/../../include/kennzeichen.class.php'); require_once(dirname(__FILE__).'/../../include/errorhandler.class.php'); if (!$db = new basis_db()) @@ -34,6 +35,7 @@ if (!$db = new basis_db()) $limit = ''; $debug = false; +$vbpkTypes = defined('VBPK_TYPES') && is_array(VBPK_TYPES) ? VBPK_TYPES : null; // Wenn das Script nicht ueber Commandline gestartet wird, muss eine // Authentifizierung stattfinden @@ -85,8 +87,27 @@ if (defined('BPK_FUER_ALLE_BENUTZER_ABFRAGEN') && BPK_FUER_ALLE_BENUTZER_ABFRAGE JOIN public.tbl_benutzer USING(person_id) WHERE public.tbl_benutzer.aktiv = true - AND tbl_person.bpk is null - AND gebdatum is not null"; + AND + ( + tbl_person.bpk is null"; + + // checken, ob vBpks fehlen + if (isset($vbpkTypes)) + { + $qry .= + " OR ( + SELECT + COUNT(DISTINCT kennzeichentyp_kurzbz) + FROM + public.tbl_kennzeichen + WHERE + person_id = tbl_person.person_id + AND kennzeichentyp_kurzbz IN (".$db->implode4SQL($vbpkTypes).") + ) < ".$db->db_add_param(count($vbpkTypes), FHC_INTEGER); + } + + $qry .= + ") AND gebdatum is not null"; } else { @@ -100,8 +121,27 @@ else WHERE public.tbl_benutzer.aktiv = true AND tbl_person.matr_nr is not null - AND tbl_person.bpk is null - AND studiengang_kz<10000 + AND + ( + tbl_person.bpk is null"; + + // checken, ob vBpks fehlen + if (isset($vbpkTypes)) + { + $qry .= + " OR ( + SELECT + COUNT(DISTINCT kennzeichentyp_kurzbz) + FROM + public.tbl_kennzeichen + WHERE + person_id = tbl_person.person_id + AND kennzeichentyp_kurzbz IN (".$db->implode4SQL($vbpkTypes).") + ) < ".$db->db_add_param(count($vbpkTypes), FHC_INTEGER); + } + + $qry .= + ") AND studiengang_kz<10000 AND EXISTS(SELECT 1 FROM public.tbl_prestudent WHERE person_id=tbl_person.person_id AND bismelden=true) AND gebdatum is not null"; } @@ -135,6 +175,50 @@ if ($result = $db->db_query($qry)) echo ' OK'; else echo ' Failed: '.$person->errormsg; + + $vbpkErrors = array(); + + // alle existierenden vBpks einer Person holen + $kennzeichenTypes = new kennzeichen(); + if ($kennzeichenTypes->load_pers($row->person_id, $vbpkTypes)) + { + $existingVbpks = $kennzeichenTypes->result; + + foreach ($data->retval->vbpks as $vbpkType => $vbpkValue) + { + $new = true; + foreach ($existingVbpks as $existingVbpk) + { + // nicht speichern, wenn vBpk bereits vorhanden + if ($existingVbpk->kennzeichentyp_kurzbz == $vbpkType) + { + $new = false; + break; + } + } + + if (!$new) continue; + + // neue vBpk speichern + $kennzeichen = new kennzeichen(); + + $kennzeichen->person_id = $row->person_id; + $kennzeichen->kennzeichentyp_kurzbz = $vbpkType; + $kennzeichen->inhalt = $vbpkValue; + $kennzeichen->aktiv = true; + $kennzeichen->insertvon = 'bpkJob'; + + if (!$kennzeichen->save()) + { + $vbpkErrors[] = 'Failed to save vBpk '.$vbpkType.':'.$kennzeichen->errormsg; + } + } + } + + if (count($vbpkErrors) > 0) + { + echo implode('; ', $vbpkErrors); + } } } else From 835adca419efaf79b311c6d2a730859745c87161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Mon, 4 Nov 2024 15:42:47 +0100 Subject: [PATCH 59/59] Debugging option entfernt --- include/person.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/person.class.php b/include/person.class.php index 924c15ab6..f8103dd65 100644 --- a/include/person.class.php +++ b/include/person.class.php @@ -97,7 +97,7 @@ class person extends basis_db familienstand, anzahlkinder, aktiv, insertamum, insertvon, updateamum, updatevon, ext_id, geschlecht, staatsbuergerschaft, geburtsnation, kurzbeschreibung, zugangscode, foto_sperre, matr_nr, bpk, wahlname"; - if ($hasUDF = $udf->personHasUDF() && false) + if ($hasUDF = $udf->personHasUDF()) $qry .= ", udf_values"; $qry .= " FROM public.tbl_person