mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-22 01:12:17 +00:00
- Funktionen können jetzt mit einem Datum versehen werden
- Aktiv-Feld bei Organisationseinheiten
This commit is contained in:
@@ -43,6 +43,8 @@ class benutzerfunktion extends basis_db
|
||||
public $insertvon=0; // string
|
||||
public $ext_id; // bigint
|
||||
public $semester; // smallint
|
||||
public $datum_von; // date
|
||||
public $datum_bis; // date
|
||||
|
||||
|
||||
/**
|
||||
@@ -86,6 +88,8 @@ class benutzerfunktion extends basis_db
|
||||
$pfunktion_obj->updateamum = $row->updateamum;
|
||||
$pfunktion_obj->updatevon = $row->updatevon;
|
||||
$pfunktion_obj->semester = $row->semester;
|
||||
$pfunktion_obj->datum_von = $row->datum_von;
|
||||
$pfunktion_obj->datum_bis = $row->datum_bis;
|
||||
|
||||
$this->result[] = $pfunktion_obj;
|
||||
}
|
||||
@@ -141,6 +145,8 @@ class benutzerfunktion extends basis_db
|
||||
$this->updateamum = $row->updateamum;
|
||||
$this->updatevon = $row->updatevon;
|
||||
$this->semester = $row->semester;
|
||||
$this->datum_von = $row->datum_von;
|
||||
$this->datum_bis = $row->datum_bis;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -189,6 +195,8 @@ class benutzerfunktion extends basis_db
|
||||
$obj->updateamum = $row->updateamum;
|
||||
$obj->updatevon = $row->updatevon;
|
||||
$obj->semester = $row->semester;
|
||||
$obj->datum_von = $row->datum_von;
|
||||
$obj->datum_bis = $row->datum_bis;
|
||||
|
||||
$this->result[] = $obj;
|
||||
|
||||
@@ -235,6 +243,8 @@ class benutzerfunktion extends basis_db
|
||||
$this->updateamum = $row->updateamum;
|
||||
$this->updatevon = $row->updatevon;
|
||||
$this->semester = $row->semester;
|
||||
$this->datum_von = $row->datum_von;
|
||||
$this->datum_bis = $row->datum_bis;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -296,7 +306,7 @@ class benutzerfunktion extends basis_db
|
||||
}
|
||||
}
|
||||
$qry = 'BEGIN;INSERT INTO public.tbl_benutzerfunktion (fachbereich_kurzbz, uid, oe_kurzbz, funktion_kurzbz, insertamum, insertvon,
|
||||
updateamum, updatevon, semester) VALUES ('.
|
||||
updateamum, updatevon, semester, datum_von, datum_bis) VALUES ('.
|
||||
$this->addslashes($this->fachbereich_kurzbz).', '.
|
||||
$this->addslashes($this->uid).', '.
|
||||
$this->addslashes($this->oe_kurzbz).', '.
|
||||
@@ -305,7 +315,9 @@ class benutzerfunktion extends basis_db
|
||||
$this->addslashes($this->insertvon).', '.
|
||||
$this->addslashes($this->updateamum).', '.
|
||||
$this->addslashes($this->updatevon).', '.
|
||||
$this->addslashes($this->semester).'); ';
|
||||
$this->addslashes($this->semester).','.
|
||||
$this->addslashes($this->datum_von).','.
|
||||
$this->addslashes($this->datum_bis).'); ';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -328,6 +340,8 @@ class benutzerfunktion extends basis_db
|
||||
'insertvon='.$this->addslashes($this->insertvon).', '.
|
||||
'updateamum='.$this->addslashes($this->updateamum).', '.
|
||||
'updatevon='.$this->addslashes($this->updatevon).', '.
|
||||
'datum_von='.$this->addslashes($this->datum_von).', '.
|
||||
'datum_bis='.$this->addslashes($this->datum_bis).', '.
|
||||
'semester='.$this->addslashes($this->semester).' '.
|
||||
'WHERE benutzerfunktion_id = '.$this->addslashes($this->benutzerfunktion_id).';';
|
||||
}
|
||||
|
||||
@@ -35,7 +35,8 @@ class funktion extends basis_db
|
||||
public $beschreibung; // string
|
||||
public $aktiv; // boolean
|
||||
public $ext_id; // bigint
|
||||
|
||||
public $fachbereich; // boolean
|
||||
public $semester; // boolean
|
||||
|
||||
/**
|
||||
* Konstruktor
|
||||
@@ -72,9 +73,11 @@ class funktion extends basis_db
|
||||
{
|
||||
$funktion_obj = new funktion();
|
||||
|
||||
$funktion_obj->funktion_kurzbz = $row->funktion_kurzbz;
|
||||
$funktion_obj->beschreibung = $row->beschreibung;
|
||||
$funktion_obj->aktiv = $row->aktiv;
|
||||
$funktion_obj->funktion_kurzbz = $row->funktion_kurzbz;
|
||||
$funktion_obj->beschreibung = $row->beschreibung;
|
||||
$funktion_obj->aktiv = $row->aktiv;
|
||||
$funktion_obj->fachbereich = ($row->fachbereich=='t'?true:false);
|
||||
$funktion_obj->semester = ($row->semester=='t'?true:false);
|
||||
|
||||
$this->result[] = $funktion_obj;
|
||||
}
|
||||
@@ -118,9 +121,11 @@ class funktion extends basis_db
|
||||
|
||||
if($row = $this->db_fetch_object())
|
||||
{
|
||||
$this->funktion_kurzbz = $row->funktion_kurzbz;
|
||||
$this->beschreibung = $row->beschreibung;
|
||||
$this->aktiv = $row->aktiv;
|
||||
$this->funktion_kurzbz = $row->funktion_kurzbz;
|
||||
$this->beschreibung = $row->beschreibung;
|
||||
$this->aktiv = $row->aktiv;
|
||||
$this->fachbereich = ($row->fachbereich=='t'?true:false);
|
||||
$this->semester = ($row->semester=='t'?true:false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -168,9 +173,11 @@ class funktion extends basis_db
|
||||
return false;
|
||||
}
|
||||
//Neuen Datensatz anlegen
|
||||
$qry = 'INSERT INTO public.tbl_funktion (funktion_kurzbz, beschreibung, aktiv) VALUES ('.
|
||||
$qry = 'INSERT INTO public.tbl_funktion (funktion_kurzbz, beschreibung, fachbereich, semester, aktiv) VALUES ('.
|
||||
$this->addslashes($this->funktion_kurzbz).', '.
|
||||
$this->addslashes($this->beschreibung).', '.
|
||||
($this->fachbereich?'true':'false').','.
|
||||
($this->semester?'true':'false').','.
|
||||
($this->aktiv?'true':'false').'); ';
|
||||
}
|
||||
else
|
||||
@@ -186,6 +193,8 @@ class funktion extends basis_db
|
||||
|
||||
$qry = 'UPDATE public.tbl_funktion SET '.
|
||||
'beschreibung='.$this->addslashes($this->beschreibung).', '.
|
||||
'fachbereich='.($this->fachbereich?'true':'false').','.
|
||||
'semester='.($this->semester?'true':'false').','.
|
||||
'aktiv='.($this->aktiv?'true':'false') .' '.
|
||||
'WHERE funktion_kurzbz = '.$this->addslashes($this->funktion_kurzbz).';';
|
||||
}
|
||||
|
||||
@@ -623,9 +623,17 @@ class mitarbeiter extends benutzer
|
||||
if($fix=='false')
|
||||
$qry .= " AND fixangestellt=false";
|
||||
if($stgl)
|
||||
$qry .= " AND funktion_kurzbz='stgl'";
|
||||
{
|
||||
$qry .= " AND funktion_kurzbz='stgl'
|
||||
AND (tbl_benutzerfunktion.datum_von is null OR tbl_benutzerfunktion.datum_von<=now()) AND
|
||||
(tbl_benutzerfunktion.datum_bis is null OR tbl_benutzerfunktion.datum_bis>=now())";
|
||||
}
|
||||
if($fbl)
|
||||
$qry .= " AND funktion_kurzbz='fbl'";
|
||||
{
|
||||
$qry .= " AND funktion_kurzbz='fbl'
|
||||
AND (tbl_benutzerfunktion.datum_von is null OR tbl_benutzerfunktion.datum_von<=now()) AND
|
||||
(tbl_benutzerfunktion.datum_bis is null OR tbl_benutzerfunktion.datum_bis>=now())";
|
||||
}
|
||||
if($aktiv=='true')
|
||||
$qry .= " AND tbl_benutzer.aktiv=true";
|
||||
if($aktiv=='false')
|
||||
@@ -845,6 +853,8 @@ class mitarbeiter extends benutzer
|
||||
$sql_query="SELECT DISTINCT campus.vw_mitarbeiter.* FROM campus.vw_mitarbeiter
|
||||
JOIN public.tbl_benutzerfunktion USING (uid)
|
||||
WHERE funktion_kurzbz='oezuordnung' AND fachbereich_kurzbz='".addslashes($institut)."'
|
||||
(tbl_benutzerfunktion.datum_von is null OR tbl_benutzerfunktion.datum_von<=now()) AND
|
||||
(tbl_benutzerfunktion.datum_bis is null OR tbl_benutzerfunktion.datum_bis>=now())
|
||||
ORDER BY nachname, vorname";
|
||||
|
||||
if($this->db_query($sql_query))
|
||||
@@ -901,11 +911,24 @@ class mitarbeiter extends benutzer
|
||||
if (is_null($uid))
|
||||
$uid=$this->uid;
|
||||
// Suche in Instituten
|
||||
$qry = "SELECT CASE WHEN fachbereich_kurzbz is not null THEN (SELECT uid FROM public.tbl_benutzerfunktion WHERE fachbereich_kurzbz=a.fachbereich_kurzbz AND funktion_kurzbz='fbl' LIMIT 1)
|
||||
WHEN oe_kurzbz is not null THEN (SELECT uid FROM public.tbl_benutzerfunktion WHERE oe_kurzbz=a.oe_kurzbz AND funktion_kurzbz='stgl' LIMIT 1)
|
||||
$qry = "SELECT CASE WHEN fachbereich_kurzbz is not null THEN (SELECT uid FROM public.tbl_benutzerfunktion
|
||||
WHERE fachbereich_kurzbz=a.fachbereich_kurzbz AND
|
||||
funktion_kurzbz='fbl' AND
|
||||
(tbl_benutzerfunktion.datum_von is null OR tbl_benutzerfunktion.datum_von<=now()) AND
|
||||
(tbl_benutzerfunktion.datum_bis is null OR tbl_benutzerfunktion.datum_bis>=now())
|
||||
LIMIT 1)
|
||||
WHEN oe_kurzbz is not null THEN (SELECT uid FROM public.tbl_benutzerfunktion
|
||||
WHERE oe_kurzbz=a.oe_kurzbz AND
|
||||
funktion_kurzbz='stgl' AND
|
||||
(tbl_benutzerfunktion.datum_von is null OR tbl_benutzerfunktion.datum_von<=now()) AND
|
||||
(tbl_benutzerfunktion.datum_bis is null OR tbl_benutzerfunktion.datum_bis>=now())
|
||||
LIMIT 1)
|
||||
ELSE ''
|
||||
END as vorgesetzter
|
||||
FROM public.tbl_benutzerfunktion a WHERE funktion_kurzbz='oezuordnung' AND uid='".addslashes($uid)."'";
|
||||
FROM public.tbl_benutzerfunktion a WHERE
|
||||
funktion_kurzbz='oezuordnung' AND uid='".addslashes($uid)."' AND
|
||||
(a.datum_von is null OR a.datum_von<=now()) AND
|
||||
(a.datum_bis is null OR a.datum_bis>=now())";
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
@@ -936,7 +959,9 @@ class mitarbeiter extends benutzer
|
||||
|
||||
//Alle Studiengaenge und Fachbereiche holen bei denen die Person die Leitung hat
|
||||
$qry = "SELECT * FROM public.tbl_benutzerfunktion
|
||||
WHERE (funktion_kurzbz='fbl' OR funktion_kurzbz='stgl') AND uid='".addslashes($uid)."'";
|
||||
WHERE (funktion_kurzbz='fbl' OR funktion_kurzbz='stgl') AND uid='".addslashes($uid)."' AND
|
||||
(tbl_benutzerfunktion.datum_von is null OR tbl_benutzerfunktion.datum_von<=now()) AND
|
||||
(tbl_benutzerfunktion.datum_bis is null OR tbl_benutzerfunktion.datum_bis>=now())";
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
@@ -974,6 +999,8 @@ class mitarbeiter extends benutzer
|
||||
if($oe!='')
|
||||
$qry.=" OR (funktion_kurzbz='ass' AND oe_kurzbz in($oe))";
|
||||
|
||||
$qry.= " AND (tbl_benutzerfunktion.datum_von is null OR tbl_benutzerfunktion.datum_von<=now()) AND
|
||||
(tbl_benutzerfunktion.datum_bis is null OR tbl_benutzerfunktion.datum_bis>=now())";
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
|
||||
@@ -37,6 +37,7 @@ class organisationseinheit extends basis_db
|
||||
public $oe_parent_kurzbz;
|
||||
public $bezeichnung;
|
||||
public $organisationseinheittyp_kurzbz;
|
||||
public $aktiv;
|
||||
|
||||
/**
|
||||
* Konstruktor
|
||||
@@ -65,6 +66,7 @@ class organisationseinheit extends basis_db
|
||||
$obj->oe_parent_kurzbz = $row->oe_parent_kurzbz;
|
||||
$obj->bezeichnung = $row->bezeichnung;
|
||||
$obj->organisationseinheittyp_kurzbz = $row->organisationseinheittyp_kurzbz;
|
||||
$obj->aktiv = ($row->aktiv=='t'?true:false);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
@@ -104,6 +106,7 @@ class organisationseinheit extends basis_db
|
||||
$this->bezeichnung = $row->bezeichnung;
|
||||
$this->oe_parent_kurzbz = $row->oe_parent_kurzbz;
|
||||
$this->organisationseinheittyp_kurzbz = $row->organisationseinheittyp_kurzbz;
|
||||
$this->aktiv = ($row->aktiv=='t'?true:false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -133,6 +136,7 @@ class organisationseinheit extends basis_db
|
||||
$obj->oe_parent_kurzbz = $row->oe_parent_kurzbz;
|
||||
$obj->bezeichnung = $row->bezeichnung;
|
||||
$obj->organisationseinheittyp_kurzbz = $row->organisationseinheittyp_kurzbz;
|
||||
$obj->aktiv = ($row->aktiv=='t'?true:false);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user