Enforce configured device timezone during import

This commit is contained in:
Jörg Lehrke 2009-11-27 06:47:21 +00:00
parent 43c5373b4d
commit 3d93128777

View File

@ -126,7 +126,7 @@ class calendar_ical extends calendar_boupdate
*
* @var boolean
*/
var $log = false;
var $log = true;
var $logfile="/tmp/log-vcal";
@ -1476,9 +1476,15 @@ class calendar_ical extends calendar_boupdate
$dtstart_ts = is_numeric($attributes['value']) ? $attributes['value'] : $this->date2ts($attributes['value']);
$vcardData['start'] = $dtstart_ts;
// import TZID, if PHP understands it (we only care about TZID of starttime, as we store only a TZID for the whole event)
if (!empty($attributes['params']['TZID']))
if ($this->tzid)
{
// enforce device settings
$event['tzid'] = $this->tzid;
}
elseif (!empty($attributes['params']['TZID']))
{
// import TZID, if PHP understands it (we only care about TZID of starttime, as we store only a TZID for the whole event)
try
{
$tz = calendar_timezones::DateTimeZone($attributes['params']['TZID']);
@ -1490,10 +1496,6 @@ class calendar_ical extends calendar_boupdate
$event['tzid'] = egw_time::$user_timezone->getName(); // default to user timezone
}
}
elseif ($this->tzid)
{
$event['tzid'] = $this->tzid;
}
else
{
$event['tzid'] = egw_time::$user_timezone->getName(); // default to user timezone