mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-26 00:54:27 +00:00
codex/Bisverwendung_model:
- added getVerwendungen method person/Benutzer_model - added comment person/Benutzerfunktion_model - added getBenutzerFunktionByUid method ressource/Mitarbeiter_model - added getVorgesetzte method - extended getPersonal method
This commit is contained in:
@@ -61,7 +61,7 @@ class Benutzer_model extends DB_Model
|
||||
/**
|
||||
* Generates alias for a uid.
|
||||
* @param $uid
|
||||
* @return array the alias
|
||||
* @return array the alias if newly generated
|
||||
*/
|
||||
public function generateAlias($uid)
|
||||
{
|
||||
@@ -78,7 +78,6 @@ class Benutzer_model extends DB_Model
|
||||
|
||||
if (hasData($aliasexists) && !getData($aliasexists)[0])
|
||||
$aliasres = $alias;
|
||||
|
||||
}
|
||||
return success($aliasres);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,43 @@ class Benutzerfunktion_model extends DB_Model
|
||||
$this->pk = 'benutzerfunktion_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* Lädt alle Benutzerfunktionen zu einer UID
|
||||
* @param type $uid UID des Mitarbeiters
|
||||
* @param type $funktion_kurzbz OPTIONAL Kurzbezeichnung der Funktion
|
||||
* @param type $startZeitraum OPTIONAL Start Zeitraum in dem die Funktion aktiv ist
|
||||
* @param type $endeZeitraum OPTIONAL Ende Zeitraum in dem die Funktion aktiv ist
|
||||
* @return boolean
|
||||
*/
|
||||
public function getBenutzerFunktionByUid($uid, $funktion_kurzbz=null, $startZeitraum=null, $endeZeitraum=null)
|
||||
{
|
||||
$params = array($uid);
|
||||
|
||||
$qry = "SELECT tbl_benutzerfunktion.*, tbl_organisationseinheit.organisationseinheittyp_kurzbz
|
||||
FROM public.tbl_benutzerfunktion
|
||||
LEFT JOIN public.tbl_organisationseinheit USING(oe_kurzbz)
|
||||
WHERE uid=?";
|
||||
if(!is_null($funktion_kurzbz))
|
||||
{
|
||||
$qry .= ' AND funktion_kurzbz = ?';
|
||||
$params[] = $funktion_kurzbz;
|
||||
}
|
||||
if(!is_null($startZeitraum))
|
||||
{
|
||||
$qry .=' AND (datum_bis IS NULL OR datum_bis >= ?)';
|
||||
$params[] = $startZeitraum;
|
||||
}
|
||||
if(!is_null($endeZeitraum))
|
||||
{
|
||||
$qry .=' AND (datum_von IS NULL OR datum_von <= ?)';
|
||||
$params[] = $endeZeitraum;
|
||||
}
|
||||
|
||||
$qry .= ";";
|
||||
|
||||
return $this->execQuery($qry, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Benutzerfunktion using the person_id
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user