diff --git a/cis/private/profile/index.php b/cis/private/profile/index.php index d1d6c96b5..1273c517b 100644 --- a/cis/private/profile/index.php +++ b/cis/private/profile/index.php @@ -156,12 +156,7 @@ echo ' $(document).ready(function() { - $("#t1").tablesorter( - { - sortList: [[0,0]], - widgets: ["zebra"] - }); - $("#t2").tablesorter( + $("#t1, #t2, #tfuture").tablesorter( { sortList: [[0,0]], widgets: ["zebra"] @@ -504,7 +499,7 @@ echo ' if (!defined('CIS_PROFIL_FUNKTIONEN_ANZEIGEN') || CIS_PROFIL_FUNKTIONEN_ANZEIGEN) { //Funktionen - $qry = "SELECT + $baseqry = "SELECT *, tbl_benutzerfunktion.oe_kurzbz as oe_kurzbz, tbl_organisationseinheit.bezeichnung as oe_bezeichnung, tbl_benutzerfunktion.semester, tbl_benutzerfunktion.bezeichnung as bf_bezeichnung, tbl_benutzerfunktion.wochenstunden, tbl_benutzerfunktion.datum_von, tbl_benutzerfunktion.datum_bis @@ -513,15 +508,33 @@ if (!defined('CIS_PROFIL_FUNKTIONEN_ANZEIGEN') || CIS_PROFIL_FUNKTIONEN_ANZEIGEN JOIN public.tbl_funktion USING(funktion_kurzbz) JOIN public.tbl_organisationseinheit USING(oe_kurzbz) WHERE - uid=".$db->db_add_param($uid)." AND - (tbl_benutzerfunktion.datum_bis is null OR tbl_benutzerfunktion.datum_bis>=now())"; + uid=".$db->db_add_param($uid); - if ($result_funktion = $db->db_query($qry)) + $currfunkqry = $baseqry . " AND ((tbl_benutzerfunktion.datum_bis is null OR tbl_benutzerfunktion.datum_bis>=now()) + AND (tbl_benutzerfunktion.datum_von is null OR tbl_benutzerfunktion.datum_von<=now()))"; + $futurefunkqry = $baseqry . " AND (tbl_benutzerfunktion.datum_von>now())"; + + printFunctionsTable($currfunkqry, 'profil/funktionen', 't1', true); + printFunctionsTable($futurefunkqry, 'profil/zukuenftigeFunktionen', 'tfuture'); +} + +/** + * Print html table containing user functions. + * @param $query string execute for getting data + * @param $tableid string html table id + * @param $showVertragsstunden bool show Vertragsstunden sum near Wochenstunden sum + */ +function printFunctionsTable($query, $headingphrase, $tableid, $showVertragsstunden = false) +{ + global $db, $p, $datum_obj, $uid; + + if ($result_funktion = $db->db_query($query)) { if ($db->db_num_rows($result_funktion) > 0) { - echo ''.$p->t('profil/funktionen').' - + echo ''.$p->t($headingphrase).''; + echo ' +
@@ -547,7 +560,7 @@ if (!defined('CIS_PROFIL_FUNKTIONEN_ANZEIGEN') || CIS_PROFIL_FUNKTIONEN_ANZEIGEN - + "; if(isset($row_funktion->wochenstunden)) @@ -556,18 +569,21 @@ if (!defined('CIS_PROFIL_FUNKTIONEN_ANZEIGEN') || CIS_PROFIL_FUNKTIONEN_ANZEIGEN echo '
'; //vertragsstunden - $vertragsstunden = 0.00; - $qry = "SELECT sum(vertragsstunden) AS vertragsstdsumme from bis.tbl_bisverwendung - WHERE mitarbeiter_uid = ".$db->db_add_param($uid)." - AND (ende > now() OR ende IS NULL)"; - - if ($result_vertragsstd = $db->db_query($qry)) + if ($showVertragsstunden === true) { - if ($db->db_num_rows($result_vertragsstd) > 0) + $vertragsstunden = 0.00; + $qry = "SELECT sum(vertragsstunden) AS vertragsstdsumme from bis.tbl_bisverwendung + WHERE mitarbeiter_uid = ".$db->db_add_param($uid)." + AND (ende > now() OR ende IS NULL)"; + + if ($result_vertragsstd = $db->db_query($qry)) { - while($row_vertragsstd = $db->db_fetch_object($result_vertragsstd)) + if ($db->db_num_rows($result_vertragsstd) > 0) { - $vertragsstunden = $row_vertragsstd->vertragsstdsumme; + while($row_vertragsstd = $db->db_fetch_object($result_vertragsstd)) + { + $vertragsstunden = $row_vertragsstd->vertragsstdsumme; + } } } } @@ -577,13 +593,12 @@ if (!defined('CIS_PROFIL_FUNKTIONEN_ANZEIGEN') || CIS_PROFIL_FUNKTIONEN_ANZEIGEN - - + + "; echo "
'.$p->t('global/bezeichnung').'".$row_funktion->organisationseinheittyp_kurzbz.' '.$row_funktion->oe_bezeichnung." ".$datum_obj->formatDatum($row_funktion->datum_von,'d.m.Y')." ".$datum_obj->formatDatum($row_funktion->datum_bis,'d.m.Y')."".$row_funktion->wochenstunden."".number_format($row_funktion->wochenstunden, 2)."
Summe Wochenstunden (Vertragsstunden) ".number_format($wochenstunden_sum,2). - " (".number_format($vertragsstunden,2).")Summe Wochenstunden".($showVertragsstunden === true ? " (".$p->t('profil/vertragsstunden').")" : "")." ".number_format($wochenstunden_sum,2).($showVertragsstunden === true ? + " (".number_format($vertragsstunden,2).")" : "")."
"; - } } } diff --git a/locale/de-AT/profil.php b/locale/de-AT/profil.php index 61c89784e..bf999ce96 100644 --- a/locale/de-AT/profil.php +++ b/locale/de-AT/profil.php @@ -81,4 +81,6 @@ $this->phrasen['profil/bildSpeichern']='Bild speichern'; $this->phrasen['profil/gueltigvon']='Gültig von'; $this->phrasen['profil/gueltigbis']='Gültig bis'; $this->phrasen['profil/wochenstunden']='Wochenstunden'; +$this->phrasen['profil/vertragsstunden']='Vertragsstunden'; +$this->phrasen['profil/zukuenftigeFunktionen']='Zukünftige Funktionen'; ?> diff --git a/locale/en-US/profil.php b/locale/en-US/profil.php index 538c1d1e4..ef8380d8a 100644 --- a/locale/en-US/profil.php +++ b/locale/en-US/profil.php @@ -79,4 +79,6 @@ $this->phrasen['profil/bildSpeichern']='Save image'; $this->phrasen['profil/gueltigvon']='Valid from'; $this->phrasen['profil/gueltigbis']='Valid to'; $this->phrasen['profil/wochenstunden']='week hours'; +$this->phrasen['profil/vertragsstunden']='contract hours'; +$this->phrasen['profil/zukuenftigeFunktionen']='Future functions'; ?> diff --git a/locale/it-IT/profil.php b/locale/it-IT/profil.php index 14636a082..27f52566f 100644 --- a/locale/it-IT/profil.php +++ b/locale/it-IT/profil.php @@ -59,5 +59,6 @@ $this->phrasen['profil/zeitsperrenVon']=''; $this->phrasen['profil/zeitwuensche']=''; $this->phrasen['profil/zustaendigeAssistenz']=''; $this->phrasen['profil/wochenstunden']=''; - +$this->phrasen['profil/vertragsstunden']=''; +$this->phrasen['profil/zukuenftigeFunktionen']=''; ?>