- add ability to choose activation date for vacation message in user module

- add files to user module
TODO: clean up whole user module, use VacationHandler in admin module

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@764 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Sebastian 15 years ago
parent e701d6e756
commit 5275e17c20

@ -61,7 +61,7 @@ class VacationHandler {
/**
* Retrieve information on someone who is on vacation
* @return struct|boolean stored information on vacation - array(subject - string, message - string, active - boolean)
* @return struct|boolean stored information on vacation - array(subject - string, message - string, active - boolean, activeFrom - date, activeUntil - date)
* will return false if no existing data
*/
function get_details() {
@ -75,32 +75,38 @@ class VacationHandler {
$boolean = ($row['active'] == db_get_boolean(true));
return array( 'subject' => $row['subject'],
'body' => $row['body'],
'active' => $boolean );
'active' => $boolean ,
'activeFrom' => $row['activefrom'],
'activeUntil' => $row['activeuntil']);
}
return false;
}
/**
* @param string $subject
* @param string $body
* @param date $activeFrom
* @param date $activeUntil
*/
function set_away($subject, $body) {
function set_away($subject, $body, $activeFrom, $activeUntil) {
$this->remove(); // clean out any notifications that might already have been sent.
// is there an entry in the vacaton table for the user, or do we need to insert?
$table_vacation = table_by_key('vacation');
$username = escape_string($this->username);
$body = escape_string($body);
$subject = escape_string($subject);
$activeFrom = date ("Y-m-d 00:00:00", strtotime ($activeFrom));
$activeUntil = date ("Y-m-d 23:59:59", strtotime ($activeUntil));
$result = db_query("SELECT * FROM $table_vacation WHERE email = '$username'");
$active = db_get_boolean(True);
// check if the user has a vacation entry already, if so just update it
if($result['rows'] == 1) {
$result = db_query("UPDATE $table_vacation SET active = '$active', body = '$body', subject = '$subject', created = NOW() WHERE email = '$username'");
$result = db_query("UPDATE $table_vacation SET active = '$active', body = '$body', subject = '$subject', activefrom = '$activeFrom', activeuntil = '$activeUntil', created = NOW() WHERE email = '$username'");
}
else {
$tmp = preg_split ('/@/', $username);
$domain = escape_string($tmp[1]);
$result = db_query ("INSERT INTO $table_vacation (email,subject,body,domain,created,active) VALUES ('$username','$subject','$body','$domain',NOW(),'$active')");
$result = db_query ("INSERT INTO $table_vacation (email,subject,body,domain,created,active,activefrom, activeuntil) VALUES ('$username','$subject','$body','$domain',NOW(),'$active','$activeFrom','$ativeUntil')");
}
$ah = new AliasHandler($this->username);

@ -58,9 +58,9 @@
</tr>
<tr>
<td colspan="3" class="hlp_center">
<input class="button" type="submit" name="fChange" value="{$PALANG.pEdit_vacation_set}" />
<input class="button" type="submit" name="fBack" value="{$PALANG.pEdit_vacation_remove}" />
<input class="button" type="button" name="fCancel" value="{$PALANG.exit}" onclick="newLocation()" />
<input class="button" type="submit" name="fChange" value="{$PALANG.pEdit_vacation_set}" />
<input class="button" type="submit" name="fBack" value="{$PALANG.pEdit_vacation_remove}" />
<input class="button" type="button" name="fCancel" value="{$PALANG.exit}" onclick="newLocation()" />
</td>
</tr>
<tr>

@ -1,21 +1,54 @@
{literal}
<script type="text/javascript">
function newLocation() {
window.location="{/literal}{$fCanceltarget}{literal}"
}
</script>
<script language="JavaScript" src="calendar.js"></script>
<link rel="stylesheet" href="css/calendar.css">
{/literal}
<div id="edit_form">
<form name="vacation" method="post" action="">
<form name="vacation" method="post" action=''>
<table>
<tr>
<td colspan="3"><h3>{$PALANG.pUsersVacation_welcome}</h3></td>
</tr>
<tr>
<td>{$PALANG.pUsersVacation_activefrom}:</td>
<td><input name="fActiveFrom" value="{$fActiveFrom}" readonly="readonly" style="background:#eee;"/>
{literal}
<script language="JavaScript">
new tcal ({
'formname': 'vacation',
'controlname': 'fActiveFrom'
});
</script>
{/literal}
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>{$PALANG.pUsersVacation_activeuntil}:</td>
<td><input name="fActiveUntil" value="{$fActiveUntil}" readonly="readonly" style="background:#eee;"/>
{literal}
<script language="JavaScript">
new tcal ({
'formname': 'vacation',
'controlname': 'fActiveUntil'
});
</script>
{/literal}
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>{$PALANG.pUsersVacation_subject}:</td>
<td><input type="text" name="fSubject" value="{$tSubject}" /></td>
<td><textarea class="flat" rows="3" cols="60" name="fSubject" >{$tSubject}</textarea></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>{$PALANG.pUsersVacation_body}:</td>
<td>
<textarea rows="10" cols="80" name="fBody">
{$tBody}
</textarea>
</td>
<td><textarea class="flat" rows="10" cols="60" name="fBody" >{$tBody}</textarea></td>
<td>&nbsp;</td>
</tr>
<tr>

@ -0,0 +1,336 @@
// Tigra Calendar v4.0.2 (12-01-2009) European (dd.mm.yyyy)
// http://www.softcomplex.com/products/tigra_calendar/
// Public Domain Software... You're welcome.
// default settins
var A_TCALDEF = {
'months' : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
'weekdays' : ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
'yearscroll': true, // show year scroller
'weekstart': 1, // first day of week: 0-Su or 1-Mo
'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx.
'imgpath' : 'images/calendar/' // directory with calendar images
}
// date parsing function
function f_tcalParseDate (s_date) {
var re_date = /^\s*(\d{1,2})\.(\d{1,2})\.(\d{2,4})\s*$/;
if (!re_date.exec(s_date))
return alert ("Invalid date: '" + s_date + "'.\nAccepted format is dd.mm.yyyy.")
var n_day = Number(RegExp.$1),
n_month = Number(RegExp.$2),
n_year = Number(RegExp.$3);
if (n_year < 100)
n_year += (n_year < this.a_tpl.centyear ? 2000 : 1900);
if (n_month < 1 || n_month > 12)
return alert ("Invalid month value: '" + n_month + "'.\nAllowed range is 01-12.");
var d_numdays = new Date(n_year, n_month, 0);
if (n_day > d_numdays.getDate())
return alert("Invalid day of month value: '" + n_day + "'.\nAllowed range for selected month is 01 - " + d_numdays.getDate() + ".");
return new Date (n_year, n_month - 1, n_day);
}
// date generating function
function f_tcalGenerDate (d_date) {
return (
(d_date.getDate() < 10 ? '0' : '') + d_date.getDate() + "."
+ (d_date.getMonth() < 9 ? '0' : '') + (d_date.getMonth() + 1) + "."
+ d_date.getFullYear()
);
}
// implementation
function tcal (a_cfg, a_tpl) {
// apply default template if not specified
if (!a_tpl)
a_tpl = A_TCALDEF;
// register in global collections
if (!window.A_TCALS)
window.A_TCALS = [];
if (!window.A_TCALSIDX)
window.A_TCALSIDX = [];
this.s_id = a_cfg.id ? a_cfg.id : A_TCALS.length;
window.A_TCALS[this.s_id] = this;
window.A_TCALSIDX[window.A_TCALSIDX.length] = this;
// assign methods
this.f_show = f_tcalShow;
this.f_hide = f_tcalHide;
this.f_toggle = f_tcalToggle;
this.f_update = f_tcalUpdate;
this.f_relDate = f_tcalRelDate;
this.f_parseDate = f_tcalParseDate;
this.f_generDate = f_tcalGenerDate;
// create calendar icon
this.s_iconId = 'tcalico_' + this.s_id;
this.e_icon = f_getElement(this.s_iconId);
if (!this.e_icon) {
document.write('<img src="' + a_tpl.imgpath + 'cal.gif" id="' + this.s_iconId + '" onclick="A_TCALS[\'' + this.s_id + '\'].f_toggle()" class="tcalIcon" alt="Open Calendar" />');
this.e_icon = f_getElement(this.s_iconId);
}
// save received parameters
this.a_cfg = a_cfg;
this.a_tpl = a_tpl;
}
function f_tcalShow (d_date) {
// find input field
if (!this.a_cfg.controlname)
throw("TC: control name is not specified");
if (this.a_cfg.formname) {
var e_form = document.forms[this.a_cfg.formname];
if (!e_form)
throw("TC: form '" + this.a_cfg.formname + "' can not be found");
this.e_input = e_form.elements[this.a_cfg.controlname];
}
else
this.e_input = f_getElement(this.a_cfg.controlname);
if (!this.e_input || !this.e_input.tagName || this.e_input.tagName != 'INPUT')
throw("TC: element '" + this.a_cfg.controlname + "' does not exist in "
+ (this.a_cfg.formname ? "form '" + this.a_cfg.controlname + "'" : 'this document'));
// dynamically create HTML elements if needed
this.e_div = f_getElement('tcal');
if (!this.e_div) {
this.e_div = document.createElement("DIV");
this.e_div.id = 'tcal';
document.body.appendChild(this.e_div);
}
this.e_shade = f_getElement('tcalShade');
if (!this.e_shade) {
this.e_shade = document.createElement("DIV");
this.e_shade.id = 'tcalShade';
document.body.appendChild(this.e_shade);
}
this.e_iframe = f_getElement('tcalIF')
if (b_ieFix && !this.e_iframe) {
this.e_iframe = document.createElement("IFRAME");
this.e_iframe.style.filter = 'alpha(opacity=0)';
this.e_iframe.id = 'tcalIF';
this.e_iframe.src = this.a_tpl.imgpath + 'pixel.gif';
document.body.appendChild(this.e_iframe);
}
// hide all calendars
f_tcalHideAll();
// generate HTML and show calendar
this.e_icon = f_getElement(this.s_iconId);
if (!this.f_update())
return;
this.e_div.style.visibility = 'visible';
this.e_shade.style.visibility = 'visible';
if (this.e_iframe)
this.e_iframe.style.visibility = 'visible';
// change icon and status
this.e_icon.src = this.a_tpl.imgpath + 'no_cal.gif';
this.e_icon.title = 'Close Calendar';
this.b_visible = true;
}
function f_tcalHide (n_date) {
if (n_date)
this.e_input.value = this.f_generDate(new Date(n_date));
// no action if not visible
if (!this.b_visible)
return;
// hide elements
if (this.e_iframe)
this.e_iframe.style.visibility = 'hidden';
if (this.e_shade)
this.e_shade.style.visibility = 'hidden';
this.e_div.style.visibility = 'hidden';
// change icon and status
this.e_icon = f_getElement(this.s_iconId);
this.e_icon.src = this.a_tpl.imgpath + 'cal.gif';
this.e_icon.title = 'Open Calendar';
this.b_visible = false;
}
function f_tcalToggle () {
return this.b_visible ? this.f_hide() : this.f_show();
}
function f_tcalUpdate (d_date) {
var d_today = this.a_cfg.today ? this.f_parseDate(this.a_cfg.today) : f_tcalResetTime(new Date());
var d_selected = this.e_input.value == ''
? (this.a_cfg.selected ? this.f_parseDate(this.a_cfg.selected) : d_today)
: this.f_parseDate(this.e_input.value);
// figure out date to display
if (!d_date)
// selected by default
d_date = d_selected;
else if (typeof(d_date) == 'number')
// get from number
d_date = f_tcalResetTime(new Date(d_date));
else if (typeof(d_date) == 'string')
// parse from string
this.f_parseDate(d_date);
if (!d_date) return false;
// first date to display
var d_firstday = new Date(d_date);
d_firstday.setDate(1);
d_firstday.setDate(1 - (7 + d_firstday.getDay() - this.a_tpl.weekstart) % 7);
var a_class, s_html = '<table class="ctrl"><tbody><tr>'
+ (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, -1, 'y') + ' title="Previous Year"><img src="' + this.a_tpl.imgpath + 'prev_year.gif" /></td>' : '')
+ '<td' + this.f_relDate(d_date, -1) + ' title="Previous Month"><img src="' + this.a_tpl.imgpath + 'prev_mon.gif" /></td><th>'
+ this.a_tpl.months[d_date.getMonth()] + ' ' + d_date.getFullYear()
+ '</th><td' + this.f_relDate(d_date, 1) + ' title="Next Month"><img src="' + this.a_tpl.imgpath + 'next_mon.gif" /></td>'
+ (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, 1, 'y') + ' title="Next Year"><img src="' + this.a_tpl.imgpath + 'next_year.gif" /></td></td>' : '')
+ '</tr></tbody></table><table><tbody><tr class="wd">';
// print weekdays titles
for (var i = 0; i < 7; i++)
s_html += '<th>' + this.a_tpl.weekdays[(this.a_tpl.weekstart + i) % 7] + '</th>';
s_html += '</tr>' ;
// print calendar table
var n_date, n_month, d_current = new Date(d_firstday);
while (d_current.getMonth() == d_date.getMonth() ||
d_current.getMonth() == d_firstday.getMonth()) {
// print row heder
s_html +='<tr>';
for (var n_wday = 0; n_wday < 7; n_wday++) {
a_class = [];
n_date = d_current.getDate();
n_month = d_current.getMonth();
// other month
if (d_current.getMonth() != d_date.getMonth())
a_class[a_class.length] = 'othermonth';
// weekend
if (d_current.getDay() == 0 || d_current.getDay() == 6)
a_class[a_class.length] = 'weekend';
// today
if (d_current.valueOf() == d_today.valueOf())
a_class[a_class.length] = 'today';
// selected
if (d_current.valueOf() == d_selected.valueOf())
a_class[a_class.length] = 'selected';
s_html += '<td onclick="A_TCALS[\'' + this.s_id + '\'].f_hide(' + d_current.valueOf() + ')"' + (a_class.length ? ' class="' + a_class.join(' ') + '">' : '>') + n_date + '</td>'
d_current.setDate(++n_date);
while (d_current.getDate() != n_date && d_current.getMonth() == n_month) {
alert(n_date + "\n" + d_current + "\n" + new Date());
d_current.setHours(d_current.getHours + 1);
d_current = f_tcalResetTime(d_current);
}
}
// print row footer
s_html +='</tr>';
}
s_html +='</tbody></table>';
// update HTML, positions and sizes
this.e_div.innerHTML = s_html;
var n_width = this.e_div.offsetWidth;
var n_height = this.e_div.offsetHeight;
var n_top = f_getPosition (this.e_icon, 'Top') + this.e_icon.offsetHeight;
var n_left = f_getPosition (this.e_icon, 'Left') - n_width + this.e_icon.offsetWidth;
if (n_left < 0) n_left = 0;
this.e_div.style.left = n_left + 'px';
this.e_div.style.top = n_top + 'px';
this.e_shade.style.width = (n_width + 8) + 'px';
this.e_shade.style.left = (n_left - 1) + 'px';
this.e_shade.style.top = (n_top - 1) + 'px';
this.e_shade.innerHTML = b_ieFix
? '<table><tbody><tr><td rowspan="2" colspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_tr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td height="' + (n_height - 7) + '" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_mr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td width="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bl.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bm.png\', sizingMethod=\'scale\');" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_br.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tbody></table>'
: '<table><tbody><tr><td rowspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td rowspan="2"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7"><img src="' + this.a_tpl.imgpath + 'shade_tr.png"></td></tr><tr><td background="' + this.a_tpl.imgpath + 'shade_mr.png" height="' + (n_height - 7) + '"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td><img src="' + this.a_tpl.imgpath + 'shade_bl.png"></td><td background="' + this.a_tpl.imgpath + 'shade_bm.png" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td><img src="' + this.a_tpl.imgpath + 'shade_br.png"></td></tr><tbody></table>';
if (this.e_iframe) {
this.e_iframe.style.left = n_left + 'px';
this.e_iframe.style.top = n_top + 'px';
this.e_iframe.style.width = (n_width + 6) + 'px';
this.e_iframe.style.height = (n_height + 6) +'px';
}
return true;
}
function f_getPosition (e_elemRef, s_coord) {
var n_pos = 0, n_offset,
e_elem = e_elemRef;
while (e_elem) {
n_offset = e_elem["offset" + s_coord];
n_pos += n_offset;
e_elem = e_elem.offsetParent;
}
// margin correction in some browsers
if (b_ieMac)
n_pos += parseInt(document.body[s_coord.toLowerCase() + 'Margin']);
else if (b_safari)
n_pos -= n_offset;
e_elem = e_elemRef;
while (e_elem != document.body) {
n_offset = e_elem["scroll" + s_coord];
if (n_offset && e_elem.style.overflow == 'scroll')
n_pos -= n_offset;
e_elem = e_elem.parentNode;
}
return n_pos;
}
function f_tcalRelDate (d_date, d_diff, s_units) {
var s_units = (s_units == 'y' ? 'FullYear' : 'Month');
var d_result = new Date(d_date);
d_result['set' + s_units](d_date['get' + s_units]() + d_diff);
if (d_result.getDate() != d_date.getDate())
d_result.setDate(0);
return ' onclick="A_TCALS[\'' + this.s_id + '\'].f_update(' + d_result.valueOf() + ')"';
}
function f_tcalHideAll () {
for (var i = 0; i < window.A_TCALSIDX.length; i++)
window.A_TCALSIDX[i].f_hide();
}
function f_tcalResetTime (d_date) {
d_date.setHours(0);
d_date.setMinutes(0);
d_date.setSeconds(0);
d_date.setMilliseconds(0);
return d_date;
}
f_getElement = document.all ?
function (s_id) { return document.all[s_id] } :
function (s_id) { return document.getElementById(s_id) };
if (document.addEventListener)
window.addEventListener('scroll', f_tcalHideAll, false);
if (window.attachEvent)
window.attachEvent('onscroll', f_tcalHideAll);
// global variables
var s_userAgent = navigator.userAgent.toLowerCase(),
re_webkit = /WebKit\/(\d+)/i;
var b_mac = s_userAgent.indexOf('mac') != -1,
b_ie5 = s_userAgent.indexOf('msie 5') != -1,
b_ie6 = s_userAgent.indexOf('msie 6') != -1 && s_userAgent.indexOf('opera') == -1;
var b_ieFix = b_ie5 || b_ie6,
b_ieMac = b_mac && b_ie5,
b_safari = b_mac && re_webkit.exec(s_userAgent) && Number(RegExp.$1) < 500;

@ -0,0 +1,95 @@
/* calendar icon */
img.tcalIcon {
cursor: pointer;
margin-left: 1px;
vertical-align: middle;
}
/* calendar container element */
div#tcal {
position: absolute;
visibility: hidden;
z-index: 100;
width: 158px;
padding: 2px 0 0 0;
}
/* all tables in calendar */
div#tcal table {
width: 100%;
border: 1px solid silver;
border-collapse: collapse;
background-color: white;
}
/* navigation table */
div#tcal table.ctrl {
border-bottom: 0;
}
/* navigation buttons */
div#tcal table.ctrl td {
width: 15px;
height: 20px;
}
/* month year header */
div#tcal table.ctrl th {
background-color: white;
color: black;
border: 0;
}
/* week days header */
div#tcal th {
border: 1px solid silver;
border-collapse: collapse;
text-align: center;
padding: 3px 0;
font-family: tahoma, verdana, arial;
font-size: 10px;
background-color: gray;
color: white;
}
/* date cells */
div#tcal td {
border: 0;
border-collapse: collapse;
text-align: center;
padding: 2px 0;
font-family: tahoma, verdana, arial;
font-size: 11px;
width: 22px;
cursor: pointer;
}
/* date highlight
in case of conflicting settings order here determines the priority from least to most important */
div#tcal td.othermonth {
color: silver;
}
div#tcal td.weekend {
background-color: #ACD6F5;
}
div#tcal td.today {
border: 1px solid red;
}
div#tcal td.selected {
background-color: #FFB3BE;
}
/* iframe element used to suppress windowed controls in IE5/6 */
iframe#tcalIF {
position: absolute;
visibility: hidden;
z-index: 98;
border: 0;
}
/* transparent shadow */
div#tcalShade {
position: absolute;
visibility: hidden;
z-index: 99;
}
div#tcalShade table {
border: 0;
border-collapse: collapse;
width: 100%;
}
div#tcalShade table td {
border: 0;
border-collapse: collapse;
padding: 0;
}

@ -0,0 +1,317 @@
body {
background: #ffffff;
color: #000000;
font-family: "BitStream Vera Sans", Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: normal;
text-align: center;
}
a {
text-decoration: none;
color: #888888;
}
a:hover {
text-decoration: underline;
color: #888888;
}
a:visited, a:active {
color: #888888;
}
table {
/* border-spacing: 0; */
/* padding: 0; */
border-collapse: collapse; /* for IE */
}
.button {
border: 1px solid #aaaaaa;
color: #777777;
background: #dddddd;
padding: 3px 3px 3px 3px;
font-size: 11px;
}
.button:hover {
background: #BCFF36;
color: #888888;
}
.flat {
border: 1px solid #888888;
}
ul.flash-info {
border:2px solid #AFE1A6; /* medium green */
padding:1em;
max-width:730px;
margin-left:auto;
margin-right:auto;
list-style:none;
}
ul.flash-error {
border:2px solid #FF6347; /* tomato */
padding:1em;
max-width:730px;
margin-left:auto;
margin-right:auto;
list-style:none;
}
.error_msg {
color: #d01313;
}
.standout {
color: maroon;
padding: 3px 3px 3px 3px;
text-align: center;
}
#login_header {
width: 750px;
margin: 0 auto;
padding-bottom: 10px;
text-align: left;
}
#login {
width: 750px;
margin: 0 auto;
}
#login_table {
border-left: 8px solid gray;
border-right: 8px solid gray;
background: #eeeeee;
width: 350px;
margin: 0 auto;
border-collapse: separate;
border-spacing: 10px;
}
#login_table h4 {
font-size: 13px;
}
#menu, #tabbar {
width: 750px;
margin: 0 auto;
padding-top: 10px;
white-space: nowrap;
}
#menu ul, #tabbar ul {
padding: 0;
margin: 0;
margin-left:auto;
margin-right:auto;
list-style: none;
}
#menu li, #tabbar li {
float: left;
background: #efefef;
margin-right: 3px;
border-top: 4px solid #aaaaaa;
}
#menu li:hover, #menu li.sfhover, #tabbar li:hover, #tabbar li.sfhover {
background: #BFFF00;
}
#menu li ul, #tabbar li ul {
position: absolute;
width: auto;
left: -999em;
background: #FFFFFF;
border:2px solid white;
border-top:none;
}
#menu li:hover ul, #menu li.sfhover ul, #tabbar li:hover ul, #tabbar li.sfhover ul {
left: auto;
}
#menu li ul li, #tabbar li ul li {
float: none;
margin-right: 0px;
border-top:2px solid white;;
text-align:left;
}
#menu a, #tabbar a {
display: block;
width: auto;
padding: 20px 5px 5px 5px;
color: #888888;
}
#menu a:hover, #tabbar a:hover {
color: #888888;
}
#menu li ul li a, #tabbar li ul li a {
padding: 5px 5px 5px 5px;
}
#main_menu, #edit_form {
width: 750px;
margin: 0 auto;
}
#edit_form table {
margin: 0 auto;
padding-top: 10px;
text-align: left;
width: 500px;
border: 1px solid #efefef;
}
#edit_form h3 {
text-align: center;
font-size: 12px;
margin: 0;
background: #AFE1A6; /*#b4004a;*/
border: 1px solid #bbb;
line-height: 25px;
color: #555555;
}
.hlp_center {
text-align: center;
}
.help_text {
background: #efefef;
border-left: 1px solid #bbbbbb;
border-right: 1px solid #bbbbbb;
text-align: center;
padding-top: 5px;
padding-bottom: 5px;
}
#main_menu table {
margin: 0 auto;
text-align: left;
padding-top: 20px;
padding-bottom: 20px;
}
#main_menu table td {
padding-left: 30px;
padding-bottom: 5px;
}
#main_menu a {
color: #888888;
padding-left: 8px;
}
#main_menu a:hover {
color: #40B33C; /*#CD6A6A;*/
text-decoration: none;
padding-left: 4px;
border-bottom: 1px solid #40B33C;
border-left: 4px solid #40B33C;
}
#overview, #admin_domains, #admin_virtual {
width: 750px;
margin: 0 auto;
background: #AFE1A6; /*#9ACD32;*/
border: 1px solid #bbb;
}
#overview h4, #overview P, #overview FORM, #admin_virtual h4, #admin_virtual P, #admin_virtual FORM {
display: inline;
padding-right: 10px;
line-height: 30px;
}
#alias_domain_table, #alias_table, #mailbox_table, #overview_table, #log_table, #admin_table {
width: 750px;
margin: 0px auto;
border: 1px solid #efefef;
}
#alias_domain_table .header, #alias_table .header, #mailbox_table .header, #overview_table .header, #log_table .header, #admin_table .header {
line-height: 20px;
background: #efefef;
color: black;
}
#alias_domain_table .hilightoff, #alias_table .hilightoff, #mailbox_table .hilightoff, #overview_table .hilightoff, #log_table .hilightoff, #admin_table .hilighoff {
background: white;
}
#alias_domain_table .hilighton, #alias_table .hilighton, #mailbox_table .hilighton, #overview_table .hilighton, #log_table .hilighton, #admin_table .hilighton {
background: #D9FF43; /*#D6FF85;*/ /*#ffdddd;*/
}
#alias_domain_table tr:hover, #alias_table tr:hover, #mailbox_table tr:hover, #overview_table tr:hover, #log_table tr:hover, #admin_table tr:hover {
background: #D9FF43; /*#D6FF85;*/ /*#ffdddd;*/
}
#alias_domain_table h3, #alias_table h3, #mailbox_table h3, #overview_table h3, #log_table h3, #admin_table h3 {
background: silver;
text-align: left;
font-size: 12px;
font-weight: bold;
padding-left: 20px;
line-height: 25px;
margin: 0;
}
#alias_domain_table td, #alias_table td, #mailbox_table td, #overview_table td, #log_table td, #admin_table td {
text-align : left;
}
#footer {
width: 750px;
margin: 20px auto;
border-top: 1px solid #bbbbbb;
background: #efefef;
color: #999999;
line-height: 20px;
text-align: left;
padding-left: 15px;
font-size: 9px;
}
#footer a {
text-decoration: none;
color: #999999;
}
#footer a:hover {
text-decoration: underline;
color: #777777;
}
div.setup {
width:700px;
margin-left:auto;
margin-right:auto;
text-align: left;
}
div.setup li {
padding-bottom:1em;
}
div.nav_bar {
text-align: left;
width: 750px;
margin: 0 auto;
}

@ -73,6 +73,8 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
if (isset ($_POST['fBody'])) $fBody = $_POST['fBody'];
if (isset ($_POST['fAway'])) $fAway = escape_string ($_POST['fAway']);
if (isset ($_POST['fBack'])) $fBack = escape_string ($_POST['fBack']);
if (isset ($_POST['fActiveFrom'])) $tActiveFrom = date ("Y-m-d 00:00:00", strtotime ($_POST['fActiveFrom']));
if (isset ($_POST['fActiveUntil'])) $tActiveUntil = date ("Y-m-d 23:59:59", strtotime ($_POST['fActiveUntil']));
//set a default, reset fields for coming back selection
if ($tSubject == '') { $tSubject = html_entity_decode($PALANG['pUsersVacation_subject_text'], ENT_QUOTES, 'UTF-8'); }
@ -83,7 +85,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
// the user is going away - set the goto alias and vacation table as necessary.
if (!empty ($fAway))
{
if(!$vh->set_away($fSubject, $fBody)) {
if(!$vh->set_away($fSubject, $fBody, $tActiveFrom, $tActiveUntil)) {
$error = 1;
$tMessage = $PALANG['pUsersVacation_result_error'];
}
@ -104,6 +106,8 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$smarty->assign ('tSubject', htmlentities ($tSubject, ENT_QUOTES, 'UTF-8'));
$smarty->assign ('tBody', htmlentities ($tBody, ENT_QUOTES, 'UTF-8'));
$smarty->assign ('tMessage', $tMessage);
$smarty->assign ('tActiveFrom', date ("d.m.Y", strtotime ($fActiveFrom)));
$smarty->assign ('tActiveUntil', date ("d.m.Y", strtotime ($fActiveUntil)));
$smarty->assign ('smarty_template', 'users_vacation');
$smarty->display ('index.tpl');
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */

Loading…
Cancel
Save