From: Georg Ehrke Date: Sun, 8 Apr 2012 02:54:38 +0000 (-0400) Subject: fix view of single shared events X-Git-Tag: v4.0.0beta~244^2~23 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9294a954383f06a16af921b0f390be0245f3bdb6;p=nextcloud-server.git fix view of single shared events --- diff --git a/apps/calendar/ajax/events.php b/apps/calendar/ajax/events.php index 4c011e5d764..fad1097cdce 100755 --- a/apps/calendar/ajax/events.php +++ b/apps/calendar/ajax/events.php @@ -20,7 +20,7 @@ $events = OC_Calendar_App::getrequestedEvents($_GET['calendar_id'], $start, $end $output = array(); foreach($events as $event){ $output[] = OC_Calendar_App::generateEventOutput($event, $start, $end); + } - OC_JSON::encodedPrint($output); ?> \ No newline at end of file diff --git a/apps/calendar/lib/app.php b/apps/calendar/lib/app.php index 4ea73688505..9febf389f50 100644 --- a/apps/calendar/lib/app.php +++ b/apps/calendar/lib/app.php @@ -255,7 +255,7 @@ class OC_Calendar_App{ $singleevents = OC_Calendar_Share::allSharedwithuser(OC_USER::getUser(), OC_Calendar_Share::EVENT, 1, ($_GET['calendar_id'] == 'shared_rw')?'rw':'r'); foreach($singleevents as $singleevent){ $event = OC_Calendar_Object::find($singleevent['eventid']); - $events = array_merge($events, $event); + $events[] = $event; } }else{ $calendar_id = $_GET['calendar_id']; @@ -281,7 +281,7 @@ class OC_Calendar_App{ public static function generateEventOutput($event, $start, $end){ $output = array(); - if(array_key_exists('calendardata', $event)){ + if(isset($event['calendardata'])){ $object = OC_VObject::parse($event['calendardata']); $vevent = $object->VEVENT; }else{ @@ -332,7 +332,6 @@ class OC_Calendar_App{ $output['start'] = $result->format('Y-m-d H:i:s'); $output['end'] = date('Y-m-d H:i:s', $result->format('U') + $duration); } - $output[] = $output; } }else{ if($output['allDay'] == true){ @@ -343,7 +342,7 @@ class OC_Calendar_App{ $output['start'] = $start_dt->format('Y-m-d H:i:s'); $output['end'] = $end_dt->format('Y-m-d H:i:s'); } - $output[] = $output; } + return $output; } } \ No newline at end of file