mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 00:24:35 +00:00
Coodle
- Umfragestart ohne Terminwahl verhindern - Coodle FreeBusy einbinden - Coodle Zusagen als iCal abonnieren
This commit is contained in:
@@ -314,6 +314,24 @@ switch($work)
|
||||
echo $coodletermin->errormsg;
|
||||
|
||||
break;
|
||||
|
||||
case 'countTermine':
|
||||
if(isset($_POST['coodle_id']))
|
||||
$coodle_id = $_POST['coodle_id'];
|
||||
else
|
||||
die('CoodleID fehlt');
|
||||
|
||||
$coodle = new coodle();
|
||||
if ($coodle->getTermine($coodle_id))
|
||||
{
|
||||
echo count($coodle->result);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $coodle->errormsg;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
die('Invalid Work Parameter');
|
||||
}
|
||||
|
||||
@@ -76,11 +76,12 @@ if(isset($_POST['action']) && $_POST['action']=='start')
|
||||
// Start der Umfrage
|
||||
$coodle_termine = new coodle();
|
||||
$coodle_termine->getTermine($coodle_id);
|
||||
if(count($coodle_termine->result)>0)
|
||||
// Die Terminoption "keine Auswahl wird immer benötigt. Deshalb > 1
|
||||
if(count($coodle_termine->result) > 1)
|
||||
{
|
||||
$coodle_ressource = new coodle();
|
||||
$coodle_ressource->getRessourcen($coodle_id);
|
||||
if(count($coodle_ressource->result)>0)
|
||||
if(count($coodle_ressource->result) > 0)
|
||||
{
|
||||
// Status aendern
|
||||
$coodle->coodle_status_kurzbz='laufend';
|
||||
@@ -135,16 +136,18 @@ if(isset($_POST['action']) && $_POST['action']=='start')
|
||||
Bitte folgen Sie dem Link, um Ihre Terminwünsche bekannt zu geben:
|
||||
<a href="'.$link.'">Link zur Terminumfrage</a>
|
||||
<br><br>
|
||||
'.($coodle->beschreibung != '' ? '
|
||||
Beschreibung:<br><br>
|
||||
'.$coodle->beschreibung.'<br><br>
|
||||
'.$coodle->beschreibung.'<br><br>' : '').'
|
||||
'.nl2br($sign);
|
||||
|
||||
$text=$anrede."!\n\nSie wurden zu einer Terminumfrage zum Thema \"".$db->convert_html_chars($coodle->titel)."\" eingeladen.\n
|
||||
Bitte folgen Sie dem Link, um Ihre Terminwünsche bekannt zu geben:\n
|
||||
$link\n\n
|
||||
".($coodle->beschreibung != "" ? "
|
||||
Beschreibung:\n\n
|
||||
".strip_tags($coodle->beschreibung)."
|
||||
\n\n
|
||||
\n\n" : "")."
|
||||
$sign";
|
||||
|
||||
$mail = new mail($email, $von,'Terminumfrage - '.$coodle->titel, $text);
|
||||
@@ -317,7 +320,6 @@ echo '<html>
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
// Coodle Termin initialisieren
|
||||
@@ -342,7 +344,6 @@ echo '<html>
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// Kalender Initialisieren
|
||||
$("#calendar").fullCalendar(
|
||||
{
|
||||
@@ -568,6 +569,35 @@ echo '<html>
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#umfrageStartenSubmitButton").click(function(e)
|
||||
{
|
||||
e.preventDefault(); // avoid to execute the actual submit of the form.
|
||||
|
||||
var form = $(this).parents("form:first");
|
||||
formdata = form.serialize();
|
||||
formdata += (formdata!=="")? "&work=countTermine&coodle_id='.$coodle_id.'":"";
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url:"coodle_worker.php",
|
||||
data: formdata,
|
||||
success: function(data)
|
||||
{
|
||||
if (parseInt(data) > 1)
|
||||
{
|
||||
form.submit();
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Bitte ziehen Sie mindestens einen Termin in den Kalender");
|
||||
}
|
||||
},
|
||||
error: function(data)
|
||||
{
|
||||
alert("Error: "+data);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -847,7 +877,8 @@ echo '
|
||||
}
|
||||
</script>
|
||||
<p>
|
||||
'.$p->t('coodle/ressourcenBeschreibung').'
|
||||
'.$p->t('coodle/ressourcenBeschreibung');
|
||||
echo '
|
||||
<br><br><a href="#" onclick="showExterne(); return false;">'.$p->t('coodle/externePersonhinzu').'</a>
|
||||
</div> <!-- RessourcenInput -->
|
||||
<div id="externePersonen" style="display: none">
|
||||
@@ -864,10 +895,10 @@ echo '
|
||||
</div>
|
||||
<div id="fertig">
|
||||
<h4>'.$p->t('coodle/umfrageStarten').'</h4>
|
||||
<form action="'.$_SERVER['PHP_SELF'].'" method="POST">
|
||||
<form id="umfrageStartenForm" action="'.$_SERVER['PHP_SELF'].'" method="POST">
|
||||
<input type="hidden" name="action" value="start" />
|
||||
<input type="hidden" name="coodle_id" value="'.$db->convert_html_chars($coodle_id).'" />
|
||||
<input type="submit" value="'.$p->t('coodle/umfrageStarten').'" />
|
||||
<input id="umfrageStartenSubmitButton" type="submit" value="'.$p->t('coodle/umfrageStarten').'"/>
|
||||
</form>
|
||||
<p>
|
||||
'.$p->t('coodle/startBeschreibung').'
|
||||
|
||||
Reference in New Issue
Block a user