From 96b4210d218bddb2359d99e6bcb2b54703522c29 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Thu, 30 Jul 2026 15:29:15 +0200 Subject: [PATCH] refactor backend css file for showing inactive items in dropdown fix missing view for vertretung zeitsperren sticky top for header --- .../api/frontend/v1/MaZeitsperren.php | 24 ++- .../models/ressource/Zeitsperre_model.php | 71 +------- application/views/Vertragsverwaltung.php | 5 +- public/css/components/Zeitsperren.css | 3 + .../Details/listsZeitsperren.js | 154 +++++++++--------- system/phrasesupdate.php | 41 ++++- 6 files changed, 146 insertions(+), 152 deletions(-) create mode 100644 public/css/components/Zeitsperren.css diff --git a/application/controllers/api/frontend/v1/MaZeitsperren.php b/application/controllers/api/frontend/v1/MaZeitsperren.php index 93c0f619f..796adc40c 100644 --- a/application/controllers/api/frontend/v1/MaZeitsperren.php +++ b/application/controllers/api/frontend/v1/MaZeitsperren.php @@ -34,7 +34,6 @@ class MaZeitsperren extends FHCAPI_Controller //only user with zeitsperren public function getAllActiveZeitsperren($days) { - $result = $this->ZeitsperreModel->getZeitsperrenForNextDays($days); $data = $this->getDataOrTerminateWithError($result); @@ -45,7 +44,9 @@ class MaZeitsperren extends FHCAPI_Controller //all fixe Ma public function getAllZeitsperrenFixeMa($days) { - $result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($days, true, false, null, false); + $von = date('Y-m-d'); + $bis = date('Y-m-d', strtotime("+{$days} days")); + $result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($von, $bis, true, false, null, false); $data = $this->getDataOrTerminateWithError($result); $this->terminateWithSuccess($data); @@ -53,7 +54,9 @@ class MaZeitsperren extends FHCAPI_Controller public function getAllZeitsperrenLector($days) { - $result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($days, false, true, null, false); + $von = date('Y-m-d'); + $bis = date('Y-m-d', strtotime("+{$days} days")); + $result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($von, $bis, false, true, null, false); $data = $this->getDataOrTerminateWithError($result); @@ -62,7 +65,9 @@ class MaZeitsperren extends FHCAPI_Controller public function getZeitsperrenAss($days) { - $result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($days, false, false, null, true); + $von = date('Y-m-d'); + $bis = date('Y-m-d', strtotime("+{$days} days")); + $result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($von, $bis, false, false, null, true); $data = $this->getDataOrTerminateWithError($result); @@ -71,7 +76,9 @@ class MaZeitsperren extends FHCAPI_Controller public function getAllZeitsperrenOes($days, $oe) { - $result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($days, false, false, $oe, false); + $von = date('Y-m-d'); + $bis = date('Y-m-d', strtotime("+{$days} days")); + $result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($von, $bis, false, false, $oe, false); $data = $this->getDataOrTerminateWithError($result); @@ -80,7 +87,9 @@ class MaZeitsperren extends FHCAPI_Controller public function loadZeitsperrenLectorStg($days, $stg) { - $result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($days, false, true, false, false, $stg); + $von = date('Y-m-d'); + $bis = date('Y-m-d', strtotime("+{$days} days")); + $result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($von, $bis, false, true, false, false, $stg); $data = $this->getDataOrTerminateWithError($result); @@ -96,7 +105,8 @@ class MaZeitsperren extends FHCAPI_Controller kurzbzlang, typ, bezeichnung, - kurzbzlang || ' (' || bezeichnung || ')' AS label + kurzbzlang || ' (' || bezeichnung || ')' AS label, + aktiv from public.tbl_studiengang where diff --git a/application/models/ressource/Zeitsperre_model.php b/application/models/ressource/Zeitsperre_model.php index 4a6bc330e..4ecd1bda8 100644 --- a/application/models/ressource/Zeitsperre_model.php +++ b/application/models/ressource/Zeitsperre_model.php @@ -67,13 +67,11 @@ class Zeitsperre_model extends DB_Model * @ days: count of the intervall of the next days * @return array */ - public function getZeitsperrenForNextDays($days, $type=null) + public function getZeitsperrenForNextDays($days) { - //TODO(Manu) von und bis im controller berechnen und hier übergeben $von = date('Y-m-d'); $bis = date('Y-m-d', strtotime("+{$days} days")); - //version with campus.vw_mitarbeiter $paramsArray = [$von, $bis, $bis, $von]; $qry = "select nachname, @@ -82,85 +80,28 @@ class Zeitsperre_model extends DB_Model vondatum, bisdatum, vertretung_uid, - erreichbarkeit_kurzbz - --lektor, - -- fixangestellt + erreichbarkeit_kurzbz, + mv.kurzbz from campus.vw_mitarbeiter join campus.tbl_zeitsperre on (uid = mitarbeiter_uid) + left join public.tbl_mitarbeiter mv on campus.tbl_zeitsperre.vertretung_uid = mv.mitarbeiter_uid where ((? <= bisdatum and ? >= bisdatum) or (?>= vondatum and ? <= vondatum)) + order by nachname "; - //fix, lektor etc just with all ma - if($type=="fix") { - $qry.= "AND fixangestellt = true"; - } - if($type=="lector") { - $qry.= "AND lektor = true"; - } - - //wenn lektor= WAHR und fixangestellt = Falsch: --> externer Lektor - - $qry .= " order by nachname"; - - - - //version with hr.dienstverhaeltnis -/* $paramsArray = [$bis, $von]; - $qry = " - SELECT - ps.nachname, - ps.vorname, - zs.mitarbeiter_uid, - zs.vondatum, - zs.bisdatum, - zs.vertretung_uid, - zs.erreichbarkeit_kurzbz - FROM campus.tbl_zeitsperre zs - JOIN public.tbl_benutzer bn - ON bn.uid = zs.mitarbeiter_uid - JOIN public.tbl_person ps - ON ps.person_id = bn.person_id "; - - if ($type != null) { - $qry.= " JOIN hr.tbl_dienstverhaeltnis dv on bn.uid = dv.mitarbeiter_uid "; - } - - $qry.=" - WHERE - zs.vondatum <= ? - AND zs.bisdatum >= ?"; - - if($type=="fix") { - $qry.= " and dv.vertragsart_kurzbz = 'echterdv'"; - } - if($type=="lector") { - $qry.= " and dv.vertragsart_kurzbz in ('externerlehrender', 'gastlektor')"; - } - - $qry .= " - ORDER BY - ps.nachname, - ps.vorname, - zs.vondatum;";*/ - $result = $this->execQuery($qry, $paramsArray); return $result; } - public function getMitarbeiterWithZeitsperren($days, $fix=false, $lector=false, $oe=null, $ass=false, $stg=false) + public function getMitarbeiterWithZeitsperren($von, $bis, $fix=false, $lector=false, $oe=null, $ass=false, $stg=false) { - //TODO(Manu) von und bis im controller berechnen und hier übergeben - $von = date('Y-m-d'); - $bis = date('Y-m-d', strtotime("+{$days} days")); - - //version with campus.vw_mitarbeiter $paramsArray = [$von, $bis, $bis, $von]; if($oe) diff --git a/application/views/Vertragsverwaltung.php b/application/views/Vertragsverwaltung.php index 8fa6dff27..4a73be945 100644 --- a/application/views/Vertragsverwaltung.php +++ b/application/views/Vertragsverwaltung.php @@ -12,13 +12,14 @@ $includesArray = array( 'tinymce5' => true, 'phrases' => array( 'global', - 'ui', + 'ui' ), 'customCSSs' => [ 'public/css/components/vue-datepicker.css', 'public/css/components/primevue.css', 'public/css/Vertragsverwaltung.css', - 'public/css/components/Detailheader.css' + 'public/css/components/Detailheader.css', + 'public/css/components/Zeitsperren.css' ], 'customJSs' => [ #'vendor/npm-asset/primevue/tree/tree.min.js', diff --git a/public/css/components/Zeitsperren.css b/public/css/components/Zeitsperren.css new file mode 100644 index 000000000..3e5e4a632 --- /dev/null +++ b/public/css/components/Zeitsperren.css @@ -0,0 +1,3 @@ +.item-inactive { + text-decoration: line-through; +} \ No newline at end of file diff --git a/public/js/components/Cis/ZeitsperrenMitarbeiter/Details/listsZeitsperren.js b/public/js/components/Cis/ZeitsperrenMitarbeiter/Details/listsZeitsperren.js index cde46e0d8..fc3687853 100644 --- a/public/js/components/Cis/ZeitsperrenMitarbeiter/Details/listsZeitsperren.js +++ b/public/js/components/Cis/ZeitsperrenMitarbeiter/Details/listsZeitsperren.js @@ -311,80 +311,81 @@ export default { }, template: `
-

{{$p.t('zeitsperren/title_allMa')}} - {{$p.t('zeitsperren/title_fix')}} - {{$p.t('zeitsperren/title_fixLecturers')}} - {{$p.t('zeitsperren/title_byOe')}} - {{$p.t('zeitsperren/title_lectStg')}} - {{$p.t('zeitsperren/title_ass')}} - {{ mondayBeforeToday.toLocaleDateString('de-AT') }} - {{endInterval}} -

-
- - - -
- - - - - -
- - -
- - - - - +
+

{{$p.t('zeitsperren/title_allMa')}} + {{$p.t('zeitsperren/title_fix')}} + {{$p.t('zeitsperren/title_fixLecturers')}} + {{$p.t('zeitsperren/title_byOe')}} + {{$p.t('zeitsperren/title_lectStg')}} + {{$p.t('zeitsperren/title_ass')}} + {{ mondayBeforeToday.toLocaleDateString('de-AT') }} - {{endInterval}} +

+
+ + + +
+ + + + + +
+ +
+ + + + + +
@@ -404,14 +405,13 @@ export default { :key="m.uid" > {{m.sperren[0].nachname}} {{m.sperren[0].vorname}} -