|
|
|
@ -76,11 +76,15 @@ if ($_SERVER['REQUEST_METHOD'] == "GET") {
|
|
|
|
|
$tActiveFrom = '';
|
|
|
|
|
$tActiveUntil = '';
|
|
|
|
|
$tUseremail = $fUsername;
|
|
|
|
|
$tReply_Type = '';
|
|
|
|
|
$tInterval_Time = '';
|
|
|
|
|
|
|
|
|
|
$details = $vh->get_details();
|
|
|
|
|
if($details != false) {
|
|
|
|
|
$tSubject = $details['subject'];
|
|
|
|
|
$tBody = $details['body'];
|
|
|
|
|
$tReply_Type = $details['reply_type'];
|
|
|
|
|
$tInterval_Time = $details['interval_time'];
|
|
|
|
|
$tActiveFrom = $details['activeFrom'];
|
|
|
|
|
$tActiveUntil = $details['activeUntil'];
|
|
|
|
|
}
|
|
|
|
@ -93,6 +97,13 @@ if ($_SERVER['REQUEST_METHOD'] == "GET") {
|
|
|
|
|
//set a default, reset fields for coming back selection
|
|
|
|
|
if ($tSubject == '') { $tSubject = html_entity_decode($PALANG['pUsersVacation_subject_text'], ENT_QUOTES, 'UTF-8'); }
|
|
|
|
|
if ($tBody == '') { $tBody = html_entity_decode($PALANG['pUsersVacation_body_text'], ENT_QUOTES, 'UTF-8'); }
|
|
|
|
|
|
|
|
|
|
if ($tReply_Type =='') { $tReply_Type = $CONF['replytype_default'];}
|
|
|
|
|
if ($tReply_Type =='One Reply') { $tInterval_Time = '0';}
|
|
|
|
|
if ($tReply_Type =='Auto Reply') { $tInterval_Time = $CONF['autoreplydelay_default'];}
|
|
|
|
|
if (($tReply_Type =='Interval Reply') and ($tInterval_Time =='')) { $tInterval_Time = $CONF['intervaldelay_default'];}
|
|
|
|
|
if (($tReply_Type =='Interval Reply') and ($tInterval_Time <= $CONF['autoreplydelay_default'])) { $tInterval_Time = $CONF['intervaldelay_default'];}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] == "POST")
|
|
|
|
@ -110,6 +121,9 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
|
|
|
|
|
$tBody = safepost('fBody');
|
|
|
|
|
$fBody = $tBody;
|
|
|
|
|
|
|
|
|
|
$tReply_Type = safepost('fReply_Type');
|
|
|
|
|
$tInterval_Time = safepost('fInterval_Time');
|
|
|
|
|
|
|
|
|
|
$fChange = escape_string (safepost('fChange'));
|
|
|
|
|
$fBack = escape_string (safepost('fBack'));
|
|
|
|
|
|
|
|
|
@ -118,6 +132,14 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
|
|
|
|
|
//set a default, reset fields for coming back selection
|
|
|
|
|
if ($tSubject == '') { $tSubject = html_entity_decode($PALANG['pUsersVacation_subject_text'], ENT_QUOTES, 'UTF-8'); }
|
|
|
|
|
if ($tBody == '') { $tBody = html_entity_decode($PALANG['pUsersVacation_body_text'], ENT_QUOTES, 'UTF-8'); }
|
|
|
|
|
if ($tReply_Type =='') { $tReply_Type = $CONF['replytype_default'];}
|
|
|
|
|
if ($tReply_Type =='One Reply') { $tInterval_Time = '0';}
|
|
|
|
|
if ($tReply_Type =='Auto Reply') { $tInterval_Time = $CONF['autoreplydelay_default'];}
|
|
|
|
|
if (($tReply_Type =='Interval Reply') and ($tInterval_Time =='')) { $tInterval_Time = $CONF['intervaldelay_default'];}
|
|
|
|
|
if (($tReply_Type =='Interval Reply') and ($tInterval_Time <= $CONF['autoreplydelay_default'])) { $tInterval_Time = $CONF['intervaldelay_default'];}
|
|
|
|
|
|
|
|
|
|
$fReply_Type = $tReply_Type ;
|
|
|
|
|
$fInterval_Time = $tInterval_Time;
|
|
|
|
|
|
|
|
|
|
// if they've set themselves change OR back, delete any record of vacation emails.
|
|
|
|
|
// the user is going away - set the goto alias and vacation table as necessary.
|
|
|
|
@ -125,7 +147,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
|
|
|
|
|
//Set the vacation data for $fUsername
|
|
|
|
|
if (!empty ($fChange))
|
|
|
|
|
{
|
|
|
|
|
if(!$vh->set_away($fSubject, $fBody, $tActiveFrom, $tActiveUntil)) {
|
|
|
|
|
if(!$vh->set_away($fSubject, $fBody, $fReply_Type, $fInterval_Time, $tActiveFrom, $tActiveUntil)) {
|
|
|
|
|
$error = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -165,6 +187,8 @@ $smarty->assign ('tSubject', $tSubject);
|
|
|
|
|
$smarty->assign ('tBody', $tBody);
|
|
|
|
|
$smarty->assign ('tActiveFrom', date ("d.m.Y", strtotime ($tActiveFrom)));
|
|
|
|
|
$smarty->assign ('tActiveUntil', date ("d.m.Y", strtotime ($tActiveUntil)));
|
|
|
|
|
$smarty->assign ('select_options', select_options ( $CONF ['choice_of_reply'], array ($tReply_Type)),false);
|
|
|
|
|
$smarty->assign ('tInterval_Time', $tInterval_Time);
|
|
|
|
|
$smarty->assign ('smarty_template', 'vacation');
|
|
|
|
|
$smarty->display ('index.tpl');
|
|
|
|
|
|
|
|
|
|