Changeset View
Changeset View
Standalone View
Standalone View
lib/kolab_sync_data_calendar.php
Show First 20 Lines • Show All 302 Lines • ▼ Show 20 Lines | public function getEntry(Syncroton_Model_SyncCollection $collection, $serverId, $as_array = false) | ||||
} | } | ||||
$att['name'] = $attendee['name'] ?: $email; | $att['name'] = $attendee['name'] ?: $email; | ||||
$type = isset($attendee['role']) ? $this->attendeeTypeMap[$attendee['role']] : null; | $type = isset($attendee['role']) ? $this->attendeeTypeMap[$attendee['role']] : null; | ||||
$status = isset($attendee['status']) ? $this->attendeeStatusMap[$attendee['status']] : null; | $status = isset($attendee['status']) ? $this->attendeeStatusMap[$attendee['status']] : null; | ||||
if ($this->asversion >= 12) { | if ($this->asversion >= 12) { | ||||
if (isset($attendee['cutype']) && strtolower($attendee['cutype']) == 'resource') { | |||||
$att['attendeeType'] = self::ATTENDEE_TYPE_RESOURCE; | |||||
} else { | |||||
$att['attendeeType'] = $type ?: self::ATTENDEE_TYPE_REQUIRED; | $att['attendeeType'] = $type ?: self::ATTENDEE_TYPE_REQUIRED; | ||||
} | |||||
machniak: Make sure `$attendee['cutype']` is set. | |||||
$att['attendeeStatus'] = $status ?: self::ATTENDEE_STATUS_UNKNOWN; | $att['attendeeStatus'] = $status ?: self::ATTENDEE_STATUS_UNKNOWN; | ||||
} | } | ||||
if ($email && in_array_nocase($email, $user_emails)) { | if ($email && in_array_nocase($email, $user_emails)) { | ||||
$user_rsvp = !empty($attendee['rsvp']); | $user_rsvp = !empty($attendee['rsvp']); | ||||
$resp_type = $status ?: self::ATTENDEE_STATUS_UNKNOWN; | $resp_type = $status ?: self::ATTENDEE_STATUS_UNKNOWN; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 178 Lines • ▼ Show 20 Lines | public function toKolab(Syncroton_Model_IEntry $data, $folderid, $entry = null, $timezone = null) | ||||
} | } | ||||
$_attendee = array( | $_attendee = array( | ||||
'role' => $role, | 'role' => $role, | ||||
'name' => $attendee->name != $attendee->email ? $attendee->name : '', | 'name' => $attendee->name != $attendee->email ? $attendee->name : '', | ||||
'email' => $attendee->email, | 'email' => $attendee->email, | ||||
); | ); | ||||
if (isset($attendee->attendeeType) && $attendee->attendeeType == self::ATTENDEE_TYPE_RESOURCE) { | |||||
$_attendee['cutype'] = 'RESOURCE'; | |||||
} | |||||
if (isset($attendee->attendeeStatus)) { | if (isset($attendee->attendeeStatus)) { | ||||
$_attendee['status'] = $attendee->attendeeStatus ? array_search($attendee->attendeeStatus, $this->attendeeStatusMap) : null; | $_attendee['status'] = $attendee->attendeeStatus ? array_search($attendee->attendeeStatus, $this->attendeeStatusMap) : null; | ||||
if (!$_attendee['status']) { | if (!$_attendee['status']) { | ||||
$_attendee['status'] = 'NEEDS-ACTION'; | $_attendee['status'] = 'NEEDS-ACTION'; | ||||
$_attendee['rsvp'] = true; | $_attendee['rsvp'] = true; | ||||
} | } | ||||
} | } | ||||
else if (!empty($event['attendees']) && !empty($attendee->email)) { | else if (!empty($event['attendees']) && !empty($attendee->email)) { | ||||
▲ Show 20 Lines • Show All 582 Lines • Show Last 20 Lines |
Make sure $attendee['cutype'] is set.