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))
{