index.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  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. $l10n = new OC_L10N('tasks');
  26. $priority_options = OC_Task_App::getPriorityOptions();
  27. $output = new OCP\Template('tasks', 'tasks', 'user');
  28. $output->assign('priority_options', $priority_options);
  29. $output->assign('categories', $categories);
  30. $output -> printPage();