From 0b48e94d3c6e000ff1039847bbaace655851d11b Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 11 Jul 2024 10:44:12 +0200 Subject: [PATCH 1/6] Added config variable $config['explain_equivalence'] (Begruendung zu Gleichwertigkeit) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ...to display and enable 'Begründung zu Gleichwertigkeit'-fields --- application/config/anrechnung.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/config/anrechnung.php b/application/config/anrechnung.php index 768ec3197..2466d2bb1 100644 --- a/application/config/anrechnung.php +++ b/application/config/anrechnung.php @@ -21,3 +21,6 @@ $config['grades_blocking_application'] = array( $config['fbl'] = FALSE; //Enables Info Mails $config['send_mail'] = TRUE; + +// Display fields to explain equivalence of ECTS and LV-Inhalte +$config['explain_equivalence'] = TRUE; From 8c3b85066ad87efdbfd29757334d31c125866e83 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 11 Jul 2024 10:49:05 +0200 Subject: [PATCH 2/6] Adapted Controller RequestAnrechnung.php to handle Begruendung-zur-Gleichwertigkeit fields ...depending on $config['explain_equivalence'] --- .../lehre/anrechnung/RequestAnrechnung.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index 3cba756cf..ebc272e3e 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -111,8 +111,13 @@ class requestAnrechnung extends Auth_Controller $lehrveranstaltung_id = $this->input->post('lv_id'); $studiensemester_kurzbz = $this->input->post('studiensemester'); $bestaetigung = $this->input->post('bestaetigung'); - $begruendung_ects = $this->input->post('begruendung_ects'); - $begruendung_lvinhalt = $this->input->post('begruendung_lvinhalt'); + $begruendung_ects = $this->config->item('explain_equivalence') === TRUE + ? $this->input->post('begruendung_ects') + : NULL; + $begruendung_lvinhalt = $this->config->item('explain_equivalence') === TRUE + ? $this->input->post('begruendung_lvinhalt') + : NULL; + // Validate data if (empty($_FILES['uploadfile']['name'])) @@ -124,8 +129,8 @@ class requestAnrechnung extends Auth_Controller isEmptyString($anmerkung) || isEmptyString($lehrveranstaltung_id) || isEmptyString($studiensemester_kurzbz) || - isEmptyString($begruendung_ects) || - isEmptyString($begruendung_lvinhalt)) + ($this->config->item('explain_equivalence') === TRUE && isEmptyString($begruendung_ects)) || + ($this->config->item('explain_equivalence') === TRUE && isEmptyString($begruendung_lvinhalt))) { return $this->outputJsonError($this->p->t('ui', 'errorFelderFehlen')); } @@ -168,7 +173,7 @@ class requestAnrechnung extends Auth_Controller // Hold just inserted DMS ID $lastInsert_dms_id = $result->retval['dms_id']; - + // Save Anrechnung and Anrechnungstatus $result = $this->AnrechnungModel->createAnrechnungsantrag( $prestudent_id, From 1139b251ef2b10e08f074d710a3da2778134b3b9 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 11 Jul 2024 10:52:51 +0200 Subject: [PATCH 3/6] Adapted Views to handle display of Begruendung-zur-Gleichwertigkeit fields ...depending on $config['explain_equivalence'] --- .../anrechnung/approveAnrechnungDetail.php | 19 +++++---- .../lehre/anrechnung/requestAnrechnung.php | 41 +++++++++++-------- .../anrechnung/reviewAnrechnungDetail.php | 19 +++++---- 3 files changed, 45 insertions(+), 34 deletions(-) diff --git a/application/views/lehre/anrechnung/approveAnrechnungDetail.php b/application/views/lehre/anrechnung/approveAnrechnungDetail.php index 0970b6edd..c96631781 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/approveAnrechnungDetail.php @@ -1,4 +1,5 @@ load->config('anrechnung'); $this->load->view( 'templates/FHC-Header', array( @@ -172,14 +173,16 @@ $this->load->view( p->t('global', 'begruendung'); ?> begruendung ?> - - p->t('anrechnung', 'begruendungEctsLabel'); ?> - begruendung_ects ?> - - - p->t('anrechnung', 'begruendungLvinhaltLabel'); ?> - begruendung_lvinhalt ?> - + config->item('explain_equivalence')): ?> + + p->t('anrechnung', 'begruendungEctsLabel'); ?> + begruendung_ects ?> + + + p->t('anrechnung', 'begruendungLvinhaltLabel'); ?> + begruendung_lvinhalt ?> + + diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php index 18fd66a67..bb3c48235 100644 --- a/application/views/lehre/anrechnung/requestAnrechnung.php +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -4,6 +4,7 @@ const CHAR_LENGTH150 = 150; const CHAR_LENGTH500 = 500; const CHAR_LENGTH1000 = 1000; +$this->load->config('anrechnung'); $this->load->view( 'templates/FHC-Header', array( @@ -200,27 +201,29 @@ $this->load->view( - -
-
-
-
- p->t('anrechnung', 'begruendungEcts'); ?>  - - - -
-
- - p->t('ui', 'maxZeichen'); ?> : + + config->item('explain_equivalence')): ?> + +
+
+
+
+ p->t('anrechnung', 'begruendungEcts'); ?>  + + + +
+
+ + p->t('ui', 'maxZeichen'); ?> : +
-
- -
+ +
@@ -240,6 +243,8 @@ $this->load->view(
+ +
diff --git a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php index 08d23d8c4..98fee67a3 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php @@ -1,4 +1,5 @@ load->config('anrechnung'); $this->load->view( 'templates/FHC-Header', array( @@ -143,14 +144,16 @@ $this->load->view( target="_blank">dokumentname) ?> - - p->t('anrechnung', 'begruendungEctsLabel'); ?> - begruendung_ects ?> - - - p->t('anrechnung', 'begruendungLvinhaltLabel'); ?> - begruendung_lvinhalt ?> - + config->item('explain_equivalence')): ?> + + p->t('anrechnung', 'begruendungEctsLabel'); ?> + begruendung_ects ?> + + + p->t('anrechnung', 'begruendungLvinhaltLabel'); ?> + begruendung_lvinhalt ?> + + From a23b133217d7940c9ab3fc46782a9f70eb7384d7 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 11 Jul 2024 10:54:43 +0200 Subject: [PATCH 4/6] Adapted requestAnrechnung.js to handle submit data and events on Begruendung-zur-Gleichwertigkeit fields ...depending on $config['explain_equivalence'] --- .../js/lehre/anrechnung/requestAnrechnung.js | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/public/js/lehre/anrechnung/requestAnrechnung.js b/public/js/lehre/anrechnung/requestAnrechnung.js index 2947aebe9..0a8a09ea0 100644 --- a/public/js/lehre/anrechnung/requestAnrechnung.js +++ b/public/js/lehre/anrechnung/requestAnrechnung.js @@ -101,8 +101,12 @@ $(function(){ begruendung: this.begruendung.value, lv_id: this.lv_id.value, studiensemester: this.studiensemester.value, - begruendung_ects: this.begruendung_ects.value, - begruendung_lvinhalt: this.begruendung_lvinhalt.value, + begruendung_ects: this.begruendung_ects && this.begruendung_ects.value + ? this.begruendung_ects.value + : null, + begruendung_lvinhalt: this.begruendung_lvinhalt && this.begruendung_lvinhalt.value + ? this.begruendung_lvinhalt.value + : null, bestaetigung: this.bestaetigung.value, uploadfile: this.uploadfile.files }, @@ -216,18 +220,22 @@ var requestAnrechnung = { $('#requestAnrechnung-herkunftDerKenntnisse-charCounter').text(length); }); - $('#requestAnrechnung-begruendungEcts').keyup(function() { - let length = CHAR_LENGTH150 - $(this).val().length; - $('#requestAnrechnung-begruendungEcts-charCounter').text(length); - }); + if ($('#requestAnrechnung-begruendungEcts').length) { + $('#requestAnrechnung-begruendungEcts').keyup(function () { + let length = CHAR_LENGTH150 - $(this).val().length; + $('#requestAnrechnung-begruendungEcts-charCounter').text(length); + }); + } - $('#requestAnrechnung-begruendungLvinhalt').keyup(function() { - let maxlength = CHAR_LENGTH1000 - $(this).val().length; - $('#requestAnrechnung-begruendungLvinhalt-charCounterMax').text(maxlength); + if ($('#requestAnrechnung-begruendungLvinhalt').length){ + $('#requestAnrechnung-begruendungLvinhalt').keyup(function() { + let maxlength = CHAR_LENGTH1000 - $(this).val().length; + $('#requestAnrechnung-begruendungLvinhalt-charCounterMax').text(maxlength); - let minlength = CHAR_LENGTH500 - $(this).val().length; - $('#requestAnrechnung-begruendungLvinhalt-charCounterMin').text(minlength); - }); + let minlength = CHAR_LENGTH500 - $(this).val().length; + $('#requestAnrechnung-begruendungLvinhalt-charCounterMin').text(minlength); + }); + } }, formatAnrechnungIsApplied: function (antragdatum, dms_id, filename){ $('#requestAnrechnung-antragdatum').text(antragdatum); From e6684a0116d11358e9285632bca69c50d6b01b6c Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Mon, 29 Jul 2024 17:41:24 +0200 Subject: [PATCH 5/6] add db view that contains oe path --- system/dbupdate_3.4.php | 1 + system/dbupdate_3.4/41150_oe-pfad_db_view.php | 37 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 system/dbupdate_3.4/41150_oe-pfad_db_view.php diff --git a/system/dbupdate_3.4.php b/system/dbupdate_3.4.php index 9fb7f0ee9..f728910e9 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/41150_oe-pfad_db_view.php'); // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; diff --git a/system/dbupdate_3.4/41150_oe-pfad_db_view.php b/system/dbupdate_3.4/41150_oe-pfad_db_view.php new file mode 100644 index 000000000..077033fbb --- /dev/null +++ b/system/dbupdate_3.4/41150_oe-pfad_db_view.php @@ -0,0 +1,37 @@ +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 = " + 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 ( + 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 + FROM + public.tbl_organisationseinheit oe + JOIN + public.tbl_organisationseinheittyp oetyp USING(organisationseinheittyp_kurzbz) + WHERE + 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 + FROM + public.tbl_organisationseinheit oe, vw_oe_path oet + JOIN + public.tbl_organisationseinheittyp oetyp USING(organisationseinheittyp_kurzbz) + WHERE + oe.oe_parent_kurzbz = oet.oe_kurzbz + ) + SELECT * FROM vw_oe_path ORDER BY path, depth; + "; + + if (!$db->db_query($qry)) + echo 'public.vw_oe_path: ' . $db->db_last_error() . '
'; + else + echo 'public.vw_oe_path: erstellt
'; + } +} From d0f3cee7de0dd7a1ba5c5b42702ff1db88301ddb Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Mon, 29 Jul 2024 18:11:13 +0200 Subject: [PATCH 6/6] add permissions for vw_oe_path --- system/dbupdate_3.4/41150_oe-pfad_db_view.php | 2 ++ 1 file changed, 2 insertions(+) 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 077033fbb..c108fcd77 100644 --- a/system/dbupdate_3.4/41150_oe-pfad_db_view.php +++ b/system/dbupdate_3.4/41150_oe-pfad_db_view.php @@ -27,6 +27,8 @@ if ($result = $db->db_query("SELECT * FROM information_schema.views WHERE table_ oe.oe_parent_kurzbz = oet.oe_kurzbz ) SELECT * FROM vw_oe_path ORDER BY path, depth; + + GRANT SELECT ON public.vw_oe_path TO vilesci; "; if (!$db->db_query($qry))