summaryrefslogtreecommitdiffstats
path: root/apps/tasks
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-02-22 20:12:49 +0100
committerBart Visscher <bartv@thisnet.nl>2012-02-22 20:12:54 +0100
commit92db4f8be099c32b477bba33412b1d2fc7a04dbc (patch)
tree31fb3283a3f151a2ecf4c48db9bc73253c386310 /apps/tasks
parent7f754c02f3728bf8d71e3e61264504c88e92bdd2 (diff)
downloadnextcloud-server-92db4f8be099c32b477bba33412b1d2fc7a04dbc.tar.gz
nextcloud-server-92db4f8be099c32b477bba33412b1d2fc7a04dbc.zip
Update edittaskform for new calendar API
Diffstat (limited to 'apps/tasks')
-rw-r--r--apps/tasks/ajax/edittaskform.php16
-rw-r--r--apps/tasks/index.php4
-rw-r--r--apps/tasks/templates/part.edittaskform.php2
3 files changed, 5 insertions, 17 deletions
diff --git a/apps/tasks/ajax/edittaskform.php b/apps/tasks/ajax/edittaskform.php
index b9c1f700b61..651c26c4986 100644
--- a/apps/tasks/ajax/edittaskform.php
+++ b/apps/tasks/ajax/edittaskform.php
@@ -8,19 +8,7 @@ OC_JSON::checkAppEnabled('tasks');
$l10n = new OC_L10N('tasks');
$id = $_GET['id'];
-$task = OC_Calendar_Object::find( $id );
-if( $task === false ){
- OC_JSON::error(array('data' => array( 'message' => $l10n->t('Can not find Task!'))));
- exit();
-}
-
-$calendar = OC_Calendar_Calendar::findCalendar( $task['calendarid'] );
-if( $calendar === false || $calendar['userid'] != OC_USER::getUser()){
- OC_JSON::error(array('data' => array( 'message' => $l10n->t('This is not your task!'))));
- exit();
-}
-
-$details = Sabre_VObject_Reader::read($task['calendardata'])->VTODO;
+$details = OC_Calendar_App::getVCalendar($id)->VTODO;
$categories = array();
if (isset($details->CATEGORIES)){
$categories = explode(',', $details->CATEGORIES->value);
@@ -35,7 +23,7 @@ $tmpl = new OC_Template('tasks','part.edittaskform');
$tmpl->assign('category_options', $category_options);
$tmpl->assign('percent_options', $percent_options);
$tmpl->assign('priority_options', $priority_options);
-$tmpl->assign('task',$task);
+$tmpl->assign('id',$id);
$tmpl->assign('details',$details);
$tmpl->assign('categories', $categories);
$page = $tmpl->fetchPage();
diff --git a/apps/tasks/index.php b/apps/tasks/index.php
index e2f559dfebc..f0e6c2e4ddb 100644
--- a/apps/tasks/index.php
+++ b/apps/tasks/index.php
@@ -13,8 +13,8 @@ OC_Util::checkLoggedIn();
OC_Util::checkAppEnabled('tasks');
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser(), true);
-if( count($calendars) == 0){
- header('Location: ' . OC_HELPER::linkTo('calendar', 'index.php'));
+if( count($calendars) == 0 ) {
+ header('Location: ' . OC_Helper::linkTo('calendar', 'index.php'));
exit;
}
diff --git a/apps/tasks/templates/part.edittaskform.php b/apps/tasks/templates/part.edittaskform.php
index 3e26c420380..fe123f07ac6 100644
--- a/apps/tasks/templates/part.edittaskform.php
+++ b/apps/tasks/templates/part.edittaskform.php
@@ -1,5 +1,5 @@
<form id="tasks_edittaskform">
- <input type="hidden" name="id" value="<?php echo $_['task']['id']; ?>">
+ <input type="hidden" name="id" value="<?php echo $_['id']; ?>">
<?php echo $this->inc('part.taskform'); ?>
<input type="submit" name="submit" value="<?php echo $l->t('Update Task'); ?>">
</form>