Changeset View
Changeset View
Standalone View
Standalone View
plugins/libcalendaring/libvcalendar.php
Show First 20 Lines • Show All 571 Lines • ▼ Show 20 Lines | private function _to_array($ve) | ||||
$attendee['role'] = 'ORGANIZER'; | $attendee['role'] = 'ORGANIZER'; | ||||
$attendee['status'] = 'ACCEPTED'; | $attendee['status'] = 'ACCEPTED'; | ||||
$event['organizer'] = $attendee; | $event['organizer'] = $attendee; | ||||
if (array_key_exists('schedule-agent', $attendee)) { | if (array_key_exists('schedule-agent', $attendee)) { | ||||
$schedule_agent = $attendee['schedule-agent']; | $schedule_agent = $attendee['schedule-agent']; | ||||
} | } | ||||
} | } | ||||
else if ($attendee['email'] != $event['organizer']['email']) { | else if (empty($event['organizer']) || $attendee['email'] != $event['organizer']['email']) { | ||||
$event['attendees'][] = $attendee; | $event['attendees'][] = $attendee; | ||||
} | } | ||||
break; | break; | ||||
case 'ATTACH': | case 'ATTACH': | ||||
$params = self::parameters_array($prop); | $params = self::parameters_array($prop); | ||||
if (substr($value, 0, 4) == 'http' && !strpos($value, ':attachment:')) { | if (substr($value, 0, 4) == 'http' && !strpos($value, ':attachment:')) { | ||||
$event['links'][] = $value; | $event['links'][] = $value; | ||||
▲ Show 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | class libvcalendar implements Iterator | ||||
*/ | */ | ||||
private function _apply_timezone(&$date) | private function _apply_timezone(&$date) | ||||
{ | { | ||||
if (empty($this->timezone)) { | if (empty($this->timezone)) { | ||||
return; | return; | ||||
} | } | ||||
// For date-only we'll keep the date and time intact | // For date-only we'll keep the date and time intact | ||||
if ($date->_dateonly) { | if (!empty($date->_dateonly)) { | ||||
$dt = new DateTime(null, $this->timezone); | $dt = new DateTime(null, $this->timezone); | ||||
$dt->setDate($date->format('Y'), $date->format('n'), $date->format('j')); | $dt->setDate($date->format('Y'), $date->format('n'), $date->format('j')); | ||||
$dt->setTime($date->format('G'), $date->format('i'), 0); | $dt->setTime($date->format('G'), $date->format('i'), 0); | ||||
$date = $dt; | $date = $dt; | ||||
} | } | ||||
else { | else { | ||||
$date->setTimezone($this->timezone); | $date->setTimezone($this->timezone); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 765 Lines • Show Last 20 Lines |