diff options
Diffstat (limited to 'apps/calendar/lib/app.php')
-rw-r--r-- | apps/calendar/lib/app.php | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/apps/calendar/lib/app.php b/apps/calendar/lib/app.php index 2cd28c0f782..e04f2ed0cdf 100644 --- a/apps/calendar/lib/app.php +++ b/apps/calendar/lib/app.php @@ -331,26 +331,29 @@ class OC_Calendar_App{ */ public static function getrequestedEvents($calendarid, $start, $end){ $events = array(); - if($calendarid == 'shared_rw' || $_GET['calendar_id'] == 'shared_r'){ + if($calendarid == 'shared_rw' || $calendarid == 'shared_r'){ $calendars = OC_Calendar_Share::allSharedwithuser(OCP\USER::getUser(), OC_Calendar_Share::CALENDAR, 1, ($_GET['calendar_id'] == 'shared_rw')?'rw':'r'); foreach($calendars as $calendar){ $calendarevents = OC_Calendar_Object::allInPeriod($calendar['calendarid'], $start, $end); + foreach($calendarevents as $event){ + $event['summary'] .= ' (' . self::$l10n->t('by') . ' ' . OC_Calendar_Object::getowner($event['id']) . ')'; + } $events = array_merge($events, $calendarevents); } $singleevents = OC_Calendar_Share::allSharedwithuser(OCP\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']); + $event['summary'] .= ' (' . self::$l10n->t('by') . ' ' . OC_Calendar_Object::getowner($event['id']) . ')'; $events[] = $event; } }else{ - $calendar_id = $_GET['calendar_id']; - if (is_numeric($calendar_id)) { - $calendar = self::getCalendar($calendar_id); + if (is_numeric($calendarid)) { + $calendar = self::getCalendar($calendarid); OCP\Response::enableCaching(0); OCP\Response::setETagHeader($calendar['ctag']); - $events = OC_Calendar_Object::allInPeriod($calendar_id, $start, $end); + $events = OC_Calendar_Object::allInPeriod($calendarid, $start, $end); } else { - OCP\Util::emitHook('OC_Calendar', 'getEvents', array('calendar_id' => $calendar_id, 'events' => &$events)); + OCP\Util::emitHook('OC_Calendar', 'getEvents', array('calendar_id' => $calendarid, 'events' => &$events)); } } return $events; @@ -377,8 +380,8 @@ class OC_Calendar_App{ $lastmodified = ($last_modified)?$last_modified->getDateTime()->format('U'):0; $output = array('id'=>(int)$event['id'], - 'title' => htmlspecialchars(($event['summary']!=NULL || $event['summary'] != '')?$event['summary']: self::$l10n->t('unnamed')), - 'description' => isset($vevent->DESCRIPTION)?htmlspecialchars($vevent->DESCRIPTION->value):'', + 'title' => ($event['summary']!=NULL || $event['summary'] != '')?$event['summary']: self::$l10n->t('unnamed'), + 'description' => isset($vevent->DESCRIPTION)?$vevent->DESCRIPTION->value:'', 'lastmodified'=>$lastmodified); $dtstart = $vevent->DTSTART; |