From 6267a1bc37f8ed2c7db4dd507d9b125ad283a5eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Fri, 23 Jul 2021 13:06:15 +0200 Subject: [PATCH] =?UTF-8?q?-=20Hautpberuf=20wird=20im=20CIS=20Profil=20ang?= =?UTF-8?q?ezeigt=20f=C3=BCr=20den=20Mitarbeiter=20-=20Fehler=20behoben=20?= =?UTF-8?q?wodurch=20die=20letzte=20Verwendung=20nicht=20korrekt=20ermitte?= =?UTF-8?q?lt=20wurde=20wenn=20das=20Ende=20Datum=20leer=20ist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cis/private/profile/index.php | 17 +++++++++++++++++ include/bisverwendung.class.php | 8 +++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/cis/private/profile/index.php b/cis/private/profile/index.php index dd39cf301..80062a932 100644 --- a/cis/private/profile/index.php +++ b/cis/private/profile/index.php @@ -44,6 +44,7 @@ require_once('../../../include/addon.class.php'); require_once('../../../include/gruppe.class.php'); require_once('../../../include/adresse.class.php'); require_once('../../../include/benutzerberechtigung.class.php'); +require_once('../../../include/bisverwendung.class.php'); $sprache = getSprache(); $p = new phrasen($sprache); @@ -271,6 +272,22 @@ if (!$ansicht) } +if (!$ansicht) +{ + if ($is_employee) + { + $verwendung = new bisverwendung(); + if($verwendung->getLastVerwendung($uid)) + { + if (!$verwendung->hauptberuflich) + { + echo 'Hauptberuf: '. $verwendung->hauptberuf; + } + } + echo "

"; + } +} + if (!$ansicht) { $adresse = new adresse(); diff --git a/include/bisverwendung.class.php b/include/bisverwendung.class.php index 799cfc93e..07f2a74de 100644 --- a/include/bisverwendung.class.php +++ b/include/bisverwendung.class.php @@ -524,12 +524,13 @@ class bisverwendung extends basis_db { //laden des Datensatzes $qry = "SELECT - * + *, tbl_hauptberuf.bezeichnung as hauptberuf FROM bis.tbl_bisverwendung + LEFT JOIN bis.tbl_hauptberuf USING(hauptberufcode) WHERE mitarbeiter_uid=".$this->db_add_param($uid)." - ORDER BY ende DESC NULLS LAST,beginn DESC NULLS LAST LIMIT 1;"; + ORDER BY ende DESC NULLS FIRST,beginn DESC NULLS LAST LIMIT 1;"; if($this->db_query($qry)) { @@ -543,6 +544,7 @@ class bisverwendung extends basis_db $this->mitarbeiter_uid = $row->mitarbeiter_uid; $this->hauptberufcode = $row->hauptberufcode; $this->hauptberuflich = $this->db_parse_bool($row->hauptberuflich); + $this->hauptberuf = $row->hauptberuf; $this->habilitation = $this->db_parse_bool($row->habilitation); $this->beginn = $row->beginn; $this->ende = $row->ende; @@ -582,7 +584,7 @@ class bisverwendung extends basis_db (beginn<=now() OR beginn IS NULL) AND (ende>=now() OR ende IS NULL) - ORDER BY ende DESC NULLS LAST,beginn DESC NULLS LAST LIMIT 1;"; + ORDER BY ende DESC NULLS FIRST,beginn DESC NULLS LAST LIMIT 1;"; if($this->db_query($qry)) {