index.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /*************************************************
  3. * ownCloud - Tasks Plugin *
  4. * *
  5. * (c) Copyright 2011 Bart Visscher *
  6. * This file is licensed under the Affero General *
  7. * Public License version 3 or later. *
  8. * See the COPYING-README file. *
  9. *************************************************/
  10. OCP\User::checkLoggedIn();
  11. OCP\App::checkAppEnabled('tasks');
  12. $calendars = OC_Calendar_Calendar::allCalendars(OCP\User::getUser(), true);
  13. if( count($calendars) == 0 ) {
  14. header('Location: ' . OCP\Util::linkTo('calendar', 'index.php'));
  15. exit;
  16. }
  17. OCP\Util::addScript('3rdparty/timepicker', 'jquery.ui.timepicker');
  18. OCP\Util::addStyle('3rdparty/timepicker', 'jquery.ui.timepicker');
  19. OCP\Util::addScript('tasks', 'tasks');
  20. OCP\Util::addStyle('tasks', 'style');
  21. OCP\Util::addScript('contacts','jquery.multi-autocomplete');
  22. OCP\Util::addScript('','oc-vcategories');
  23. OCP\App::setActiveNavigationEntry('tasks_index');
  24. $categories = OC_Calendar_App::getCategoryOptions();
  25. $priority_options = OC_Task_App::getPriorityOptions();
  26. $output = new OCP\Template('tasks', 'tasks', 'user');
  27. $output->assign('priority_options', $priority_options);
  28. $output->assign('categories', $categories);
  29. $output -> printPage();