<?php /** * Copyright (c) 2011 Bart Visscher <*****@*****.**> * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. */ require_once '../../../lib/base.php'; $l10n = new OC_L10N('calendar'); if (!OC_USER::isLoggedIn()) { die('<script type="text/javascript">document.location = oc_webroot;</script>'); } OC_JSON::checkAppEnabled('calendar'); $calendar_options = OC_Calendar_Calendar::allCalendars(OC_User::getUser()); $category_options = OC_Calendar_Object::getCategoryOptions($l10n); $repeat_options = OC_Calendar_Object::getRepeatOptions($l10n); $id = $_GET['id']; $data = OC_Calendar_Object::find($id); $calendar = OC_Calendar_Calendar::findCalendar($data['calendarid']); if ($calendar['userid'] != OC_User::getUser()) { echo $l10n->t('Wrong calendar'); exit; } $object = Sabre_VObject_Reader::read($data['calendardata']); $vevent = $object->VEVENT; $dtstart = $vevent->DTSTART; $dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent); switch ($dtstart->getDateType()) { case Sabre_VObject_Element_DateTime::LOCALTZ: case Sabre_VObject_Element_DateTime::LOCAL: