From 1853e44cf36bcb80c128556fe0aa2dbeabee2ef2 Mon Sep 17 00:00:00 2001 From: Werner Masik Date: Tue, 21 Jan 2025 12:58:09 +0100 Subject: [PATCH 1/5] add valorized data for chart display --- .../GehaltsbestandteilLib.php | 5 ++ .../Gehaltsbestandteil_model.php | 90 +++++++++++++++++++ 2 files changed, 95 insertions(+) diff --git a/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php b/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php index b75bdd722..5eb509e4a 100644 --- a/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php @@ -28,6 +28,11 @@ class GehaltsbestandteilLib $this->GehaltsbestandteilModel = $this->CI->GehaltsbestandteilModel; } + public function fetchGehaltsbestandteileValorisiert($dienstverhaeltnis_id, $stichtag=null, $includefuture=false) + { + return $this->GehaltsbestandteilModel->getGehaltsbestandteileValorisiert($dienstverhaeltnis_id, $stichtag, $includefuture); + } + public function fetchGehaltsbestandteile($dienstverhaeltnis_id, $stichtag=null, $includefuture=false) { return $this->GehaltsbestandteilModel->getGehaltsbestandteile($dienstverhaeltnis_id, $stichtag, $includefuture); diff --git a/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php index e9006dfc0..abc539b69 100644 --- a/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php +++ b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php @@ -129,6 +129,96 @@ EOSQL; return $gehaltsbestandteile; } + public function getGehaltsbestandteileValorisiert($dienstverhaeltnis_id, $stichtag=null, $includefuture=false) + { + $stichtagclause = ''; + if( !is_null($stichtag) ) + { + $date = strftime('%Y-%m-%d', strtotime($stichtag)); + $stichtagclause = 'AND (' . $this->escape($date) + . ' BETWEEN COALESCE(von, \'1970-01-01\'::date)' + . ' AND COALESCE(bis, \'2170-01-01\'::date)'; + if( $includefuture ) + { + $stichtagclause .= ' OR COALESCE(von, \'1970-01-01\'::date) > ' + . $this->escape($date); + } + $stichtagclause .= ')'; + } + + // Note: replaced gb.betrag_valorisiert with vh.betrag_valorisiert! + $qry = " + SELECT + gb.gehaltsbestandteil_id,gb.dienstverhaeltnis_id,gb.vertragsbestandteil_id,gb.gehaltstyp_kurzbz, + gb.von,gb.bis,gb.anmerkung,gb.grundbetrag as grundbetrag,gb.valorisierungssperre,gb.insertamum, + gb.insertvon,gb.updateamum,gb.updatevon,gb.valorisierung,gb.auszahlungen, + vh.valorisierungsdatum, vh.betrag_valorisiert as betrag_valorisiert + FROM hr.tbl_gehaltsbestandteil gb LEFT JOIN hr.tbl_valorisierung_historie vh using (gehaltsbestandteil_id) + WHERE dienstverhaeltnis_id=? + $stichtagclause + ORDER BY gb.von,vh.valorisierungsdatum, gb.gehaltsbestandteil_id; + "; + + $encryptedColumns = array( + 'gb.grundbetrag' => array( + DB_Model::CRYPT_CAST => 'numeric', + DB_Model::CRYPT_PASSWORD_NAME => 'ENCRYPTIONKEYGEHALT' + ), + 'vh.betrag_valorisiert' => array( + DB_Model::CRYPT_CAST => 'numeric', + DB_Model::CRYPT_PASSWORD_NAME => 'ENCRYPTIONKEYGEHALT' + ) + ); + + $query = $this->execQuery($qry, + array($dienstverhaeltnis_id), + $encryptedColumns); + + $gehaltsbestandteile = array(); + if( null !== ($rows = getData($query)) ) + { + // store for preserving the last records of every gehaltsbestandteil_id + $lastRecords = array(); + + foreach( $rows as $row ) { + $tmpgb = new Gehaltsbestandteil(); + $tmpgb->hydrateByStdClass($row, true); + + // prevent duplication (caused by the join with historic values) + if (!isset($lastRecords[(string)$row->gehaltsbestandteil_id])) { + $gehaltsbestandteile[] = $tmpgb; + $lastRecords[(string)$row->gehaltsbestandteil_id] = $tmpgb; + } + + if ($row->betrag_valorisiert != null && $row->valorisierungsdatum != null + && $row->valorisierungsdatum != $row->von && $row->valorisierungsdatum != $row->bis) { + + // create additional row + $tmpgbv = new Gehaltsbestandteil(); + $tmpgbv->hydrateByStdClass($row, true); + $tmpgbv->setVon($row->valorisierungsdatum); + $tmpgbv->setBis($lastRecords[(string)$row->gehaltsbestandteil_id]->getBis()); + // overwrite Grundbetrag with the current valorized loan + // (otherwise the chart would show the wrong value) + $tmpgbv->setGrundbetrag($row->betrag_valorisiert); + $gehaltsbestandteile[] = $tmpgbv; + + // finish previous + $daybefore = new DateTimeImmutable($row->valorisierungsdatum); + $daybefore = $daybefore->sub(new \DateInterval('P1D')); + $lastRecords[(string)$row->gehaltsbestandteil_id]->setBis($daybefore->format('Y-m-d')); + + // preserve as last row, because there might be another valorization + $lastRecords[(string)$row->gehaltsbestandteil_id] = $tmpgbv; + + } + + } + } + + return $gehaltsbestandteile; + } + public function getGehaltsbestandteil($id) { From e068abd124cebb2ebba83b417dd4a82bd9b43e1a Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Tue, 28 Jan 2025 18:35:25 +0100 Subject: [PATCH 2/5] rename functions since they manipulate data for using it in a chart --- .../libraries/vertragsbestandteil/GehaltsbestandteilLib.php | 4 ++-- .../models/vertragsbestandteil/Gehaltsbestandteil_model.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php b/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php index ab6484dea..1aaafa471 100644 --- a/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php +++ b/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php @@ -28,9 +28,9 @@ class GehaltsbestandteilLib $this->GehaltsbestandteilModel = $this->CI->GehaltsbestandteilModel; } - public function fetchGehaltsbestandteileValorisiert($dienstverhaeltnis_id, $stichtag=null, $includefuture=false) + public function fetchGehaltsbestandteileValorisiertForChart($dienstverhaeltnis_id, $stichtag=null, $includefuture=false) { - return $this->GehaltsbestandteilModel->getGehaltsbestandteileValorisiert($dienstverhaeltnis_id, $stichtag, $includefuture); + return $this->GehaltsbestandteilModel->getGehaltsbestandteileValorisiertForChart($dienstverhaeltnis_id, $stichtag, $includefuture); } public function fetchGehaltsbestandteile($dienstverhaeltnis_id, $stichtag=null, diff --git a/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php index 2e30764f0..c50627697 100644 --- a/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php +++ b/application/models/vertragsbestandteil/Gehaltsbestandteil_model.php @@ -243,7 +243,7 @@ EOSQL; return $result; } - public function getGehaltsbestandteileValorisiert($dienstverhaeltnis_id, $stichtag=null, $includefuture=false) + public function getGehaltsbestandteileValorisiertForChart($dienstverhaeltnis_id, $stichtag=null, $includefuture=false) { $stichtagclause = ''; if( !is_null($stichtag) ) From 3eb1f7b06b455a6893c76ee5b6245bda46673e37 Mon Sep 17 00:00:00 2001 From: Cristina Date: Thu, 30 Jan 2025 12:08:28 +0100 Subject: [PATCH 3/5] Added array 'display_infobox' to config file anrechnung.php and adapted code to display only if set to true --- application/config/anrechnung.php | 11 +- .../anrechnung/requestAnrechnungImportant.php | 138 +++++++------ .../lehre/anrechnung/reviewAnrechnungInfo.php | 182 ++++++++++-------- 3 files changed, 184 insertions(+), 147 deletions(-) diff --git a/application/config/anrechnung.php b/application/config/anrechnung.php index 2466d2bb1..0c370a78c 100644 --- a/application/config/anrechnung.php +++ b/application/config/anrechnung.php @@ -1,6 +1,6 @@ TRUE, + 'referenzbeispiele_ects' => FALSE, + 'voraussetzungen' => TRUE, + 'nachweisdokumente' => TRUE, + 'herkunft_kenntnisse' => TRUE +]; diff --git a/application/views/lehre/anrechnung/requestAnrechnungImportant.php b/application/views/lehre/anrechnung/requestAnrechnungImportant.php index 0ee13d422..6a3cc5a9a 100644 --- a/application/views/lehre/anrechnung/requestAnrechnungImportant.php +++ b/application/views/lehre/anrechnung/requestAnrechnungImportant.php @@ -1,71 +1,83 @@ +
+ + config->item('display_infobox')['fristen']) && $this->config->item('display_infobox')['fristen'] === true): ?> +
+

+
+
+   + p->t('anrechnung', 'requestAnrechnungInfoFristenTitle'); ?> -
- -
-

-
-
- -   - p->t('anrechnung', 'requestAnrechnungInfoFristenTitle'); ?> - +
+
+

+
+
+ p->t('anrechnung', 'requestAnrechnungInfoFristenBody'); ?> +
+
+ + + config->item('display_infobox')['referenzbeispiele_ects']) && $this->config->item('display_infobox')['referenzbeispiele_ects'] === true): ?> +
+

+ +

+
+
+ p->t('anrechnung', 'requestAnrechnungInfoEctsBerechnungBody'); ?> +
+
-

-
-
- p->t('anrechnung', 'requestAnrechnungInfoFristenBody'); ?> -
-
-
- -
-

-

-
-
- p->t('anrechnung', 'requestAnrechnungInfoEctsBerechnungBody'); ?> -
-
-
- -
-

-
- -
-

-
-
- p->t('anrechnung', 'requestAnrechnungInfoNachweisdokumenteBody'); ?> -
-
-
+ -
-

-

-
-
- p->t('anrechnung', 'requestAnrechnungInfoHerkunftKenntnisseBody'); ?> -
-
-
- +
\ No newline at end of file diff --git a/application/views/lehre/anrechnung/reviewAnrechnungInfo.php b/application/views/lehre/anrechnung/reviewAnrechnungInfo.php index c5d30987c..aebe80f1c 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungInfo.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungInfo.php @@ -1,86 +1,102 @@ -
- -
-

-
-
- -   - p->t('anrechnung', 'reviewAnrechnungInfoFristenTitle'); ?> - -
-
-

-
-
- p->t('anrechnung', 'reviewAnrechnungInfoFristenBody'); ?> -
-
-
- -
-

- -

-
-
- p->t('anrechnung', 'requestAnrechnungInfoEctsBerechnungBody'); ?> -
-
-
- -
-

-
- -
-

-
-
- p->t('anrechnung', 'reviewAnrechnungInfoAntragVoraussetungenBody'); ?> -
-
-
- -
-

- -

-
-
- p->t('anrechnung', 'reviewAnrechnungInfoNachweisdokumenteBody'); ?> -
-
-
- -
-

- -

-
-
- p->t('anrechnung', 'reviewAnrechnungInfoHerkunftKenntnisseBody'); ?> -
-
-
+ + config->item('display_infobox')['fristen']) && $this->config->item('display_infobox')['fristen'] === true): ?> +
+

+
+
+   + p->t('anrechnung', 'reviewAnrechnungInfoFristenTitle'); ?> + +
+
+

+
+
+ p->t('anrechnung', 'reviewAnrechnungInfoFristenBody'); ?> +
+
+
+ + + config->item('display_infobox')['referenzbeispiele_ects']) && $this->config->item('display_infobox')['referenzbeispiele_ects'] === true): ?> +
+

+ +

+
+
+ p->t('anrechnung', 'requestAnrechnungInfoEctsBerechnungBody'); ?> +
+
+
+ + + config->item('display_infobox')['voraussetzungen']) && $this->config->item('display_infobox')['voraussetzungen'] === true): ?> +
+

+
+ +
+

+
+
+ p->t('anrechnung', 'reviewAnrechnungInfoAntragVoraussetungenBody'); ?> +
+
+
+ + + config->item('display_infobox')['nachweisdokumente']) && $this->config->item('display_infobox')['nachweisdokumente'] === true): ?> +
+

+ +

+
+
+ p->t('anrechnung', 'reviewAnrechnungInfoNachweisdokumenteBody'); ?> +
+
+
+ + + config->item('display_infobox')['herkunft_kenntnisse']) && $this->config->item('display_infobox')['herkunft_kenntnisse'] === true): ?> +
+

+ +

+
+
+ p->t('anrechnung', 'reviewAnrechnungInfoHerkunftKenntnisseBody'); ?> +
+
+
+
From 07194cfaff8391456cf6c6da301be17342dc56e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Thu, 30 Jan 2025 14:54:16 +0100 Subject: [PATCH 4/5] =?UTF-8?q?-=20Index=20f=C3=BCr=20lehre.tbl=5Fanrechnu?= =?UTF-8?q?ngen=20hinzugef=C3=BCgt=20um=20Ladezeiten=20zu=20verbessern=20-?= =?UTF-8?q?=20Bugfix=20fuer=20Detailseite=20der=20Lehrenden?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/config/anrechnung.php | 2 +- .../anrechnung/reviewAnrechnungDetail.php | 2 -- system/dbupdate_3.4.php | 1 + .../dbupdate_3.4/55968_index_anrechnung.php | 30 +++++++++++++++++++ 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 system/dbupdate_3.4/55968_index_anrechnung.php diff --git a/application/config/anrechnung.php b/application/config/anrechnung.php index 0c370a78c..6713ef37d 100644 --- a/application/config/anrechnung.php +++ b/application/config/anrechnung.php @@ -28,7 +28,7 @@ $config['explain_equivalence'] = TRUE; // Displays infobox if set to true $config['display_infobox'] = [ 'fristen' => TRUE, - 'referenzbeispiele_ects' => FALSE, + 'referenzbeispiele_ects' => TRUE, 'voraussetzungen' => TRUE, 'nachweisdokumente' => TRUE, 'herkunft_kenntnisse' => TRUE diff --git a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php index 53f1ee34e..1e7bef81e 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php @@ -2,7 +2,6 @@ $this->load->config('anrechnung'); $includesArray = array( - array( 'title' => $this->p->t('anrechnung', 'anrechnungenPruefen'), 'jquery3' => true, 'jqueryui1' => true, @@ -50,7 +49,6 @@ $includesArray = array( 'public/js/bootstrapper.js', 'public/js/lehre/anrechnung/reviewAnrechnungDetail.js' ) - ) ); if (defined("CIS4")) { diff --git a/system/dbupdate_3.4.php b/system/dbupdate_3.4.php index c6e64edb3..66d62a3f8 100644 --- a/system/dbupdate_3.4.php +++ b/system/dbupdate_3.4.php @@ -69,6 +69,7 @@ require_once('dbupdate_3.4/40717_lv_faktor.php'); require_once('dbupdate_3.4/48526_pep_tagging.php'); require_once('dbupdate_3.4/41950_perm_gehaelter.php'); require_once('dbupdate_3.4/53903_valorisierung.php'); +require_once('dbupdate_3.4/55968_index_anrechnung.php'); // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; diff --git a/system/dbupdate_3.4/55968_index_anrechnung.php b/system/dbupdate_3.4/55968_index_anrechnung.php new file mode 100644 index 000000000..020c72b4b --- /dev/null +++ b/system/dbupdate_3.4/55968_index_anrechnung.php @@ -0,0 +1,30 @@ +db_query("SELECT * FROM pg_class WHERE relname='idx_anrechnungen_prestudent_id'")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = "CREATE INDEX idx_anrechnungen_prestudent_id ON lehre.tbl_anrechnung USING btree (prestudent_id)"; + + if (! $db->db_query($qry)) + echo 'Indizes: ' . $db->db_last_error() . '
'; + else + echo 'Index fuer lehre.tbl_anrechnung_prestudent_id hinzugefuegt'; + } +} + +// Add index to lehre.tbl_anrechnung.studiensemester_kurzbz +if ($result = $db->db_query("SELECT * FROM pg_class WHERE relname='idx_anrechnungen_studiensemester_kurzbz'")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = "CREATE INDEX idx_anrechnungen_studiensemester_kurzbz ON lehre.tbl_anrechnung USING btree (studiensemester_kurzbz)"; + + if (! $db->db_query($qry)) + echo 'Indizes: ' . $db->db_last_error() . '
'; + else + echo 'Index fuer lehre.tbl_anrechnung_studiensemester_kurzbz hinzugefuegt'; + } +} From fbd02e02f13c0f64e0dccee97b837c7dd142ac6c Mon Sep 17 00:00:00 2001 From: kindlm Date: Mon, 3 Feb 2025 10:41:41 +0100 Subject: [PATCH 5/5] Rufzeichen bei Phrase entfernt --- locale/de-AT/testtool.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/de-AT/testtool.php b/locale/de-AT/testtool.php index 059cd33c5..67f2a04ea 100644 --- a/locale/de-AT/testtool.php +++ b/locale/de-AT/testtool.php @@ -25,7 +25,7 @@ $this->phrasen['testtool/klickenSieAufEinTeilgebiet']='Zum Starten klicken Sie b $this->phrasen['testtool/gebietStarten']='Gebiet starten'; $this->phrasen['testtool/startseite']='Startseite'; $this->phrasen['testtool/zurueckZurStartseite']='Zurück zur Startseite'; -$this->phrasen['testtool/begruessungstext']="Willkommen zum Reihungstest der Fachhochschule Technikum Wien!"; +$this->phrasen['testtool/begruessungstext']="Willkommen zum Reihungstest der Fachhochschule Technikum Wien"; $this->phrasen['testtool/anmeldedaten']= "Sie sind mit folgenden Daten angemeldet:"; $this->phrasen['testtool/keineAntwort']='Keine Antwort'; $this->phrasen['testtool/speichernUndWeiter']='Speichern und weiter';