Mail: Fix mail vacation notice widget did not hide

This commit is contained in:
nathan 2022-12-05 16:27:39 -07:00
parent fa2375b1a6
commit 09ecd29a91

View File

@ -4774,13 +4774,15 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
$dtfrmt = $GLOBALS['egw_info']['user']['preferences']['common']['dateformat']; $dtfrmt = $GLOBALS['egw_info']['user']['preferences']['common']['dateformat'];
$refreshData['vacationnotice'] = lang('Vacation notice is active'); $refreshData['vacationnotice'] = lang('Vacation notice is active');
$refreshData['vacationrange'] = ($vacation['status']=='by_date'? Api\DateTime::server2user($vacation['start_date'],$dtfrmt,true).($vacation['end_date']>$vacation['start_date']?'->'.Api\DateTime::server2user($vacation['end_date']+ 24*3600-1,$dtfrmt,true):''):''); $refreshData['vacationrange'] = ($vacation['status']=='by_date'? Api\DateTime::server2user($vacation['start_date'],$dtfrmt,true).($vacation['end_date']>$vacation['start_date']?'->'.Api\DateTime::server2user($vacation['end_date']+ 24*3600-1,$dtfrmt,true):''):'');
if ($vacation['status'] == 'by_date' && $vacation['end_date']+ 24*3600 < time())$refreshData = ''; if($vacation['status'] == 'by_date' && $vacation['end_date'] + 24 * 3600 < time())
{
$refreshData = null;
}
} }
} }
if ($vacation==false) if ($vacation==false)
{ {
$refreshData['vacationnotice'] = ''; $refreshData = null;
$refreshData['vacationrange'] = '';
} }
$response = Api\Json\Response::get(); $response = Api\Json\Response::get();
$response->call('app.mail.mail_refreshVacationNotice',$refreshData); $response->call('app.mail.mail_refreshVacationNotice',$refreshData);