|
|
|
|
@ -368,12 +368,14 @@ class OC_Calendar_App{
|
|
|
|
|
* @return (array) $output - readable output
|
|
|
|
|
*/
|
|
|
|
|
public static function generateEventOutput($event, $start, $end){
|
|
|
|
|
if(isset($event['calendardata'])){
|
|
|
|
|
$object = OC_VObject::parse($event['calendardata']);
|
|
|
|
|
$vevent = $object->VEVENT;
|
|
|
|
|
}else{
|
|
|
|
|
$vevent = $event['vevent'];
|
|
|
|
|
if(!isset($event['calendardata']) && !isset($event['vevent'])){
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if(!isset($event['calendardata']) && isset($event['vevent'])){
|
|
|
|
|
$event['calendardata'] = "BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:ownCloud's Internal iCal System\n" . $event['vevent']->serialize() . "END:VCALENDAR";
|
|
|
|
|
}
|
|
|
|
|
$object = OC_VObject::parse($event['calendardata']);
|
|
|
|
|
$vevent = $object->VEVENT;
|
|
|
|
|
$return = array();
|
|
|
|
|
$id = $event['id'];
|
|
|
|
|
$allday = ($vevent->DTSTART->getDateType() == Sabre_VObject_Element_DateTime::DATE)?true:false;
|
|
|
|
|
@ -404,15 +406,13 @@ class OC_Calendar_App{
|
|
|
|
|
$return[] = array_merge($staticoutput, $dynamicoutput);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
if(OC_Calendar_Object::isrepeating($id)){
|
|
|
|
|
$object->expand($start, $end);
|
|
|
|
|
}
|
|
|
|
|
$object->expand($start, $end);
|
|
|
|
|
foreach($object->getComponents() as $singleevent){
|
|
|
|
|
if(!($singleevent instanceof Sabre_VObject_Component_VEvent)){
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
$dynamicoutput = OC_Calendar_Object::generateStartEndDate($singleevent->DTSTART, OC_Calendar_Object::getDTEndFromVEvent($singleevent), $allday, self::$tz);
|
|
|
|
|
$return[] = array_merge($staticoutput, $dynamicoutput);
|
|
|
|
|
$return[] = array_merge($staticoutput, $dynamicoutput);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return $return;
|
|
|
|
|
|