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)); + } + } + } } diff --git a/system/dbupdate_3.4.php b/system/dbupdate_3.4.php index 7baeca953..532d66aac 100644 --- a/system/dbupdate_3.4.php +++ b/system/dbupdate_3.4.php @@ -49,6 +49,7 @@ require_once('dbupdate_3.4/30181_tabelle_anrechnung_neue_attribute_fuer_begruend 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/33714_erhoehter_studienbeitrag_fuer_drittsaatenangehoerig.php'); +require_once('dbupdate_3.4/33003_bis_meldung_personal.php'); require_once('dbupdate_3.4/36275_zeitaufzeichnung_karenz.php'); require_once('dbupdate_3.4/21620_neues_feld_zum_erfassen_des_ESI.php'); require_once('dbupdate_3.4/36530_bis_internationsalisierung_codextabelle_neuerungen.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..eb49217ea --- /dev/null +++ b/system/dbupdate_3.4/33003_bis_meldung_personal.php @@ -0,0 +1,14 @@ +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'; +}