mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -364,6 +364,11 @@ class cronjob extends basis_db
|
||||
public function execute()
|
||||
{
|
||||
$return = true;
|
||||
if($this->running)
|
||||
{
|
||||
$this->errormsg = 'Job kann nicht ausgefuehrt werden, da er bereits laeuft';
|
||||
return false;
|
||||
}
|
||||
if($this->standalone && $this->isJobRunning())
|
||||
{
|
||||
$this->errormsg = 'Job kann nicht ausgefuehrt werden, da noch ein anderer Job laeuft';
|
||||
|
||||
+21
-6
@@ -240,26 +240,31 @@ class datum
|
||||
/**
|
||||
* Subtrahiert 2 Zeiten ($zeit1-$zeit2) Stunde:Minute
|
||||
* Es liefert keine Uhrzeit zurueck sondern Stunden und Minuten
|
||||
* zB 12:10 + 23:15 = 35:25
|
||||
* zB 23:15 - 12:10 = 11:05
|
||||
*
|
||||
* @param $zeit1
|
||||
* @param $zeit2
|
||||
* @return subtraktion der beiden zeiten im Format Stunden:Minuten
|
||||
* @return subtraktion der beiden zeiten im Format Stunden:Minuten, null wenn zeit 1 kleiner als zeit2 ist
|
||||
*/
|
||||
public function subZeit($zeit1, $zeit2)
|
||||
{
|
||||
list($h1, $m1) = explode(':', $zeit1);
|
||||
list($h2, $m2) = explode(':', $zeit2);
|
||||
|
||||
if($h1<$h2)
|
||||
return null;
|
||||
else if($h1 == $h2 && $m1<$m2)
|
||||
return null;
|
||||
|
||||
$m1 -=$m2;
|
||||
//echo $h1.','.$m1.','.$h2.','.$m2;
|
||||
if($m1>=60)
|
||||
if($m1<0)
|
||||
{
|
||||
$uebertrag = (int)($m1/60);
|
||||
$h1+= $uebertrag;
|
||||
$m1 = $m1 + 60;
|
||||
$h1 = (int)$h1-1;
|
||||
}
|
||||
$m1=$m1%60;
|
||||
$h1+=-$h2;
|
||||
$h1-=$h2;
|
||||
if($m1<10)
|
||||
$m1='0'.$m1;
|
||||
if($h1<10)
|
||||
@@ -381,5 +386,15 @@ class datum
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* konvertiert Zeit in format stunden:minuten in Stunden als Dezimalahl
|
||||
* @param $timestring in Form stunden:minuten
|
||||
* @return int Stundenzahl als Dezimalzahl
|
||||
*/
|
||||
public function convertTimeStringToHours($timestring)
|
||||
{
|
||||
return intval(substr($timestring, 0, 2)) + intval(substr($timestring, 3, 2)) / 60;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -670,7 +670,7 @@ class dokument extends basis_db
|
||||
$bezeichnung_mehrsprachig = $sprache->getSprachQuery('bezeichnung_mehrsprachig');
|
||||
$dokumentbeschreibung_mehrsprachig = $sprache->getSprachQuery('dokumentbeschreibung_mehrsprachig');
|
||||
$beschreibung_mehrsprachig = $sprache->getSprachQuery('beschreibung_mehrsprachig');
|
||||
$qry = "SELECT distinct on (dokument_kurzbz) dokument_kurzbz, bezeichnung, pflicht, nachreichbar, ausstellungsdetails,
|
||||
$qry = "SELECT distinct on (dokument_kurzbz) dokument_kurzbz, bezeichnung, pflicht, nachreichbar, ausstellungsdetails,
|
||||
$bezeichnung_mehrsprachig, $dokumentbeschreibung_mehrsprachig, $beschreibung_mehrsprachig
|
||||
FROM public.tbl_dokumentstudiengang
|
||||
JOIN public.tbl_prestudent using (studiengang_kz)
|
||||
@@ -722,7 +722,7 @@ class dokument extends basis_db
|
||||
$dokumentbeschreibung_mehrsprachig = $sprache->getSprachQuery('dokumentbeschreibung_mehrsprachig');
|
||||
$beschreibung_mehrsprachig = $sprache->getSprachQuery('beschreibung_mehrsprachig');
|
||||
|
||||
$qry = " SELECT DISTINCT dokument_kurzbz, studiengang_kz, ausstellungsdetails,
|
||||
$qry = " SELECT DISTINCT dokument_kurzbz, studiengang_kz, ausstellungsdetails,
|
||||
$dokumentbeschreibung_mehrsprachig, $beschreibung_mehrsprachig
|
||||
FROM public.tbl_dokumentstudiengang
|
||||
JOIN public.tbl_dokument using (dokument_kurzbz)
|
||||
|
||||
@@ -48,7 +48,13 @@ class dokument_export
|
||||
|
||||
exec('unoconv --version',$ret_arr);
|
||||
if(isset($ret_arr[0]))
|
||||
$this->unoconv_version = explode(' ',$ret_arr[0])[1];
|
||||
{
|
||||
$hlp = explode(' ',$ret_arr[0]);
|
||||
if(isset($hlp[1]))
|
||||
$this->unoconv_version = $hlp[1];
|
||||
else
|
||||
die('Could not get Unoconv Version');
|
||||
}
|
||||
else
|
||||
die('Unoconv not found');
|
||||
|
||||
@@ -411,7 +417,11 @@ class dokument_export
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Remove UTF8 Control Characters (breaking XML)
|
||||
$value = preg_replace('/[\x00-\x1F\x7F]/u', '', $value);
|
||||
$_xml_data->addChild("$key",htmlspecialchars("$value"));
|
||||
}
|
||||
}
|
||||
return $_xml_data->asXML();
|
||||
}
|
||||
|
||||
@@ -320,7 +320,10 @@ function loadVariables($user)
|
||||
if (!isset($emailadressentrennzeichen))
|
||||
{
|
||||
global $emailadressentrennzeichen;
|
||||
$emailadressentrennzeichen=',';
|
||||
if(defined('DEFAULT_EMAILADRESSENTRENNZEICHEN'))
|
||||
$emailadressentrennzeichen = DEFAULT_EMAILADRESSENTRENNZEICHEN;
|
||||
else
|
||||
$emailadressentrennzeichen=',';
|
||||
}
|
||||
|
||||
if(!isset($alle_unr_mitladen))
|
||||
@@ -1066,7 +1069,7 @@ function cutString($string, $limit, $placeholderSign = '', $keepFilextension = f
|
||||
{
|
||||
return '<span class="error">$placeholderSign must not be shorter than $limit</span>';
|
||||
}
|
||||
|
||||
|
||||
if(strlen($string) > ($limit - $offset))
|
||||
{
|
||||
return substr($string, 0, ($limit - $offset)).$placeholderSign.$extension;
|
||||
@@ -1076,4 +1079,10 @@ function cutString($string, $limit, $placeholderSign = '', $keepFilextension = f
|
||||
return $string;
|
||||
}
|
||||
}
|
||||
|
||||
function PersonLog($ci, $person_id, $logtype_kurzbz, $logdata, $app, $oe_kurzbz = null, $user=null)
|
||||
{
|
||||
$ci->load->library('PersonLogLib');
|
||||
$ci->personloglib->log($person_id, $logtype_kurzbz, $logdata, $app, $oe_kurzbz, $user);
|
||||
}
|
||||
?>
|
||||
|
||||
+69
-22
@@ -36,9 +36,9 @@ class note extends basis_db
|
||||
public $bezeichnung; // varchar(32)
|
||||
public $anmerkung; // varchar(256)
|
||||
public $farbe; // varchar(6)
|
||||
public $positiv=true; // boolean
|
||||
public $notenwert; // boolean
|
||||
public $aktiv; // boolean
|
||||
public $positiv=true; // boolean
|
||||
public $notenwert; // boolean
|
||||
public $aktiv; // boolean
|
||||
public $lehre; // boolean
|
||||
|
||||
/**
|
||||
@@ -75,10 +75,10 @@ class note extends basis_db
|
||||
$this->note = $row->note;
|
||||
$this->bezeichnung = $row->bezeichnung;
|
||||
$this->anmerkung = $row->anmerkung;
|
||||
$this->farbe = $row->farbe;
|
||||
$this->farbe = $row->farbe;
|
||||
$this->notenwert = $row->notenwert;
|
||||
$this->positiv = $this->db_parse_bool($row->positiv);
|
||||
$this->lehre = $this->db_parse_bool($row->lehre);
|
||||
$this->positiv = $this->db_parse_bool($row->positiv);
|
||||
$this->lehre = $this->db_parse_bool($row->lehre);
|
||||
$this->aktiv = $this->db_parse_bool($row->aktiv);
|
||||
return true;
|
||||
}
|
||||
@@ -130,10 +130,10 @@ class note extends basis_db
|
||||
$this->db_add_param($this->note).', '.
|
||||
$this->db_add_param($this->bezeichnung).', '.
|
||||
$this->db_add_param($this->anmerkung).', '.
|
||||
$this->db_add_param($this->positiv, FHC_BOOLEAN).','.
|
||||
$this->db_add_param($this->notenwert).','.
|
||||
$this->db_add_parma($this->aktiv, FHC_BOOLEAN).','.
|
||||
$this->db_add_param($htis->lehre, FHC_BOOLEAN).');';
|
||||
$this->db_add_param($this->positiv, FHC_BOOLEAN).','.
|
||||
$this->db_add_param($this->notenwert).','.
|
||||
$this->db_add_param($this->aktiv, FHC_BOOLEAN).','.
|
||||
$this->db_add_param($this->lehre, FHC_BOOLEAN).');';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -141,9 +141,9 @@ class note extends basis_db
|
||||
'note='.$this->db_add_param($this->note).', '.
|
||||
'bezeichnung='.$this->db_add_param($this->bezeichnung).', '.
|
||||
'anmerkung='.$this->db_add_param($this->anmerkung).', '.
|
||||
'positiv='.$this->db_add_param($this->positiv, FHC_BOOLEAN).', '.
|
||||
'notenwert='.$this->db_add_param($this->notenwert).', '.
|
||||
'aktiv='.$this->db_add_param($this->aktiv, FHC_BOOLEAN).', '.
|
||||
'positiv='.$this->db_add_param($this->positiv, FHC_BOOLEAN).', '.
|
||||
'notenwert='.$this->db_add_param($this->notenwert).', '.
|
||||
'aktiv='.$this->db_add_param($this->aktiv, FHC_BOOLEAN).', '.
|
||||
'lehre='.$this->db_add_param($this->lehre, FHC_BOOLEAN).' '.
|
||||
'WHERE note='.$this->db_add_param($this->note).';';
|
||||
}
|
||||
@@ -158,15 +158,21 @@ class note extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Laedt alle Noten
|
||||
* Laedt alle Noten, inklusive inaktiven Noten
|
||||
* @param null $offiziell wenn true, werden nur Noten, die auf offiziellen Dokumenten gedruckt weden können, geladen
|
||||
* @return true wenn ok, false wenn Fehler
|
||||
*/
|
||||
public function getAll()
|
||||
*/
|
||||
public function getAll($offiziell = null)
|
||||
{
|
||||
$qry = "SELECT * FROM lehre.tbl_note ORDER BY note";
|
||||
|
||||
$qry = "SELECT * FROM lehre.tbl_note";
|
||||
|
||||
if(is_bool($offiziell))
|
||||
$qry .= " WHERE offiziell = ".$this->db_add_param($offiziell, FHC_BOOLEAN);
|
||||
|
||||
$qry .= " ORDER BY note";
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
@@ -177,9 +183,50 @@ class note extends basis_db
|
||||
$n->bezeichnung = $row->bezeichnung;
|
||||
$n->anmerkung = $row->anmerkung;
|
||||
$n->farbe = $row->farbe;
|
||||
$n->positiv = $this->db_parse_bool($row->positiv);
|
||||
$n->notenwert = $row->notenwert;
|
||||
$n->aktiv = $this->db_parse_bool($row->aktiv);
|
||||
$n->positiv = $this->db_parse_bool($row->positiv);
|
||||
$n->notenwert = $row->notenwert;
|
||||
$n->aktiv = $this->db_parse_bool($row->aktiv);
|
||||
$n->lehre = $this->db_parse_bool($row->lehre);
|
||||
|
||||
$this->result[] = $n;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Laedt alle aktive Noten
|
||||
* @param null $offiziell wenn true, werden nur Noten, die auf offiziellen Dokumenten gedruckt weden können, geladen
|
||||
* @return true wenn ok, false wenn Fehler
|
||||
*/
|
||||
public function getActive($offiziell = null)
|
||||
{
|
||||
$qry = "SELECT * FROM lehre.tbl_note WHERE aktiv = TRUE";
|
||||
|
||||
|
||||
if(is_bool($offiziell))
|
||||
$qry .= " AND offiziell = ".$this->db_add_param($offiziell, FHC_BOOLEAN);
|
||||
|
||||
$qry .= " ORDER BY note";
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$n = new note();
|
||||
|
||||
$n->note = $row->note;
|
||||
$n->bezeichnung = $row->bezeichnung;
|
||||
$n->anmerkung = $row->anmerkung;
|
||||
$n->farbe = $row->farbe;
|
||||
$n->positiv = $this->db_parse_bool($row->positiv);
|
||||
$n->notenwert = $row->notenwert;
|
||||
$n->aktiv = $this->db_parse_bool($row->aktiv);
|
||||
$n->lehre = $this->db_parse_bool($row->lehre);
|
||||
|
||||
$this->result[] = $n;
|
||||
|
||||
@@ -104,19 +104,22 @@ class pruefungstermin extends basis_db{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Lädt alle Prüfungstypen aus der Datenbank
|
||||
* @return Array/Boolean Ein Array mit den Daten, wenn ok; ansonsten false
|
||||
*/
|
||||
public function getAllPruefungstypen($abschluss = null)
|
||||
|
||||
/**
|
||||
* Lädt alle Prüfungstypen aus der Datenbank
|
||||
* @param null $abschluss gibt an, ob Abschlussprüfungen ausgegeben werden sollen. default: Abschlussprüfungen und andere Prüfungen
|
||||
* @return array /Boolean Ein Array mit den Daten, wenn ok; ansonsten false
|
||||
*/
|
||||
public function getAllPruefungstypen($abschluss = null, $sort = false)
|
||||
{
|
||||
$qry = 'SELECT * FROM lehre.tbl_pruefungstyp';
|
||||
|
||||
if(!is_null($abschluss))
|
||||
if(is_bool($abschluss))
|
||||
{
|
||||
$qry .= ' WHERE abschluss='.$this->db_add_param($abschluss);
|
||||
$qry .= ' WHERE abschluss='.$this->db_add_param($abschluss, FHC_BOOLEAN);
|
||||
}
|
||||
if($sort)
|
||||
$qry .= ' ORDER BY (sort IS NULL), sort, pruefungstyp_kurzbz';
|
||||
$qry .=';';
|
||||
|
||||
if($this->db_query($qry))
|
||||
@@ -128,6 +131,7 @@ class pruefungstermin extends basis_db{
|
||||
$obj->pruefungstyp_kurzbz = $row->pruefungstyp_kurzbz;
|
||||
$obj->beschreibung = $row->beschreibung;
|
||||
$obj->abschluss = $row->abschluss;
|
||||
$obj->sort = $row->sort;
|
||||
array_push($result, $obj);
|
||||
}
|
||||
}
|
||||
@@ -137,7 +141,6 @@ class pruefungstermin extends basis_db{
|
||||
return false;
|
||||
}
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Regular → Executable
+6
-4
@@ -200,11 +200,11 @@ class service extends basis_db
|
||||
WHERE tbl_zeitaufzeichnung.uid=".$this->db_add_param($user)."
|
||||
$zeit
|
||||
GROUP BY tbl_service.service_id HAVING COUNT(*) > $anzahl_ereignisse
|
||||
|
||||
|
||||
UNION
|
||||
SELECT tbl_service.*, '0' AS anzahl
|
||||
FROM public.tbl_service
|
||||
|
||||
|
||||
ORDER BY count DESC,bezeichnung,oe_kurzbz";
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
@@ -254,7 +254,7 @@ class service extends basis_db
|
||||
if (!is_null($content_id) && is_numeric($content_id))
|
||||
$qry.= ' AND content_id='.$this->db_add_param($content_id);
|
||||
elseif ($content_id==true)
|
||||
$qry.= ' AND content_id IS NOT NULL';
|
||||
$qry.= ' AND (content_id IS NOT NULL OR ext_id IS NOT NULL)';
|
||||
else
|
||||
$qry.= '';
|
||||
|
||||
@@ -363,12 +363,13 @@ class service extends basis_db
|
||||
|
||||
if($new)
|
||||
{
|
||||
$qry = "BEGIN;INSERT INTO public.tbl_service (bezeichnung, beschreibung, oe_kurzbz, content_id, design_uid, betrieb_uid, operativ_uid)
|
||||
$qry = "BEGIN;INSERT INTO public.tbl_service (bezeichnung, beschreibung, oe_kurzbz, content_id, ext_id, design_uid, betrieb_uid, operativ_uid)
|
||||
VALUES(".
|
||||
$this->db_add_param($this->bezeichnung).','.
|
||||
$this->db_add_param($this->beschreibung).','.
|
||||
$this->db_add_param($this->oe_kurzbz).','.
|
||||
$this->db_add_param($this->content_id).','.
|
||||
$this->db_add_param($this->ext_id).','.
|
||||
$this->db_add_param($this->design_uid).','.
|
||||
$this->db_add_param($this->betrieb_uid).','.
|
||||
$this->db_add_param($this->operativ_uid).');';
|
||||
@@ -380,6 +381,7 @@ class service extends basis_db
|
||||
' beschreibung = '.$this->db_add_param($this->beschreibung).','.
|
||||
' oe_kurzbz = '.$this->db_add_param($this->oe_kurzbz).','.
|
||||
' content_id = '.$this->db_add_param($this->content_id).','.
|
||||
' ext_id = '.$this->db_add_param($this->ext_id).','.
|
||||
' design_uid = '.$this->db_add_param($this->design_uid).','.
|
||||
' betrieb_uid = '.$this->db_add_param($this->betrieb_uid).','.
|
||||
' operativ_uid = '.$this->db_add_param($this->operativ_uid).
|
||||
|
||||
@@ -538,9 +538,9 @@ class studienplan extends basis_db
|
||||
$this->db_add_param($this->studienplan_lehrveranstaltung_id_parent, FHC_INTEGER) . ', ' .
|
||||
$this->db_add_param($this->pflicht, FHC_BOOLEAN) . ', ' .
|
||||
$this->db_add_param($this->koordinator) . ', ' .
|
||||
$this->db_add_param($this->curriculum) . ', ' .
|
||||
$this->db_add_param($this->export) . ', ' .
|
||||
$this->db_add_param($this->genehmigung) . ', ' .
|
||||
$this->db_add_param($this->curriculum, FHC_BOOLEAN) . ', ' .
|
||||
$this->db_add_param($this->export, FHC_BOOLEAN) . ', ' .
|
||||
$this->db_add_param($this->genehmigung, FHC_BOOLEAN) . ', ' .
|
||||
'now(), ' .
|
||||
$this->db_add_param($this->insertvon) . ');';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user