summaryrefslogtreecommitdiffstats
path: root/apps/calendar/ajax/event
diff options
context:
space:
mode:
Diffstat (limited to 'apps/calendar/ajax/event')
-rw-r--r--apps/calendar/ajax/event/delete.php21
-rw-r--r--apps/calendar/ajax/event/edit.form.php272
-rw-r--r--apps/calendar/ajax/event/edit.php46
-rw-r--r--apps/calendar/ajax/event/move.php47
-rw-r--r--apps/calendar/ajax/event/new.form.php75
-rw-r--r--apps/calendar/ajax/event/new.php25
-rw-r--r--apps/calendar/ajax/event/resize.php39
7 files changed, 0 insertions, 525 deletions
diff --git a/apps/calendar/ajax/event/delete.php b/apps/calendar/ajax/event/delete.php
deleted file mode 100644
index 17e45c001e8..00000000000
--- a/apps/calendar/ajax/event/delete.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-/**
- * Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-
-OCP\JSON::checkLoggedIn();
-OCP\JSON::checkAppEnabled('calendar');
-OCP\JSON::callCheck();
-
-$id = $_POST['id'];
-$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);
-if($access != 'owner' && $access != 'rw'){
- OCP\JSON::error(array('message'=>'permission denied'));
- exit;
-}
-$result = OC_Calendar_Object::delete($id);
-OCP\JSON::success(); \ No newline at end of file
diff --git a/apps/calendar/ajax/event/edit.form.php b/apps/calendar/ajax/event/edit.form.php
deleted file mode 100644
index 27512481538..00000000000
--- a/apps/calendar/ajax/event/edit.form.php
+++ /dev/null
@@ -1,272 +0,0 @@
-<?php
-/**
- * Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-
-
-if(!OCP\User::isLoggedIn()) {
- die('<script type="text/javascript">document.location = oc_webroot;</script>');
-}
-OCP\JSON::checkAppEnabled('calendar');
-
-$id = $_POST['id'];
-$data = OC_Calendar_App::getEventObject($id, true, true);
-
-if(!$data){
- OCP\JSON::error(array('data' => array('message' => self::$l10n->t('Wrong calendar'))));
- exit;
-}
-$access = OC_Calendar_App::getaccess($id, OC_Calendar_Share::EVENT);
-$object = OC_VObject::parse($data['calendardata']);
-$vevent = $object->VEVENT;
-
-$dtstart = $vevent->DTSTART;
-$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
-switch($dtstart->getDateType()) {
- case Sabre_VObject_Property_DateTime::UTC:
- $timeOffset = $_SESSION['timezone']*60;
- $newDT = $dtstart->getDateTime();
- $newDT->add(new DateInterval("PT" . $timeOffset . "M"));
- $dtstart->setDateTime($newDT);
- $newDT = $dtend->getDateTime();
- $newDT->add(new DateInterval("PT" . $timeOffset . "M"));
- $dtend->setDateTime($newDT);
- case Sabre_VObject_Property_DateTime::LOCALTZ:
- case Sabre_VObject_Property_DateTime::LOCAL:
- $startdate = $dtstart->getDateTime()->format('d-m-Y');
- $starttime = $dtstart->getDateTime()->format('H:i');
- $enddate = $dtend->getDateTime()->format('d-m-Y');
- $endtime = $dtend->getDateTime()->format('H:i');
- $allday = false;
- break;
- case Sabre_VObject_Property_DateTime::DATE:
- $startdate = $dtstart->getDateTime()->format('d-m-Y');
- $starttime = '';
- $dtend->getDateTime()->modify('-1 day');
- $enddate = $dtend->getDateTime()->format('d-m-Y');
- $endtime = '';
- $allday = true;
- break;
-}
-
-$summary = $vevent->getAsString('SUMMARY');
-$location = $vevent->getAsString('LOCATION');
-$categories = $vevent->getAsString('CATEGORIES');
-$description = $vevent->getAsString('DESCRIPTION');
-$last_modified = $vevent->__get('LAST-MODIFIED');
-if ($last_modified){
- $lastmodified = $last_modified->getDateTime()->format('U');
-}else{
- $lastmodified = 0;
-}
-if($data['repeating'] == 1){
- $rrule = explode(';', $vevent->getAsString('RRULE'));
- $rrulearr = array();
- foreach($rrule as $rule){
- list($attr, $val) = explode('=', $rule);
- $rrulearr[$attr] = $val;
- }
- if(!isset($rrulearr['INTERVAL']) || $rrulearr['INTERVAL'] == ''){
- $rrulearr['INTERVAL'] = 1;
- }
- if(array_key_exists('BYDAY', $rrulearr)){
- if(substr_count($rrulearr['BYDAY'], ',') == 0){
- if(strlen($rrulearr['BYDAY']) == 2){
- $repeat['weekdays'] = array($rrulearr['BYDAY']);
- }elseif(strlen($rrulearr['BYDAY']) == 3){
- $repeat['weekofmonth'] = substr($rrulearr['BYDAY'], 0, 1);
- $repeat['weekdays'] = array(substr($rrulearr['BYDAY'], 1, 2));
- }elseif(strlen($rrulearr['BYDAY']) == 4){
- $repeat['weekofmonth'] = substr($rrulearr['BYDAY'], 0, 2);
- $repeat['weekdays'] = array(substr($rrulearr['BYDAY'], 2, 2));
- }
- }else{
- $byday_days = explode(',', $rrulearr['BYDAY']);
- foreach($byday_days as $byday_day){
- if(strlen($byday_day) == 2){
- $repeat['weekdays'][] = $byday_day;
- }elseif(strlen($byday_day) == 3){
- $repeat['weekofmonth'] = substr($byday_day , 0, 1);
- $repeat['weekdays'][] = substr($byday_day , 1, 2);
- }elseif(strlen($byday_day) == 4){
- $repeat['weekofmonth'] = substr($byday_day , 0, 2);
- $repeat['weekdays'][] = substr($byday_day , 2, 2);
- }
- }
- }
- }
- if(array_key_exists('BYMONTHDAY', $rrulearr)){
- if(substr_count($rrulearr['BYMONTHDAY'], ',') == 0){
- $repeat['bymonthday'][] = $rrulearr['BYMONTHDAY'];
- }else{
- $bymonthdays = explode(',', $rrulearr['BYMONTHDAY']);
- foreach($bymonthdays as $bymonthday){
- $repeat['bymonthday'][] = $bymonthday;
- }
- }
- }
- if(array_key_exists('BYYEARDAY', $rrulearr)){
- if(substr_count($rrulearr['BYYEARDAY'], ',') == 0){
- $repeat['byyearday'][] = $rrulearr['BYYEARDAY'];
- }else{
- $byyeardays = explode(',', $rrulearr['BYYEARDAY']);
- foreach($byyeardays as $yearday){
- $repeat['byyearday'][] = $yearday;
- }
- }
- }
- if(array_key_exists('BYWEEKNO', $rrulearr)){
- if(substr_count($rrulearr['BYWEEKNO'], ',') == 0){
- $repeat['byweekno'][] = (string) $rrulearr['BYWEEKNO'];
- }else{
- $byweekno = explode(',', $rrulearr['BYWEEKNO']);
- foreach($byweekno as $weekno){
- $repeat['byweekno'][] = (string) $weekno;
- }
- }
- }
- if(array_key_exists('BYMONTH', $rrulearr)){
- $months = OC_Calendar_App::getByMonthOptions();
- if(substr_count($rrulearr['BYMONTH'], ',') == 0){
- $repeat['bymonth'][] = $months[$month];
- }else{
- $bymonth = explode(',', $rrulearr['BYMONTH']);
- foreach($bymonth as $month){
- $repeat['bymonth'][] = $months[$month];
- }
- }
- }
- switch($rrulearr['FREQ']){
- case 'DAILY':
- $repeat['repeat'] = 'daily';
- break;
- case 'WEEKLY':
- if($rrulearr['INTERVAL'] % 2 == 0){
- $repeat['repeat'] = 'biweekly';
- $rrulearr['INTERVAL'] = $rrulearr['INTERVAL'] / 2;
- }elseif($rrulearr['BYDAY'] == 'MO,TU,WE,TH,FR'){
- $repeat['repeat'] = 'weekday';
- }else{
- $repeat['repeat'] = 'weekly';
- }
- break;
- case 'MONTHLY':
- $repeat['repeat'] = 'monthly';
- if(array_key_exists('BYDAY', $rrulearr)){
- $repeat['month'] = 'weekday';
- }else{
- $repeat['month'] = 'monthday';
- }
- break;
- case 'YEARLY':
- $repeat['repeat'] = 'yearly';
- if(array_key_exists('BYMONTH', $rrulearr)){
- $repeat['year'] = 'bydaymonth';
- }elseif(array_key_exists('BYWEEKNO', $rrulearr)){
- $repeat['year'] = 'byweekno';
- }else{
- $repeat['year'] = 'byyearday';
- }
- }
- $repeat['interval'] = $rrulearr['INTERVAL'];
- if(array_key_exists('COUNT', $rrulearr)){
- $repeat['end'] = 'count';
- $repeat['count'] = $rrulearr['COUNT'];
- }elseif(array_key_exists('UNTIL', $rrulearr)){
- $repeat['end'] = 'date';
- $endbydate_day = substr($rrulearr['UNTIL'], 6, 2);
- $endbydate_month = substr($rrulearr['UNTIL'], 4, 2);
- $endbydate_year = substr($rrulearr['UNTIL'], 0, 4);
- $repeat['date'] = $endbydate_day . '-' . $endbydate_month . '-' . $endbydate_year;
- }else{
- $repeat['end'] = 'never';
- }
- if(array_key_exists('weekdays', $repeat)){
- $repeat_weekdays_ = array();
- $days = OC_Calendar_App::getWeeklyOptions();
- foreach($repeat['weekdays'] as $weekday){
- $repeat_weekdays_[] = $days[$weekday];
- }
- $repeat['weekdays'] = $repeat_weekdays_;
- }
-}else{
- $repeat['repeat'] = 'doesnotrepeat';
-}
-if($access == 'owner'){
- $calendar_options = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser());
-}else{
- $calendar_options = array(OC_Calendar_App::getCalendar($data['calendarid'], false));
-}
-$category_options = OC_Calendar_App::getCategoryOptions();
-$repeat_options = OC_Calendar_App::getRepeatOptions();
-$repeat_end_options = OC_Calendar_App::getEndOptions();
-$repeat_month_options = OC_Calendar_App::getMonthOptions();
-$repeat_year_options = OC_Calendar_App::getYearOptions();
-$repeat_weekly_options = OC_Calendar_App::getWeeklyOptions();
-$repeat_weekofmonth_options = OC_Calendar_App::getWeekofMonth();
-$repeat_byyearday_options = OC_Calendar_App::getByYearDayOptions();
-$repeat_bymonth_options = OC_Calendar_App::getByMonthOptions();
-$repeat_byweekno_options = OC_Calendar_App::getByWeekNoOptions();
-$repeat_bymonthday_options = OC_Calendar_App::getByMonthDayOptions();
-
-if($access == 'owner' || $access == 'rw'){
- $tmpl = new OCP\Template('calendar', 'part.editevent');
-}elseif($access == 'r'){
- $tmpl = new OCP\Template('calendar', 'part.showevent');
-}
-
-$tmpl->assign('eventid', $id);
-$tmpl->assign('access', $access);
-$tmpl->assign('lastmodified', $lastmodified);
-$tmpl->assign('calendar_options', $calendar_options);
-$tmpl->assign('repeat_options', $repeat_options);
-$tmpl->assign('repeat_month_options', $repeat_month_options);
-$tmpl->assign('repeat_weekly_options', $repeat_weekly_options);
-$tmpl->assign('repeat_end_options', $repeat_end_options);
-$tmpl->assign('repeat_year_options', $repeat_year_options);
-$tmpl->assign('repeat_byyearday_options', $repeat_byyearday_options);
-$tmpl->assign('repeat_bymonth_options', $repeat_bymonth_options);
-$tmpl->assign('repeat_byweekno_options', $repeat_byweekno_options);
-$tmpl->assign('repeat_bymonthday_options', $repeat_bymonthday_options);
-$tmpl->assign('repeat_weekofmonth_options', $repeat_weekofmonth_options);
-
-$tmpl->assign('title', $summary);
-$tmpl->assign('location', $location);
-$tmpl->assign('categories', $categories);
-$tmpl->assign('calendar', $data['calendarid']);
-$tmpl->assign('allday', $allday);
-$tmpl->assign('startdate', $startdate);
-$tmpl->assign('starttime', $starttime);
-$tmpl->assign('enddate', $enddate);
-$tmpl->assign('endtime', $endtime);
-$tmpl->assign('description', $description);
-
-$tmpl->assign('repeat', $repeat['repeat']);
-if($repeat['repeat'] != 'doesnotrepeat'){
- $tmpl->assign('repeat_month', $repeat['month']);
- $tmpl->assign('repeat_weekdays', $repeat['weekdays']);
- $tmpl->assign('repeat_interval', $repeat['interval']);
- $tmpl->assign('repeat_end', $repeat['end']);
- $tmpl->assign('repeat_count', $repeat['count']);
- $tmpl->assign('repeat_weekofmonth', $repeat['weekofmonth']);
- $tmpl->assign('repeat_date', $repeat['date']);
- $tmpl->assign('repeat_year', $repeat['year']);
- $tmpl->assign('repeat_byyearday', $repeat['byyearday']);
- $tmpl->assign('repeat_bymonthday', $repeat['bymonthday']);
- $tmpl->assign('repeat_bymonth', $repeat['bymonth']);
- $tmpl->assign('repeat_byweekno', $repeat['byweekno']);
-} else {
- $tmpl->assign('repeat_month', 'monthday');
- $tmpl->assign('repeat_weekdays', array());
- $tmpl->assign('repeat_interval', 1);
- $tmpl->assign('repeat_end', 'never');
- $tmpl->assign('repeat_count', '10');
- $tmpl->assign('repeat_weekofmonth', 'auto');
- $tmpl->assign('repeat_date', '');
- $tmpl->assign('repeat_year', 'bydate');
-}
-$tmpl->printpage();
diff --git a/apps/calendar/ajax/event/edit.php b/apps/calendar/ajax/event/edit.php
deleted file mode 100644
index db78bf6e5e0..00000000000
--- a/apps/calendar/ajax/event/edit.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-/**
- * Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-
-OCP\JSON::checkLoggedIn();
-OCP\JSON::checkAppEnabled('calendar');
-OCP\JSON::callCheck();
-
-$id = $_POST['id'];
-
-if(!array_key_exists('calendar', $_POST)){
- $cal = OC_Calendar_Object::getCalendarid($id);
- $_POST['calendar'] = $cal;
-}else{
- $cal = $_POST['calendar'];
-}
-
-$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);
-if($access != 'owner' && $access != 'rw'){
- OCP\JSON::error(array('message'=>'permission denied'));
- exit;
-}
-
-$errarr = OC_Calendar_Object::validateRequest($_POST);
-if($errarr){
- //show validate errors
- OCP\JSON::error($errarr);
- exit;
-}else{
- $data = OC_Calendar_App::getEventObject($id, false, false);
- $vcalendar = OC_VObject::parse($data['calendardata']);
-
- OC_Calendar_App::isNotModified($vcalendar->VEVENT, $_POST['lastmodified']);
- OC_Calendar_Object::updateVCalendarFromRequest($_POST, $vcalendar);
-
- OC_Calendar_Object::edit($id, $vcalendar->serialize());
- if ($data['calendarid'] != $cal) {
- OC_Calendar_Object::moveToCalendar($id, $cal);
- }
- OCP\JSON::success();
-} \ No newline at end of file
diff --git a/apps/calendar/ajax/event/move.php b/apps/calendar/ajax/event/move.php
deleted file mode 100644
index f4e2b36376d..00000000000
--- a/apps/calendar/ajax/event/move.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-/**
- * Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-OCP\JSON::checkLoggedIn();
-OCP\JSON::callCheck();
-
-$id = $_POST['id'];
-$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);
-if($access != 'owner' && $access != 'rw'){
- OCP\JSON::error(array('message'=>'permission denied'));
- exit;
-}
-$vcalendar = OC_Calendar_App::getVCalendar($id, false, false);
-$vevent = $vcalendar->VEVENT;
-
-$allday = $_POST['allDay'];
-$delta = new DateInterval('P0D');
-$delta->d = $_POST['dayDelta'];
-$delta->i = $_POST['minuteDelta'];
-OC_Calendar_App::isNotModified($vevent, $_POST['lastmodified']);
-
-$dtstart = $vevent->DTSTART;
-$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
-$start_type = $dtstart->getDateType();
-$end_type = $dtend->getDateType();
-if ($allday && $start_type != Sabre_VObject_Property_DateTime::DATE){
- $start_type = $end_type = Sabre_VObject_Property_DateTime::DATE;
- $dtend->setDateTime($dtend->getDateTime()->modify('+1 day'), $end_type);
-}
-if (!$allday && $start_type == Sabre_VObject_Property_DateTime::DATE){
- $start_type = $end_type = Sabre_VObject_Property_DateTime::LOCALTZ;
-}
-$dtstart->setDateTime($dtstart->getDateTime()->add($delta), $start_type);
-$dtend->setDateTime($dtend->getDateTime()->add($delta), $end_type);
-unset($vevent->DURATION);
-
-$vevent->setDateTime('LAST-MODIFIED', 'now', Sabre_VObject_Property_DateTime::UTC);
-$vevent->setDateTime('DTSTAMP', 'now', Sabre_VObject_Property_DateTime::UTC);
-
-$result = OC_Calendar_Object::edit($id, $vcalendar->serialize());
-$lastmodified = $vevent->__get('LAST-MODIFIED')->getDateTime();
-OCP\JSON::success(array('lastmodified'=>(int)$lastmodified->format('U'))); \ No newline at end of file
diff --git a/apps/calendar/ajax/event/new.form.php b/apps/calendar/ajax/event/new.form.php
deleted file mode 100644
index db04cdf2d49..00000000000
--- a/apps/calendar/ajax/event/new.form.php
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-/**
- * Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-
-
-if(!OCP\User::isLoggedIn()) {
- die('<script type="text/javascript">document.location = oc_webroot;</script>');
-}
-OCP\JSON::checkAppEnabled('calendar');
-
-if (!isset($_POST['start'])){
- OCP\JSON::error();
- die;
-}
-$start = $_POST['start'];
-$end = $_POST['end'];
-$allday = $_POST['allday'];
-
-if (!$end){
- $duration = OCP\Config::getUserValue( OCP\USER::getUser(), 'calendar', 'duration', '60');
- $end = $start + ($duration * 60);
-}
-$start = new DateTime('@'.$start);
-$end = new DateTime('@'.$end);
-$timezone = OC_Calendar_App::getTimezone();
-$start->setTimezone(new DateTimeZone($timezone));
-$end->setTimezone(new DateTimeZone($timezone));
-
-$calendar_options = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser());
-$repeat_options = OC_Calendar_App::getRepeatOptions();
-$repeat_end_options = OC_Calendar_App::getEndOptions();
-$repeat_month_options = OC_Calendar_App::getMonthOptions();
-$repeat_year_options = OC_Calendar_App::getYearOptions();
-$repeat_weekly_options = OC_Calendar_App::getWeeklyOptions();
-$repeat_weekofmonth_options = OC_Calendar_App::getWeekofMonth();
-$repeat_byyearday_options = OC_Calendar_App::getByYearDayOptions();
-$repeat_bymonth_options = OC_Calendar_App::getByMonthOptions();
-$repeat_byweekno_options = OC_Calendar_App::getByWeekNoOptions();
-$repeat_bymonthday_options = OC_Calendar_App::getByMonthDayOptions();
-
-$tmpl = new OCP\Template('calendar', 'part.newevent');
-$tmpl->assign('access', 'owner');
-$tmpl->assign('calendar_options', $calendar_options);
-$tmpl->assign('repeat_options', $repeat_options);
-$tmpl->assign('repeat_month_options', $repeat_month_options);
-$tmpl->assign('repeat_weekly_options', $repeat_weekly_options);
-$tmpl->assign('repeat_end_options', $repeat_end_options);
-$tmpl->assign('repeat_year_options', $repeat_year_options);
-$tmpl->assign('repeat_byyearday_options', $repeat_byyearday_options);
-$tmpl->assign('repeat_bymonth_options', $repeat_bymonth_options);
-$tmpl->assign('repeat_byweekno_options', $repeat_byweekno_options);
-$tmpl->assign('repeat_bymonthday_options', $repeat_bymonthday_options);
-$tmpl->assign('repeat_weekofmonth_options', $repeat_weekofmonth_options);
-
-$tmpl->assign('eventid', 'new');
-$tmpl->assign('startdate', $start->format('d-m-Y'));
-$tmpl->assign('starttime', $start->format('H:i'));
-$tmpl->assign('enddate', $end->format('d-m-Y'));
-$tmpl->assign('endtime', $end->format('H:i'));
-$tmpl->assign('allday', $allday);
-$tmpl->assign('repeat', 'doesnotrepeat');
-$tmpl->assign('repeat_month', 'monthday');
-$tmpl->assign('repeat_weekdays', array());
-$tmpl->assign('repeat_interval', 1);
-$tmpl->assign('repeat_end', 'never');
-$tmpl->assign('repeat_count', '10');
-$tmpl->assign('repeat_weekofmonth', 'auto');
-$tmpl->assign('repeat_date', '');
-$tmpl->assign('repeat_year', 'bydate');
-$tmpl->printpage(); \ No newline at end of file
diff --git a/apps/calendar/ajax/event/new.php b/apps/calendar/ajax/event/new.php
deleted file mode 100644
index bc0439cc315..00000000000
--- a/apps/calendar/ajax/event/new.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-/**
- * Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-
-
-OCP\JSON::checkLoggedIn();
-OCP\JSON::checkAppEnabled('calendar');
-OCP\JSON::callCheck();
-
-$errarr = OC_Calendar_Object::validateRequest($_POST);
-if($errarr){
- //show validate errors
- OCP\JSON::error($errarr);
- exit;
-}else{
- $cal = $_POST['calendar'];
- $vcalendar = OC_Calendar_Object::createVCalendarFromRequest($_POST);
- $result = OC_Calendar_Object::add($cal, $vcalendar->serialize());
- OCP\JSON::success();
-} \ No newline at end of file
diff --git a/apps/calendar/ajax/event/resize.php b/apps/calendar/ajax/event/resize.php
deleted file mode 100644
index 15b687b55da..00000000000
--- a/apps/calendar/ajax/event/resize.php
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-/**
- * Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-OCP\JSON::checkLoggedIn();
-OCP\JSON::callCheck();
-
-$id = $_POST['id'];
-
-$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);
-if($access != 'owner' && $access != 'rw'){
- OCP\JSON::error(array('message'=>'permission denied'));
- exit;
-}
-
-$vcalendar = OC_Calendar_App::getVCalendar($id, false, false);
-$vevent = $vcalendar->VEVENT;
-
-$delta = new DateInterval('P0D');
-$delta->d = $_POST['dayDelta'];
-$delta->i = $_POST['minuteDelta'];
-
-OC_Calendar_App::isNotModified($vevent, $_POST['lastmodified']);
-
-$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
-$end_type = $dtend->getDateType();
-$dtend->setDateTime($dtend->getDateTime()->add($delta), $end_type);
-unset($vevent->DURATION);
-
-$vevent->setDateTime('LAST-MODIFIED', 'now', Sabre_VObject_Property_DateTime::UTC);
-$vevent->setDateTime('DTSTAMP', 'now', Sabre_VObject_Property_DateTime::UTC);
-
-OC_Calendar_Object::edit($id, $vcalendar->serialize());
-$lastmodified = $vevent->__get('LAST-MODIFIED')->getDateTime();
-OCP\JSON::success(array('lastmodified'=>(int)$lastmodified->format('U'))); \ No newline at end of file