calendar.php 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <script type='text/javascript'>
  2. var defaultView = '<?php echo OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') ?>';
  3. var eventSources = <?php echo json_encode($_['eventSources']) ?>;
  4. var categories = <?php echo json_encode($_['categories']); ?>;
  5. var dayNames = <?php echo json_encode($l->tA(array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'))) ?>;
  6. var dayNamesShort = <?php echo json_encode($l->tA(array('Sun.', 'Mon.', 'Tue.', 'Wed.', 'Thu.', 'Fri.', 'Sat.'))) ?>;
  7. var monthNames = <?php echo json_encode($l->tA(array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'))) ?>;
  8. var monthNamesShort = <?php echo json_encode($l->tA(array('Jan.', 'Feb.', 'Mar.', 'Apr.', 'May.', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Oct.', 'Nov.', 'Dec.'))) ?>;
  9. var agendatime = '<?php echo ((int) OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>{ - <?php echo ((int) OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>}';
  10. var defaulttime = '<?php echo ((int) OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>';
  11. var allDayText = '<?php echo addslashes($l->t('All day')) ?>';
  12. var newcalendar = '<?php echo addslashes($l->t('New Calendar')) ?>';
  13. var missing_field = '<?php echo addslashes($l->t('Missing fields')) ?>';
  14. var missing_field_title = '<?php echo addslashes($l->t('Title')) ?>';
  15. var missing_field_calendar = '<?php echo addslashes($l->t('Calendar')) ?>';
  16. var missing_field_fromdate = '<?php echo addslashes($l->t('From Date')) ?>';
  17. var missing_field_fromtime = '<?php echo addslashes($l->t('From Time')) ?>';
  18. var missing_field_todate = '<?php echo addslashes($l->t('To Date')) ?>';
  19. var missing_field_totime = '<?php echo addslashes($l->t('To Time')) ?>';
  20. var missing_field_startsbeforeends = '<?php echo addslashes($l->t('The event ends before it starts')) ?>';
  21. var missing_field_dberror = '<?php echo addslashes($l->t('There was a database fail')) ?>';
  22. var totalurl = '<?php echo OCP\Util::linkToRemote('caldav'); ?>calendars';
  23. var firstDay = '<?php echo (OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'firstday', 'mo') == 'mo' ? '1' : '0'); ?>';
  24. $(document).ready(function() {
  25. <?php
  26. if(array_key_exists('showevent', $_)){
  27. $data = OC_Calendar_App::getEventObject($_['showevent']);
  28. $date = substr($data['startdate'], 0, 10);
  29. list($year, $month, $day) = explode('-', $date);
  30. echo '$(\'#calendar_holder\').fullCalendar(\'gotoDate\', ' . $year . ', ' . --$month . ', ' . $day . ');';
  31. echo '$(\'#dialog_holder\').load(OC.filePath(\'calendar\', \'ajax\', \'editeventform.php\') + \'?id=\' + ' . $_['showevent'] . ' , Calendar.UI.startEventDialog);';
  32. }
  33. ?>
  34. });
  35. </script>
  36. <div id="controls">
  37. <div>
  38. <form>
  39. <div id="view">
  40. <input type="button" value="<?php echo $l->t('Week');?>" id="oneweekview_radio"/>
  41. <input type="button" value="<?php echo $l->t('Month');?>" id="onemonthview_radio"/>
  42. <input type="button" value="<?php echo $l->t('List');?>" id="listview_radio"/>&nbsp;&nbsp;
  43. <img id="loading" src="<?php echo OCP\Util::imagePath('core', 'loading.gif'); ?>" />
  44. </div>
  45. </form>
  46. <form>
  47. <div id="choosecalendar">
  48. <input type="button" id="today_input" value="<?php echo $l->t("Today");?>"/>
  49. <input type="button" id="choosecalendar_input" value="<?php echo $l->t("Calendars");?>" onclick="Calendar.UI.Calendar.overview();" />
  50. </div>
  51. </form>
  52. <form>
  53. <div id="datecontrol">
  54. <input type="button" value="&nbsp;&lt;&nbsp;" id="datecontrol_left"/>
  55. <span class="button" id="datecontrol_date"></span>
  56. <input type="button" value="&nbsp;&gt;&nbsp;" id="datecontrol_right"/>
  57. </div>
  58. </form>
  59. </div>
  60. </div>
  61. <div id="notification" style="display:none;"></div>
  62. <div id="calendar_holder">
  63. </div>
  64. <!-- Dialogs -->
  65. <div id="dialog_holder"></div>
  66. <div id="parsingfail_dialog" title="Parsing Fail">
  67. <?php echo $l->t("There was a fail, while parsing the file."); ?>
  68. </div>
  69. <!-- End of Dialogs -->