From 25ee1032e54b0e3e80aa45e471bfde787554efc8 Mon Sep 17 00:00:00 2001 From: cris-technikum Date: Tue, 10 Aug 2021 12:30:10 +0200 Subject: [PATCH] Added "homeoffice" to DB and bisverwendung Class Signed-off-by: cris-technikum --- include/bisverwendung.class.php | 22 ++++++++++++++++++++-- system/dbupdate_3.3.php | 13 ++++++++++++- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/include/bisverwendung.class.php b/include/bisverwendung.class.php index 598edcac1..ca15d03de 100644 --- a/include/bisverwendung.class.php +++ b/include/bisverwendung.class.php @@ -48,6 +48,7 @@ class bisverwendung extends basis_db public $inkludierte_lehre; public $zeitaufzeichnungspflichtig; public $azgrelevant; + public $homeoffice; public $ba1bez; public $ba2bez; @@ -124,6 +125,7 @@ class bisverwendung extends basis_db $this->inkludierte_lehre = $row->inkludierte_lehre; $this->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); $this->azgrelevant = $this->db_parse_bool($row->azgrelevant); + $this->homeoffice = $this->db_parse_bool($row->homeoffice); return true; } else @@ -257,6 +259,14 @@ class bisverwendung extends basis_db { $azgrelevant = 'null'; } + if(is_bool($this->homeoffice)) + { + $homeoffice = $this->db_add_param($this->homeoffice, FHC_BOOLEAN); + } + else + { + $homeoffice = 'null'; + } if($new) { @@ -282,7 +292,8 @@ class bisverwendung extends basis_db $this->db_add_param($this->dv_art).','. $this->db_add_param($this->inkludierte_lehre).','. $zeitaufzeichnungspflichtig.','. - $azgrelevant. ');'; + $azgrelevant.','. + $homeoffice. ');'; } else @@ -307,7 +318,8 @@ class bisverwendung extends basis_db " dv_art=".$this->db_add_param($this->dv_art).",". " inkludierte_lehre=".$this->db_add_param($this->inkludierte_lehre).",". " zeitaufzeichnungspflichtig=". $zeitaufzeichnungspflichtig.",". - " azgrelevant =". $azgrelevant. + " azgrelevant =". $azgrelevant.",". + " homeoffice =". $homeoffice. " WHERE bisverwendung_id=".$this->db_add_param($this->bisverwendung_id, FHC_INTEGER); } @@ -401,6 +413,7 @@ class bisverwendung extends basis_db $obj->inkludierte_lehre = $row->inkludierte_lehre; $obj->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); $obj->azgrelevant = $this->db_parse_bool($row->azgrelevant); + $obj->homeoffice = $this->db_parse_bool($row->homeoffice); $this->result[] = $obj; } return true; @@ -458,6 +471,7 @@ class bisverwendung extends basis_db $obj->inkludierte_lehre = $row->inkludierte_lehre; $obj->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); $obj->azgrelevant = $this->db_parse_bool($row->azgrelevant); + $obj->homeoffice = $this->db_parse_bool($row->homeoffice); $this->result[] = $obj; } @@ -517,6 +531,7 @@ class bisverwendung extends basis_db $obj->inkludierte_lehre = $row->inkludierte_lehre; $obj->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); $obj->azgrelevant = $this->db_parse_bool($row->azgrelevant); + $obj->homeoffice = $this->db_parse_bool($row->homeoffice); $this->result[] = $obj; } @@ -571,6 +586,7 @@ class bisverwendung extends basis_db $this->inkludierte_lehre = $row->inkludierte_lehre; $this->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); $this->azgrelevant = $this->db_parse_bool($row->azgrelevant); + $this->homeoffice = $this->db_parse_bool($row->homeoffice); } return true; } @@ -625,6 +641,7 @@ class bisverwendung extends basis_db $this->inkludierte_lehre = $row->inkludierte_lehre; $this->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); $this->azgrelevant = $this->db_parse_bool($row->azgrelevant); + $this->homeoffice = $this->db_parse_bool($row->homeoffice); } return true; } @@ -688,6 +705,7 @@ class bisverwendung extends basis_db $obj->inkludierte_lehre = $row->inkludierte_lehre; $obj->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); $obj->azgrelevant = $this->db_parse_bool($row->azgrelevant); + $obj->homeoffice = $this->db_parse_bool($row->homeoffice); $this->result[] = $obj; } diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 19f2e228e..a1fc54ea8 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4796,6 +4796,17 @@ if ($result = $db->db_query("SELECT * FROM pg_class WHERE relname='idx_tbl_pruef } } +// Add column homeoffice to bis.tbl_bisverwendung +if (!$result = @$db->db_query("SELECT homeoffice FROM bis.tbl_bisverwendung LIMIT 1")) +{ + $qry = "ALTER TABLE bis.tbl_bisverwendung ADD COLUMN homeoffice boolean NOT NULL DEFAULT FALSE"; + + if(!$db->db_query($qry)) + echo 'bis.tbl_bisverwendung: '.$db->db_last_error().'
'; + else + echo '
bis.tbl_bisverwendung: Spalte homeoffice hinzugefuegt'; +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; @@ -4813,7 +4824,7 @@ $tabellen=array( "bis.tbl_bisfunktion" => array("bisverwendung_id","studiengang_kz","sws","updateamum","updatevon","insertamum","insertvon","ext_id"), "bis.tbl_bisio" => array("bisio_id","mobilitaetsprogramm_code","nation_code","von","bis","zweck_code","student_uid","updateamum","updatevon","insertamum","insertvon","ext_id","ort","universitaet","lehreinheit_id","ects_erworben","ects_angerechnet"), "bis.tbl_bisio_zweck" => array("bisio_id","zweck_code"), - "bis.tbl_bisverwendung" => array("bisverwendung_id","ba1code","ba2code","vertragsstunden","beschausmasscode","verwendung_code","mitarbeiter_uid","hauptberufcode","hauptberuflich","habilitation","beginn","ende","updateamum","updatevon","insertamum","insertvon","ext_id","dv_art","inkludierte_lehre","zeitaufzeichnungspflichtig","azgrelevant"), + "bis.tbl_bisverwendung" => array("bisverwendung_id","ba1code","ba2code","vertragsstunden","beschausmasscode","verwendung_code","mitarbeiter_uid","hauptberufcode","hauptberuflich","habilitation","beginn","ende","updateamum","updatevon","insertamum","insertvon","ext_id","dv_art","inkludierte_lehre","zeitaufzeichnungspflichtig","azgrelevant", "homeoffice"), "bis.tbl_bundesland" => array("bundesland_code","kurzbz","bezeichnung"), "bis.tbl_entwicklungsteam" => array("mitarbeiter_uid","studiengang_kz","besqualcode","beginn","ende","updateamum","updatevon","insertamum","insertvon","ext_id"), "bis.tbl_gemeinde" => array("gemeinde_id","plz","name","ortschaftskennziffer","ortschaftsname","bulacode","bulabez","kennziffer"),