summaryrefslogtreecommitdiffstats
path: root/apps/tasks/ajax
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-08-26 17:30:07 +0200
committerFrank Karlitschek <frank@owncloud.org>2012-08-26 17:30:07 +0200
commit72e9a2ce57ee88503db83614cec5ccda71f0b58e (patch)
tree8bc301ca22d9ca08ea54426bcb61f62bd1c1cb75 /apps/tasks/ajax
parent32bad688bdb4fea55eba9d4255fc55f1c60a0aca (diff)
downloadnextcloud-server-72e9a2ce57ee88503db83614cec5ccda71f0b58e.tar.gz
nextcloud-server-72e9a2ce57ee88503db83614cec5ccda71f0b58e.zip
moved to apps repository
Diffstat (limited to 'apps/tasks/ajax')
-rw-r--r--apps/tasks/ajax/addtask.php28
-rw-r--r--apps/tasks/ajax/delete.php32
-rw-r--r--apps/tasks/ajax/gettasks.php36
-rw-r--r--apps/tasks/ajax/update_property.php69
4 files changed, 0 insertions, 165 deletions
diff --git a/apps/tasks/ajax/addtask.php b/apps/tasks/ajax/addtask.php
deleted file mode 100644
index d98fdbf3888..00000000000
--- a/apps/tasks/ajax/addtask.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-
-// Init owncloud
-OCP\JSON::checkLoggedIn();
-OCP\JSON::checkAppEnabled('tasks');
-OCP\JSON::callCheck();
-
-$calendars = OC_Calendar_Calendar::allCalendars(OCP\User::getUser(), true);
-$first_calendar = reset($calendars);
-$cid = $first_calendar['id'];
-
-$input = $_POST['text'];
-$request = array();
-$request['summary'] = $input;
-$request["categories"] = null;
-$request['priority'] = null;
-$request['percent_complete'] = null;
-$request['completed'] = null;
-$request['location'] = null;
-$request['due'] = null;
-$request['description'] = null;
-$vcalendar = OC_Task_App::createVCalendarFromRequest($request);
-$id = OC_Calendar_Object::add($cid, $vcalendar->serialize());
-
-$user_timezone = OC_Calendar_App::getTimezone();
-$task = OC_Task_App::arrayForJSON($id, $vcalendar->VTODO, $user_timezone);
-
-OCP\JSON::success(array('task' => $task));
diff --git a/apps/tasks/ajax/delete.php b/apps/tasks/ajax/delete.php
deleted file mode 100644
index cc22c3e3873..00000000000
--- a/apps/tasks/ajax/delete.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-/**
- * ownCloud - Addressbook
- *
- * @author Jakob Sack
- * @copyright 2011 Jakob Sack mail@jakobsack.de
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
- *
- * You should have received a copy of the GNU Affero General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-// Init owncloud
-OCP\JSON::checkLoggedIn();
-OCP\JSON::checkAppEnabled('tasks');
-OCP\JSON::callCheck();
-
-$id = $_POST['id'];
-$task = OC_Calendar_App::getEventObject( $id );
-
-OC_Calendar_Object::delete($id);
-OCP\JSON::success(array('data' => array( 'id' => $id )));
diff --git a/apps/tasks/ajax/gettasks.php b/apps/tasks/ajax/gettasks.php
deleted file mode 100644
index b6183d9cb65..00000000000
--- a/apps/tasks/ajax/gettasks.php
+++ /dev/null
@@ -1,36 +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.
- */
-
-// Init owncloud
-OCP\JSON::checkLoggedIn();
-OCP\JSON::checkAppEnabled('tasks');
-
-$calendars = OC_Calendar_Calendar::allCalendars(OCP\User::getUser(), true);
-$user_timezone = OC_Calendar_App::getTimezone();
-
-$tasks = array();
-foreach( $calendars as $calendar ){
- $calendar_tasks = OC_Calendar_Object::all($calendar['id']);
- foreach( $calendar_tasks as $task ){
- if($task['objecttype']!='VTODO'){
- continue;
- }
- if(is_null($task['summary'])){
- continue;
- }
- $object = OC_VObject::parse($task['calendardata']);
- $vtodo = $object->VTODO;
- try {
- $tasks[] = OC_Task_App::arrayForJSON($task['id'], $vtodo, $user_timezone);
- } catch(Exception $e) {
- OCP\Util::writeLog('tasks', $e->getMessage(), OCP\Util::ERROR);
- }
- }
-}
-
-OCP\JSON::encodedPrint($tasks);
diff --git a/apps/tasks/ajax/update_property.php b/apps/tasks/ajax/update_property.php
deleted file mode 100644
index 679cfdefe48..00000000000
--- a/apps/tasks/ajax/update_property.php
+++ /dev/null
@@ -1,69 +0,0 @@
-<?php
-/**
- * Copyright (c) 2012 Bart Visscher <bartv@thisnet.nl>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-// Init owncloud
-OCP\JSON::checkLoggedIn();
-OCP\JSON::checkAppEnabled('tasks');
-OCP\JSON::callCheck();
-
-$id = $_POST['id'];
-$property = $_POST['type'];
-$vcalendar = OC_Calendar_App::getVCalendar( $id );
-
-$vtodo = $vcalendar->VTODO;
-switch($property) {
- case 'summary':
- $summary = $_POST['summary'];
- $vtodo->setString('SUMMARY', $summary);
- break;
- case 'description':
- $description = $_POST['description'];
- $vtodo->setString('DESCRIPTION', $description);
- break;
- case 'location':
- $location = $_POST['location'];
- $vtodo->setString('LOCATION', $location);
- break;
- case 'categories':
- $categories = $_POST['categories'];
- $vtodo->setString('CATEGORIES', $categories);
- break;
- case 'due':
- $due = $_POST['due'];
- $due_date_only = $_POST['date'];
- $type = null;
- if ($due != 'false') {
- try {
- $timezone = OC_Calendar_App::getTimezone();
- $timezone = new DateTimeZone($timezone);
- $due = new DateTime('@'.$due);
- $due->setTimezone($timezone);
- $type = Sabre_VObject_Element_DateTime::LOCALTZ;
- if ($due_date_only) {
- $type = Sabre_VObject_Element_DateTime::DATE;
- }
- } catch (Exception $e) {
- OCP\JSON::error(array('data'=>array('message'=>OC_Task_App::$l10n->t('Invalid date/time'))));
- exit();
- }
- }
- $vtodo->setDateTime('DUE', $due, $type);
- break;
- case 'complete':
- $checked = $_POST['checked'];
- OC_Task_App::setComplete($vtodo, $checked ? '100' : '0', null);
- break;
- default:
- OCP\JSON::error(array('data'=>array('message'=>'Unknown type')));
- exit();
-}
-OC_Calendar_Object::edit($id, $vcalendar->serialize());
-
-$user_timezone = OC_Calendar_App::getTimezone();
-$task_info = OC_Task_App::arrayForJSON($id, $vtodo, $user_timezone);
-OCP\JSON::success(array('data' => $task_info));