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; 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, 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 ?> + + 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); 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..c108fcd77 --- /dev/null +++ b/system/dbupdate_3.4/41150_oe-pfad_db_view.php @@ -0,0 +1,39 @@ +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; + + GRANT SELECT ON public.vw_oe_path TO vilesci; + "; + + if (!$db->db_query($qry)) + echo 'public.vw_oe_path: ' . $db->db_last_error() . '
'; + else + echo 'public.vw_oe_path: erstellt
'; + } +}