Changeset View
Changeset View
Standalone View
Standalone View
lib/kolab_sync_data_calendar.php
Show First 20 Lines • Show All 179 Lines • ▼ Show 20 Lines | // 'CHAIR' => self::ATTENDEE_TYPE_RESOURCE, | ||||
* @return array|Syncroton_Model_Event|array Event object | * @return array|Syncroton_Model_Event|array Event object | ||||
*/ | */ | ||||
public function getEntry(Syncroton_Model_SyncCollection $collection, $serverId, $as_array = false) | public function getEntry(Syncroton_Model_SyncCollection $collection, $serverId, $as_array = false) | ||||
{ | { | ||||
$event = is_array($serverId) ? $serverId : $this->getObject($collection->collectionId, $serverId); | $event = is_array($serverId) ? $serverId : $this->getObject($collection->collectionId, $serverId); | ||||
$config = $this->getFolderConfig($event['_mailbox']); | $config = $this->getFolderConfig($event['_mailbox']); | ||||
$result = array(); | $result = array(); | ||||
// Timezone | |||||
// 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) { | $result['timezone'] = kolab_sync_timezone_converter::encodeTimezoneFromDate($event['start']); | ||||
$timezone = $event['start']->getTimezone(); | |||||
if ($timezone && ($tz_name = $timezone->getName()) != 'UTC') { | |||||
$tzc = kolab_sync_timezone_converter::getInstance(); | |||||
if ($tz_name = $tzc->encodeTimezone($tz_name, $event['start']->format('Y-m-d'))) { | |||||
$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); | ||||
switch ($name) { | switch ($name) { | ||||
case 'changed': | case 'changed': | ||||
case 'end': | case 'end': | ||||
▲ Show 20 Lines • Show All 908 Lines • Show Last 20 Lines |