Bootswatch, Summernote, and Captcheck mods for Mods for HESK (mods-for-hesk.com). In use at support.netsyms.com.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

calendar.php 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <?php
  2. define('IN_SCRIPT', 1);
  3. define('HESK_PATH', './');
  4. define('PAGE_TITLE', 'CUSTOMER_CALENDAR');
  5. define('MFH_CUSTOMER_CALENDAR', 1);
  6. define('USE_JQUERY_2', 1);
  7. /* Get all the required files and functions */
  8. require(HESK_PATH . 'hesk_settings.inc.php');
  9. require(HESK_PATH . 'inc/common.inc.php');
  10. // Are we in maintenance mode?
  11. hesk_check_maintenance();
  12. hesk_load_database_functions();
  13. hesk_session_start();
  14. /* Connect to database */
  15. hesk_dbConnect();
  16. $modsForHesk_settings = mfh_getSettings();
  17. // Is the calendar enabled?
  18. if ($modsForHesk_settings['enable_calendar'] != '1') {
  19. hesk_error($hesklang['calendar_disabled']);
  20. }
  21. $categories = array();
  22. $orderBy = $modsForHesk_settings['category_order_column'];
  23. $categorySql = "SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` WHERE `usage` <> 1 AND `type` = '0' ORDER BY '" . $orderBy . "'";
  24. $categoryRs = hesk_dbQuery($categorySql);
  25. while ($row = hesk_dbFetchAssoc($categoryRs))
  26. {
  27. $row['css_style'] = "background: {$row['background_color']};";
  28. $row['background_volatile'] = 'background-volatile';
  29. if ($row['foreground_color'] != 'AUTO') {
  30. $row['background_volatile'] = '';
  31. $row['css_style'] .= " color: {$row['foreground_color']};";
  32. if ($row['display_border_outline'] == '1') {
  33. $row['css_style'] .= " border: solid 1px {$row['foreground_color']};";
  34. }
  35. }
  36. $categories[] = $row;
  37. }
  38. require_once(HESK_PATH . 'inc/header.inc.php');
  39. ?>
  40. <div class="row pad-20">
  41. <div class="col-lg-3">
  42. <div class="panel panel-default">
  43. <div class="panel-heading">
  44. <h4><?php echo $hesklang['calendar_categories']; ?></h4>
  45. </div>
  46. <div class="panel-body">
  47. <ul class="list-unstyled">
  48. <div class="btn-group btn-group-sm">
  49. <button id="select-all" class="btn btn-default" data-select-all="category-toggle"><?php echo $hesklang['select_all_title_case']; ?></button>
  50. <button id="deselect-all" class="btn btn-default" data-deselect-all="category-toggle"><?php echo $hesklang['deselect_all_title_case']; ?></button>
  51. </div>
  52. <?php foreach ($categories as $category): ?>
  53. <li class="move-down-20 move-right-20">
  54. <div class="checkbox">
  55. <input type="checkbox" data-select-target="category-toggle" name="category-toggle" value="<?php echo $category['id']; ?>" checked>
  56. </div>
  57. <div class="hide-on-overflow no-wrap event-category <?php echo $category['background_volatile']; ?>"
  58. style="<?php echo $category['css_style']; ?>">
  59. <?php echo $category['name']; ?>
  60. </div>
  61. </li>
  62. <?php endforeach; ?>
  63. </ul>
  64. </div>
  65. </div>
  66. </div>
  67. <div class="col-lg-9">
  68. <div class="panel panel-default">
  69. <div class="panel-heading">
  70. <h4>
  71. <?php echo $hesklang['calendar_title_case']; ?>
  72. </h4>
  73. </div>
  74. <div class="panel-body">
  75. <div id="calendar"></div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="popover-template" style="display: none">
  81. <div>
  82. <div class="popover-location">
  83. <strong><?php echo $hesklang['event_location']; ?></strong>
  84. <span></span>
  85. </div>
  86. <div class="popover-category">
  87. <strong><?php echo $hesklang['category']; ?></strong>
  88. <span></span>
  89. </div>
  90. <div class="popover-from">
  91. <strong><?php echo $hesklang['from']; ?></strong>
  92. <span></span>
  93. </div>
  94. <div class="popover-to">
  95. <strong><?php echo $hesklang['to_title_case']; ?></strong>
  96. <span></span>
  97. </div>
  98. <div class="popover-comments">
  99. <strong><?php echo $hesklang['event_comments']; ?></strong>
  100. <span></span>
  101. </div>
  102. </div>
  103. </div>
  104. <?php
  105. echo mfh_get_hidden_fields_for_language(array(
  106. 'error_loading_events'
  107. ));
  108. ?>
  109. <div style="display: none">
  110. <p id="setting_default_view"><?php echo $modsForHesk_settings['default_calendar_view']; ?></p>
  111. <p id="setting_first_day_of_week"><?php echo $modsForHesk_settings['first_day_of_week']; ?></p>
  112. <p id="setting_show_start_time"><?php echo $modsForHesk_settings['calendar_show_start_time']; ?></p>
  113. <?php
  114. $businessHoursRs = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mfh_calendar_business_hours`");
  115. while ($row = hesk_dbFetchAssoc($businessHoursRs)):
  116. ?>
  117. <p id="business_hours_<?php echo $row['day_of_week']; ?>_start"><?php echo $row['start_time']; ?></p>
  118. <p id="business_hours_<?php echo $row['day_of_week']; ?>_end"><?php echo $row['end_time']; ?></p>
  119. <?php endwhile; ?>
  120. </div>