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.

347 lines
18KB

  1. <?php
  2. /**
  3. *
  4. * This file is part of HESK - PHP Help Desk Software.
  5. *
  6. * (c) Copyright Klemen Stirn. All rights reserved.
  7. * https://www.hesk.com
  8. *
  9. * For the full copyright and license agreement information visit
  10. * https://www.hesk.com/eula.php
  11. *
  12. */
  13. require_once(HESK_PATH . 'build.php');
  14. /* Check if this is a valid include */
  15. if (!defined('IN_SCRIPT')) {
  16. die('Invalid attempt');
  17. }
  18. if (!function_exists('mfh_getSettings')) {
  19. die('Mods for HESK settings are not accessible!');
  20. }
  21. $modsForHesk_settings = array();
  22. if (is_dir(HESK_PATH . 'install')) {
  23. define('MAINTENANCE_MODE', true);
  24. $modsForHesk_settings['navbar_title_url'] = 'javascript:;';
  25. $modsForHesk_settings['use_bootstrap_theme'] = 1;
  26. $modsForHesk_settings['show_icons'] = 1;
  27. $modsForHesk_settings['navbarBackgroundColor'] = '#414a5c';
  28. $modsForHesk_settings['navbarBrandColor'] = '#d4dee7';
  29. $modsForHesk_settings['navbarBrandHoverColor'] = '#ffffff';
  30. $modsForHesk_settings['navbarItemTextColor'] = '#d4dee7';
  31. $modsForHesk_settings['navbarItemTextHoverColor'] = '#ffffff';
  32. $modsForHesk_settings['navbarItemTextSelectedColor'] = '#ffffff';
  33. $modsForHesk_settings['navbarItemSelectedBackgroundColor'] = '#2d3646';
  34. $modsForHesk_settings['dropdownItemTextColor'] = '#333333';
  35. $modsForHesk_settings['dropdownItemTextHoverColor'] = '#262626';
  36. $modsForHesk_settings['dropdownItemTextHoverBackgroundColor'] = '#f5f5f5';
  37. $modsForHesk_settings['questionMarkColor'] = '#000000';
  38. $modsForHesk_settings['enable_calendar'] = 1;
  39. } else {
  40. $modsForHesk_settings = mfh_getSettings();
  41. }
  42. ?>
  43. <!DOCTYPE html>
  44. <html>
  45. <head>
  46. <title><?php echo(isset($hesk_settings['tmp_title']) ? $hesk_settings['tmp_title'] : $hesk_settings['hesk_title']); ?></title>
  47. <meta http-equiv="Content-Type" content="text/html;charset=<?php echo $hesklang['ENCODING']; ?>"/>
  48. <meta name="viewport" content="width=device-width, user-scalable=no">
  49. <meta name="theme-color" content="<?php echo '#414a5c'; ?>">
  50. <link href="<?php echo HESK_PATH; ?>hesk_style.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>" type="text/css" rel="stylesheet"/>
  51. <link href="<?php echo HESK_PATH; ?>css/datepicker.css" type="text/css" rel="stylesheet"/>
  52. <link href="<?php echo HESK_PATH; ?>css/bootstrap.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>" type="text/css"
  53. rel="stylesheet"/>
  54. <link href="<?php echo HESK_PATH; ?>css/bootstrap-theme.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>" type="text/css"
  55. rel="stylesheet" <?php if ($modsForHesk_settings['use_bootstrap_theme'] == 0) {
  56. echo 'disabled';
  57. } ?>>
  58. <link href="<?php echo HESK_PATH; ?>css/mods-for-hesk.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>" type="text/css"
  59. rel="stylesheet"/>
  60. <link href="<?php echo HESK_PATH; ?>css/hesk_newStyle.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>" type="text/css"
  61. rel="stylesheet"/>
  62. <link href="<?php echo HESK_PATH; ?>css/bootstrap-iconpicker.min.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>" rel="stylesheet">
  63. <link href="//netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>" rel="stylesheet">
  64. <link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/octicons.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>" type="text/css">
  65. <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>">
  66. <link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/dropzone.min.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>">
  67. <link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/dropzone-basic.min.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>">
  68. <link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/fullcalendar.min.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>">
  69. <link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/bootstrap-clockpicker.min.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>">
  70. <link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/bootstrap-colorpicker.min.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>">
  71. <link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/toastr.min.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>">
  72. <link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/magnific-popup.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>">
  73. <?php if (defined('USE_JQUERY_2')): ?>
  74. <script src="<?php echo HESK_PATH; ?>js/jquery-2.2.4.min.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
  75. <?php else: ?>
  76. <script src="<?php echo HESK_PATH; ?>js/jquery-1.10.2.min.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
  77. <?php endif; ?>
  78. <script language="Javascript" type="text/javascript" src="<?php echo HESK_PATH; ?>hesk_javascript.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
  79. <script language="Javascript" type="text/javascript" src="<?php echo HESK_PATH; ?>js/bootstrap.min.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
  80. <script type="text/javascript" src="<?php echo HESK_PATH; ?>js/dropzone.min.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
  81. <script language="Javascript" type="text/javascript"
  82. src="<?php echo HESK_PATH; ?>js/modsForHesk-javascript.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
  83. <script language="JavaScript" type="text/javascript"
  84. src="<?php echo HESK_PATH; ?>js/bootstrap-datepicker.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
  85. <script type="text/javascript" src="<?php echo HESK_PATH; ?>js/bootstrap-clockpicker.min.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
  86. <script type="text/javascript" src="<?php echo HESK_PATH; ?>js/iconset-fontawesome-4.3.0.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
  87. <script type="text/javascript" src="<?php echo HESK_PATH; ?>js/iconset-octicon-2.1.2.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
  88. <script type="text/javascript" src="<?php echo HESK_PATH; ?>js/bootstrap-iconpicker.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
  89. <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
  90. <script type="text/javascript" src="<?php echo HESK_PATH; ?>js/platform.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
  91. <script type="text/javascript" src="<?php echo HESK_PATH; ?>js/bootstrap-validator.min.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
  92. <script type="text/javascript" src="<?php echo HESK_PATH; ?>internal-api/js/core.php?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
  93. <script type="text/javascript" src="<?php echo HESK_PATH; ?>js/bootstrap-colorpicker.min.js?v=<?php echo MODS_FOR_HESK_BUILD; ?>"></script>
  94. <script type="text/javascript" src="<?php echo HESK_PATH; ?>js/toastr.min.js?v=<?php echo MODS_FOR_HESK_BUILD ?>"></script>
  95. <script type="text/javascript" src="<?php echo HESK_PATH; ?>js/jquery.magnific-popup.min.js?v=<?php echo MODS_FOR_HESK_BUILD ?>"></script>
  96. <style>
  97. .navbar-default {
  98. background-color: <?php echo $modsForHesk_settings['navbarBackgroundColor']; ?>;
  99. background-image: none;
  100. filter: none;
  101. }
  102. .navbar-default .navbar-brand {
  103. color: <?php echo $modsForHesk_settings['navbarBrandColor']; ?>;
  104. }
  105. .navbar-default .navbar-brand:focus, .navbar-default .navbar-brand:hover {
  106. color: <?php echo $modsForHesk_settings['navbarBrandHoverColor']; ?>;
  107. background-color: transparent;
  108. }
  109. .navbar-default .navbar-nav > li > a {
  110. color: <?php echo $modsForHesk_settings['navbarItemTextColor']; ?>;
  111. }
  112. .navbar-default .navbar-nav > li > a:focus, .navbar-default .navbar-nav > li > a:hover {
  113. color: <?php echo $modsForHesk_settings['navbarItemTextHoverColor']; ?>;
  114. background-color: transparent;
  115. }
  116. .dropdown-menu > li > a {
  117. color: <?php echo $modsForHesk_settings['dropdownItemTextColor']; ?>;
  118. }
  119. .dropdown-menu > li > a:focus, .dropdown-menu > li > a:hover {
  120. color: <?php echo $modsForHesk_settings['dropdownItemTextHoverColor']; ?>;
  121. text-decoration: none;
  122. background-color: <?php echo $modsForHesk_settings['dropdownItemTextHoverBackgroundColor']; ?>;
  123. }
  124. .navbar-default .navbar-nav > .open > a,
  125. .navbar-default .navbar-nav > .open > a:focus,
  126. .navbar-default .navbar-nav > .open > a:hover,
  127. .navbar-default .navbar-nav > .active > a,
  128. .navbar-default .navbar-nav > .active > a:focus,
  129. .navbar-default .navbar-nav > .active > a:hover {
  130. color: <?php echo $modsForHesk_settings['navbarItemTextSelectedColor']; ?>;
  131. background-color: <?php echo $modsForHesk_settings['navbarItemSelectedBackgroundColor']; ?>;
  132. background-image: none;
  133. }
  134. .settingsquestionmark {
  135. color: <?php echo $modsForHesk_settings['questionMarkColor']; ?>;
  136. cursor: pointer;
  137. }
  138. .h3questionmark {
  139. color: <?php echo $modsForHesk_settings['questionMarkColor']; ?>;
  140. }
  141. </style>
  142. <?php
  143. /* Prepare Javascript that browser should load on page load */
  144. $onload = "javascript:var i=new Image();i.src='" . HESK_PATH . "img/orangebtnover.gif';var i2=new Image();i2.src='" . HESK_PATH . "img/greenbtnover.gif';";
  145. /* Tickets shouldn't be indexed by search engines */
  146. if (defined('HESK_NO_ROBOTS')) {
  147. ?>
  148. <meta name="robots" content="noindex, nofollow"/>
  149. <?php
  150. }
  151. /* If page requires calendar include calendar Javascript and CSS */
  152. if (defined('CALENDAR')) {
  153. ?>
  154. <script language="Javascript" type="text/javascript"
  155. src="<?php echo HESK_PATH; ?>inc/calendar/tcal.php"></script>
  156. <link href="<?php echo HESK_PATH; ?>inc/calendar/tcal.css" type="text/css" rel="stylesheet"/>
  157. <?php
  158. }
  159. /* If page requires WYSIWYG editor include TinyMCE Javascript */
  160. if (defined('WYSIWYG') && $hesk_settings['kb_wysiwyg']) {
  161. ?>
  162. <script type="text/javascript" src="<?php echo HESK_PATH; ?>inc/tiny_mce/3.5.11/tiny_mce.js"></script>
  163. <?php
  164. }
  165. /* If page requires tabs load tabs Javascript and CSS */
  166. if (defined('LOAD_TABS')) {
  167. ?>
  168. <link href="<?php echo HESK_PATH; ?>inc/tabs/tabber.css" type="text/css" rel="stylesheet"/>
  169. <?php
  170. }
  171. /* If page requires timer load Javascript */
  172. if (defined('TIMER')) {
  173. ?>
  174. <script language="Javascript" type="text/javascript"
  175. src="<?php echo HESK_PATH; ?>inc/timer/hesk_timer.js"></script>
  176. <?php
  177. /* Need to load default time or a custom one? */
  178. if (isset($_SESSION['time_worked'])) {
  179. $t = hesk_getHHMMSS($_SESSION['time_worked']);
  180. $onload .= "load_timer('time_worked', " . $t[0] . ", " . $t[1] . ", " . $t[2] . ");";
  181. unset($t);
  182. } else {
  183. $onload .= "load_timer('time_worked', 0, 0, 0);";
  184. }
  185. /* Autostart timer? */
  186. if (!empty($_SESSION['autostart'])) {
  187. $onload .= "ss();";
  188. }
  189. }
  190. // Use ReCaptcha API v2?
  191. if (defined('RECAPTCHA')) {
  192. echo '<script src="https://www.google.com/recaptcha/api.js?hl=' . $hesklang['RECAPTCHA'] . '" async defer></script>';
  193. }
  194. if (defined('VALIDATOR')) {
  195. ?>
  196. <script type="text/javascript" src="<?php echo HESK_PATH; ?>js/validation-scripts.js"></script>
  197. <?php
  198. }
  199. if (defined('MFH_CUSTOMER_CALENDAR')) {
  200. ?>
  201. <script src="<?php echo HESK_PATH; ?>js/calendar/moment.js"></script>
  202. <script src="<?php echo HESK_PATH; ?>js/calendar/fullcalendar.min.js"></script>
  203. <script src="<?php echo HESK_PATH; ?>js/calendar/locale/<?php echo $hesk_settings['languages'][$hesk_settings['language']]['folder'] ?>.js"></script>
  204. <script type="text/javascript" src="<?php echo HESK_PATH; ?>js/calendar/mods-for-hesk-calendar-readonly.js"></script>
  205. <?php
  206. }
  207. // Include custom head code
  208. include(HESK_PATH . 'head.txt');
  209. ?>
  210. </head>
  211. <body onload="<?php echo $onload;
  212. unset($onload); ?>">
  213. <?php
  214. include(HESK_PATH . 'header.txt');
  215. $iconDisplay = 'style="display: none"';
  216. if ($modsForHesk_settings['show_icons']) {
  217. $iconDisplay = '';
  218. }
  219. ?>
  220. <div class="enclosing">
  221. <nav class="navbar navbar-default navbar-static-top" role="navigation">
  222. <div class="navbar-header">
  223. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
  224. <span class="sr-only">Toggle navigation</span>
  225. <span class="icon-bar"></span>
  226. <span class="icon-bar"></span>
  227. <span class="icon-bar"></span>
  228. </button>
  229. <a class="navbar-brand" href="<?php echo $modsForHesk_settings['navbar_title_url']; ?>"><?php echo $hesk_settings['hesk_title'] ?></a>
  230. </div>
  231. <div class="navbar-collapse collapse">
  232. <ul class="nav navbar-nav">
  233. <?php
  234. if ($hesk_settings['kb_enable'] !== 2 && !defined('MAINTENANCE_MODE')) {
  235. $active = '';
  236. if (defined('PAGE_TITLE') && PAGE_TITLE == 'CUSTOMER_HOME') {
  237. $active = 'class="active"';
  238. }
  239. ?>
  240. <li <?php echo $active; ?>><a href="<?php echo HESK_PATH; ?>"><i
  241. class="fa fa-home" <?php echo $iconDisplay; ?>></i>&nbsp;<?php echo $hesklang['main_page']; ?>
  242. </a></li>
  243. <?php
  244. $active = '';
  245. if (defined('PAGE_TITLE') && PAGE_TITLE == 'CUSTOMER_TICKET') {
  246. $active = ' active';
  247. }
  248. ?>
  249. <li class="dropdown<?php echo $active; ?>">
  250. <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i
  251. class="fa fa-ticket" <?php echo $iconDisplay; ?>></i>&nbsp;<?php echo $hesklang['ticket'] ?>
  252. <b class="caret"></b></a>
  253. <ul class="dropdown-menu">
  254. <li><a href="<?php echo HESK_PATH; ?>index.php?a=add"><i
  255. class="fa fa-plus-circle" <?php echo $iconDisplay; ?>></i>&nbsp;<?php echo $hesklang['sub_support'] ?>
  256. </a></li>
  257. <li><a href="<?php echo HESK_PATH; ?>ticket.php"><i
  258. class="fa fa-search" <?php echo $iconDisplay; ?>></i>&nbsp;<?php echo $hesklang['view_ticket_nav'] ?>
  259. </a></li>
  260. </ul>
  261. </li>
  262. <?php
  263. }
  264. if ($hesk_settings['kb_enable'] && !defined('MAINTENANCE_MODE')) {
  265. $active = '';
  266. if (defined('PAGE_TITLE') && PAGE_TITLE == 'CUSTOMER_KB') {
  267. $active = 'class="active"';
  268. }
  269. ?>
  270. <li <?php echo $active; ?>><a href="<?php echo HESK_PATH; ?>knowledgebase.php"><i
  271. class="fa fa-book" <?php echo $iconDisplay; ?>></i>&nbsp;<?php echo $hesklang['kb_text'] ?>
  272. </a></li> <?php }
  273. $active = '';
  274. if (defined('PAGE_TITLE') && PAGE_TITLE == 'CUSTOMER_CALENDAR') {
  275. $active = ' active';
  276. }
  277. if ($modsForHesk_settings['enable_calendar'] == 1 && !defined('MAINTENANCE_MODE')):
  278. ?>
  279. <li class="<?php echo $active; ?>">
  280. <a href="<?php echo HESK_PATH; ?>calendar.php"><i class="fa fa-calendar" <?php echo $iconDisplay; ?>></i>&nbsp;<?php echo $hesklang['calendar_title_case']; ?></a>
  281. </li>
  282. <?php endif; ?>
  283. <?php
  284. $customNavRs = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "custom_nav_element` AS `t1`
  285. INNER JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "custom_nav_element_to_text` AS `t2`
  286. ON `t1`.`id` = `t2`.`nav_element_id`
  287. AND `t2`.`language` = '" . hesk_dbEscape($hesk_settings['language']) . "'
  288. WHERE `t1`.`place` = 2");
  289. while ($row = hesk_dbFetchAssoc($customNavRs)):
  290. ?>
  291. <li>
  292. <a href="<?php echo $row['url']; ?>">
  293. <?php if ($row['image_url'] !== null): ?>
  294. <img src="<?php echo $row['image_url']; ?>" alt="<?php echo $row['text']; ?>" <?php echo $iconDisplay; ?>>
  295. <?php else: ?>
  296. <i class="<?php echo $row['font_icon']; ?>" <?php echo $iconDisplay; ?>></i>
  297. <?php endif; ?>
  298. <?php echo $row['text']; ?>
  299. </a>
  300. </li>
  301. <?php endwhile; ?>
  302. </ul>
  303. <?php if ($hesk_settings['can_sel_lang']) { ?>
  304. <div class="navbar-form navbar-right" role="search" style="margin-right: 20px; min-width: 80px;">
  305. <?php
  306. if (!defined('MAINTENANCE_MODE')) {
  307. if (defined('PAGE_TITLE') && PAGE_TITLE == 'CUSTOMER_TICKET') {
  308. hesk_getLanguagesAsFormIfNecessary($trackingID);
  309. } else {
  310. hesk_getLanguagesAsFormIfNecessary();
  311. }
  312. }
  313. ?>
  314. </div>
  315. <?php } ?>
  316. </div>
  317. </nav>