$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));
$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 )));
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 ){
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);
}
}
}
$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);
}
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));
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')));
$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;
}
}
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) {
}
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) {
$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);
$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);