Added sancho ampel-erinnerungsmail

This commit is contained in:
Cris
2018-04-25 11:24:40 +02:00
parent 999b4040a4
commit 51f6d4545f
10 changed files with 1748 additions and 1420 deletions
+270 -281
View File
@@ -1,281 +1,270 @@
{
"name": "fh-complete/fhc-core",
"type": "app",
"description": "FH-Complete Core",
"keywords": [
"fhc",
"fh-complete",
"campusmanagement"
],
"homepage": "https://github.com/FH-Complete/FHC-Core",
"license": "GPLv3",
"authors": [
{
"name": "Christian Paminger",
"email": "christian.paminger@fhcomplete.org",
"homepage": "http://fhcomplete.org"
},
{
"name": "Andreas Österreicher",
"email": "oesi@technikum-wien.at",
"homepage": "http://fhcomplete.org"
}
],
"support": {
"email": "info@fhcomplete.org",
"forum": "https://plus.google.com/communities/113278802529782592610",
"wiki": "http://wiki.fhcomplete.org/"
},
"repositories": [
{
"type": "package",
"package": {
"name": "codeigniter-restserver",
"version": "2.6",
"dist": {
"url": "https://github.com/chriskacerguis/codeigniter-restserver/archive/master.zip",
"type": "zip"
}
}
},
{
"type": "package",
"package": {
"name": "jsoneditor",
"version": "5.5.6",
"dist": {
"url": "https://github.com/josdejong/jsoneditor/archive/v5.5.6.zip",
"type": "zip"
}
}
},
{
"type": "package",
"package": {
"name": "json-forms",
"version": "1.4.0",
"dist": {
"url": "https://github.com/brutusin/json-forms/archive/v1.4.0.zip",
"type": "zip"
}
}
},
{
"type": "package",
"package": {
"name": "borgar/textile-js",
"version": "1.0",
"source": {
"url": "https://github.com/borgar/textile-js.git",
"type": "git",
"reference": "master"
}
}
},
{
"type": "package",
"package": {
"name": "rmariuzzo/jquery-checkboxes",
"version": "1.0.7",
"source": {
"url": "https://github.com/rmariuzzo/checkboxes.js.git",
"type": "git",
"reference": "081cac1eb9b504dc32be27b57f32f6d1d29a5253"
}
}
},
{
"type": "package",
"package": {
"name": "jquery/jqueryV1",
"version": "1.12.4",
"dist": {
"type": "file",
"url": "https://code.jquery.com/jquery-1.12.4.min.js"
}
}
},
{
"type": "package",
"package": {
"name": "jquery/jqueryV2",
"version": "2.2.4",
"dist": {
"type": "file",
"url": "https://code.jquery.com/jquery-2.2.4.min.js"
}
}
},
{
"type": "package",
"package": {
"name": "fgelinas/timepicker",
"version": "0.3.3",
"dist": {
"url": "https://fgelinas.com/code/timepicker/releases/jquery-ui-timepicker-0.3.3.zip",
"type": "zip"
}
}
},
{
"type": "package",
"package": {
"name": "alvaro-prieto/colResizable",
"version": "1.6",
"dist": {
"url": "https://github.com/alvaro-prieto/colResizable/archive/1.6.zip",
"type": "zip"
}
}
},
{
"type": "package",
"package": {
"name": "tapmodo/Jcrop",
"version": "2.0.4",
"dist": {
"url": "https://github.com/tapmodo/Jcrop/archive/v2.0.4.zip",
"type": "zip"
}
}
},
{
"type": "package",
"package": {
"name": "jquery-archive/jquery-metadata",
"version": "1.0",
"source": {
"url": "https://github.com/jquery-archive/jquery-metadata.git",
"type": "git",
"reference": "e5a9e4315675bf4d68716872ca754e858088f8ab"
}
}
},
{
"type": "package",
"package": {
"name": "tomazdragar/SimpleCropper",
"version": "1.0",
"source": {
"url": "https://github.com/tomazdragar/SimpleCropper.git",
"type": "git",
"reference": "9750b81fa55ed07b3b429297d18ffbeac07a2cde"
}
}
},
{
"type": "package",
"package": {
"name": "joeldbirch/superfish",
"version": "1.7.9",
"dist": {
"url": "https://github.com/joeldbirch/superfish/archive/v1.7.9.zip",
"type": "zip"
}
}
},
{
"type": "package",
"package": {
"name": "jquery/sizzle",
"version": "1.0",
"dist": {
"url": "https://github.com/jquery/sizzle/archive/1.0.0.zip",
"type": "zip"
}
}
},
{
"type": "package",
"package": {
"name": "nicolaskruchten/pivottable",
"version": "2.15.0",
"source": {
"url": "https://github.com/nicolaskruchten/pivottable.git",
"type": "git",
"reference": "b15ea33268b587d986371c0b6f215c36ffbb860c"
}
}
},
{
"type": "package",
"package": {
"name": "BlackrockDigital/startbootstrap-sb-admin-2",
"version": "3.3.7",
"source": {
"url": "https://github.com/BlackrockDigital/startbootstrap-sb-admin-2.git",
"type": "git",
"reference": "master"
}
}
}
],
"require": {
"php": ">=5.4.0",
"alvaro-prieto/colResizable": "^1.6",
"borgar/textile-js": "1.0",
"BlackrockDigital/startbootstrap-sb-admin-2": "^3.3",
"christianbach/tablesorter": "^1.0",
"codeigniter/framework": "3.*",
"codeigniter-restserver": "2.6",
"components/jquery": "^3.2",
"components/jqueryui": "^1.12",
"components/font-awesome": "^4.7",
"components/angular.js": "1.3.16",
"easyrdf/easyrdf": "0.9.*",
"fgelinas/timepicker": "^0.3.3",
"fzaninotto/faker": "1.*",
"joeldbirch/superfish": "^1.7",
"jquery/jqueryV1": "^1.12",
"jquery/jqueryV2": "^2.2",
"jquery/sizzle": "^1.0",
"jquery-archive/jquery-metadata": "^1.0",
"json-forms": "1.4.0",
"jsoneditor": "5.5.6",
"kingsquare/json-schema-form": "*",
"michelf/php-markdown": "1.5.0",
"ml/json-ld": "1.*",
"mottie/tablesorter": "^2.29",
"netcarver/textile": "^3.5",
"nicolaskruchten/pivottable": "^2.15.0",
"rmariuzzo/jquery-checkboxes": "1.0.7",
"rougin/combustor": "1.1.*",
"rougin/refinery": "*",
"tapmodo/Jcrop": "^2.0",
"tinymce/tinymce": "4.*",
"tomazdragar/SimpleCropper": "^1.0",
"twbs/bootstrap": "^3.3",
"zetacomponents/workflow": "1.*",
"zetacomponents/document": "1.*",
"zetacomponents/workflow-database-tiein": "1.*",
"zetacomponents/workflow-event-log-tiein": "1.*"
},
"require-dev": {
"squizlabs/php_codesniffer": "2.*"
},
"config": {
"bin-dir": "vendor/bin"
},
"extra": {
"merge-plugin": {
"include": [
"composer.json",
"addons/*/composer.json"
],
"recurse": true,
"replace": false,
"merge-dev": false,
"merge-extra": false
}
}
}
{
"name": "fh-complete/fhc-core",
"type": "app",
"description": "FH-Complete Core",
"keywords": [
"fhc",
"fh-complete",
"campusmanagement"
],
"homepage": "https://github.com/FH-Complete/FHC-Core",
"license": "GPLv3",
"authors": [
{
"name": "Christian Paminger",
"email": "christian.paminger@fhcomplete.org",
"homepage": "http://fhcomplete.org"
},
{
"name": "Andreas Österreicher",
"email": "oesi@technikum-wien.at",
"homepage": "http://fhcomplete.org"
}
],
"support": {
"email": "info@fhcomplete.org",
"forum": "https://plus.google.com/communities/113278802529782592610",
"wiki": "http://wiki.fhcomplete.org/"
},
"repositories": [
{
"type": "package",
"package": {
"name": "codeigniter-restserver",
"version": "2.6",
"dist": {
"url": "https://github.com/chriskacerguis/codeigniter-restserver/archive/master.zip",
"type": "zip"
}
}
},
{
"type": "package",
"package": {
"name": "jsoneditor",
"version": "5.5.6",
"dist": {
"url": "https://github.com/josdejong/jsoneditor/archive/v5.5.6.zip",
"type": "zip"
}
}
},
{
"type": "package",
"package": {
"name": "json-forms",
"version": "1.4.0",
"dist": {
"url": "https://github.com/brutusin/json-forms/archive/v1.4.0.zip",
"type": "zip"
}
}
},
{
"type": "package",
"package": {
"name": "borgar/textile-js",
"version": "1.0",
"source": {
"url": "https://github.com/borgar/textile-js.git",
"type": "git",
"reference": "master"
}
}
},
{
"type": "package",
"package": {
"name": "rmariuzzo/jquery-checkboxes",
"version": "1.0.7",
"source": {
"url": "https://github.com/rmariuzzo/checkboxes.js.git",
"type": "git",
"reference": "081cac1eb9b504dc32be27b57f32f6d1d29a5253"
}
}
},
{
"type": "package",
"package": {
"name": "jquery/jqueryV1",
"version": "1.12.4",
"dist": {
"type": "file",
"url": "https://code.jquery.com/jquery-1.12.4.min.js"
}
}
},
{
"type": "package",
"package": {
"name": "jquery/jqueryV2",
"version": "2.2.4",
"dist": {
"type": "file",
"url": "https://code.jquery.com/jquery-2.2.4.min.js"
}
}
},
{
"type": "package",
"package": {
"name": "fgelinas/timepicker",
"version": "0.3.3",
"dist": {
"url": "https://fgelinas.com/code/timepicker/releases/jquery-ui-timepicker-0.3.3.zip",
"type": "zip"
}
}
},
{
"type": "package",
"package": {
"name": "alvaro-prieto/colResizable",
"version": "1.6",
"dist": {
"url": "https://github.com/alvaro-prieto/colResizable/archive/1.6.zip",
"type": "zip"
}
}
},
{
"type": "package",
"package": {
"name": "tapmodo/Jcrop",
"version": "2.0.4",
"dist": {
"url": "https://github.com/tapmodo/Jcrop/archive/v2.0.4.zip",
"type": "zip"
}
}
},
{
"type": "package",
"package": {
"name": "jquery-archive/jquery-metadata",
"version": "1.0",
"source": {
"url": "https://github.com/jquery-archive/jquery-metadata.git",
"type": "git",
"reference": "e5a9e4315675bf4d68716872ca754e858088f8ab"
}
}
},
{
"type": "package",
"package": {
"name": "tomazdragar/SimpleCropper",
"version": "1.0",
"source": {
"url": "https://github.com/tomazdragar/SimpleCropper.git",
"type": "git",
"reference": "9750b81fa55ed07b3b429297d18ffbeac07a2cde"
}
}
},
{
"type": "package",
"package": {
"name": "joeldbirch/superfish",
"version": "1.7.9",
"dist": {
"url": "https://github.com/joeldbirch/superfish/archive/v1.7.9.zip",
"type": "zip"
}
}
},
{
"type": "package",
"package": {
"name": "jquery/sizzle",
"version": "1.0",
"dist": {
"url": "https://github.com/jquery/sizzle/archive/1.0.0.zip",
"type": "zip"
}
}
},
{
"type": "package",
"package": {
"name": "nicolaskruchten/pivottable",
"version": "2.15.0",
"source": {
"url": "https://github.com/nicolaskruchten/pivottable.git",
"type": "git",
"reference": "b15ea33268b587d986371c0b6f215c36ffbb860c"
}
}
},
{
"type": "package",
"package": {
"name": "BlackrockDigital/startbootstrap-sb-admin-2",
"version": "3.3.7",
"source": {
"url": "https://github.com/BlackrockDigital/startbootstrap-sb-admin-2.git",
"type": "git",
"reference": "master"
}
}
}
],
"require": {
"php": ">=5.4.0",
"alvaro-prieto/colResizable": "^1.6",
"borgar/textile-js": "1.0",
"BlackrockDigital/startbootstrap-sb-admin-2": "^3.3",
"christianbach/tablesorter": "^1.0",
"codeigniter/framework": "3.*",
"codeigniter-restserver": "2.6",
"components/jquery": "^3.2",
"components/jqueryui": "^1.12",
"components/font-awesome": "^4.7",
"components/angular.js": "1.3.16",
"easyrdf/easyrdf": "0.9.*",
"fgelinas/timepicker": "^0.3.3",
"fzaninotto/faker": "1.*",
"joeldbirch/superfish": "^1.7",
"jquery/jqueryV1": "^1.12",
"jquery/jqueryV2": "^2.2",
"jquery/sizzle": "^1.0",
"jquery-archive/jquery-metadata": "^1.0",
"json-forms": "1.4.0",
"jsoneditor": "5.5.6",
"kingsquare/json-schema-form": "*",
"michelf/php-markdown": "1.5.0",
"ml/json-ld": "1.*",
"mottie/tablesorter": "^2.29",
"netcarver/textile": "^3.5",
"nicolaskruchten/pivottable": "^2.15.0",
"rmariuzzo/jquery-checkboxes": "1.0.7",
"rougin/combustor": "1.1.*",
"rougin/refinery": "*",
"tapmodo/Jcrop": "^2.0",
"tinymce/tinymce": "4.*",
"tomazdragar/SimpleCropper": "^1.0",
"twbs/bootstrap": "^3.3",
"zetacomponents/workflow": "1.*",
"zetacomponents/document": "1.*",
"zetacomponents/workflow-database-tiein": "1.*",
"zetacomponents/workflow-event-log-tiein": "1.*"
},
"require-dev": {
"squizlabs/php_codesniffer": "2.*"
},
"config": {
"bin-dir": "vendor/bin"
}
}
+579 -579
View File
File diff suppressed because it is too large Load Diff
+400 -400
View File
@@ -1,400 +1,400 @@
<?php
/* Copyright (C) 2006 Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
class datum
{
public $ts_day=86400; // Timestamp eines Tages
/**
* Konstruktor
*
*/
public function __construct()
{
}
/**
* Liefert einen UNIX Timestamp von einem String im
* Format "31.12.2007 14:30"
*/
public function mktime_datumundzeit($datumundzeit)
{
if(mb_ereg("([0-9]{2}).([0-9]{2}).([0-9]{4}) ([0-9]{2}):([0-9]{2})",$datumundzeit, $regs))
return mktime($regs[4],$regs[5],0,$regs[2],$regs[1],$regs[3]);
else
{
$this->errormsg = 'Falsches Datumsformat';
return false;
}
}
/**
* Liefert einen UNIX Timestamp von einem String im
* Format "31.12.2007"
*/
public function mktime_datum($datum)
{
if(mb_ereg("([0-9]{2}).([0-9]{2}).([0-9]{4})",$datum, $regs))
{
return mktime(0,0,0,$regs[2],$regs[1],$regs[3]);
}
else
{
$this->errormsg = 'Falsches Datumsformat';
return false;
}
}
/**
* Liefert einen UNIX Timestamp von einem Datum im
* ISO-Format "2007-01-31"
*/
public function mktime_fromdate($datum)
{
if(mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})",$datum, $regs))
{
return mktime(0,0,0,$regs[2],$regs[3],$regs[1]);
}
else
{
$this->errormsg = 'Falsches Datumsformat';
return false;
}
}
/**
* Liefert einen UNIX Timestamp von einem String im
* Format "2007-01-31 14:30:12"
*/
public function mktime_fromtimestamp($timestamp)
{
if(mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})",$timestamp, $regs))
{
return mktime($regs[4],$regs[5],$regs[6],$regs[2],$regs[3],$regs[1]);
}
else
{
$this->errormsg = 'Falsches Datumsformat';
return false;
}
}
/**
* Springt von einen UNIX Timestamp ($datum) $wochen nach vor bzw. hinten
*/
public function jump_week($datum, $wochen)
{
$days = $wochen * 7;
$datetime=new DateTime();
$datetime->setTimestamp($datum);
$datetime->modify($days.' day');
return $datetime->format("U");
}
/**
* Springt von einen UNIX Timestamp ($datum) $days nach vor bzw. hinten
*/
public function jump_day($datum, $days)
{
$stunde_vor=date("G",$datum);
// Ein Tag sind 86400 Sekunden
$datum+=86400*$days;
$stunde_nach=date("G",$datum);
if ($stunde_nach!=$stunde_vor)
$datum+=3600;
return $datum;
}
/**
* Konvertiert das ISO Datumsformat (YYYY-MM-DD)
* nach (DD.MM.YYYY)
*/
public function convertISODate($datum)
{
return (mb_strlen($datum)>0?date('d.m.Y',strtotime($datum)):'');
}
/**
* Prueft Uhrzeit auf Gueltigkeit (HH:MM:SS)
* @return true wenn ok, false wenn falsches Format
*/
public function checkUhrzeit($uhrzeit)
{
if(mb_ereg("([0-9]{2}):([0-9]{2})(:([0-9]{2}))?$",$uhrzeit))
return true;
else
return false;
}
/**
* Prueft ob das Datum im Format dd.mm.YYYY oder YYYY-mm-dd ist
* @return true wenn ok, false wenn falsches Format
*/
public function checkDatum($datum)
{
if(mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})$",$datum) || mb_ereg("([0-9]{2}).([0-9]{2}).([0-9]{4})$",$datum))
return true;
else
return false;
}
/**
* Zieht ein Datum von einem anderen ab, und gibt die differenz in Tagen zurueck (mit Vorzeichen)
* @param $datum1
* @param $datum2
*/
public function DateDiff($datum1, $datum2)
{
$datetime1 = new DateTime($datum1);
$datetime2 = new DateTime($datum2);
$interval = $datetime1->diff($datetime2);
return $interval->format('%R%a');
}
/**
* Prueft ob ein Datum / Datum und Uhrzeit zwischen 2 anderen liegt
* Unterstuetzt auch offenes (leeres) Start und Ende Datum
*
* @param $start Startdatum
* @param $ende Endedatum
* @param $datum Datum das geprueft wird
* @return true wenn dazwischen sonst false
*/
public function between($start, $ende, $datum)
{
$datestart = new DateTime($start);
$dateende = new DateTime($ende);
$dateref = new DateTime($datum);
// Start und Ende nicht gesetzt
if($start=='' && $ende=='')
return true;
// Start nicht gesetzt; Ende gesetzt
if($start=='' && $ende!='' && $dateende>=$dateref)
return true;
// Ende nicht gesetzt; Start gesetzt
if($ende=='' && $start!='' && $datestart<=$dateref)
return true;
// Start und Ende gesetzt
if($ende!='' && $start!='' && $datestart<=$dateref && $dateende>=$dateref)
return true;
return false;
}
/**
* Summiert 2 Zeiten Stunde:Minute
* Es liefert keine Uhrzeit zurueck sondern Stunden und Minuten
* zB 12:10 + 23:15 = 35:25
*
* @param $zeit1
* @param $zeit2
* @return summe der beiden zeiten im Format Stunden:Minuten
*/
public function sumZeit($zeit1, $zeit2)
{
list($h1, $m1) = explode(':', $zeit1);
list($h2, $m2) = explode(':', $zeit2);
$m1 +=$m2;
if($m1>=60)
{
$uebertrag = (int)($m1/60);
$h1+= $uebertrag;
}
$m1=$m1%60;
$h1+=$h2;
if($m1<10)
$m1='0'.$m1;
if($h1<10)
$h1='0'.$h1;
return $h1.':'.$m1;
}
/**
* Subtrahiert 2 Zeiten ($zeit1-$zeit2) Stunde:Minute
* Es liefert keine Uhrzeit zurueck sondern Stunden und Minuten
* zB 23:15 - 12:10 = 11:05
*
* @param $zeit1
* @param $zeit2
* @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<0)
{
$m1 = $m1 + 60;
$h1 = (int)$h1-1;
}
$m1=$m1%60;
$h1-=$h2;
if($m1<10)
$m1='0'.$m1;
if($h1<10)
$h1='0'.$h1;
return $h1.':'.$m1;
}
/**
* Prueft und Liefert ein Datum im angegeben Format
* fuer die Formatierung wird die Funktion formatDatum verwendet
* @param $datum
* @param $format
* @param $strict wenn das Datum aus einem Suchfeld komment, dann strict auf TRUE setzen da sonst
* Eintraege wie zB 'last Monday' oder 'a' auch in ein Datum umgewandelt werden.
* @return Formatierten Timestamp wenn ok, false im Fehlerfall
*/
function checkformatDatum($datum, $format='Y-m-d H:i:s', $strict=false)
{
@list($day, $month, $year) = @explode(".", $datum);
if (@checkdate($month, $day, $year))
return $this->formatDatum($datum, $format, $strict);
@list($day, $month, $year) = @explode("-", $datum);
if (@checkdate($month, $day, $year))
return $this->formatDatum($datum, $format, $strict);
@list($year, $month, $day) = @explode(".", $datum);
if (@checkdate($month, $day, $year))
return $this->formatDatum($datum, $format, $strict);
@list($year, $month, $day) = @explode("-", $datum);
if (@checkdate($month, $day, $year))
return $this->formatDatum($datum, $format, $strict);
if (strlen($datum)==6)
{
$year="20".substr($datum,0,2);
$month=substr($datum,2,2);
$day=substr($datum,4,2);
if (@checkdate($month, $day, $year))
return $this->formatDatum($datum, $format, $strict);
}
else if (strlen($datum)==8)
{
$year=substr($datum,0,4);
$month=substr($datum,4,2);
$day=substr($datum, 6,2);
if (@checkdate($month, $day, $year))
return $this->formatDatum($datum, $format, $strict);
$year=substr($datum,5,4);
$month=substr($datum,3,2);
$day=substr($datum, 0,2);
if (@checkdate($month, $day, $year))
return $this->formatDatum($datum, $format, $strict);
}
return false;
}
/**
* Liefert ein Datum im angegeben Format
* ToDo: Liefert aktuellen Timestamp wenn Sonderzeichen uebergeben werden
* zB '---'
* @param $datum
* @param $format
* @param $strict wenn das Datum aus einem Suchfeld kommt, dann strict auf TRUE setzen da sonst
* Eintraege wie zB 'last Monday' oder 'a' auch in ein Datum umgewandelt werden.
* @return Formatierten Timestamp wenn ok, false im Fehlerfall
*/
public function formatDatum($datum, $format='Y-m-d H:i:s', $strict=false)
{
if(trim($datum)=='')
return '';
$ts='';
$error=false;
//2008-12-31
if(mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})",$datum, $regs))
$ts = mktime(0,0,0,$regs[2],$regs[3],$regs[1]);
//2008-12-31 12:30
if(mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2})",$datum, $regs))
$ts = mktime($regs[4],$regs[5],0,$regs[2],$regs[3],$regs[1]);
//2008-12-31 12:30:15
if(mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})",$datum, $regs))
$ts = mktime($regs[4],$regs[5],$regs[6],$regs[2],$regs[3],$regs[1]);
if($ts=='')
{
//1.12.2008
if(mb_ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})",$datum, $regs))
$ts = mktime(0,0,0,$regs[2],$regs[1],$regs[3]);
//1.12.2008 12:30
if(mb_ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4}) ([0-9]{2}):([0-9]{2})",$datum, $regs))
$ts = mktime($regs[4],$regs[5],0,$regs[2],$regs[1],$regs[3]);
//1.12.2008 12:30:15
if(mb_ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4}) ([0-9]{2}):([0-9]{2}):([0-9]{2})",$datum, $regs))
$ts = mktime($regs[4],$regs[5],$regs[6],$regs[2],$regs[1],$regs[3]);
}
if($ts=='' && !$strict)
{
$ts = strtotime($datum);
if(!$ts || $ts==-1)
{
//wenn strtotime fehlschlaegt liefert diese -1 zurueck, ab php5.1.0 jedoch false
$error = true;
}
}
if($ts!='' && !$error)
return date($format, $ts);
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;
}
}
?>
<?php
/* Copyright (C) 2006 Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
class datum
{
public $ts_day=86400; // Timestamp eines Tages
/**
* Konstruktor
*
*/
public function __construct()
{
}
/**
* Liefert einen UNIX Timestamp von einem String im
* Format "31.12.2007 14:30"
*/
public function mktime_datumundzeit($datumundzeit)
{
if(mb_ereg("([0-9]{2}).([0-9]{2}).([0-9]{4}) ([0-9]{2}):([0-9]{2})",$datumundzeit, $regs))
return mktime($regs[4],$regs[5],0,$regs[2],$regs[1],$regs[3]);
else
{
$this->errormsg = 'Falsches Datumsformat';
return false;
}
}
/**
* Liefert einen UNIX Timestamp von einem String im
* Format "31.12.2007"
*/
public function mktime_datum($datum)
{
if(mb_ereg("([0-9]{2}).([0-9]{2}).([0-9]{4})",$datum, $regs))
{
return mktime(0,0,0,$regs[2],$regs[1],$regs[3]);
}
else
{
$this->errormsg = 'Falsches Datumsformat';
return false;
}
}
/**
* Liefert einen UNIX Timestamp von einem Datum im
* ISO-Format "2007-01-31"
*/
public function mktime_fromdate($datum)
{
if(mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})",$datum, $regs))
{
return mktime(0,0,0,$regs[2],$regs[3],$regs[1]);
}
else
{
$this->errormsg = 'Falsches Datumsformat';
return false;
}
}
/**
* Liefert einen UNIX Timestamp von einem String im
* Format "2007-01-31 14:30:12"
*/
public function mktime_fromtimestamp($timestamp)
{
if(mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})",$timestamp, $regs))
{
return mktime($regs[4],$regs[5],$regs[6],$regs[2],$regs[3],$regs[1]);
}
else
{
$this->errormsg = 'Falsches Datumsformat';
return false;
}
}
/**
* Springt von einen UNIX Timestamp ($datum) $wochen nach vor bzw. hinten
*/
public function jump_week($datum, $wochen)
{
$days = $wochen * 7;
$datetime=new DateTime();
$datetime->setTimestamp($datum);
$datetime->modify($days.' day');
return $datetime->format("U");
}
/**
* Springt von einen UNIX Timestamp ($datum) $days nach vor bzw. hinten
*/
public function jump_day($datum, $days)
{
$stunde_vor=date("G",$datum);
// Ein Tag sind 86400 Sekunden
$datum+=86400*$days;
$stunde_nach=date("G",$datum);
if ($stunde_nach!=$stunde_vor)
$datum+=3600;
return $datum;
}
/**
* Konvertiert das ISO Datumsformat (YYYY-MM-DD)
* nach (DD.MM.YYYY)
*/
public function convertISODate($datum)
{
return (mb_strlen($datum)>0?date('d.m.Y',strtotime($datum)):'');
}
/**
* Prueft Uhrzeit auf Gueltigkeit (HH:MM:SS)
* @return true wenn ok, false wenn falsches Format
*/
public function checkUhrzeit($uhrzeit)
{
if(mb_ereg("([0-9]{2}):([0-9]{2})(:([0-9]{2}))?$",$uhrzeit))
return true;
else
return false;
}
/**
* Prueft ob das Datum im Format dd.mm.YYYY oder YYYY-mm-dd ist
* @return true wenn ok, false wenn falsches Format
*/
public function checkDatum($datum)
{
if(mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})$",$datum) || mb_ereg("([0-9]{2}).([0-9]{2}).([0-9]{4})$",$datum))
return true;
else
return false;
}
/**
* Zieht ein Datum von einem anderen ab, und gibt die differenz in Tagen zurueck (mit Vorzeichen)
* @param $datum1
* @param $datum2
*/
public function DateDiff($datum1, $datum2)
{
$datetime1 = new DateTime($datum1);
$datetime2 = new DateTime($datum2);
$interval = $datetime1->diff($datetime2);
return $interval->format('%R%a');
}
/**
* Prueft ob ein Datum / Datum und Uhrzeit zwischen 2 anderen liegt
* Unterstuetzt auch offenes (leeres) Start und Ende Datum
*
* @param $start Startdatum
* @param $ende Endedatum
* @param $datum Datum das geprueft wird
* @return true wenn dazwischen sonst false
*/
public function between($start, $ende, $datum)
{
$datestart = new DateTime($start);
$dateende = new DateTime($ende);
$dateref = new DateTime($datum);
// Start und Ende nicht gesetzt
if($start=='' && $ende=='')
return true;
// Start nicht gesetzt; Ende gesetzt
if($start=='' && $ende!='' && $dateende>=$dateref)
return true;
// Ende nicht gesetzt; Start gesetzt
if($ende=='' && $start!='' && $datestart<=$dateref)
return true;
// Start und Ende gesetzt
if($ende!='' && $start!='' && $datestart<=$dateref && $dateende>=$dateref)
return true;
return false;
}
/**
* Summiert 2 Zeiten Stunde:Minute
* Es liefert keine Uhrzeit zurueck sondern Stunden und Minuten
* zB 12:10 + 23:15 = 35:25
*
* @param $zeit1
* @param $zeit2
* @return summe der beiden zeiten im Format Stunden:Minuten
*/
public function sumZeit($zeit1, $zeit2)
{
list($h1, $m1) = explode(':', $zeit1);
list($h2, $m2) = explode(':', $zeit2);
$m1 +=$m2;
if($m1>=60)
{
$uebertrag = (int)($m1/60);
$h1+= $uebertrag;
}
$m1=$m1%60;
$h1+=$h2;
if($m1<10)
$m1='0'.$m1;
if($h1<10)
$h1='0'.$h1;
return $h1.':'.$m1;
}
/**
* Subtrahiert 2 Zeiten ($zeit1-$zeit2) Stunde:Minute
* Es liefert keine Uhrzeit zurueck sondern Stunden und Minuten
* zB 23:15 - 12:10 = 11:05
*
* @param $zeit1
* @param $zeit2
* @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<0)
{
$m1 = $m1 + 60;
$h1 = (int)$h1-1;
}
$m1=$m1%60;
$h1-=$h2;
if($m1<10)
$m1='0'.$m1;
if($h1<10)
$h1='0'.$h1;
return $h1.':'.$m1;
}
/**
* Prueft und Liefert ein Datum im angegeben Format
* fuer die Formatierung wird die Funktion formatDatum verwendet
* @param $datum
* @param $format
* @param $strict wenn das Datum aus einem Suchfeld komment, dann strict auf TRUE setzen da sonst
* Eintraege wie zB 'last Monday' oder 'a' auch in ein Datum umgewandelt werden.
* @return Formatierten Timestamp wenn ok, false im Fehlerfall
*/
function checkformatDatum($datum, $format='Y-m-d H:i:s', $strict=false)
{
@list($day, $month, $year) = @explode(".", $datum);
if (@checkdate($month, $day, $year))
return $this->formatDatum($datum, $format, $strict);
@list($day, $month, $year) = @explode("-", $datum);
if (@checkdate($month, $day, $year))
return $this->formatDatum($datum, $format, $strict);
@list($year, $month, $day) = @explode(".", $datum);
if (@checkdate($month, $day, $year))
return $this->formatDatum($datum, $format, $strict);
@list($year, $month, $day) = @explode("-", $datum);
if (@checkdate($month, $day, $year))
return $this->formatDatum($datum, $format, $strict);
if (strlen($datum)==6)
{
$year="20".substr($datum,0,2);
$month=substr($datum,2,2);
$day=substr($datum,4,2);
if (@checkdate($month, $day, $year))
return $this->formatDatum($datum, $format, $strict);
}
else if (strlen($datum)==8)
{
$year=substr($datum,0,4);
$month=substr($datum,4,2);
$day=substr($datum, 6,2);
if (@checkdate($month, $day, $year))
return $this->formatDatum($datum, $format, $strict);
$year=substr($datum,5,4);
$month=substr($datum,3,2);
$day=substr($datum, 0,2);
if (@checkdate($month, $day, $year))
return $this->formatDatum($datum, $format, $strict);
}
return false;
}
/**
* Liefert ein Datum im angegeben Format
* ToDo: Liefert aktuellen Timestamp wenn Sonderzeichen uebergeben werden
* zB '---'
* @param $datum
* @param $format
* @param $strict wenn das Datum aus einem Suchfeld kommt, dann strict auf TRUE setzen da sonst
* Eintraege wie zB 'last Monday' oder 'a' auch in ein Datum umgewandelt werden.
* @return Formatierten Timestamp wenn ok, false im Fehlerfall
*/
public function formatDatum($datum, $format='Y-m-d H:i:s', $strict=false)
{
if(trim($datum)=='')
return '';
$ts='';
$error=false;
//2008-12-31
if(mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})",$datum, $regs))
$ts = mktime(0,0,0,$regs[2],$regs[3],$regs[1]);
//2008-12-31 12:30
if(mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2})",$datum, $regs))
$ts = mktime($regs[4],$regs[5],0,$regs[2],$regs[3],$regs[1]);
//2008-12-31 12:30:15
if(mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})",$datum, $regs))
$ts = mktime($regs[4],$regs[5],$regs[6],$regs[2],$regs[3],$regs[1]);
if($ts=='')
{
//1.12.2008
if(mb_ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})",$datum, $regs))
$ts = mktime(0,0,0,$regs[2],$regs[1],$regs[3]);
//1.12.2008 12:30
if(mb_ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4}) ([0-9]{2}):([0-9]{2})",$datum, $regs))
$ts = mktime($regs[4],$regs[5],0,$regs[2],$regs[1],$regs[3]);
//1.12.2008 12:30:15
if(mb_ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4}) ([0-9]{2}):([0-9]{2}):([0-9]{2})",$datum, $regs))
$ts = mktime($regs[4],$regs[5],$regs[6],$regs[2],$regs[1],$regs[3]);
}
if($ts=='' && !$strict)
{
$ts = strtotime($datum);
if(!$ts || $ts==-1)
{
//wenn strtotime fehlschlaegt liefert diese -1 zurueck, ab php5.1.0 jedoch false
$error = true;
}
}
if($ts!='' && !$error)
return date($format, $ts);
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;
}
}
?>
+23 -2
View File
@@ -96,7 +96,8 @@ class mail
$header .= 'X-Mailer: FHComplete V1'.$eol;
$header .= 'Mime-Version: 1.0'.$eol;
$header .= "Content-Type: multipart/mixed; boundary=\"$mime_boundary_mixed\"".$eol;
$header .= "Content-Type: multipart/related; boundary=\"$mime_boundary_mixed\"".$eol;
$header .= "Content-Transfer-Encoding: 8bit".$eol;
// Body
$mailbody = "";
@@ -152,7 +153,7 @@ class mail
$dispo = empty($attachment[3]) ? 'attachment' : 'inline';
$mailbody .= $eol;
$mailbody .= "Content-Disposition: $dispo; filename={$attachment[2]}".$eol;
$mailbody .= "Content-Type: {$attachment[1]}; name={$attachment[2]}".$eol;
$mailbody .= "Content-Type: {$attachment[1]}; name={$attachment[2]}".$eol;
if (!empty($attachment[3]))
{
$mailbody .= "Content-ID: <{$attachment[3]}>".$eol;
@@ -231,6 +232,26 @@ class mail
return true;
}
/**
* Fuegt ein Bild zum Mail hinzu
* $image image-URL
* $type MIME Type "image/[image-type]", zB "image/jpg"
* $name Anzeigename des Files
* $ContentID ContentID für inline-embedding (diese muss im script im tag <img src="cid:ContentID"> angegeben werden)
*/
public function addEmbeddedImage ($image, $type, $name = '', $ContentID)
{
$image_string = file_get_contents($image);
if (!$image_string)
{
$this->errormsg = 'Fehler beim Einlesen der Datei';
return false;
}
$image_b64 = chunk_split(base64_encode($image_string), 76, "\n");
$this->attachments[] = Array($image_b64, $type, $name, $ContentID);
}
/**
* Fuegt ein Attachment zum Mail hinzu
* $content
+1
View File
@@ -4,6 +4,7 @@ $this->phrasen['global/studienrichtung']='Studienrichtung';
$this->phrasen['global/institut']='Institut';
$this->phrasen['global/semester']='Semester';
$this->phrasen['global/studiensemester']='Studiensemester';
$this->phrasen['global/studienplan']='Studienplan';
$this->phrasen['global/studienzentrum']='Studienzentrum';
$this->phrasen['global/studiengangsleitung']='Studiengangsleitung';
$this->phrasen['global/leitung']='Leitung';
+1
View File
@@ -4,6 +4,7 @@ $this->phrasen['global/studienrichtung']='Degree-Program';
$this->phrasen['global/institut']='Institute';
$this->phrasen['global/semester']='Semester';
$this->phrasen['global/studiensemester']='Semester';
$this->phrasen['global/studienplan']='Study Plan';
$this->phrasen['global/studienzentrum']='Study Center';
$this->phrasen['global/studiengangsleitung']='Program Director';
$this->phrasen['global/leitung']='Head';
+159 -158
View File
@@ -1,158 +1,159 @@
<?php
$this->phrasen['global/abbrechen']='annulla';
$this->phrasen['global/abmelden']='esci';
$this->phrasen['global/abschicken']='Invia ';
$this->phrasen['global/adresse']='indirizzo';
$this->phrasen['global/aendern']='modifica';
$this->phrasen['global/aktion']='azione';
$this->phrasen['global/alle']='tutti';
$this->phrasen['global/allgemeinerdownload']='download generale';
$this->phrasen['global/angelegtAm']='registrato il ';
$this->phrasen['global/angemeldet']='iscritto';
$this->phrasen['global/anleitung']='istruzioni';
$this->phrasen['global/anmelden']='iscriversi';
$this->phrasen['global/anmerkung']='osservazioni';
$this->phrasen['global/anmerkungen']='osservazioni';
$this->phrasen['global/anzeigen']='mostra';
$this->phrasen['global/ausblenden']='';
$this->phrasen['global/auswaehlen']='';
$this->phrasen['global/auswahl']='';
$this->phrasen['global/bearbeiten']='modifica';
$this->phrasen['global/beginn']='inizio';
$this->phrasen['global/beispiele']='esempi';
$this->phrasen['global/benutzer']='utente';
$this->phrasen['global/beschreibung']='descrizione';
$this->phrasen['global/betreff']='oggetto';
$this->phrasen['global/bezeichnung']='denominazione';
$this->phrasen['global/bis']='fino';
$this->phrasen['global/code']='codice';
$this->phrasen['global/datei']='file';
$this->phrasen['global/dateiErfolgreichHochgeladen']='il file è stato caricato';
$this->phrasen['global/dateiExistiertNicht']='il file è inesistente';
$this->phrasen['global/dateiLoeschen']='cancella file';
$this->phrasen['global/dateiNichtErfolgreichHochgeladen']='impossibile caricare il file. Si prega di ripetere l\'operazione.';
$this->phrasen['global/datensatzWurdeNichtGefunden']='impossibile trovare i dati cercati';
$this->phrasen['global/datenWurdenGespeichert']='i dati sono stati salvati';
$this->phrasen['global/datum']='Data';
$this->phrasen['global/datumNichtGesetzt']='non è stata impostata la data';
$this->phrasen['global/deutsch']='tedesco';
$this->phrasen['global/dienstag']='martedì';
$this->phrasen['global/donnerstag']='giovedì ';
$this->phrasen['global/download']='download';
$this->phrasen['global/editieren']='editare';
$this->phrasen['global/eintragen']='registrare';
$this->phrasen['global/eintragWurdeGeloescht']='cancellata registrazione';
$this->phrasen['global/emailAdresse']='indirizzo e-mail';
$this->phrasen['global/emailAnAssistenz']='e-mail alla segreteria';
$this->phrasen['global/emailgesendetan']='spedisci e-mail a';
$this->phrasen['global/ende']='fine';
$this->phrasen['global/englisch']='inglese';
$this->phrasen['global/entfernen']='cestina';
$this->phrasen['global/erfolgreichAngelegt']='ok, registrato';
$this->phrasen['global/erfolgreichgelöscht']='ok, cancellato';
$this->phrasen['global/erfolgreichgespeichert']='ok, salvato';
$this->phrasen['global/erstellen']='crea';
$this->phrasen['global/fax']='fax';
$this->phrasen['global/fehleraufgetreten']='è avvenuto un errore';
$this->phrasen['global/fehlerBeiDerParameteruebergabe']='errore di trasmissione dei parametri';
$this->phrasen['global/fehlerBeimAktualisierenDerDaten']='errore di aggiornamento dei dati';
$this->phrasen['global/fehlerBeimErmittelnDerUID ']='errore di ricerca della UID';
$this->phrasen['global/fehlerBeimLadenDesDatensatzes']='errore di caricamento dei dati';
$this->phrasen['global/fehlerBeimLesenAusDatenbank']='errore di lettura dalla banca dati';
$this->phrasen['global/fehlerBeimLoeschenDesEintrags']='errore di cancellazione della registrazione';
$this->phrasen['global/fehlerBeimOeffnenDerDatenbankverbindung']='errore di apertura del collegamento con la banca dati';
$this->phrasen['global/fehlerBeimSpeichernDerDaten']='errore di salvataggio dati';
$this->phrasen['global/fhTechnikumWien']='SFU';
$this->phrasen['global/fhtw']='Sigmund Freud PrivatUniversität';
$this->phrasen['global/frau']='Sig.ra';
$this->phrasen['global/freitag']='venerdì';
$this->phrasen['global/FuerDieseAktionBenoetigenSieAdministrationsrechte']='per questa azione si necessita l\'amministratore del sistema';
$this->phrasen['global/funktion']='funzione';
$this->phrasen['global/geburtsdatum']='Data di nascita';
$this->phrasen['global/geburtsort']='Luogo di nascita';
$this->phrasen['global/geschaeftsfuehrendeltg']='Amministratore';
$this->phrasen['global/geschlecht']='';
$this->phrasen['global/gruppe']='Gruppo';
$this->phrasen['global/handbuch']='Manuale';
$this->phrasen['global/handy']='Cellulare';
$this->phrasen['global/hauptwohnsitz']='Residenza ';
$this->phrasen['global/hilfe']='Assistenza';
$this->phrasen['global/hinzufuegen']='aggiungi';
$this->phrasen['global/institut']='Istituto';
$this->phrasen['global/ja']='sì';
$this->phrasen['global/kalender']='Calendario';
$this->phrasen['global/keineBerechtigung']='non autorizzato';
$this->phrasen['global/keineBerechtigungFuerDieseSeite']='errore di autorizzazione per questa pagina';
$this->phrasen['global/keineBerechtigungZumAendernDesDatensatzes']='errore di autorizzazione per modificare i dati';
$this->phrasen['global/keineDatenGefunden']='impossibile trovare i dati';
$this->phrasen['global/kopieren']='copia';
$this->phrasen['global/LDAPserverNichtErreichbar']='il server LDAP non è raggiungibile';
$this->phrasen['global/lehreinheit']='';
$this->phrasen['global/lehrveranstaltung']='Insegnamento';
$this->phrasen['global/lehrziele']='obiettivi di studio';
$this->phrasen['global/loeschen']='cancella';
$this->phrasen['global/löschen']='cancella';
$this->phrasen['global/mail']='messaggio mail';
$this->phrasen['global/mann']='maschio/uomo';
$this->phrasen['global/matrikelnummer']='Matricola';
$this->phrasen['global/minute']='minuti';
$this->phrasen['global/mittwoch']='mercoledì';
$this->phrasen['global/montag']='lunedì';
$this->phrasen['global/nachname']='Cognome';
$this->phrasen['global/name']='Nome';
$this->phrasen['global/nebenwohnsitz']='domicilio';
$this->phrasen['global/nein']='no';
$this->phrasen['global/neu']='nuovo';
$this->phrasen['global/newsgroups']='newsgroup';
$this->phrasen['global/nichtAngemeldet ']='errore di log in: impossibile trovare l\'UID dell\'utente ';
$this->phrasen['global/nummer']='numero';
$this->phrasen['global/ok']='ok';
$this->phrasen['global/organisationseinheit']='Unità organizzativa';
$this->phrasen['global/organisationseinheiten']='';
$this->phrasen['global/ort']='luogo';
$this->phrasen['global/passwort']='Password';
$this->phrasen['global/person']='persona';
$this->phrasen['global/personen']='persone ';
$this->phrasen['global/personenkennzeichen']='Codice Persona';
$this->phrasen['global/personenkz']='Codice Persona';
$this->phrasen['global/plz']='CAP';
$this->phrasen['global/postnomen']='Titolo';
$this->phrasen['global/samstag']='sabato';
$this->phrasen['global/sekretariat']='segreteria';
$this->phrasen['global/semester']='Semestre';
$this->phrasen['global/sonntag']='domenica';
$this->phrasen['global/speichern']='salva';
$this->phrasen['global/sprache']='lingua';
$this->phrasen['global/staatsbuergerschaft']='cittadinanza';
$this->phrasen['global/stellvertreter']='supplenza ';
$this->phrasen['global/strasse']='via';
$this->phrasen['global/studentenvertreter']='rappresentanti degli studendi';
$this->phrasen['global/studiengang']='Corso di studi';
$this->phrasen['global/studiengangKonnteNichtGefundenWerden ']='impossibile trovare corso di studi digitato';
$this->phrasen['global/studiengangsleitung']='Direzione del corso di studi';
$this->phrasen['global/studiengangsmanagement']='Management del corso di studi';
$this->phrasen['global/studienrichtung']='indirizzo di studio';
$this->phrasen['global/studiensemester']='Semestre di studio';
$this->phrasen['global/studiensemesterKonnteNichtGefundenWerden ']='impossibile trovare semestre di studio digitato';
$this->phrasen['global/studienzentrum']='';
$this->phrasen['global/stunde']='ora';
$this->phrasen['global/suchen']='cerca';
$this->phrasen['global/telefon']='telefono';
$this->phrasen['global/telefonnummer']='numero telefonico';
$this->phrasen['global/titel']='Titolo';
$this->phrasen['global/uid']='UID';
$this->phrasen['global/umbenennen']='cambia nome';
$this->phrasen['global/unbekannterFehleraufgetreten']='è avvenuto un errore sconosciuto';
$this->phrasen['global/universität']='università';
$this->phrasen['global/username']='Username';
$this->phrasen['global/userNichtGefunden']='';
$this->phrasen['global/verband']='Gruppo Principale';
$this->phrasen['global/von']='inizio';
$this->phrasen['global/vorname']='Nome';
$this->phrasen['global/warnungWirklichLoeschen']='';
$this->phrasen['global/zurueck']='Indietro';
$this->phrasen['global/zuruecksetzen']='';
$this->phrasen['global/zweck']='';
$this->phrasen['global/ects']='ECTS';
?>
<?php
$this->phrasen['global/abbrechen']='annulla';
$this->phrasen['global/abmelden']='esci';
$this->phrasen['global/abschicken']='Invia ';
$this->phrasen['global/adresse']='indirizzo';
$this->phrasen['global/aendern']='modifica';
$this->phrasen['global/aktion']='azione';
$this->phrasen['global/alle']='tutti';
$this->phrasen['global/allgemeinerdownload']='download generale';
$this->phrasen['global/angelegtAm']='registrato il ';
$this->phrasen['global/angemeldet']='iscritto';
$this->phrasen['global/anleitung']='istruzioni';
$this->phrasen['global/anmelden']='iscriversi';
$this->phrasen['global/anmerkung']='osservazioni';
$this->phrasen['global/anmerkungen']='osservazioni';
$this->phrasen['global/anzeigen']='mostra';
$this->phrasen['global/ausblenden']='';
$this->phrasen['global/auswaehlen']='';
$this->phrasen['global/auswahl']='';
$this->phrasen['global/bearbeiten']='modifica';
$this->phrasen['global/beginn']='inizio';
$this->phrasen['global/beispiele']='esempi';
$this->phrasen['global/benutzer']='utente';
$this->phrasen['global/beschreibung']='descrizione';
$this->phrasen['global/betreff']='oggetto';
$this->phrasen['global/bezeichnung']='denominazione';
$this->phrasen['global/bis']='fino';
$this->phrasen['global/code']='codice';
$this->phrasen['global/datei']='file';
$this->phrasen['global/dateiErfolgreichHochgeladen']='il file è stato caricato';
$this->phrasen['global/dateiExistiertNicht']='il file è inesistente';
$this->phrasen['global/dateiLoeschen']='cancella file';
$this->phrasen['global/dateiNichtErfolgreichHochgeladen']='impossibile caricare il file. Si prega di ripetere l\'operazione.';
$this->phrasen['global/datensatzWurdeNichtGefunden']='impossibile trovare i dati cercati';
$this->phrasen['global/datenWurdenGespeichert']='i dati sono stati salvati';
$this->phrasen['global/datum']='Data';
$this->phrasen['global/datumNichtGesetzt']='non è stata impostata la data';
$this->phrasen['global/deutsch']='tedesco';
$this->phrasen['global/dienstag']='martedì';
$this->phrasen['global/donnerstag']='giovedì ';
$this->phrasen['global/download']='download';
$this->phrasen['global/editieren']='editare';
$this->phrasen['global/eintragen']='registrare';
$this->phrasen['global/eintragWurdeGeloescht']='cancellata registrazione';
$this->phrasen['global/emailAdresse']='indirizzo e-mail';
$this->phrasen['global/emailAnAssistenz']='e-mail alla segreteria';
$this->phrasen['global/emailgesendetan']='spedisci e-mail a';
$this->phrasen['global/ende']='fine';
$this->phrasen['global/englisch']='inglese';
$this->phrasen['global/entfernen']='cestina';
$this->phrasen['global/erfolgreichAngelegt']='ok, registrato';
$this->phrasen['global/erfolgreichgelöscht']='ok, cancellato';
$this->phrasen['global/erfolgreichgespeichert']='ok, salvato';
$this->phrasen['global/erstellen']='crea';
$this->phrasen['global/fax']='fax';
$this->phrasen['global/fehleraufgetreten']='è avvenuto un errore';
$this->phrasen['global/fehlerBeiDerParameteruebergabe']='errore di trasmissione dei parametri';
$this->phrasen['global/fehlerBeimAktualisierenDerDaten']='errore di aggiornamento dei dati';
$this->phrasen['global/fehlerBeimErmittelnDerUID ']='errore di ricerca della UID';
$this->phrasen['global/fehlerBeimLadenDesDatensatzes']='errore di caricamento dei dati';
$this->phrasen['global/fehlerBeimLesenAusDatenbank']='errore di lettura dalla banca dati';
$this->phrasen['global/fehlerBeimLoeschenDesEintrags']='errore di cancellazione della registrazione';
$this->phrasen['global/fehlerBeimOeffnenDerDatenbankverbindung']='errore di apertura del collegamento con la banca dati';
$this->phrasen['global/fehlerBeimSpeichernDerDaten']='errore di salvataggio dati';
$this->phrasen['global/fhTechnikumWien']='SFU';
$this->phrasen['global/fhtw']='Sigmund Freud PrivatUniversität';
$this->phrasen['global/frau']='Sig.ra';
$this->phrasen['global/freitag']='venerdì';
$this->phrasen['global/FuerDieseAktionBenoetigenSieAdministrationsrechte']='per questa azione si necessita l\'amministratore del sistema';
$this->phrasen['global/funktion']='funzione';
$this->phrasen['global/geburtsdatum']='Data di nascita';
$this->phrasen['global/geburtsort']='Luogo di nascita';
$this->phrasen['global/geschaeftsfuehrendeltg']='Amministratore';
$this->phrasen['global/geschlecht']='';
$this->phrasen['global/gruppe']='Gruppo';
$this->phrasen['global/handbuch']='Manuale';
$this->phrasen['global/handy']='Cellulare';
$this->phrasen['global/hauptwohnsitz']='Residenza ';
$this->phrasen['global/hilfe']='Assistenza';
$this->phrasen['global/hinzufuegen']='aggiungi';
$this->phrasen['global/institut']='Istituto';
$this->phrasen['global/ja']='sì';
$this->phrasen['global/kalender']='Calendario';
$this->phrasen['global/keineBerechtigung']='non autorizzato';
$this->phrasen['global/keineBerechtigungFuerDieseSeite']='errore di autorizzazione per questa pagina';
$this->phrasen['global/keineBerechtigungZumAendernDesDatensatzes']='errore di autorizzazione per modificare i dati';
$this->phrasen['global/keineDatenGefunden']='impossibile trovare i dati';
$this->phrasen['global/kopieren']='copia';
$this->phrasen['global/LDAPserverNichtErreichbar']='il server LDAP non è raggiungibile';
$this->phrasen['global/lehreinheit']='';
$this->phrasen['global/lehrveranstaltung']='Insegnamento';
$this->phrasen['global/lehrziele']='obiettivi di studio';
$this->phrasen['global/loeschen']='cancella';
$this->phrasen['global/löschen']='cancella';
$this->phrasen['global/mail']='messaggio mail';
$this->phrasen['global/mann']='maschio/uomo';
$this->phrasen['global/matrikelnummer']='Matricola';
$this->phrasen['global/minute']='minuti';
$this->phrasen['global/mittwoch']='mercoledì';
$this->phrasen['global/montag']='lunedì';
$this->phrasen['global/nachname']='Cognome';
$this->phrasen['global/name']='Nome';
$this->phrasen['global/nebenwohnsitz']='domicilio';
$this->phrasen['global/nein']='no';
$this->phrasen['global/neu']='nuovo';
$this->phrasen['global/newsgroups']='newsgroup';
$this->phrasen['global/nichtAngemeldet ']='errore di log in: impossibile trovare l\'UID dell\'utente ';
$this->phrasen['global/nummer']='numero';
$this->phrasen['global/ok']='ok';
$this->phrasen['global/organisationseinheit']='Unità organizzativa';
$this->phrasen['global/organisationseinheiten']='';
$this->phrasen['global/ort']='luogo';
$this->phrasen['global/passwort']='Password';
$this->phrasen['global/person']='persona';
$this->phrasen['global/personen']='persone ';
$this->phrasen['global/personenkennzeichen']='Codice Persona';
$this->phrasen['global/personenkz']='Codice Persona';
$this->phrasen['global/plz']='CAP';
$this->phrasen['global/postnomen']='Titolo';
$this->phrasen['global/samstag']='sabato';
$this->phrasen['global/sekretariat']='segreteria';
$this->phrasen['global/semester']='Semestre';
$this->phrasen['global/sonntag']='domenica';
$this->phrasen['global/speichern']='salva';
$this->phrasen['global/sprache']='lingua';
$this->phrasen['global/staatsbuergerschaft']='cittadinanza';
$this->phrasen['global/stellvertreter']='supplenza ';
$this->phrasen['global/strasse']='via';
$this->phrasen['global/studentenvertreter']='rappresentanti degli studendi';
$this->phrasen['global/studiengang']='Corso di studi';
$this->phrasen['global/studiengangKonnteNichtGefundenWerden ']='impossibile trovare corso di studi digitato';
$this->phrasen['global/studiengangsleitung']='Direzione del corso di studi';
$this->phrasen['global/studiengangsmanagement']='Management del corso di studi';
$this->phrasen['global/studienrichtung']='indirizzo di studio';
$this->phrasen['global/studiensemester']='Semestre di studio';
$this->phrasen['global/studienplan']='Piano di studio';
$this->phrasen['global/studiensemesterKonnteNichtGefundenWerden ']='impossibile trovare semestre di studio digitato';
$this->phrasen['global/studienzentrum']='';
$this->phrasen['global/stunde']='ora';
$this->phrasen['global/suchen']='cerca';
$this->phrasen['global/telefon']='telefono';
$this->phrasen['global/telefonnummer']='numero telefonico';
$this->phrasen['global/titel']='Titolo';
$this->phrasen['global/uid']='UID';
$this->phrasen['global/umbenennen']='cambia nome';
$this->phrasen['global/unbekannterFehleraufgetreten']='è avvenuto un errore sconosciuto';
$this->phrasen['global/universität']='università';
$this->phrasen['global/username']='Username';
$this->phrasen['global/userNichtGefunden']='';
$this->phrasen['global/verband']='Gruppo Principale';
$this->phrasen['global/von']='inizio';
$this->phrasen['global/vorname']='Nome';
$this->phrasen['global/warnungWirklichLoeschen']='';
$this->phrasen['global/zurueck']='Indietro';
$this->phrasen['global/zuruecksetzen']='';
$this->phrasen['global/zweck']='';
$this->phrasen['global/ects']='ECTS';
?>
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

+315
View File
@@ -0,0 +1,315 @@
<?php
/* Copyright (C) 2018 fhcomplete.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Cristina Hainberger <hainberg@technikum-wien.at> */
require_once('../../config/vilesci.config.inc.php');
require_once('../../include/basis_db.class.php');
require_once('../../include/datum.class.php');
require_once('../../include/mail.class.php');
require_once('../../include/ampel.class.php');
require_once('../../include/person.class.php');
require_once('../../include/phrasen.class.php');
$db = new basis_db();
$datum = new datum();
$now = $datum->mktime_fromdate(date('Y-m-d'));
$sprache = getSprache();
$p = new phrasen($sprache);
//get all notifications
$ampel_obj = new ampel();
$ampel_obj->getAll();
$ampel_arr = $ampel_obj->result;
//filter only notifications that are not expired, not before vorlaufzeit AND email is true
$ampel_arr = filterAmpeln($ampel_arr);
//get user of notifications, ampel_id, description and deadline
$new_ampel_user_arr = array(); //user with new notifications that are not confirmed
$overdue_ampel_user_arr = array(); //user with overdue notifications that are not confirmed
foreach($ampel_arr as $ampel)
{
$deadline = $datum->mktime_fromdate($ampel->deadline);
$insert_date = $datum->formatDatum($ampel->insertamum, 'Y-m-d');
$qry_all_ampel_user = $ampel->benutzer_select;
$kurzbz = $ampel->kurzbz;
$new = false;
$overdue = false;
$new_user_arr = array();
$overdue_user_arr = array();
if($result = $db->db_query($qry_all_ampel_user))
{
while($row = $db->db_fetch_object($result))
{
$user = $row->uid;
//break if almost confirmed
if ($ampel_obj->isBestaetigt($user, $ampel->ampel_id))
break;
//check if notification is new (within last week, as cronjob will run every week)
if ($datum->DateDiff (date('Y-m-d'), $insert_date) >= -7)
{
$new = true;
$new_user_arr[] = $user;
}
//check if notification is overdue
if ($now > $deadline)
{
$overdue = true;
$overdue_user_arr[] = $user;
}
}
}
if ($new)
{
$new_ampel_user_arr[] = array(
'ampel_id' => $ampel->ampel_id,
'ampel_bezeichnung' => $kurzbz,
'user' => $new_user_arr,
'deadline' => date('d.m.Y', $deadline));
}
if ($overdue)
{
$overdue_ampel_user_arr[] = array(
'ampel_id' => $ampel->ampel_id,
'ampel_bezeichnung' => $kurzbz,
'user' => $overdue_user_arr,
'deadline' => date('d.m.Y', $deadline));
}
}
//rearrange arrays as needed to send in eMails
$new_ampel_user_arr = organizeAmpelnForMail($new_ampel_user_arr);
$overdue_ampel_user_arr = organizeAmpelnForMail($overdue_ampel_user_arr);
//send eMail for new notifications
foreach ($new_ampel_user_arr as $receiver)
{
//get data about sender
$person = new person();
$person->getPersonFromBenutzer($receiver['user']);
$firstName = $person->vorname;
//link to notifications system site
$link = APP_ROOT . "cis/index.php?sprache=German&content_id=&menu=" . APP_ROOT . "cis/menu.php?content_id=&content=" . APP_ROOT . "cis/private/tools/ampelverwaltung.php";
//eMail data
$to = $receiver['user'] . '@' . DOMAIN;
$from = 'noreply@'.DOMAIN;
$subject = 'Sie haben eine neue Ampel!';
$title = "Sie haben neue Nachrichten in Ihrem Ampelsystem!";
$content = "<p>Hallo " . $firstName . ",</p>";
$content .= "<p>es gibt neue Ampeln für Sie:</p><br>";
for ($i = 0; $i < count($receiver) - 1; $i++)
{
$receiver[$i]['ampel_id'];
$content .= "<p><i>NEU:</i>&nbsp&nbsp<strong>" . $receiver[$i]['ampel_bezeichnung'] . "</strong></p>";
}
$content .= "<br><p>Sie können sie jetzt gleich in Ihrem Ampelsystem bestätigen:</p>";
$content .= "<br><a style=\"color: #74ba24;\" href=" . $link . ">Zu meinem Ampelsystem</a></br>";
$content .= "<p><br>Schönen Tag noch,</p>";
$content .= "<p>Sancho</p>";
//send eMail
sendMail($to, $from, $subject, $content, $title);
}
//send eMail for overdue notifications
foreach ($overdue_ampel_user_arr as $receiver)
{
//get data about sender
$person = new person();
$person->getPersonFromBenutzer($receiver['user']);
$firstName = $person->vorname;
//link to notifications system site
$link = APP_ROOT . "cis/index.php?sprache=German&content_id=&menu=" . APP_ROOT . "cis/menu.php?content_id=&content=" . APP_ROOT . "cis/private/tools/ampelverwaltung.php";
//eMail data
$to = $receiver['user'] . '@' . DOMAIN;
$from = 'noreply@'.DOMAIN;
$subject = 'Bestätigen Sie bitte Ihre Ampel!';
$title = "Die Deadline für Ihre Ampel ist überschritten!";
$content = "<p>Hallo " . $firstName . ",</p>";
$content .= "<p>es gibt Ampeln, die von Ihnen noch bestätigt werden müssen:</p><br>";
for ($i = 0; $i < count($receiver) - 1; $i++)
{
$receiver[$i]['ampel_id'];
$content .= "<p><i>BESTÄTIGUNG FEHLT:</i>&nbsp&nbsp<strong>" . $receiver[$i]['ampel_bezeichnung'] . "</strong></p>";
$content .= "<p><small><i style=\"color: #65696E;\">Die Deadline für die Bestätigung war am <span style=\"color: #FF0000;\">" . $receiver[$i]['deadline'] . "</span></i></small></p><br>";
}
$content .= "<br><p>Sie können sie jetzt gleich in Ihrem Ampelsystem bestätigen:</p>";
$content .= "<br><a style=\"color: #74ba24;\" href=" . $link . ">Zu meinem Ampelsystem</a></br>";
$content .= "<p><br>Schönen Tag noch,</p>";
$content .= "<p>Sancho</p>";
//send eMail
sendMail($to, $from, $subject, $content, $title);
}
//************************************************************* FUNCTIONS
function filterAmpeln($ampel_arr)
{
$datum = new datum();
$now = $datum->mktime_fromdate(date('Y-m-d'));
$arr = array();
foreach ($ampel_arr as $ampel)
{
$deadline = $datum->mktime_fromdate($ampel->deadline);
$vorlaufzeit = $ampel->vorlaufzeit;
$verfallszeit = $ampel->verfallszeit;
$datum_liegt_vor_vorlaufzeit = false;
$datum_liegt_nach_verfallszeit = false;
if (!is_null($vorlaufzeit))
$datum_liegt_vor_vorlaufzeit = $now < strtotime('-' . $vorlaufzeit . ' day', $deadline);
if (!is_null($verfallszeit))
$datum_liegt_nach_verfallszeit = $now > strtotime('+' . $verfallszeit . ' day', $deadline);
if (!$datum_liegt_vor_vorlaufzeit && !$datum_liegt_nach_verfallszeit && $ampel->email)
{
$arr[] = $ampel;
}
}
return $arr;
}
function organizeAmpelnForMail ($ampel_user_arr)
{
$helper_arr = array();
$unique_user_arr = array();
foreach ($ampel_user_arr as $ampel_user)
{
foreach ($ampel_user['user'] as $user)
{
if(!in_array($user, $helper_arr))
{
$helper_arr[] = $user;
$unique_user_arr[] = array(
'user' => $user,
array(
'ampel_id' => $ampel_user['ampel_id'],
'ampel_bezeichnung' => $ampel_user['ampel_bezeichnung'],
'deadline' => $ampel_user['deadline']));
}
else
{
$index = array_search($user, array_column($unique_user_arr, 'user'));
$unique_user_arr[$index][] =
array(
'ampel_id' => $ampel_user['ampel_id'],
'ampel_bezeichnung' => $ampel_user['ampel_bezeichnung'],
'deadline' => $ampel_user['deadline']);
}
}
}
return $unique_user_arr;
}
function sendMail($to, $from, $subject, $html_content, $title = 'Sancho hat neue Nachrichten für Sie!')
{
$sancho_img = APP_ROOT . "skin/images/sancho_round_right_blue.png";
$logo_img = APP_ROOT . "skin/images/fh_logo.png";
//mail content as plain text (fallback if html not activated)
$plain_text = "Hallo,\n\n";
if (!empty ($title))
$plain_text .= strip_tags($title) . "\n\n";
$plain_text .= "Bitte sehen Sie sich die Nachricht in HTML Sicht an, um den Inhalt vollständig darzustellen.";
//mail content as html text
/*
* no css styles in html-head (email clients picky about that)
* tables inside tables for correct styles in different email clients
*/
$html_text = '
<html>
<head>
<title>Sancho Ampelmail</title>
</head>
<body><center>
<table width="650px" cellpadding="0" cellspacing="0" style="border: 2px solid #65696e; border-spacing: 0px; margin-top: 40px;">
<tr>
<td align="left">
<table cellpadding="0" width="100%" cellspacing="0" style="padding:0; border-bottom: 2px solid #A0A0A0; margin: 0; font-family: arial, verdana, sans-serif; font-size: 0.8em; border-spacing: 0px;">
<tr>
<td width="25%" style="padding: 25px;">
<img src="cid:SanchoFace" align="left" alt="sancho_face" width="105" height="105">
</td>
<td width="75%" style="padding: 25px;">
<h4 align="center" style="padding-top: 20">' . $title . '</h4>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left">
<table cellpadding="0" width="100%" cellspacing="0" style="padding:0; border-bottom: 2px solid #A0A0A0; margin: 0; font-family: arial, verdana, sans-serif; font-size: 0.8em; border-spacing: 0px;">
<tr>
<td style="padding: 25px;">
<br>' . $html_content . '</br>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left">
<table cellpadding="0" width="100%" cellspacing="0" style="padding:0; margin: 0; font-family: arial, verdana, sans-serif; font-size: 0.8em; border-spacing: 0px;">
<tr>
<td width="75%" style="padding: 25px;">
<span style="color: #0a629c; padding: 20 0 0 20;">So spannend kann Technik sein!</span>
</td>
<td width="25%" style="padding: 25px;">
<a href="https://www.technikum-wien.at"><img src="cid:Logo" align="right" alt="logo" width="120" height="70">
</td>
</tr>
</table>
</td>
</tr>
</table>
</center></body>
</html>';
$mail = new mail($to, $from, $subject, $plain_text);
$mail->setHtmlContent($html_text);
$mail->addEmbeddedImage($sancho_img, "image/png", "", "SanchoFace");
$mail->addEmbeddedImage($logo_img, "image/png", "", "Logo");
if(!$mail->send())
echo $p->t('global/emailNichtVersendet') . ' an ' . $to . "<br>";
}