From 3a8216577ffb5e60557ecfbbacea62a8070fbed1 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Thu, 9 Nov 2023 10:53:04 +0100 Subject: [PATCH 1/4] added column habilitation to tbl_mitarbeiter --- .../dbupdate_3.4/33003_bis_meldung_personal.php | 15 +++++++++++++++ .../dbupdate_3.4/anrechnung_von_outgoing_lvs.php | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 system/dbupdate_3.4/33003_bis_meldung_personal.php create mode 100644 system/dbupdate_3.4/anrechnung_von_outgoing_lvs.php diff --git a/system/dbupdate_3.4/33003_bis_meldung_personal.php b/system/dbupdate_3.4/33003_bis_meldung_personal.php new file mode 100644 index 000000000..f59d6770e --- /dev/null +++ b/system/dbupdate_3.4/33003_bis_meldung_personal.php @@ -0,0 +1,15 @@ +db_query("SELECT habilitation FROM public.tbl_mitarbeiter LIMIT 1")) +{ + $qry = "ALTER TABLE public.tbl_mitarbeiter ADD COLUMN habilitation boolean NOT NULL DEFAULT false; + COMMENT ON COLUMN public.tbl_mitarbeiter.habilitation IS 'Zeigt an, ob Mitarbeiter habilitiert ist (BIS relevant).'; + "; + + if(!$db->db_query($qry)) + echo 'public.tbl_mitarbeiter '.$db->db_last_error().'
'; + else + echo '
Spalte habilitation zu Tabelle public.tbl_mitarbeiter hinzugefügt'; +} diff --git a/system/dbupdate_3.4/anrechnung_von_outgoing_lvs.php b/system/dbupdate_3.4/anrechnung_von_outgoing_lvs.php new file mode 100644 index 000000000..0af077e66 --- /dev/null +++ b/system/dbupdate_3.4/anrechnung_von_outgoing_lvs.php @@ -0,0 +1,16 @@ +db_query("SELECT 1 FROM system.tbl_app WHERE app='mobilityonline'")) +{ + if($db->db_num_rows($result)==0) + { + $qry = "INSERT INTO system.tbl_app(app) VALUES('mobilityonline');"; + + if(!$db->db_query($qry)) + echo 'App: '.$db->db_last_error().'
'; + else + echo '
Neue App mobilityonline in system.tbl_app hinzugefügt'; + } +} From cf85cb084f60debc4c4437a2a78675d29a323cf6 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Wed, 15 Nov 2023 20:51:44 +0100 Subject: [PATCH 2/4] dbupdate habilitation: added file to dbupdate3.4, code formatting --- system/dbupdate_3.4.php | 1 + system/dbupdate_3.4/33003_bis_meldung_personal.php | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system/dbupdate_3.4.php b/system/dbupdate_3.4.php index 458f178d4..1b4b67b36 100644 --- a/system/dbupdate_3.4.php +++ b/system/dbupdate_3.4.php @@ -45,6 +45,7 @@ require_once('dbupdate_3.4/30537_anmerkung_in_tbl_rolleberechtigung.php'); require_once('dbupdate_3.4/30181_tabelle_anrechnung_neue_attribute_fuer_begruendung.php'); require_once('dbupdate_3.4/29529_infocenter_anpassungen.php'); require_once('dbupdate_3.4/29835_uhstat1_erfassung_der_uhstat1_daten_ueber_das_bewerbungstool.php'); +require_once('dbupdate_3.4/33003_bis_meldung_personal.php'); // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen diff --git a/system/dbupdate_3.4/33003_bis_meldung_personal.php b/system/dbupdate_3.4/33003_bis_meldung_personal.php index f59d6770e..eb49217ea 100644 --- a/system/dbupdate_3.4/33003_bis_meldung_personal.php +++ b/system/dbupdate_3.4/33003_bis_meldung_personal.php @@ -5,8 +5,7 @@ if (! defined('DB_NAME')) exit('No direct script access allowed'); if(!@$db->db_query("SELECT habilitation FROM public.tbl_mitarbeiter LIMIT 1")) { $qry = "ALTER TABLE public.tbl_mitarbeiter ADD COLUMN habilitation boolean NOT NULL DEFAULT false; - COMMENT ON COLUMN public.tbl_mitarbeiter.habilitation IS 'Zeigt an, ob Mitarbeiter habilitiert ist (BIS relevant).'; - "; + COMMENT ON COLUMN public.tbl_mitarbeiter.habilitation IS 'Zeigt an, ob Mitarbeiter habilitiert ist (BIS relevant).';"; if(!$db->db_query($qry)) echo 'public.tbl_mitarbeiter '.$db->db_last_error().'
'; From 3e7d91718445aec64fdf2845fae46ea894fd4eb0 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Fri, 22 Dec 2023 19:07:15 +0100 Subject: [PATCH 3/4] deleted anrechnung von outgoing lvs file in dbupdate folder --- .../dbupdate_3.4/anrechnung_von_outgoing_lvs.php | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 system/dbupdate_3.4/anrechnung_von_outgoing_lvs.php diff --git a/system/dbupdate_3.4/anrechnung_von_outgoing_lvs.php b/system/dbupdate_3.4/anrechnung_von_outgoing_lvs.php deleted file mode 100644 index 0af077e66..000000000 --- a/system/dbupdate_3.4/anrechnung_von_outgoing_lvs.php +++ /dev/null @@ -1,16 +0,0 @@ -db_query("SELECT 1 FROM system.tbl_app WHERE app='mobilityonline'")) -{ - if($db->db_num_rows($result)==0) - { - $qry = "INSERT INTO system.tbl_app(app) VALUES('mobilityonline');"; - - if(!$db->db_query($qry)) - echo 'App: '.$db->db_last_error().'
'; - else - echo '
Neue App mobilityonline in system.tbl_app hinzugefügt'; - } -} From 1d300a604f59e130040cbc2ffc1ebe1f3ecaca69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Thu, 8 Feb 2024 08:03:34 +0100 Subject: [PATCH 4/4] =?UTF-8?q?Funktion=20zum=20Migrieren=20der=20Habiliat?= =?UTF-8?q?ion=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/system/MigrateContract.php | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/application/controllers/system/MigrateContract.php b/application/controllers/system/MigrateContract.php index 99b894473..f011be356 100644 --- a/application/controllers/system/MigrateContract.php +++ b/application/controllers/system/MigrateContract.php @@ -677,4 +677,35 @@ class MigrateContract extends CLI_Controller else return 0; } + + /** + * Habilitation wird aus der Tabelle bis.tbl_bisverwendung in die Tabelle public.tbl_mitarbeiter uebernommen + * Sofern die Person einmal in den Verwendungen eine habiliation eingetragen hat wird diese in den MA-Datensatz übernommen + * Da es in der regel öfter vorkommt dass das hakerl vergessen wurde beim Vertragswechsel als dass die person die habiliation verliert. + */ + public function migrateHabilitation() + { + $this->load->model('ressource/Mitarbeiter_model','MitarbeiterModel'); + $db = new DB_Model(); + + $qry = " + SELECT + distinct mitarbeiter_uid + FROM + bis.tbl_bisverwendung + WHERE + habilitation=true"; + + $resultHabilitation = $db->execReadOnlyQuery($qry); + + if (isSuccess($resultHabilitation) && hasData($resultHabilitation)) + { + $habilitationen = getData($resultHabilitation); + + foreach ($habilitationen as $row_habilitationen) + { + $this->MitarbeiterModel->update($row_habilitationen->mitarbeiter_uid, array('habilitation'=>true)); + } + } + } }