Changeset View
Changeset View
Standalone View
Standalone View
lib/kolab_sync_data_calendar.php
Show First 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | public function getEntry(Syncroton_Model_SyncCollection $collection, $serverId, $as_array = false) | ||||
// Kolab Format 3.0 and xCal does support timezone per-date, but ActiveSync allows | // Kolab Format 3.0 and xCal does support timezone per-date, but ActiveSync allows | ||||
// only one timezone per-event. We'll use timezone of the start date | // only one timezone per-event. We'll use timezone of the start date | ||||
if ($event['start'] instanceof DateTime) { | if ($event['start'] instanceof DateTime) { | ||||
$timezone = $event['start']->getTimezone(); | $timezone = $event['start']->getTimezone(); | ||||
if ($timezone && ($tz_name = $timezone->getName()) != 'UTC') { | if ($timezone && ($tz_name = $timezone->getName()) != 'UTC') { | ||||
$tzc = kolab_sync_timezone_converter::getInstance(); | $tzc = kolab_sync_timezone_converter::getInstance(); | ||||
if ($tz_name = $tzc->encodeTimezone($tz_name)) { | if ($tz_name = $tzc->encodeTimezone($tz_name, $event['start']->format('Y-m-d'))) { | ||||
$result['timezone'] = $tz_name; | $result['timezone'] = $tz_name; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
// Calendar namespace fields | // Calendar namespace fields | ||||
foreach ($this->mapping as $key => $name) { | foreach ($this->mapping as $key => $name) { | ||||
$value = $this->getKolabDataItem($event, $name); | $value = $this->getKolabDataItem($event, $name); | ||||
▲ Show 20 Lines • Show All 898 Lines • Show Last 20 Lines |