]> source.dussan.org Git - nextcloud-server.git/commitdiff
Tasks: More updates to public API
authorBart Visscher <bartv@thisnet.nl>
Fri, 4 May 2012 18:20:37 +0000 (20:20 +0200)
committerBart Visscher <bartv@thisnet.nl>
Fri, 4 May 2012 18:20:37 +0000 (20:20 +0200)
apps/tasks/ajax/addtask.php
apps/tasks/ajax/edittask.php
apps/tasks/ajax/gettasks.php
apps/tasks/ajax/update_property.php
apps/tasks/appinfo/app.php
apps/tasks/index.php
apps/tasks/lib/app.php

index 03eee7c5d9b2e6d9f8d88d1de643059be8cead24..891fbdb96df69bca6c955ac1bff97696cf435769 100644 (file)
@@ -20,7 +20,7 @@ $request['description'] = null;
 $vcalendar = OC_Task_App::createVCalendarFromRequest($request);
 $id = OC_Calendar_Object::add($cid, $vcalendar->serialize());
 
-$user_timezone = OC_Preferences::getValue(OCP\User::getUser(), 'calendar', 'timezone', date_default_timezone_get());
+$user_timezone = OCP\Config::getUserValue(OCP\User::getUser(), 'calendar', 'timezone', date_default_timezone_get());
 $task = OC_Task_App::arrayForJSON($id, $vcalendar->VTODO, $user_timezone);
 
 OCP\JSON::success(array('task' => $task));
index b50a6cee6a341f6b4ab5e4b859df98b2487c8d33..78d1f19393854c3aec5839e77697b9ebb5883d61 100644 (file)
@@ -25,7 +25,7 @@ $tmpl->assign('details', $vcalendar->VTODO);
 $tmpl->assign('id', $id);
 $page = $tmpl->fetchPage();
 
-$user_timezone = OC_Preferences::getValue(OCP\User::getUser(), 'calendar', 'timezone', date_default_timezone_get());
+$user_timezone = OCP\Config::getUserValue(OCP\User::getUser(), 'calendar', 'timezone', date_default_timezone_get());
 $task = OC_Task_App::arrayForJSON($id, $vcalendar->VTODO, $user_timezone);
 
 OCP\JSON::success(array('data' => array( 'id' => $id, 'page' => $page, 'task' => $task )));
index aaf80a667768429dc58bf43135568a6f099fc5a1..011730d0a13e771de2275a9f46d3e137b2479558 100644 (file)
@@ -11,7 +11,7 @@ OCP\JSON::checkLoggedIn();
 OCP\JSON::checkAppEnabled('tasks');
 
 $calendars = OC_Calendar_Calendar::allCalendars(OCP\User::getUser(), true);
-$user_timezone = OC_Preferences::getValue(OCP\User::getUser(), 'calendar', 'timezone', date_default_timezone_get());
+$user_timezone = OCP\Config::getUserValue(OCP\User::getUser(), 'calendar', 'timezone', date_default_timezone_get());
 
 $tasks = array();
 foreach( $calendars as $calendar ){
@@ -28,7 +28,7 @@ foreach( $calendars as $calendar ){
                try {
                        $tasks[] = OC_Task_App::arrayForJSON($task['id'], $vtodo, $user_timezone);
                } catch(Exception $e) {
-                        OC_Log::write('tasks', $e->getMessage(), OC_Log::ERROR);
+                        OCP\Util::writeLog('tasks', $e->getMessage(), OCP\Util::ERROR);
                 }
         }
 }
index 2067dd983ecad6bf588cf768173f2df0662ef286..46521cf6c585a2604f2ef3f6fa0993e7aa2cc6b1 100644 (file)
@@ -38,7 +38,7 @@ switch($property) {
                $type = null;
                if ($due != 'false') {
                        try {
-                               $timezone = OC_Preferences::getValue(OCP\User::getUser(), 'calendar', 'timezone', date_default_timezone_get());
+                               $timezone = OCP\Config::getUserValue(OCP\User::getUser(), 'calendar', 'timezone', date_default_timezone_get());
                                $timezone = new DateTimeZone($timezone);
                                $due = new DateTime('@'.$due);
                                $due->setTimezone($timezone);
@@ -63,6 +63,6 @@ switch($property) {
 }
 OC_Calendar_Object::edit($id, $vcalendar->serialize());
 
-$user_timezone = OC_Preferences::getValue(OCP\User::getUser(), 'calendar', 'timezone', date_default_timezone_get());
+$user_timezone = OCP\Config::getUserValue(OCP\User::getUser(), 'calendar', 'timezone', date_default_timezone_get());
 $task_info = OC_Task_App::arrayForJSON($id, $vtodo, $user_timezone);
 OCP\JSON::success(array('data' => $task_info));
index 657c56c0401c869c26b59b21be7378f70f065514..f346e2aa4c0adea10cf958f502f121317d6c0462 100644 (file)
@@ -3,14 +3,14 @@ $l=new OC_L10N('tasks');
 OC::$CLASSPATH['OC_Calendar_Calendar'] = 'apps/calendar/lib/calendar.php';
 OC::$CLASSPATH['OC_Task_App'] = 'apps/tasks/lib/app.php';
 
-OC_App::register( array(
+OCP\App::register( array(
   'order' => 11,
   'id' => 'tasks',
   'name' => 'Tasks' ));
 
-OC_App::addNavigationEntry( array(
+OCP\App::addNavigationEntry( array(
   'id' => 'tasks_index',
   'order' => 11,
-  'href' => OC_Helper::linkTo( 'tasks', 'index.php' ),
-  'icon' => OC_Helper::imagePath( 'tasks', 'icon.png' ),
+  'href' => OCP\Util::linkTo( 'tasks', 'index.php' ),
+  'icon' => OCP\Util::imagePath( 'tasks', 'icon.png' ),
   'name' => $l->t('Tasks')));
index 160fb5a269715fc37bb6a48b4db84b07c8b6b0e3..8ed5f4104345fbc822503097229d11182f5ab348 100644 (file)
@@ -13,7 +13,7 @@ OCP\App::checkAppEnabled('tasks');
 
 $calendars = OC_Calendar_Calendar::allCalendars(OCP\User::getUser(), true);
 if( count($calendars) == 0 ) {
-       header('Location: ' . OC_Helper::linkTo('calendar', 'index.php'));
+       header('Location: ' . OCP\Util::linkTo('calendar', 'index.php'));
        exit;
 }
 
index b1e92dc6b6e53f537128f3ecf840bf028d72a287..7b908420333f257712ab7e02b0a2868cfca23715 100644 (file)
@@ -82,7 +82,7 @@ class OC_Task_App {
                }
 
                try {
-                       $timezone = OC_Preferences::getValue(OCP\User::getUser(), "calendar", "timezone", "Europe/London");
+                       $timezone = OCP\Config::getUserValue(OCP\User::getUser(), "calendar", "timezone", "Europe/London");
                        $timezone = new DateTimeZone($timezone);
                        new DateTime($request['due'], $timezone);
                } catch (Exception $e) {
@@ -94,7 +94,7 @@ class OC_Task_App {
                }
                if ($request['percent_complete'] == 100 && !empty($request['completed'])){
                        try {
-                               $timezone = OC_Preferences::getValue(OCP\User::getUser(), "calendar", "timezone", "Europe/London");
+                               $timezone = OCP\Config::getUserValue(OCP\User::getUser(), "calendar", "timezone", "Europe/London");
                                $timezone = new DateTimeZone($timezone);
                                new DateTime($request['completed'], $timezone);
                        } catch (Exception $e) {
@@ -147,7 +147,7 @@ class OC_Task_App {
                $vtodo->setString('PRIORITY', $priority);
 
                if ($due) {
-                       $timezone = OC_Preferences::getValue(OCP\User::getUser(), 'calendar', 'timezone', date_default_timezone_get());
+                       $timezone = OCP\Config::getUserValue(OCP\User::getUser(), 'calendar', 'timezone', date_default_timezone_get());
                        $timezone = new DateTimeZone($timezone);
                        $due = new DateTime($due, $timezone);
                        $vtodo->setDateTime('DUE', $due);
@@ -176,7 +176,7 @@ class OC_Task_App {
                        $completed = null;
                }
                if ($completed) {
-                       $timezone = OC_Preferences::getValue(OCP\User::getUser(), 'calendar', 'timezone', date_default_timezone_get());
+                       $timezone = OCP\Config::getUserValue(OCP\User::getUser(), 'calendar', 'timezone', date_default_timezone_get());
                        $timezone = new DateTimeZone($timezone);
                        $completed = new DateTime($completed, $timezone);
                        $vtodo->setDateTime('COMPLETED', $completed);