From 48cbc2dbee7874fb8d663563ab65a8dd62ee5db0 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Mon, 24 Mar 2014 15:30:37 +0000 Subject: [PATCH] * eMail: give user feedback when setting/applying timed vacation; do display of dates regarding user time zone settings; improve information when a vacation is set for a given time-range --- felamimail/inc/class.uifelamimail.inc.php | 4 ++-- felamimail/inc/class.uisieve.inc.php | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/felamimail/inc/class.uifelamimail.inc.php b/felamimail/inc/class.uifelamimail.inc.php index d7ed0e66e8..3b9ca8e73e 100644 --- a/felamimail/inc/class.uifelamimail.inc.php +++ b/felamimail/inc/class.uifelamimail.inc.php @@ -893,9 +893,9 @@ class uifelamimail } if(is_array($vacation) && ($vacation['status'] == 'on' || $vacation['status']=='by_date')) { - $dtfrmt = $GLOBALS['egw_info']['user']['preferences']['common']['dateformat']; + $dtfrmt = $GLOBALS['egw_info']['user']['preferences']['common']['dateformat']/*.' '.($GLOBALS['egw_info']['user']['preferences']['common']['timeformat']!='24'?'h:i a':'H:i')*/; $this->t->set_var('vacation_warning', - html::image('phpgwapi','dialog_warning',false,'style="vertical-align: middle; width: 16px;"').lang('Vacation notice is active').($vacation['status']=='by_date'? ' '.common::show_date($vacation['start_date'],$dtfrmt,true).'->'.common::show_date($vacation['end_date'],$dtfrmt,true):'')); + html::image('phpgwapi','dialog_warning',false,'style="vertical-align: middle; width: 16px;"').lang('Vacation notice is active').($vacation['status']=='by_date'? ' '.common::show_date($vacation['start_date'],$dtfrmt,true).($vacation['end_date']>$vacation['start_date']?'->'.common::show_date($vacation['end_date']+ 24*3600-1,$dtfrmt,true):''):'')); } else { diff --git a/felamimail/inc/class.uisieve.inc.php b/felamimail/inc/class.uisieve.inc.php index 33e358ce11..f103af222c 100644 --- a/felamimail/inc/class.uisieve.inc.php +++ b/felamimail/inc/class.uisieve.inc.php @@ -590,7 +590,7 @@ } $uiwidgets =& CreateObject('felamimail.uiwidgets',EGW_APP_TPL); $boemailadmin = new emailadmin_bo(); - +$this->timed_vacation=true; if ($this->timed_vacation) { include_once(EGW_API_INC.'/class.jscalendar.inc.php'); @@ -643,13 +643,15 @@ { if (isset($_POST['start_date'])) { + //input2date returns a timestap for the day selected at noon if nothing else is specified $date = $jscal->input2date($_POST['start_date']); - if ($date['raw']) $newVacation['start_date'] = $date['raw']-12*3600; + if ($date['raw']) $newVacation['start_date'] = egw_time::user2server($date['raw']-12*3600,'ts'); } if (isset($_POST['end_date'])) { + //input2date returns a timestap for the day selected at noon if nothing else is specified $date = $jscal->input2date($_POST['end_date']); - if ($date['raw']) $newVacation['end_date'] = $date['raw']-12*3600; + if ($date['raw']) $newVacation['end_date'] = egw_time::user2server($date['raw']-12*3600,'ts'); } } if(isset($_POST['save']) || isset($_POST['apply'])) @@ -775,9 +777,11 @@ if ($this->timed_vacation) { + $dtfrmt = $GLOBALS['egw_info']['user']['preferences']['common']['dateformat'].' '.($GLOBALS['egw_info']['user']['preferences']['common']['timeformat']!='24'?'h:i a':'H:i'); $this->t->set_var('by_date',' : '. - $jscal->input('start_date',$vacation['start_date']).' - '.$jscal->input('end_date',$vacation['end_date'])); + $jscal->input('start_date',egw_time::server2user($vacation['start_date'],'ts')).' - '.$jscal->input('end_date',egw_time::server2user($vacation['end_date'],'ts')).' '. + ($vacation['status']=='by_date'?lang('Vacation notice is active').($vacation['status']=='by_date'? ' '.common::show_date($vacation['start_date'],$dtfrmt,true).'->'.common::show_date($vacation['end_date']+ 24*3600-1,$dtfrmt,true):''):'')); $this->t->set_var('lang_help_start_end_replacement','
'.lang('You can use %1 for the above start-date and %2 for the end-date.','$$start$$','$$end$$')); } $this->t->pfp('out','vacation');