Merge remote-tracking branch 'origin/master'

This commit is contained in:
Manfred Kindl
2018-10-08 14:34:03 +02:00
27 changed files with 600 additions and 321 deletions
+21 -3
View File
@@ -46,6 +46,7 @@ class bisverwendung extends basis_db
public $ext_id;
public $dv_art;
public $inkludierte_lehre;
public $zeitaufzeichnungspflichtig;
public $ba1bez;
public $ba2bez;
@@ -120,6 +121,7 @@ class bisverwendung extends basis_db
$this->vertragsstunden = $row->vertragsstunden;
$this->dv_art = $row->dv_art;
$this->inkludierte_lehre = $row->inkludierte_lehre;
$this->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig);
return true;
}
else
@@ -207,12 +209,22 @@ class bisverwendung extends basis_db
$hauptberuflich = $this->db_add_param($this->hauptberuflich, FHC_BOOLEAN);
else
$hauptberuflich = 'null';
if(is_bool($this->zeitaufzeichnungspflichtig))
{
$zeitaufzeichnungspflichtig = $this->db_add_param($this->zeitaufzeichnungspflichtig, FHC_BOOLEAN);
}
else
{
$zeitaufzeichnungspflichtig = 'null';
}
if($new)
{
//Neuen Datensatz anlegen
$qry = "BEGIN;INSERT INTO bis.tbl_bisverwendung (ba1code, ba2code, beschausmasscode,
verwendung_code, mitarbeiter_uid, hauptberufcode, hauptberuflich, habilitation, beginn, ende, vertragsstunden,
updateamum, updatevon, insertamum, insertvon, dv_art, inkludierte_lehre) VALUES (".
updateamum, updatevon, insertamum, insertvon, dv_art, inkludierte_lehre, zeitaufzeichnungspflichtig) VALUES (".
$this->db_add_param($this->ba1code, FHC_INTEGER).', '.
$this->db_add_param($this->ba2code, FHC_INTEGER).', '.
$this->db_add_param($this->beschausmasscode, FHC_INTEGER).', '.
@@ -229,7 +241,8 @@ class bisverwendung extends basis_db
$this->db_add_param($this->insertamum).', '.
$this->db_add_param($this->insertvon).', '.
$this->db_add_param($this->dv_art).','.
$this->db_add_param($this->inkludierte_lehre).');';
$this->db_add_param($this->inkludierte_lehre).','.
$zeitaufzeichnungspflichtig. ');';
}
else
@@ -252,7 +265,8 @@ class bisverwendung extends basis_db
" insertamum=".$this->db_add_param($this->insertamum).",".
" insertvon=".$this->db_add_param($this->insertvon).",".
" dv_art=".$this->db_add_param($this->dv_art).",".
" inkludierte_lehre=".$this->db_add_param($this->inkludierte_lehre).
" inkludierte_lehre=".$this->db_add_param($this->inkludierte_lehre).",".
" zeitaufzeichnungspflichtig=". $zeitaufzeichnungspflichtig.
" WHERE bisverwendung_id=".$this->db_add_param($this->bisverwendung_id, FHC_INTEGER);
}
@@ -344,6 +358,7 @@ class bisverwendung extends basis_db
$obj->vertragsstunden = $row->vertragsstunden;
$obj->dv_art = $row->dv_art;
$obj->inkludierte_lehre = $row->inkludierte_lehre;
$obj->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig);
$this->result[] = $obj;
}
@@ -400,6 +415,7 @@ class bisverwendung extends basis_db
$obj->vertragsstunden = $row->vertragsstunden;
$obj->dv_art = $row->dv_art;
$obj->inkludierte_lehre = $row->inkludierte_lehre;
$obj->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig);
$this->result[] = $obj;
}
@@ -450,6 +466,7 @@ class bisverwendung extends basis_db
$this->vertragsstunden = $row->vertragsstunden;
$this->dv_art = $row->dv_art;
$this->inkludierte_lehre = $row->inkludierte_lehre;
$this->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig);
}
return true;
}
@@ -502,6 +519,7 @@ class bisverwendung extends basis_db
$this->vertragsstunden = $row->vertragsstunden;
$this->dv_art = $row->dv_art;
$this->inkludierte_lehre = $row->inkludierte_lehre;
$this->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig);
}
return true;
}
+13 -7
View File
@@ -1179,9 +1179,7 @@ class dms extends basis_db
*/
function isLocked($dms_id)
{
$qry = "SELECT 1 FROM
(
WITH RECURSIVE kategorien(parent_kategorie_kurzbz) as
$qry = "WITH RECURSIVE kategorien(parent_kategorie_kurzbz) as
(
SELECT parent_kategorie_kurzbz FROM campus.tbl_dms_kategorie
WHERE kategorie_kurzbz=(SELECT kategorie_kurzbz FROM campus.tbl_dms WHERE dms_id=".$this->db_add_param($dms_id, FHC_INTEGER).")
@@ -1192,12 +1190,20 @@ class dms extends basis_db
WHERE k.kategorie_kurzbz=kategorien.parent_kategorie_kurzbz
)
SELECT parent_kategorie_kurzbz
FROM kategorien
) a
JOIN campus.tbl_dms_kategorie_gruppe ON(a.parent_kategorie_kurzbz=kategorie_kurzbz)
SELECT
1
FROM
kategorien
JOIN campus.tbl_dms_kategorie_gruppe ON(kategorien.parent_kategorie_kurzbz=kategorie_kurzbz)
UNION
SELECT 1 FROM fue.tbl_projekt_dokument WHERE dms_id=".$this->db_add_param($dms_id, FHC_INTEGER)."
UNION
SELECT
1
FROM
kategorien
JOIN campus.tbl_dms_kategorie ON(kategorien.parent_kategorie_kurzbz=kategorie_kurzbz)
WHERE berechtigung_kurzbz is not null
;";
if($result = $this->db_query($qry))
+17 -8
View File
@@ -42,6 +42,7 @@ class note extends basis_db
public $aktiv; // boolean
public $lehre; // boolean
public $offiziell; // boolean
public $lkt_ueberschreibbar; // boolean
public $bezeichnung_mehrsprachig; // varchar (64)[]
/**
@@ -78,7 +79,8 @@ class note extends basis_db
notenwert,
aktiv,
lehre,
offiziell,
offiziell,
lkt_ueberschreibbar,
$bezeichnung_mehrsprachig
FROM
lehre.tbl_note
@@ -98,6 +100,7 @@ class note extends basis_db
$this->lehre = $this->db_parse_bool($row->lehre);
$this->aktiv = $this->db_parse_bool($row->aktiv);
$this->offiziell = $this->db_parse_bool($row->offiziell);
$this->lkt_ueberschreibbar = $this->db_parse_bool($row->lkt_ueberschreibbar);
$this->bezeichnung_mehrsprachig = $sprache->parseSprachResult('bezeichnung_mehrsprachig',$row);
return true;
}
@@ -151,7 +154,7 @@ class note extends basis_db
$idx = sprache::$index_arr[$key];
$qry .= " bezeichnung_mehrsprachig[$idx],";
}
$qry .= ' offiziell) VALUES('.
$qry .= ' offiziell, lkt_ueberschreibbar) VALUES('.
$this->db_add_param($this->note).', '.
$this->db_add_param($this->bezeichnung).', '.
$this->db_add_param($this->anmerkung).', '.
@@ -163,8 +166,9 @@ class note extends basis_db
foreach($this->bezeichnung_mehrsprachig as $key=>$value)
$qry .= $this->db_add_param($value).',';
$qry .= $this->db_add_param($this->offiziell, FHC_BOOLEAN).');';
$qry .= $this->db_add_param($this->offiziell, FHC_BOOLEAN);
$qry .= $this->db_add_param($this->lkt_ueberschreibbar, FHC_BOOLEAN).');';
}
else
@@ -184,7 +188,8 @@ class note extends basis_db
$qry .= " bezeichnung_mehrsprachig[$idx]=".$this->db_add_param($value).", ";
}
$qry .= ' offiziell='.$this->db_add_param($this->offiziell, FHC_BOOLEAN).' '.
$qry .= ' offiziell='.$this->db_add_param($this->offiziell, FHC_BOOLEAN).', '.
$qry .= ' lkt_ueberschreibbar='.$this->db_add_param($this->lkt_ueberschreibbar, FHC_BOOLEAN).' '.
'WHERE note='.$this->db_add_param($this->note).';';
@@ -218,7 +223,8 @@ class note extends basis_db
notenwert,
aktiv,
lehre,
offiziell,
offiziell,
lkt_ueberschreibbar,
$bezeichnung_mehrsprachig
FROM
lehre.tbl_note ";
@@ -242,7 +248,8 @@ class note extends basis_db
$n->notenwert = $row->notenwert;
$n->aktiv = $this->db_parse_bool($row->aktiv);
$n->lehre = $this->db_parse_bool($row->lehre);
$n->offiziell = $this->db_parse_bool($row->lehre);
$n->offiziell = $this->db_parse_bool($row->offiziell);
$n->lkt_ueberschreibbar = $this->db_parse_bool($row->lkt_ueberschreibbar);
$n->bezeichnung_mehrsprachig = $sprache->parseSprachResult('bezeichnung_mehrsprachig', $row);
$this->result[] = $n;
@@ -274,6 +281,7 @@ class note extends basis_db
aktiv,
lehre,
offiziell,
lkt_ueberschreibbar,
$bezeichnung_mehrsprachig
FROM
lehre.tbl_note
@@ -299,7 +307,8 @@ class note extends basis_db
$n->notenwert = $row->notenwert;
$n->aktiv = $this->db_parse_bool($row->aktiv);
$n->lehre = $this->db_parse_bool($row->lehre);
$n->offiziell = $this->db_parse_bool($row->lehre);
$n->offiziell = $this->db_parse_bool($row->offiziell);
$n->lkt_ueberschreibbar = $this->db_parse_bool($row->lkt_ueberschreibbar);
$n->bezeichnung_mehrsprachig = $sprache->parseSprachResult('bezeichnung_mehrsprachig', $row);
$this->result[] = $n;
+68 -45
View File
@@ -24,7 +24,7 @@ class notiz extends basis_db
{
public $new;
public $result=array();
public $dokumente=array();
public $dokumente=array();
//Tabellenspalten
public $notiz_id;
@@ -40,15 +40,15 @@ class notiz extends basis_db
public $updateamum;
public $updatevon;
public $projekt_kurzbz;
public $projektphase_id;
public $projekttask_id;
public $uid;
public $person_id;
public $prestudent_id;
public $bestellung_id;
public $lehreinheit_id;
public $anrechnung_id;
public $projekt_kurzbz;
public $projektphase_id;
public $projekttask_id;
public $uid;
public $person_id;
public $prestudent_id;
public $bestellung_id;
public $lehreinheit_id;
public $anrechnung_id;
/**
* Konstruktor
@@ -93,7 +93,7 @@ class notiz extends basis_db
$this->insertvon=$row->insertvon;
$this->updateamum=$row->updateamum;
$this->updatevon=$row->updatevon;
$this->getDokumente($row->notiz_id);
$this->getDokumente($row->notiz_id);
return true;
}
@@ -123,17 +123,17 @@ class notiz extends basis_db
return false;
}
// Dokumente der Notiz löschen
$this->getDokumente($notiz_id);
if(!empty($this->dokumente))
{
$dms = new dms();
// Dokumente der Notiz löschen
$this->getDokumente($notiz_id);
if(!empty($this->dokumente))
{
$dms = new dms();
foreach($this->dokumente as $dms_id)
{
$dms->deleteDms($dms_id);
}
}
foreach($this->dokumente as $dms_id)
{
$dms->deleteDms($dms_id);
}
}
$qry = "Delete FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER);
@@ -267,14 +267,14 @@ class notiz extends basis_db
}
}
/**
* Speichert ein Dokument zur Notiz
* @param int $dms_id
* @return boolean
*/
public function saveDokument($dms_id)
{
$qry = "INSERT INTO public.tbl_notiz_dokument(notiz_id, dms_id) VALUES(".
/**
* Speichert ein Dokument zur Notiz
* @param int $dms_id
* @return boolean
*/
public function saveDokument($dms_id)
{
$qry = "INSERT INTO public.tbl_notiz_dokument(notiz_id, dms_id) VALUES(".
$this->db_add_param($this->notiz_id, FHC_INTEGER).','.
$this->db_add_param($dms_id, FHC_INTEGER).');';
@@ -287,7 +287,7 @@ class notiz extends basis_db
$this->errormsg = 'Fehler beim Speichern der Daten';
return false;
}
}
}
/**
*
@@ -377,7 +377,7 @@ class notiz extends basis_db
$obj->insertvon=$row->insertvon;
$obj->updateamum=$row->updateamum;
$obj->updatevon=$row->updatevon;
$obj->getDokumente($row->notiz_id);
$obj->getDokumente($row->notiz_id);
$this->result[] = $obj;
}
@@ -404,9 +404,9 @@ class notiz extends basis_db
public.tbl_notiz
LEFT JOIN public.tbl_notizzuordnung USING(notiz_id)
WHERE person_id = ' . $this->db_add_param($person_id, FHC_INTEGER) .
' AND (insertvon = ' . $this->db_add_param('online') .' OR insertvon = ' . $this->db_add_param('online_notiz').')
' AND (insertvon = ' . $this->db_add_param('online') .' OR insertvon = ' . $this->db_add_param('online_notiz').')
ORDER BY notiz_id';
ORDER BY notiz_id';
if($result = $this->db_query($qry))
{
@@ -444,7 +444,7 @@ class notiz extends basis_db
* (Name und Adresse der besuchten Schule) in eine Notiz mit
* insertvon = online_ausbildung gespeichert.
* Wird auf UDF umgebaut!
*
*
* Laedt die Notizen zur Ausbilund vom Bewerbungstool
* @param $person_id int
* @return boolean
@@ -457,8 +457,8 @@ class notiz extends basis_db
public.tbl_notiz
LEFT JOIN public.tbl_notizzuordnung USING(notiz_id)
WHERE person_id = ' . $this->db_add_param($person_id, FHC_INTEGER) .
' AND insertvon = ' . $this->db_add_param('online_ausbildung') .
' ORDER BY notiz_id';
' AND insertvon = ' . $this->db_add_param('online_ausbildung') .
' ORDER BY notiz_id';
if($result = $this->db_query($qry))
{
@@ -564,13 +564,13 @@ class notiz extends basis_db
}
}
/**
* Laedt die Dokumente der Notiz
* @return boolean
*/
public function getDokumente($notiz_id)
{
$qry = "SELECT dms_id FROM public.tbl_notiz_dokument WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER);
/**
* Laedt die Dokumente der Notiz
* @return boolean
*/
public function getDokumente($notiz_id)
{
$qry = "SELECT dms_id FROM public.tbl_notiz_dokument WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER);
if($this->db_query($qry))
{
@@ -579,12 +579,35 @@ class notiz extends basis_db
$this->dokumente[] = $row->dms_id;
}
return true;
return true;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
}
/**
* Prueft ob das Dokument an einer Notiz haengt
* @param $dms_id DMS id des Dokuments.
* @return boolean true wenn das Dokument an einer Notiz hängt, sonst false.
*/
public function isNotizDokument($dms_id)
{
$qry = "SELECT * FROM public.tbl_notiz_dokument WHERE dms_id=".$this->db_add_param($dms_id, FHC_INTEGER);
if($result = $this->db_query($qry))
{
if($this->db_num_rows($result)>0)
return true;
else
return false;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
}
+8 -1
View File
@@ -352,9 +352,10 @@ class zeitaufzeichnung extends basis_db
* @param $user
* @param $from startdatum als String in Form Y-m-d
* @param $to enddatum als String in Form Y-m-d
* @param $excluded_activities zu ignorierende Aktivitätstypen
* @return bool
*/
public function getListeUserFromTo($user, $from = null, $to = null)
public function getListeUserFromTo($user, $from = null, $to = null, $excluded_activities = null)
{
$where = "uid=".$this->db_add_param($user);
@@ -375,6 +376,12 @@ class zeitaufzeichnung extends basis_db
$where.= " AND ((start >= ".$this->db_add_param($from)."::DATE AND start <= ".$this->db_add_param($to)."::DATE)
OR (ende >= ".$this->db_add_param($from)."::DATE AND ende <= ".$this->db_add_param($to)."::DATE))";
if (!empty($excluded_activities))
{
$exactstring = is_array($excluded_activities) ? $this->db_implode4SQL($excluded_activities) : $this->db_add_param($excluded_activities);
$where .= " AND (aktivitaet_kurzbz NOT IN (" . $exactstring . ") OR aktivitaet_kurzbz IS NULL)";
}
$qry = "SELECT
*, to_char ((ende-start),'HH24:MI') as diff,
(SELECT (to_char(sum(ende-start),'DD')::integer)*24+to_char(sum(ende-start),'HH24')::integer || ':' || to_char(sum(ende-start),'MI')