From 72e9a2ce57ee88503db83614cec5ccda71f0b58e Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Sun, 26 Aug 2012 17:30:07 +0200 Subject: moved to apps repository --- apps/tasks/ajax/addtask.php | 28 --------------- apps/tasks/ajax/delete.php | 32 ----------------- apps/tasks/ajax/gettasks.php | 36 ------------------- apps/tasks/ajax/update_property.php | 69 ------------------------------------- 4 files changed, 165 deletions(-) delete mode 100644 apps/tasks/ajax/addtask.php delete mode 100644 apps/tasks/ajax/delete.php delete mode 100644 apps/tasks/ajax/gettasks.php delete mode 100644 apps/tasks/ajax/update_property.php (limited to 'apps/tasks/ajax') 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 @@ -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 @@ -. - * - */ - -// 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 @@ - - * 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 @@ - - * 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)); -- cgit v1.2.3