getdetails.php 606 B

12345678910111213141516171819202122232425
  1. <?php
  2. // Init owncloud
  3. OCP\JSON::checkLoggedIn();
  4. OCP\JSON::checkAppEnabled('tasks');
  5. $l10n = new OC_L10N('tasks');
  6. $id = $_GET['id'];
  7. $task = OC_Calendar_Object::find($id);
  8. $details = OC_VObject::parse($task['calendardata']);
  9. if (!$details){
  10. OCP\JSON::error();
  11. exit;
  12. }
  13. $priority_options = OC_Task_App::getPriorityOptions();
  14. $tmpl = new OCP\Template('tasks','part.details');
  15. $tmpl->assign('priority_options', $priority_options);
  16. $tmpl->assign('details',$details->VTODO);
  17. $tmpl->assign('id',$id);
  18. $page = $tmpl->fetchPage();
  19. OCP\JSON::success(array('data' => array( 'id' => $id, 'page' => $page )));