mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 01:42:17 +00:00
Coodle
- Reservierung von Räumen nach Abschluss der Umfrage - Design Anpassungen - Freebusy für Coodletermine - Mailversand mit Coodle-Event im Anhang
This commit is contained in:
@@ -17,6 +17,9 @@
|
||||
*
|
||||
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
|
||||
*/
|
||||
/**
|
||||
* Bearbeiten und Eintragen von Coodle Umfragen
|
||||
*/
|
||||
require_once('../../../config/cis.config.inc.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/phrasen.class.php');
|
||||
@@ -28,6 +31,7 @@ $sprache = getSprache();
|
||||
$p = new phrasen($sprache);
|
||||
$datum_obj = new datum();
|
||||
$db = new basis_db();
|
||||
$message='';
|
||||
|
||||
echo '
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
@@ -105,9 +109,8 @@ echo '
|
||||
{
|
||||
width: 70%;
|
||||
text-align: right;
|
||||
margin-top: 20px;
|
||||
margin-top: 10px;
|
||||
padding: 10px;
|
||||
/*border: 1px dotted red;*/
|
||||
}
|
||||
</style>
|
||||
<title>'.$p->t('coodle/coodle').'</title>
|
||||
@@ -155,16 +158,17 @@ if(isset($_POST['save']))
|
||||
|
||||
if($coodle->save())
|
||||
{
|
||||
echo '<span class="ok">'.$p->t('global/erfolgreichgespeichert').'</span>';
|
||||
$message.= '<span class="ok">'.$p->t('global/erfolgreichgespeichert').'</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<span class="error">'.$coodle->errormsg.'</span>';
|
||||
$message.= '<span class="error">'.$coodle->errormsg.'</span>';
|
||||
}
|
||||
|
||||
echo '<script>
|
||||
/*
|
||||
$message.='<script>
|
||||
window.opener.location.href="uebersicht.php";
|
||||
</script>';
|
||||
</script>';*/
|
||||
|
||||
}
|
||||
elseif(isset($_GET['coodle_id']))
|
||||
@@ -185,6 +189,7 @@ else
|
||||
$coodle->dauer=60;
|
||||
}
|
||||
echo '
|
||||
<a href="uebersicht.php"><< '.$p->t('coodle/zurueckZurUebersicht').'</a><br>
|
||||
<br>
|
||||
<form method="POST">';
|
||||
echo '<div id="wrapper">
|
||||
@@ -194,18 +199,7 @@ if($coodle->coodle_id=='')
|
||||
else
|
||||
echo $p->t('coodle/bearbeiten');
|
||||
echo '</h4>';
|
||||
/*
|
||||
echo '
|
||||
<fieldset style="width:100px;">
|
||||
<legend>';
|
||||
if($coodle->coodle_id=='')
|
||||
echo $p->t('coodle/neuerEintrag');
|
||||
else
|
||||
echo $p->t('coodle/bearbeiten');
|
||||
|
||||
echo '
|
||||
</legend>';
|
||||
*/
|
||||
|
||||
echo '
|
||||
<input type="hidden" name="coodle_id" value="'.$db->convert_html_chars($coodle->coodle_id).'" />
|
||||
<table>
|
||||
@@ -230,7 +224,7 @@ echo '
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" name="save" value="'.$p->t('global/speichern').'"/></td>
|
||||
<td><input type="submit" name="save" value="'.$p->t('global/speichern').'"/> '.$message.'</td>
|
||||
</tr>
|
||||
</table>';
|
||||
|
||||
|
||||
@@ -17,6 +17,14 @@
|
||||
*
|
||||
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
|
||||
*/
|
||||
/**
|
||||
* Coodle Terminauswahl
|
||||
*
|
||||
* Funktionen:
|
||||
* - hinzufuegen von Ressourcen (Personen, Raeume und externe Personen)
|
||||
* - setzen von Terminvorschlaegen
|
||||
* - starten der Umfrage inkl. Infomail an alle Teilnehmer
|
||||
*/
|
||||
require_once('../../../config/cis.config.inc.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/phrasen.class.php');
|
||||
@@ -33,7 +41,7 @@ $datum_obj = new datum();
|
||||
|
||||
if(!isset($_REQUEST['coodle_id']))
|
||||
die($p->t('global/fehlerBeiDerParameteruebergabe'));
|
||||
|
||||
|
||||
$coodle_id = $_REQUEST['coodle_id'];
|
||||
|
||||
$db = new basis_db();
|
||||
@@ -46,7 +54,7 @@ $event_titel = $coodle->titel;
|
||||
|
||||
if($coodle->coodle_status_kurzbz == 'storniert' || $coodle->coodle_status_kurzbz == 'abgeschlossen')
|
||||
{
|
||||
die('Diese Umfrage ist bereits beendet');
|
||||
die($p->t('coodle/umfrageNichtGueltig'));
|
||||
}
|
||||
|
||||
|
||||
@@ -111,10 +119,7 @@ if(isset($_POST['action']) && $_POST['action']=='start')
|
||||
continue;
|
||||
}
|
||||
$anrede = trim($anrede);
|
||||
$sign = "Mit freundlichen Grüßen\n\n";
|
||||
$sign .= "Fachhochschule Technikum Wien\n";
|
||||
$sign .= "Höchstädtplatz 5\n";
|
||||
$sign .= "1200 Wien\n";
|
||||
$sign = $p->t('mail/signatur');
|
||||
|
||||
|
||||
$html=$anrede.'!<br><br>
|
||||
@@ -137,7 +142,7 @@ if(isset($_POST['action']) && $_POST['action']=='start')
|
||||
}
|
||||
|
||||
echo '<br><b>'.$p->t('coodle/erfolgreichGestartet').'</b>';
|
||||
echo '<br><br><a href="uebersicht.php">'.$p->t('coodle/zurueckZurUebersicht').'</a>';
|
||||
echo '<br><br><a href="uebersicht.php"><< '.$p->t('coodle/zurueckZurUebersicht').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -384,7 +389,11 @@ echo '<html>
|
||||
else
|
||||
uhrzeit = $.fullCalendar.formatDate(date, "HH:mm:ss");
|
||||
|
||||
//alert("datum:"+datum+" uhrzeit:"+uhrzeit);
|
||||
// Pruefen ob die Reservierungsgrenze ueberschritten wurde und ggf Warnung anzeigen
|
||||
if(datum>\''.RES_TAGE_LEKTOR_BIS.'\')
|
||||
{
|
||||
alert("'.$p->t('coodle/ReservierungNichtMoeglich', array($datum_obj->formatDatum(RES_TAGE_LEKTOR_BIS, 'd.m.Y'))).'");
|
||||
}
|
||||
|
||||
// Termin Speichern
|
||||
$.ajax({
|
||||
@@ -413,16 +422,15 @@ echo '<html>
|
||||
},
|
||||
eventDrop: function(event, dayDelta, minuteDelta, allDay, revertFunc, jsEvent, ui, view)
|
||||
{
|
||||
/*
|
||||
alert(
|
||||
event.id + " was moved " +
|
||||
$.fullCalendar.formatDate(event.start,"yyyy-MM-dd HH:mm:ss")
|
||||
);*/
|
||||
// Verschiebung eines Termins
|
||||
|
||||
datum = $.fullCalendar.formatDate(event.start,"yyyy-MM-dd")
|
||||
uhrzeit = $.fullCalendar.formatDate(event.start,"HH:mm:ss")
|
||||
|
||||
if(allDay)
|
||||
{
|
||||
// Wenn der Termin in die ganztaegig spalte gezogen wird,
|
||||
// wird die Uhrzeit auf 8:00 uhr gesetzt
|
||||
uhrzeit = "08:00:00";
|
||||
event.start = datum+"T"+uhrzeit;
|
||||
event.allDay=false;
|
||||
@@ -511,8 +519,6 @@ echo '
|
||||
<li id="delete"><img src="../../../skin/images/delete_round.png" />'.$p->t('global/entfernen').'</li>
|
||||
</ul>
|
||||
</div>';
|
||||
//echo '<h2>'.$coodle->titel.'</h2>';
|
||||
//echo $coodle->beschreibung;
|
||||
|
||||
echo '<a href="stammdaten.php?coodle_id='.$coodle_id.'">'.$p->t('coodle/ZurueckzumBearbeiten').'</a>';
|
||||
echo '
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/* Copyright (C) 2012 FH Technikum-Wien
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -16,14 +15,18 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Karl Burkhart <burkhart@technikum-wien.at>
|
||||
* Authors: Karl Burkhart <burkhart@technikum-wien.at>,
|
||||
* Andreas Österreicher <oesi@technikum-wien.at>
|
||||
*/
|
||||
/**
|
||||
* Uebersicht ueber die Coodle Umfragen
|
||||
*/
|
||||
|
||||
require_once('../../../config/cis.config.inc.php');
|
||||
require_once('../../../include/coodle.class.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/phrasen.class.php');
|
||||
require_once('../../../include/datum.class.php');
|
||||
require_once('../../../include/benutzer.class.php');
|
||||
|
||||
$lang = getSprache();
|
||||
|
||||
@@ -39,8 +42,7 @@ echo '
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<link rel="stylesheet" href="../../../skin/fhcomplete.css" type="text/css">
|
||||
<link rel="stylesheet" href="../../../skin/style.css.php" type="text/css">'; ?>
|
||||
|
||||
<link rel="stylesheet" href="../../../skin/style.css.php" type="text/css">
|
||||
<link href="../../../skin/style.css.php" rel="stylesheet" type="text/css">
|
||||
<link href="../../../skin/tablesort.css" rel="stylesheet" type="text/css">
|
||||
<link href="../../../skin/jquery.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -51,29 +53,46 @@ echo '
|
||||
{
|
||||
$("#myTableFiles").tablesorter(
|
||||
{
|
||||
sortList: [[0,0]],
|
||||
sortList: [[3,0]],
|
||||
widgets: ["zebra"]
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#myTableFiles2").tablesorter(
|
||||
{
|
||||
sortList: [[3,1]],
|
||||
widgets: ["zebra"]
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function conf_user(ersteller_uid)
|
||||
{
|
||||
var uid = ersteller_uid;
|
||||
|
||||
if(uid == '<?php echo $uid; ?>')
|
||||
if(uid == "'.$uid.'")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("<?php echo $p->t('global/keineBerechtigung'); ?>");
|
||||
alert("'.$p->t('global/keineBerechtigung').'");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
<style>
|
||||
.wrapper h4
|
||||
{
|
||||
font-size: 16px;
|
||||
margin-top: 0;
|
||||
padding-top: 1em;
|
||||
}
|
||||
</style>
|
||||
';
|
||||
|
||||
echo' <title>'.$p->t('coodle/uebersicht').'</title>
|
||||
</head>
|
||||
@@ -106,39 +125,97 @@ if($method=='delete')
|
||||
|
||||
echo'<h1>'.$p->t('coodle/uebersicht').'</h1>
|
||||
<br>
|
||||
<div style="display:block; text-align:left; float:left;"><a href="stammdaten.php" target="_blank">'.$p->t('coodle/neueUmfrage').'</a></div><br>
|
||||
<div style="display:block; text-align:left; float:left;"><input type="button" onclick="window.location.href=\'stammdaten.php\'" value="'.$p->t('coodle/neueUmfrage').'"></div><br>
|
||||
<div style="display:block; text-align:right; margin-right:16px; ">'.$message.'</div>
|
||||
<br>
|
||||
<div class="wrapper">
|
||||
<h4>'.$p->t('coodle/laufendeUmfragen').'</h4>
|
||||
<table id="myTableFiles" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%">'.$p->t('coodle/coodleId').'</th>
|
||||
<!--<th width="5%">'.$p->t('coodle/coodleId').'</th>-->
|
||||
<th width="20%">'.$p->t('coodle/titel').'</th>
|
||||
<th width="40%">'.$p->t('coodle/beschreibung').'</th>
|
||||
<!--<th width="40%">'.$p->t('coodle/beschreibung').'</th>-->
|
||||
<th>'.$p->t('coodle/letzterStatus').'</th>
|
||||
<th>'.$p->t('coodle/ersteller').'</th>
|
||||
<th>Endedatum</th>
|
||||
<th>'.$p->t('coodle/aktion').'</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
</thead><tbody>';
|
||||
|
||||
$beendeteUmfragen='';
|
||||
$datum = new datum();
|
||||
$coodle = new coodle();
|
||||
$coodle->loadStatus();
|
||||
$coodle->getCoodleFromUser($uid);
|
||||
foreach($coodle->result as $c)
|
||||
{
|
||||
echo '<tr>
|
||||
<td>'.$coodle->convert_html_chars($c->coodle_id).'</td>
|
||||
$benutzer = new benutzer();
|
||||
$benutzer->load($c->ersteller_uid);
|
||||
$ersteller = $benutzer->nachname.' '.$benutzer->vorname;
|
||||
$row = '<tr>
|
||||
<!-- <td>'.$coodle->convert_html_chars($c->coodle_id).'</td>-->
|
||||
<td>'.$coodle->convert_html_chars($c->titel).'</td>
|
||||
<td>'.$c->beschreibung.'</td>
|
||||
<td>'.$coodle->convert_html_chars($c->coodle_status_kurzbz).'</td>
|
||||
<td>'.$coodle->convert_html_chars($c->ersteller_uid).'</td>
|
||||
<!--<td>'.$c->beschreibung.'</td>-->
|
||||
<td>'.$coodle->convert_html_chars($coodle->status_arr[$c->coodle_status_kurzbz]).'</td>
|
||||
<td>'.$coodle->convert_html_chars($ersteller).'</td>
|
||||
<td>'.$coodle->convert_html_chars($datum->formatDatum($c->endedatum, 'd.m.Y')).'</td>
|
||||
<td>
|
||||
<a href="stammdaten.php?coodle_id='.$c->coodle_id.'" target="_blank" onclick="return conf_user(\''.$c->ersteller_uid.'\');"> <img src="../../../skin/images/edit.png" title="'.$p->t('coodle/bearbeiten').'"></a>
|
||||
<a href="'.$_SERVER['PHP_SELF'].'?method=delete&coodle_id='.$c->coodle_id.'" onclick="return conf_user(\''.$c->ersteller_uid.'\');"> <img src="../../../skin/images/delete_x.png" title="'.$p->t('coodle/loeschen').'"></a>
|
||||
<a href="../../public/coodle.php?coodle_id='.$c->coodle_id.'"> <img src="../../../skin/images/date_go.png" title="'.$p->t('coodle/zurUmfrage').'"></a>
|
||||
<td nowrap>
|
||||
|
||||
|
||||
';
|
||||
if(($c->coodle_status_kurzbz=='laufend' || $c->coodle_status_kurzbz=='neu') && $uid==$c->ersteller_uid)
|
||||
{
|
||||
$row.= '
|
||||
<a href="stammdaten.php?coodle_id='.$c->coodle_id.'" onclick="return conf_user(\''.$c->ersteller_uid.'\');"> <img src="../../../skin/images/edit.png" title="'.$p->t('coodle/bearbeiten').'"></a>
|
||||
<a href="'.$_SERVER['PHP_SELF'].'?method=delete&coodle_id='.$c->coodle_id.'" onclick="return conf_user(\''.$c->ersteller_uid.'\');"> <img src="../../../skin/images/delete_x.png" title="'.$p->t('coodle/loeschen').'"></a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$row.= '
|
||||
<img src="../../../skin/images/edit_grau.png" title="'.$p->t('global/keineBerechtigung').'">
|
||||
<img src="../../../skin/images/delete_x_grau.png" title="'.$p->t('global/keineBerechtigung').'">';
|
||||
}
|
||||
|
||||
if($c->coodle_status_kurzbz=='laufend' || $c->coodle_status_kurzbz=='abgeschlossen')
|
||||
$row.='<a href="../../public/coodle.php?coodle_id='.$c->coodle_id.'"> <img src="../../../skin/images/date_go.png" title="'.$p->t('coodle/zurUmfrage').'"></a>';
|
||||
else
|
||||
$row.=' <img src="../../../skin/images/date_go_grau.png" title="'.$p->t('global/keineBerechtigung').'">';
|
||||
$row.='
|
||||
</td>
|
||||
</tr>';
|
||||
if($c->coodle_status_kurzbz=='laufend' || $c->coodle_status_kurzbz=='neu')
|
||||
echo $row;
|
||||
else
|
||||
$beendeteUmfragen.=$row;
|
||||
}
|
||||
echo '</tbody></table></div>';
|
||||
|
||||
?>
|
||||
if($beendeteUmfragen!='')
|
||||
{
|
||||
echo '<br>
|
||||
|
||||
<div class="wrapper">
|
||||
<h4>'.$p->t('coodle/beendeteUmfragen').'</h4>
|
||||
|
||||
<table id="myTableFiles2" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<!--<th width="5%">'.$p->t('coodle/coodleId').'</th>-->
|
||||
<th width="20%">'.$p->t('coodle/titel').'</th>
|
||||
<!--<th width="40%">'.$p->t('coodle/beschreibung').'</th>-->
|
||||
<th>'.$p->t('coodle/letzterStatus').'</th>
|
||||
<th>'.$p->t('coodle/ersteller').'</th>
|
||||
<th>Endedatum</th>
|
||||
<th>'.$p->t('coodle/aktion').'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
'.$beendeteUmfragen.'
|
||||
</tbody>
|
||||
</table>
|
||||
</div>';
|
||||
}
|
||||
echo '</body>
|
||||
</html>';
|
||||
?>
|
||||
+285
-121
@@ -16,9 +16,9 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Karl Burkhart <burkhart@technikum-wien.at>
|
||||
* Authors: Karl Burkhart <burkhart@technikum-wien.at>,
|
||||
* Andreas Österreicher <oesi@technikum-wien.at>
|
||||
*/
|
||||
|
||||
require_once('../../config/cis.config.inc.php');
|
||||
require_once('../../include/phrasen.class.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
@@ -27,16 +27,17 @@ require_once('../../include/datum.class.php');
|
||||
require_once('../../include/mail.class.php');
|
||||
require_once('../../include/benutzer.class.php');
|
||||
require_once('../../include/reservierung.class.php');
|
||||
|
||||
if(isset($_GET['lang']))
|
||||
setSprache($_GET['lang']);
|
||||
require_once('../../include/stunde.class.php');
|
||||
require_once('../../include/stundenplan.class.php');
|
||||
|
||||
header("Content-Type: text/html; charset=utf-8");
|
||||
|
||||
$sprache = getSprache();
|
||||
$p=new phrasen($sprache);
|
||||
|
||||
$datum_obj = new datum();
|
||||
$message = '';
|
||||
$mailMessage='';
|
||||
$saveOk=null;
|
||||
$ersteller = false;
|
||||
$abgeschlossen = false;
|
||||
|
||||
@@ -55,7 +56,7 @@ if(!isset($_GET['zugangscode']))
|
||||
{
|
||||
$uid = get_uid();
|
||||
if(!$coodle->checkBerechtigung($coodle_id, $uid))
|
||||
die($p->t('coodle/keineBerechtiung'));
|
||||
die($p->t('coodle/keineBerechtigung'));
|
||||
|
||||
// überprüfen ob ersteller gleich uid ist
|
||||
if($coodle->ersteller_uid == $uid)
|
||||
@@ -109,63 +110,100 @@ if(isset ($_POST['save']))
|
||||
}
|
||||
|
||||
if($error)
|
||||
$message= "<span class='error'>".$p->t('global/fehlerBeimSpeichernDerDaten')."</span>";
|
||||
$message.= "<span class='error'>".$p->t('global/fehlerBeimSpeichernDerDaten')."</span><br>";
|
||||
else
|
||||
$message = "<span class='ok'>".$p->t('global/erfolgreichgespeichert')."</span>";
|
||||
$saveOk=true;
|
||||
}
|
||||
|
||||
// endgültige auswahl des termins speichern
|
||||
if(isset($_POST['auswahl_termin']))
|
||||
{
|
||||
$auswahl = $_POST['auswahl_termin'];
|
||||
|
||||
// setzte auswahl von termin_id auf true
|
||||
$coodle_help = new coodle();
|
||||
$coodle_help->loadTermin($auswahl);
|
||||
$coodle_help->auswahl = true;
|
||||
|
||||
// alle termine der coodle_id auf false setzen
|
||||
if(!$coodle_help->setTerminFalse($coodle_id))
|
||||
exit('Fehler beim Update aufgetreten');
|
||||
|
||||
if(!$coodle_help->saveTermin(false))
|
||||
$message="<span class='error'>".$p->t('global/fehlerBeimSpeichernDerDaten')."</span>";
|
||||
else
|
||||
$message="<span class='ok'>".$p->t('global/erfolgreichgespeichert')."</span>";
|
||||
|
||||
$coodle_status = new coodle();
|
||||
$coodle_status->load($coodle_id);
|
||||
$coodle_status->coodle_status_kurzbz = 'abgeschlossen';
|
||||
$coodle_status->new = false;
|
||||
$coodle_status->save();
|
||||
|
||||
sendEmail($coodle_id);
|
||||
|
||||
// raum reservieren
|
||||
$coodle_raum = new coodle();
|
||||
$coodle_raum->getRaumeFromId($coodle_id);
|
||||
|
||||
// wenn 1 raum eingetragen ist speichern
|
||||
if(count($coodle_raum->result) == 1)
|
||||
{
|
||||
$raum_reservierung = new reservierung();
|
||||
$raum_reservierung->ort_kurzb = '';
|
||||
$raum_reservierung->studiengang_kz = '0';
|
||||
$raum_reservierung->uid = $uid;
|
||||
$raum_reservierung->ort_kurzbz = $coodle_raum->result[0]->ort_kurzbz;
|
||||
$raum_reservierung->datum = $coodle_help->datum;
|
||||
|
||||
// uhrzeit in welcher stunde
|
||||
|
||||
$raum_reservierung->stunde = '1';
|
||||
if($raum_reservierung->save(true))
|
||||
echo $p->t('coodle/raumErfolgreichReserviert');
|
||||
}
|
||||
else
|
||||
echo $p->t('coodle/keineOderMehrereRäume');
|
||||
|
||||
if($ersteller)
|
||||
{
|
||||
$auswahl = $_POST['auswahl_termin'];
|
||||
if($auswahl!='')
|
||||
{
|
||||
// setzte auswahl von termin_id auf true
|
||||
$coodle_help = new coodle();
|
||||
$coodle_help->loadTermin($auswahl);
|
||||
$coodle_help->auswahl = true;
|
||||
|
||||
// alle termine der coodle_id auf false setzen
|
||||
if(!$coodle_help->setTerminFalse($coodle_id))
|
||||
exit('Fehler beim Update aufgetreten');
|
||||
|
||||
if(!$coodle_help->saveTermin(false))
|
||||
$message.="<span class='error'>".$p->t('global/fehlerBeimSpeichernDerDaten')."</span><br>";
|
||||
else
|
||||
$saveOk=true;
|
||||
|
||||
$coodle_status = new coodle();
|
||||
$coodle_status->load($coodle_id);
|
||||
$coodle_status->coodle_status_kurzbz = 'abgeschlossen';
|
||||
$coodle_status->new = false;
|
||||
$coodle_status->save();
|
||||
|
||||
sendEmail($coodle_id);
|
||||
|
||||
|
||||
if($coodle_help->datum<RES_TAGE_LEKTOR_BIS)
|
||||
{
|
||||
// Raum reservieren
|
||||
$coodle_raum = new coodle();
|
||||
$coodle_raum->getRaumeFromId($coodle_id);
|
||||
|
||||
//Ende Uhrzeit berechnen
|
||||
$date = new DateTime($coodle_help->datum.' '.$coodle_help->uhrzeit);
|
||||
$interval =new DateInterval('PT'.$coodle->dauer.'M');
|
||||
$date->add($interval);
|
||||
$uhrzeit_ende = $date->format('H:i:s');
|
||||
|
||||
foreach($coodle_raum->result as $raum)
|
||||
{
|
||||
$stunde = new stunde();
|
||||
$stunden = $stunde->getStunden($coodle_help->uhrzeit, $uhrzeit_ende);
|
||||
|
||||
// Pruefen ob der Raum frei ist
|
||||
if(!RaumBelegt($raum->ort_kurzbz, $coodle_help->datum, $stunden))
|
||||
{
|
||||
$reservierung_error=false;
|
||||
// Stunden reservieren
|
||||
foreach($stunden as $stunde)
|
||||
{
|
||||
$raum_reservierung = new reservierung();
|
||||
$raum_reservierung->studiengang_kz = '0';
|
||||
$raum_reservierung->uid = $uid;
|
||||
$raum_reservierung->ort_kurzbz = $raum->ort_kurzbz;
|
||||
$raum_reservierung->datum = $coodle_help->datum;
|
||||
$raum_reservierung->stunde = $stunde;
|
||||
$raum_reservierung->titel = mb_substr($coodle->titel,0,10);
|
||||
$raum_reservierung->beschreibung = mb_substr($coodle->titel, 0, 32);
|
||||
$raum_reservierung->insertamum = date('Y-m-d H:i:s');
|
||||
$raum_reservierung->insertvon = $uid;
|
||||
|
||||
//$message.= "Reserviere $raum->ort_kurzbz Stunde $stunde:";
|
||||
if(!$raum_reservierung->save(true))
|
||||
$reservierung_error=true;
|
||||
}
|
||||
$message.= $p->t('coodle/raumErfolgreichReserviert', array($raum->ort_kurzbz)).'<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$message.='<span class="error">'.$p->t('coodle/raumBelegt', array($raum->ort_kurzbz)).'</span><br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$message.='<span class="error">'.$p->t('coodle/raumNichtReserviert', array($datum_obj->formatDatum(RES_TAGE_LEKTOR_BIS, 'd.m.Y'))).'</span><br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
$message.= '<span class="error">'.$p-t('global/keineBerechtigung').'</span>';
|
||||
}
|
||||
|
||||
|
||||
$coodle->load($coodle_id);
|
||||
|
||||
if($coodle->coodle_status_kurzbz == 'abgeschlossen')
|
||||
@@ -177,13 +215,15 @@ if(isset($_GET['resend']))
|
||||
sendEmail ($coodle_id);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
?><!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../../skin/fhcomplete.css" type="text/css">
|
||||
<link rel="stylesheet" href="../../skin/style.css.php" type="text/css">
|
||||
<title><?php echo $p->t('coodle/terminauswahl');?></title>
|
||||
<style type="text/css">
|
||||
/*
|
||||
body
|
||||
{
|
||||
background: #f9f9f9;
|
||||
@@ -197,11 +237,12 @@ if(isset($_GET['resend']))
|
||||
|
||||
h5 {margin-top:0px; }
|
||||
.container {width: 100%; }
|
||||
*/
|
||||
#header
|
||||
{
|
||||
background: #DCDDDF;
|
||||
border: 1px solid #c4c6ca;
|
||||
position: relative;
|
||||
/*position: relative;*/
|
||||
padding-left: 50px;
|
||||
}
|
||||
.error
|
||||
@@ -209,26 +250,22 @@ if(isset($_GET['resend']))
|
||||
color:red;
|
||||
padding-left:20px;
|
||||
}
|
||||
.ok
|
||||
|
||||
#coodle_content
|
||||
{
|
||||
color:green;
|
||||
padding-left:20px;
|
||||
|
||||
}
|
||||
#content
|
||||
{
|
||||
padding: 20px 20px;
|
||||
}
|
||||
#content th
|
||||
#coodle_content th
|
||||
{
|
||||
color:#008462;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
#content tr.owner
|
||||
#coodle_content tr.owner
|
||||
{
|
||||
background-color: #DCDDDF;
|
||||
}
|
||||
#content th.auswahl
|
||||
#coodle_content th.auswahl
|
||||
{
|
||||
color:red;
|
||||
}
|
||||
@@ -241,32 +278,58 @@ if(isset($_GET['resend']))
|
||||
{
|
||||
color: Black; text-decoration: none;
|
||||
}
|
||||
#wrapper
|
||||
{
|
||||
width: 70%;
|
||||
padding: 0px 10px 15px 10px;
|
||||
/*
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
*/
|
||||
border: 1px solid #ccc;
|
||||
background: #eee;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#wrapper h4
|
||||
{
|
||||
font-size: 16px;
|
||||
margin-top: 0;
|
||||
padding-top: 1em;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<section id="header">
|
||||
<?php
|
||||
$coodle_help = new coodle();
|
||||
$coodle_help->load($coodle_id);
|
||||
|
||||
$alt = strtotime($coodle_help->insertamum) ;
|
||||
|
||||
$differenz = time() - $alt;
|
||||
$differenz = $differenz / 86400;
|
||||
<?php
|
||||
echo '<h1>'.$p->t('coodle/coodle').'</h1>';
|
||||
|
||||
if(!isset($_GET['zugangscode']))
|
||||
echo "<a href='".APP_ROOT."cis/private/coodle/uebersicht.php'><< ".$p->t('coodle/zurueckZurUebersicht')."</a>";
|
||||
echo '<br><br>';
|
||||
echo '<div id="wrapper">';
|
||||
|
||||
echo '<h1>'.$coodle->titel.'</h1>';
|
||||
$erstellt = array($coodle->ersteller_uid, round($differenz));
|
||||
echo '<h5>'.$p->t('coodle/erstelltVon', $erstellt).'</h5>';
|
||||
/// echo '<h5>Erstellt von '.$coodle->ersteller_uid.' ( vor '.round($differenz).' Tagen)</h5>';
|
||||
echo '<h4>'.$coodle->beschreibung.'</h4>';
|
||||
?>
|
||||
</section>
|
||||
$coodle_help = new coodle();
|
||||
$coodle_help->load($coodle_id);
|
||||
|
||||
$alt = strtotime($coodle_help->insertamum) ;
|
||||
|
||||
$differenz = time() - $alt;
|
||||
$differenz = $differenz / 86400;
|
||||
$benutzer = new benutzer();
|
||||
$benutzer->load($coodle->ersteller_uid);
|
||||
$ersteller_name = trim($benutzer->titelpre.' '.$benutzer->vorname.' '.$benutzer->nachname.' '.$benutzer->titelpost);
|
||||
echo '<h4>'.$coodle->titel.'</h4>';
|
||||
$erstellt = array($ersteller_name, round($differenz));
|
||||
echo '<span style="color: #555555">'.$p->t('coodle/erstelltVon', $erstellt).'</span><br><br>';
|
||||
// echo '<h5>Erstellt von '.$coodle->ersteller_uid.' ( vor '.round($differenz).' Tagen)</h5>';
|
||||
echo $coodle->beschreibung;
|
||||
|
||||
echo '
|
||||
</div>
|
||||
<div class="main">
|
||||
<?php
|
||||
<br><br>
|
||||
<div>';
|
||||
|
||||
$coodle_ressourcen = new coodle();
|
||||
$coodle_ressourcen->getRessourcen($coodle_id);
|
||||
|
||||
@@ -276,14 +339,7 @@ if(isset($_GET['resend']))
|
||||
|
||||
$datum = new datum();
|
||||
|
||||
echo "<br> ";
|
||||
if(!isset($_GET['zugangscode']))
|
||||
echo "<a href='".APP_ROOT."cis/private/coodle/uebersicht.php'><< ".$p->t('coodle/zurueckZurUebersicht')."</a>";
|
||||
|
||||
if($ersteller && $abgeschlossen)
|
||||
echo '<a href="'.$_SERVER['PHP_SELF'].'?coodle_id='.$coodle_id.'&resend" style="padding-left:25px;">'.$p->t('coodle/einladungNeuVerschicken').'</a>';
|
||||
|
||||
echo "<section id='content'>
|
||||
echo "<div id='coodle_content' >
|
||||
<form action='' method='POST'>
|
||||
|
||||
<table>
|
||||
@@ -300,7 +356,8 @@ if(isset($_GET['resend']))
|
||||
|
||||
echo "<th class='".$class_auswahl."'>".$datum->formatDatum($termin->datum, 'd.m.Y').'<br>'.date('H:i',$time)."</th>";
|
||||
}
|
||||
|
||||
if($ersteller)
|
||||
echo '<th class="normal">'.$p->t('coodle/keineAuswahl').'</th>';
|
||||
echo "</tr>";
|
||||
|
||||
// ressourcen durchlaufen
|
||||
@@ -360,33 +417,41 @@ if(isset($_GET['resend']))
|
||||
|
||||
echo "<td align='center'><input type='checkbox' ".$checked." ".$disabled." name='check_".$ressource->coodle_ressource_id."_".$termin->coodle_termin_id."'></td>";
|
||||
}
|
||||
|
||||
if($ersteller)
|
||||
echo '<td></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
$disabled = $abgeschlossen?'disabled':'';
|
||||
$disabled = $abgeschlossen?'disabled':'';
|
||||
|
||||
if($ersteller)
|
||||
{
|
||||
// buttons für auswahl des endgültigen termins
|
||||
echo '<tr><td>Auswahl:</td>';
|
||||
echo '<tr><td>'.$p->t('coodle/auswahlEndtermin').' <a href="#Details" onclick="alert(\''.$p->t('coodle/auswahlHinweis').'\');return false;"><img src="../../skin/images/information.png" style="vertical-align: middle;"></a></td>';
|
||||
foreach($coodle_termine->result as $termin)
|
||||
{
|
||||
$checked=($termin->auswahl)?'checked':'';
|
||||
echo '<td align="center"><input type="radio" name="auswahl_termin" '.$checked.' '.$disabled.' value='.$termin->coodle_termin_id.'></td>';
|
||||
}
|
||||
|
||||
echo '<td align="center"><input type="radio" name="auswahl_termin" '.$disabled.' value=""></td>';
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
if($abgeschlossen)
|
||||
$message='<span class="ok">'.$p->t('coodle/umfrageAbgeschlossen').'</span>';
|
||||
|
||||
|
||||
echo "
|
||||
<tr><td> </td></tr>
|
||||
<tr><td><input type='submit' value='save' name='save' ".$disabled."></td></tr>
|
||||
<tr><td colspan='3'><input type='submit' value='".$p->t('global/speichern')."' name='save' ".$disabled.">";
|
||||
|
||||
if($ersteller && $abgeschlossen)
|
||||
echo '<input type="button" onclick="window.location.href=\''.$_SERVER['PHP_SELF'].'?coodle_id='.$coodle_id.'&resend\'" value="'.$p->t('coodle/einladungNeuVerschicken').'">';
|
||||
if($saveOk===true)
|
||||
echo ' <span class="ok">'.$p->t('global/erfolgreichgespeichert').'</span>';
|
||||
echo "</td></tr>
|
||||
</table>
|
||||
</form></section></div>".$message;
|
||||
</form></div>".$message.'<br>'.$mailMessage;
|
||||
if($abgeschlossen)
|
||||
echo '<br><br><span class="ok">'.$p->t('coodle/umfrageAbgeschlossen').'</span>';
|
||||
|
||||
?>
|
||||
</div>
|
||||
|
||||
@@ -403,19 +468,85 @@ if(isset($_GET['resend']))
|
||||
*/
|
||||
function sendEmail($coodle_id)
|
||||
{
|
||||
// email senden
|
||||
global $mailMessage;
|
||||
global $p;
|
||||
|
||||
$coodle_help = new coodle();
|
||||
$termin_id = $coodle_help->getTerminAuswahl($coodle_id);
|
||||
$coodle_help->loadTermin($termin_id);
|
||||
|
||||
$coodle_ressource = new coodle();
|
||||
$coodle_ressource->getRessourcen($coodle_id);
|
||||
|
||||
$coodle= new coodle();
|
||||
$coodle->load($coodle_id);
|
||||
|
||||
$ort='';
|
||||
$teilnehmer='';
|
||||
foreach($coodle_ressource->result as $row)
|
||||
{
|
||||
if($row->ort_kurzbz!='')
|
||||
{
|
||||
if($ort!='')
|
||||
$ort.=', ';
|
||||
$ort.="$row->ort_kurzbz";
|
||||
}
|
||||
else
|
||||
{
|
||||
if($row->uid!='')
|
||||
{
|
||||
$benutzer = new benutzer();
|
||||
$benutzer->load($row->uid);
|
||||
$name = trim($benutzer->titelpre.' '.$benutzer->vorname.' '.$benutzer->nachname.' '.$benutzer->titelpost);
|
||||
$mail = $row->uid.'@'.DOMAIN;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mail = $row->email;
|
||||
$name = $row->name;
|
||||
}
|
||||
$coodle_ressource_termin = new coodle();
|
||||
$partstat='';
|
||||
if($coodle_ressource_termin->checkTermin($termin_id, $row->coodle_ressource_id))
|
||||
$partstat='ACCEPTED';
|
||||
else
|
||||
$partstat='TENTATIVE';
|
||||
|
||||
$teilnehmer.='ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT='.$partstat.';CN='.$name."\n :MAILTO:".$mail."\n";
|
||||
}
|
||||
}
|
||||
$date = new DateTime($coodle_help->datum.' '.$coodle_help->uhrzeit);
|
||||
//Datum des Termins ins richtige Format bringen
|
||||
$dtstart = $date->format('Ymd\THis');
|
||||
|
||||
//Ende Datum berechnen
|
||||
$interval =new DateInterval('PT'.$coodle->dauer.'M');
|
||||
$date->add($interval);
|
||||
$dtend = $date->format('Ymd\THis');
|
||||
$date = new DateTime();
|
||||
$dtstamp = $date->format('Ymd\THis');
|
||||
$benutzer = new benutzer();
|
||||
$benutzer->load($coodle->ersteller_uid);
|
||||
$erstellername = trim($benutzer->titelpre.' '.$benutzer->vorname.' '.$benutzer->nachname.' '.$benutzer->titelpost);
|
||||
//Ical File erstellen
|
||||
$ical = "BEGIN:VCALENDAR
|
||||
PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN
|
||||
VERSION:2.0
|
||||
METHOD:PUBLISH
|
||||
BEGIN:VEVENT
|
||||
ORGANIZER:MAILTO:".$erstellername." <".$coodle->ersteller_uid."@".DOMAIN."
|
||||
".$teilnehmer."
|
||||
DTSTART;TZID=Europe/Vienna:".$dtstart."
|
||||
DTEND;TZID=Europe/Vienna:".$dtend."
|
||||
LOCATION:".$ort."
|
||||
TRANSP:OPAQUE
|
||||
SEQUENCE:0
|
||||
UID:FHCompleteCoodle".$coodle_id."
|
||||
DTSTAMP;TZID=Europe/Vienna:".$dtstamp."
|
||||
DESCRIPTION:".strip_tags($coodle->beschreibung)."
|
||||
SUMMARY:".$coodle->titel."
|
||||
PRIORITY:5
|
||||
CLASS:PUBLIC
|
||||
END:VEVENT
|
||||
END:VCALENDAR";
|
||||
|
||||
if(count($coodle_ressource->result)>0)
|
||||
{
|
||||
foreach($coodle_ressource->result as $row)
|
||||
@@ -425,7 +556,7 @@ function sendEmail($coodle_id)
|
||||
$benutzer = new benutzer();
|
||||
if(!$benutzer->load($row->uid))
|
||||
{
|
||||
echo "Fehler beim Laden des Benutzers ".$coodle_ressource->convert_html_chars($row->uid);
|
||||
$mailMessage.="Fehler beim Laden des Benutzers ".$coodle_ressource->convert_html_chars($row->uid);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -446,17 +577,14 @@ function sendEmail($coodle_id)
|
||||
$anrede='Sehr geehrte(r) Herr/Frau '.$row->name;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
// Raueme bekommen kein Mail
|
||||
continue;
|
||||
}
|
||||
$anrede = trim($anrede);
|
||||
$sign = "Mit freundlichen Grüßen\n\n";
|
||||
$sign .= "Fachhochschule Technikum Wien\n";
|
||||
$sign .= "Höchstädtplatz 5\n";
|
||||
$sign .= "1200 Wien\n";
|
||||
$sign = $p->t('mail/signatur');
|
||||
|
||||
$datum = new datum();
|
||||
$datum = new datum();
|
||||
|
||||
$html=$anrede.'!<br><br>
|
||||
Die Terminumfrage zum Thema "'.$coodle_ressource->convert_html_chars($coodle->titel).'" ist beendet.
|
||||
@@ -465,14 +593,16 @@ function sendEmail($coodle_id)
|
||||
<br><br>'.nl2br($sign);
|
||||
|
||||
$text=$anrede."!\n\nDie Terminumfrage zum Thema \"".$coodle_help->convert_html_chars($coodle->titel).'"\" ist beendet.\n
|
||||
Der Termin wurde auf den <b>'.$datum->formatDatum($coodle_help->datum, 'd.m.Y').' '.$coodle_help->uhrzeit.'</b> festgelegt\n.
|
||||
\n\n$sign';
|
||||
Der Termin wurde auf den <b>'.$datum->formatDatum($coodle_help->datum, 'd.m.Y').' '.$coodle_help->uhrzeit."</b> festgelegt\n.
|
||||
\n\n$sign";
|
||||
|
||||
$mail = new mail($email, 'no-reply@'.DOMAIN,'Terminbestätigung - '.$coodle->titel, $text);
|
||||
$mail->setHTMLContent($html);
|
||||
//ICal Termineinladung hinzufuegen
|
||||
$mail->addAttachmentPlain($ical, 'text/calendar', 'meeting.ics');
|
||||
if($mail->send())
|
||||
{
|
||||
echo $p->t('coodle/mailVersandtAn',array($email))."<br>";
|
||||
$mailMessage.= $p->t('coodle/mailVersandtAn',array($email))."<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -482,4 +612,38 @@ function sendEmail($coodle_id)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Prueft ob ein Raum belegt ist
|
||||
* @param $ort_kurzbz
|
||||
* @param $datum
|
||||
* @param array $stunden
|
||||
*/
|
||||
function RaumBelegt($ort_kurzbz, $datum, $stunden)
|
||||
{
|
||||
foreach($stunden as $stunde)
|
||||
{
|
||||
//Reservierungen pruefen
|
||||
$raum_reservierung = new reservierung();
|
||||
if($raum_reservierung->isReserviert($ort_kurzbz, $datum, $stunde))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//Stundenplan abfragen
|
||||
$stundenplan = new stundenplan('stundenplan');
|
||||
if($stundenplan->isBelegt($ort_kurzbz, $datum, $stunde))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//Stundenplan DEV abfragen
|
||||
$stundenplan = new stundenplan('stundenplandev');
|
||||
if($stundenplan->isBelegt($ort_kurzbz, $datum, $stunde))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
?>
|
||||
@@ -44,9 +44,9 @@ echo "VERSION:2.0\n";
|
||||
echo "PRODID:-//FH TECHNIKUM WIEN//EN\n";
|
||||
echo "METHOD:PUBLISH\n";
|
||||
echo 'ORGANIZER;CN=',$bn->vorname,' ',$bn->nachname,':mailto:',$uid,'@',DOMAIN,"\n";
|
||||
echo 'DTSTAMP:',date('Ymd', mktime(date('H'),date('i'),date('s'),date('m'),date('d')-5,date('Y'))),'T',date('Hms'),"Z\n";
|
||||
echo 'DTSTART:',date('Ymd', mktime(0,0,0,date('m'),date('d')-5,date('Y'))),"T000000Z\n";
|
||||
echo 'DTEND:',date('Ymd', mktime(0,0,0,date('m'),date('d')+30,date('Y'))),"T000000Z\n";
|
||||
echo 'DTSTAMP;TZID=Europe/Vienna:',date('Ymd', mktime(date('H'),date('i'),date('s'),date('m'),date('d')-5,date('Y'))),'T',date('Hms'),"\n";
|
||||
echo 'DTSTART;TZID=Europe/Vienna:',date('Ymd', mktime(0,0,0,date('m'),date('d')-5,date('Y'))),"T000000\n";
|
||||
echo 'DTEND;TZID=Europe/Vienna:',date('Ymd', mktime(0,0,0,date('m'),date('d')+30,date('Y'))),"T000000\n";
|
||||
echo 'URL:',APP_ROOT,'cis/public/freebusy.php/',$uid,"\n";
|
||||
|
||||
$ical = new ical();
|
||||
|
||||
Executable
+101
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012 FH 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: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
|
||||
*/
|
||||
/**
|
||||
* Dieses Script liefert die FreeBusy Informationen für die vorreservierten Coodle Termine
|
||||
*
|
||||
* Aufruf: http://www.example.com/cis/public/freebusy_coodle.php/[uid]
|
||||
* zB
|
||||
* http://www.example.com/cis/public/freebusy_coodle.php/oesi
|
||||
*/
|
||||
require_once('../../config/cis.config.inc.php');
|
||||
require_once('../../include/benutzer.class.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/coodle.class.php');
|
||||
require_once('../../include/ical.class.php');
|
||||
|
||||
$uid = mb_substr($_SERVER['PATH_INFO'],1);
|
||||
|
||||
$bn = new benutzer();
|
||||
if(!$bn->load($uid))
|
||||
die('User invalid');
|
||||
|
||||
header("Content-Type: text/calendar; charset=UTF-8");
|
||||
|
||||
echo "BEGIN:VCALENDAR\n";
|
||||
echo "VERSION:2.0\n";
|
||||
echo "PRODID:-//FH TECHNIKUM WIEN//EN\n";
|
||||
echo "METHOD:PUBLISH\n";
|
||||
echo 'ORGANIZER;CN=',$bn->vorname,' ',$bn->nachname,':mailto:',$uid,'@',DOMAIN,"\n";
|
||||
echo 'DTSTAMP;TZID=Europe/Vienna:',date('Ymd', mktime(date('H'),date('i'),date('s'),date('m'),date('d')-5,date('Y'))),'T',date('Hms'),"\n";
|
||||
echo 'DTSTART;TZID=Europe/Vienna:',date('Ymd', mktime(0,0,0,date('m'),date('d')-5,date('Y'))),"T000000\n";
|
||||
echo 'DTEND;TZID=Europe/Vienna:',date('Ymd', mktime(0,0,0,date('m'),date('d')+30,date('Y'))),"T000000\n";
|
||||
echo 'URL:',APP_ROOT,'cis/public/freebusy_coodle.php/',$uid,"\n";
|
||||
echo "BEGIN:VFREEBUSY";
|
||||
|
||||
// Alle Umfragen holen an denen der User beteiligt ist
|
||||
$umfragen = new coodle();
|
||||
$umfragen->getCoodleFromUser($uid);
|
||||
foreach($umfragen->result as $umfrage)
|
||||
{
|
||||
if($umfrage->coodle_status_kurzbz=='laufend')
|
||||
{
|
||||
// Bei laufenden Umfragen werden alle angekreuzten Vorschlaege zur FreeBusy hinzugefuegt
|
||||
$ressource = new coodle();
|
||||
if($ressource_id = $ressource->RessourceExists($umfrage->coodle_id, $uid))
|
||||
{
|
||||
// Terminvorschlaege laden die angekreuzt wurden
|
||||
$termine = new coodle();
|
||||
$termine->getRessourceTermin($umfrage->coodle_id, $ressource_id);
|
||||
foreach($termine->result as $termin)
|
||||
{
|
||||
//Start und Ende berechnen
|
||||
$date = new DateTime($termin->datum.' '.$termin->uhrzeit);
|
||||
$dtstart = $date->format('dmY\THis');
|
||||
$interval =new DateInterval('PT'.$umfrage->dauer.'M');
|
||||
$date->add($interval);
|
||||
$uhrzeit_ende = $date->format('H:i:s');
|
||||
$dtende = $date->format('dmY\THis');
|
||||
echo "\nFREEBUSY;TZID=Europe/Vienna: $dtstart / $dtende";
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif($umfrage->coodle_status_kurzbz=='abgeschlossen')
|
||||
{
|
||||
// Bei abgeschlossenen Umfragen wird nur mehr der ausgewaehlte Termin zur FreeBusy hinzugefuegt
|
||||
$termin = new coodle();
|
||||
$coodle_termin_id=$termin->getTerminAuswahl($umfrage->coodle_id);
|
||||
if($termin->loadTermin($coodle_termin_id))
|
||||
{
|
||||
//Start und Ende berechnen
|
||||
$date = new DateTime($termin->datum.' '.$termin->uhrzeit);
|
||||
$dtstart = $date->format('dmY\THis');
|
||||
$interval =new DateInterval('PT'.$umfrage->dauer.'M');
|
||||
$date->add($interval);
|
||||
$uhrzeit_ende = $date->format('H:i:s');
|
||||
$dtende = $date->format('dmY\THis');
|
||||
echo "\nFREEBUSY;TZID=Europe/Vienna: $dtstart / $dtende";
|
||||
}
|
||||
}
|
||||
// stornierte Umfragen werden nicht beruecksichtigt
|
||||
}
|
||||
|
||||
echo "\nEND:VFREEBUSY";
|
||||
echo "\nEND:VCALENDAR";
|
||||
?>
|
||||
@@ -48,9 +48,9 @@ echo "VERSION:2.0\n";
|
||||
echo "PRODID:-//FH TECHNIKUM WIEN//EN\n";
|
||||
echo "METHOD:PUBLISH\n";
|
||||
echo 'ORGANIZER;CN=',$bn->vorname,' ',$bn->nachname,':mailto:',$uid,'@',DOMAIN,"\n";
|
||||
echo 'DTSTAMP:',date('Ymd', mktime(date('H'),date('i'),date('s'),date('m'),date('d')-5,date('Y'))),'T',date('Hms'),"Z\n";
|
||||
echo 'DTSTART:',date('Ymd', mktime(0,0,0,date('m'),date('d')-5,date('Y'))),"T000000Z\n";
|
||||
echo 'DTEND:',date('Ymd', mktime(0,0,0,date('m'),date('d')+30,date('Y'))),"T000000Z\n";
|
||||
echo 'DTSTAMP;TZID=Europe/Vienna:',date('Ymd', mktime(date('H'),date('i'),date('s'),date('m'),date('d')-5,date('Y'))),'T',date('Hms'),"\n";
|
||||
echo 'DTSTART;TZID=Europe/Vienna:',date('Ymd', mktime(0,0,0,date('m'),date('d')-5,date('Y'))),"T000000\n";
|
||||
echo 'DTEND;TZID=Europe/Vienna:',date('Ymd', mktime(0,0,0,date('m'),date('d')+30,date('Y'))),"T000000\n";
|
||||
echo 'URL:',APP_ROOT,'cis/public/freebusy_lvplan.php/',$uid,"\n";
|
||||
echo "BEGIN:VFREEBUSY";
|
||||
|
||||
|
||||
@@ -54,6 +54,8 @@ class coodle extends basis_db
|
||||
public $datum; // date
|
||||
public $uhrzeit; // date
|
||||
public $auswahl; // boolean
|
||||
|
||||
public $status_arr;
|
||||
|
||||
/**
|
||||
* Konstruktor
|
||||
@@ -648,6 +650,50 @@ class coodle extends basis_db
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Laedt alle Termine einer Umfrage zu denen eine Ressource zugesagt hat
|
||||
* @param $coodle_id ID der Umfrage
|
||||
* @param $ressource_id ID der Ressource
|
||||
*/
|
||||
public function getRessourceTermin($coodle_id, $ressource_id)
|
||||
{
|
||||
$qry = "SELECT
|
||||
*
|
||||
FROM
|
||||
campus.tbl_coodle_ressource_termin
|
||||
JOIN campus.tbl_coodle_termin USING(coodle_termin_id)
|
||||
WHERE
|
||||
coodle_id=".$this->db_add_param($coodle_id, FHC_INTEGER)."
|
||||
AND coodle_ressource_id=".$this->db_add_param($ressource_id, FHC_INTEGER).";";
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object($result))
|
||||
{
|
||||
$obj = new coodle();
|
||||
|
||||
$obj->coodle_id = $row->coodle_id;
|
||||
$obj->coodle_termin_id = $row->coodle_termin_id;
|
||||
$obj->datum = $row->datum;
|
||||
$obj->uhrzeit = $row->uhrzeit;
|
||||
$obj->auswahl = $this->db_parse_bool($row->auswahl);
|
||||
$obj->coodle_ressource_id = $row->coodle_ressource_id;
|
||||
$obj->coodle_termin_id = $row->coodle_termin_id;
|
||||
$obj->insertamum = $row->insertamum;
|
||||
$obj->insertvon = $row->insertvon;
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Überprüfut ob der Benutzer entweder der Ersteller oder eine Ressource der Coodleumfrage ist
|
||||
* @param Integer $coodle_id
|
||||
@@ -675,9 +721,10 @@ class coodle extends basis_db
|
||||
$qry.= ' uid = '.$this->db_add_param($uid, FHC_STRING, false);
|
||||
|
||||
if($zugangscode != '')
|
||||
$qry.= ' zugangscode ='.$this->db_add_param($zugangscode, FHC_STRING, false);
|
||||
$qry.= ' zugangscode ='.$this->db_add_param($zugangscode, FHC_STRING, false);
|
||||
|
||||
$qry.="UNION SELECT 1 FROM campus.tbl_coodle WHERE ersteller_uid=".$this->db_add_param($uid).";";
|
||||
|
||||
$qry.=';';
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
@@ -1107,5 +1154,27 @@ class coodle extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Laedt alle Stati
|
||||
*/
|
||||
public function loadStatus()
|
||||
{
|
||||
$qry = "SELECT * FROM campus.tbl_coodle_status";
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object($result))
|
||||
{
|
||||
$this->status_arr[$row->coodle_status_kurzbz]=$row->bezeichnung;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -83,7 +83,7 @@ class ical extends basis_db
|
||||
$dtend='';
|
||||
}
|
||||
}
|
||||
elseif(mb_strstr($row,'FREEBUSY:'))
|
||||
elseif(mb_strpos($row,'FREEBUSY')===0)
|
||||
$this->result[$idx].=$row."\n";
|
||||
}
|
||||
}
|
||||
@@ -114,13 +114,13 @@ class ical extends basis_db
|
||||
|
||||
foreach($rows as $row)
|
||||
{
|
||||
if(mb_strstr($row,'FREEBUSY:'))
|
||||
if(mb_strpos($row,'FREEBUSY')===0)
|
||||
{
|
||||
|
||||
$len = mb_strlen($row);
|
||||
$slashpos = mb_strpos($row, '/');
|
||||
$fblen = mb_strlen('FREEBUSY:');
|
||||
$dtstart = mb_substr($row, $fblen, $len-$slashpos);
|
||||
$doppelpunktpos = mb_strpos($row, ':');
|
||||
$dtstart = mb_substr($row, $doppelpunktpos+1, $len-$slashpos);
|
||||
$dtend = mb_substr($row, $slashpos+1);
|
||||
$this->dtresult[]=array('dtstart'=>trim($dtstart),'dtend'=>trim($dtend));
|
||||
}
|
||||
|
||||
+34
-3
@@ -57,6 +57,7 @@ class mail
|
||||
$this->CC_revievers='';
|
||||
$this->BCC_recievers='';
|
||||
$attachments='';
|
||||
$this->attachmentsplain='';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,7 +93,7 @@ class mail
|
||||
|
||||
$header .= 'X-Mailer: FHComplete V1'.$eol;
|
||||
$header .= 'Mime-Version: 1.0'.$eol;
|
||||
$header .= "Content-Type: multipart/related; boundary=\"$mime_boundary_mixed\"".$eol;
|
||||
$header .= "Content-Type: multipart/mixed; boundary=\"$mime_boundary_mixed\"".$eol;
|
||||
|
||||
// Body
|
||||
$mailbody = "";
|
||||
@@ -122,7 +123,25 @@ class mail
|
||||
$mailbody .= $eol;
|
||||
$mailbody .= "--$mime_boundary_mixed";
|
||||
|
||||
// Attachments
|
||||
// Attachments Plain
|
||||
if (is_array($this->attachmentsplain) && (count($this->attachmentsplain) > 0))
|
||||
{
|
||||
foreach ($this->attachmentsplain as $attachment)
|
||||
{
|
||||
$dispo = 'attachment';
|
||||
$mailbody .= $eol;
|
||||
$mailbody .= "Content-Disposition: $dispo; filename={$attachment[2]}".$eol;
|
||||
$mailbody .= "Content-Type: {$attachment[1]}; name={$attachment[2]}".$eol;
|
||||
|
||||
$mailbody .= 'Content-Transfer-Encoding: '.$attachment[3].$eol;
|
||||
$mailbody .= $eol;
|
||||
$mailbody .= $attachment[0];
|
||||
$mailbody .= $eol;
|
||||
$mailbody .= "--$mime_boundary_mixed";
|
||||
}
|
||||
}
|
||||
|
||||
// Attachments Binary
|
||||
if (is_array($this->attachments) && (count($this->attachments) > 0))
|
||||
{
|
||||
foreach ($this->attachments as $attachment)
|
||||
@@ -177,7 +196,7 @@ class mail
|
||||
}
|
||||
|
||||
/**
|
||||
* Fuegt ein Attachment zum Mail hinzu
|
||||
* Fuegt ein Binary Attachment zum Mail hinzu
|
||||
* $file Dateiname des hinzuzufuegenden Files
|
||||
* $type MIME Type "application/xls"
|
||||
* $name Anzeigename des Files
|
||||
@@ -206,6 +225,18 @@ class mail
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fuegt ein Attachment zum Mail hinzu
|
||||
* $content
|
||||
* $type MIME Type "application/xls"
|
||||
* $name Anzeigename des Files
|
||||
* $ContentID die ContentID der Datei falls sie als inline-image genutzt wird
|
||||
*/
|
||||
public function addAttachmentPlain($content, $type, $name, $encoding='8bit')
|
||||
{
|
||||
$this->attachmentsplain[] = Array($content, $type, $name, $encoding);
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Setzt den ReplyTo
|
||||
*/
|
||||
|
||||
@@ -92,5 +92,34 @@ class stunde extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Liefert die Stunden innerhalb der uebergebenen Uhrzeiten
|
||||
* @param $uhrzeit_start
|
||||
* @param $uhrzeit_ende
|
||||
* @return array $stunden
|
||||
*/
|
||||
public function getStunden($uhrzeit_start, $uhrzeit_ende)
|
||||
{
|
||||
$stunden=array();
|
||||
|
||||
$qry = "SELECT
|
||||
*
|
||||
FROM
|
||||
lehre.tbl_stunde
|
||||
WHERE
|
||||
(beginn BETWEEN ".$this->db_add_param($uhrzeit_start)." AND ".$this->db_add_param($uhrzeit_ende).")
|
||||
OR (ende BETWEEN ".$this->db_add_param($uhrzeit_start)." AND ".$this->db_add_param($uhrzeit_ende).");";
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object($result))
|
||||
{
|
||||
$stunden[] = $row->stunde;
|
||||
}
|
||||
}
|
||||
return $stunden;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -219,5 +219,38 @@ class stundenplan extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Prueft ob ein Stundenplaneintrag fuer den gewaehlten Ort/Datum/Stunde vorhanden ist
|
||||
* @param $ort_kurzbz
|
||||
* @param $datum
|
||||
* @param $stunde
|
||||
* @return true wenn belegt, false wenn frei, false+errormsg bei Fehler
|
||||
*/
|
||||
public function isBelegt($ort_kurzbz, $datum, $stunde)
|
||||
{
|
||||
$qry = "SELECT
|
||||
1
|
||||
FROM
|
||||
lehre.tbl_$this->stpl_table
|
||||
WHERE
|
||||
ort_kurzbz=".$this->db_add_param($ort_kurzbz)."
|
||||
AND datum=".$this->db_add_param($datum)."
|
||||
AND stunde=".$this->db_add_param($stunde).";";
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
+10
-2
@@ -40,14 +40,22 @@ $this->phrasen['coodle/externenHinzufuegen']='Hinzufügen';
|
||||
$this->phrasen['coodle/ZurueckzumBearbeiten']='<< Zurück zum Bearbeiten';
|
||||
$this->phrasen['coodle/umfrageNichtGueltig']='Umfrage ist nicht mehr gültig';
|
||||
$this->phrasen['coodle/keineBerechtigung']='Sie besitzen keine Berechtigung für diese Umfrage';
|
||||
$this->phrasen['coodle/raumErfolgreichReserviert']= 'Raum wurde erfolgreich reserviert';
|
||||
$this->phrasen['coodle/raumErfolgreichReserviert']= 'Raum %s wurde erfolgreich reserviert';
|
||||
$this->phrasen['coodle/keineOderMehrereRäume']='Keine oder mehrere Räume eingetragen';
|
||||
$this->phrasen['coodle/terminauswahl']='Coodle Terminauswahl';
|
||||
$this->phrasen['coodle/erstelltVon']='Erstellt von %s (vor %s Tagen)';
|
||||
$this->phrasen['coodle/zurueckZurUebersicht']='Zurück zur Übersicht';
|
||||
$this->phrasen['coodle/einladungNeuVerschicken']='Einladungen neu verschicken';
|
||||
$this->phrasen['coodle/umfrageAbgeschlossen']='Die Umfrage ist abgeschlossen';
|
||||
$this->phrasen['coodle/loeschen']='Umfrage löschen';
|
||||
$this->phrasen['coodle/loeschen']='Umfrage stornieren';
|
||||
$this->phrasen['coodle/zurUmfrage']='Zur Umfrage';
|
||||
$this->phrasen['coodle/ressource']='Ressource';
|
||||
$this->phrasen['coodle/raumBelegt']='Der Raum %s kann nicht reserviert werden, da er belegt ist!';
|
||||
$this->phrasen['coodle/laufendeUmfragen']='Laufende Umfragen';
|
||||
$this->phrasen['coodle/beendeteUmfragen']='Beendete Umfragen';
|
||||
$this->phrasen['coodle/ReservierungNichtMoeglich']='Bitte beachten Sie, dass Raumreservierungen nach dem %s noch nicht möglich sind.';
|
||||
$this->phrasen['coodle/raumNichtReserviert']='Achtung: Ihr Raum wurde nicht reserviert, da Raumreservierungen nach dem %s derzeit noch nicht möglich sind.';
|
||||
$this->phrasen['coodle/auswahlEndtermin']='Auswahl des Endtermins';
|
||||
$this->phrasen['coodle/auswahlHinweis']='Durch diese Auswahl wird der endgültige Termin ausgewählt und die Umfrage beendet. Dieser Vorgang kann nicht rückgängig gemacht werden.';
|
||||
$this->phrasen['coodle/keineAuswahl']='Keine Auswahl';
|
||||
?>
|
||||
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* Signatur die an E-Mails angehängt wird, die vom System verschickt werden
|
||||
*/
|
||||
$this->phrasen['mail/signatur']="Mit freundlichen Grüßen\n\nFachhochschule Technikum Wien\nHöchstädtplatz 5\n1200 Wien\n";
|
||||
?>
|
||||
Reference in New Issue
Block a user