* InfoLog/CalDAV: fixed wrong timezone used for iCal generation

times where read in server-time, but infolog_ical was told it is user-time, now set to server-time in infolog_groupdav::get_handler()
This commit is contained in:
Ralf Becker 2012-03-08 18:46:43 +00:00
parent 02f43870c1
commit d88b9a8cea
2 changed files with 6 additions and 3 deletions

View File

@ -623,6 +623,7 @@ class infolog_groupdav extends groupdav_handler
private function _get_handler()
{
$handler = new infolog_ical();
$handler->tzid = false; // as we read server-time timestamps (!= null=user-time), exports UTC times
$handler->setSupportedFields('GroupDAV',$this->agent);
return $handler;

View File

@ -171,7 +171,6 @@ class infolog_ical extends infolog_bo
$vcal->setAttribute('METHOD',$_method);
$tzid = $this->tzid;
if ($tzid && $tzid != 'UTC')
{
// check if we have vtimezone component data for tzid of event, if not default to user timezone (default to server tz)
@ -312,7 +311,7 @@ class infolog_ical extends infolog_bo
}
if ($taskData['info_enddate'])
{
self::setDateOrTime($vevent, 'DUE', $taskData['info_enddate'], false); // export always as date
self::setDateOrTime($vevent, 'DUE', $taskData['info_enddate'], $tzid);
}
if ($taskData['info_datecompleted'])
{
@ -365,6 +364,7 @@ class infolog_ical extends infolog_bo
static function setDateOrTime(&$vevent, $attr, $time, $tzid)
{
$params = array();
$time_in = $time;
if ($tzid)
{
@ -395,7 +395,8 @@ class infolog_ical extends infolog_bo
$value = array(
'year' => $arr['year'],
'month' => $arr['month'],
'mday' => $arr['day']);
'mday' => $arr['day'],
);
$params['VALUE'] = 'DATE';
}
else
@ -414,6 +415,7 @@ class infolog_ical extends infolog_bo
$value = egw_time::to($time, 'ts');
}
}
//error_log(__METHOD__."(, '$attr', ".array2string($time_in).', '.array2string($tzid).') tz='.$tz->getName().', value='.array2string($value).(is_int($value)?date('Y-m-d H:i:s',$value):''));
$vevent->setAttribute($attr, $value, $params);
}