calendar.php 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. <form id="view">
  38. <input type="button" value="<?php echo $l->t('Week');?>" id="oneweekview_radio"/>
  39. <input type="button" value="<?php echo $l->t('Month');?>" id="onemonthview_radio"/>
  40. <input type="button" value="<?php echo $l->t('List');?>" id="listview_radio"/>&nbsp;&nbsp;
  41. <img id="loading" src="<?php echo OCP\Util::imagePath('core', 'loading.gif'); ?>" />
  42. </form>
  43. <form id="choosecalendar">
  44. <input type="button" id="today_input" value="<?php echo $l->t("Today");?>"/>
  45. <input type="button" id="choosecalendar_input" value="<?php echo $l->t("Calendars");?>" onclick="Calendar.UI.Calendar.overview();" />
  46. </form>
  47. <form id="datecontrol">
  48. <input type="button" value="&nbsp;&lt;&nbsp;" id="datecontrol_left"/>
  49. <input type="button" value="" id="datecontrol_date"/>
  50. <input type="button" value="&nbsp;&gt;&nbsp;" id="datecontrol_right"/>
  51. </form>
  52. </div>
  53. <div id="notification" style="display:none;"></div>
  54. <div id="calendar_holder">
  55. </div>
  56. <!-- Dialogs -->
  57. <div id="dialog_holder"></div>
  58. <div id="parsingfail_dialog" title="Parsing Fail">
  59. <?php echo $l->t("There was a fail, while parsing the file."); ?>
  60. </div>
  61. <!-- End of Dialogs -->