server/apps/tasks/ajax/getdetails.php

25 lines
606 B
PHP
Raw Normal View History

2011-09-12 19:28:28 +00:00
<?php
// Init owncloud
2012-05-04 15:19:25 +00:00
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('tasks');
2011-09-12 19:28:28 +00:00
$l10n = new OC_L10N('tasks');
$id = $_GET['id'];
$task = OC_Calendar_Object::find($id);
2011-12-09 20:41:21 +00:00
$details = OC_VObject::parse($task['calendardata']);
if (!$details){
2012-05-04 15:19:25 +00:00
OCP\JSON::error();
2011-12-09 20:41:21 +00:00
exit;
}
2011-09-13 20:44:15 +00:00
$priority_options = OC_Task_App::getPriorityOptions();
2012-05-06 21:00:36 +00:00
$tmpl = new OCP\Template('tasks','part.details');
2011-09-13 20:44:15 +00:00
$tmpl->assign('priority_options', $priority_options);
2011-12-09 20:41:21 +00:00
$tmpl->assign('details',$details->VTODO);
2011-09-12 19:28:28 +00:00
$tmpl->assign('id',$id);
$page = $tmpl->fetchPage();
2012-05-04 15:19:25 +00:00
OCP\JSON::success(array('data' => array( 'id' => $id, 'page' => $page )));