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.

print.php 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. define('IN_SCRIPT', 1);
  14. define('HESK_PATH', './');
  15. /* Get all the required files and functions */
  16. require(HESK_PATH . 'hesk_settings.inc.php');
  17. require(HESK_PATH . 'inc/common.inc.php');
  18. hesk_load_database_functions();
  19. hesk_session_start();
  20. // Do we have parameters in query string? If yes, store them in session and redirect
  21. if ( isset($_GET['track']) || isset($_GET['e']) )
  22. {
  23. $_SESSION['p_track'] = hesk_GET('track');
  24. $_SESSION['p_email'] = hesk_GET('e');
  25. header('Location: print.php');
  26. die();
  27. }
  28. /* Get the tracking ID */
  29. $trackingID = hesk_cleanID('p_track') or die("$hesklang[int_error]: $hesklang[no_trackID]");
  30. /* Connect to database */
  31. hesk_dbConnect();
  32. // Load custom fields
  33. require_once(HESK_PATH . 'inc/custom_fields.inc.php');
  34. // Perform additional checks for customers
  35. if (empty($_SESSION['id'])) {
  36. // Are we in maintenance mode?
  37. hesk_check_maintenance();
  38. // Verify email address match
  39. hesk_verifyEmailMatch($trackingID);
  40. $my_email = hesk_getCustomerEmail(0, 'p_email');
  41. hesk_verifyEmailMatch($trackingID, $my_email);
  42. }
  43. /* Clean ticket parameters from the session data, we don't need them anymore */
  44. hesk_cleanSessionVars( array('p_track', 'p_email') );
  45. /* Get ticket info */
  46. $res = hesk_dbQuery("SELECT `t1`.* , `ticketStatus`.`IsClosed` AS `isClosed`, `ticketStatus`.`Key` AS `statusKey`, `t2`.name AS `repliername`
  47. FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` AS `t1` LEFT JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` AS `t2` ON `t1`.`replierid` = `t2`.`id`
  48. INNER JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "statuses` AS `ticketStatus` ON `t1`.`status` = `ticketStatus`.`ID`
  49. WHERE `trackid`='" . hesk_dbEscape($trackingID) . "' LIMIT 1");
  50. if (hesk_dbNumRows($res) != 1) {
  51. hesk_error($hesklang['ticket_not_found']);
  52. }
  53. $ticket = hesk_dbFetchAssoc($res);
  54. // Demo mode
  55. if (defined('HESK_DEMO')) {
  56. $ticket['email'] = 'hidden@demo.com';
  57. $ticket['ip'] = '127.0.0.1';
  58. }
  59. /* Get category name and ID */
  60. $res = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` WHERE `id`='{$ticket['category']}' LIMIT 1");
  61. /* If this category has been deleted use the default category with ID 1 */
  62. if (hesk_dbNumRows($res) != 1) {
  63. $res = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` WHERE `id`='1' LIMIT 1");
  64. }
  65. $category = hesk_dbFetchAssoc($res);
  66. /* Get replies */
  67. $res = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "replies` WHERE `replyto`='{$ticket['id']}' ORDER BY `id` ASC");
  68. $replies = hesk_dbNumRows($res);
  69. $modsForHesk_settings = mfh_getSettings();
  70. ?>
  71. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  72. <html>
  73. <head>
  74. <title><?php echo $hesk_settings['hesk_title']; ?></title>
  75. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $hesklang['ENCODING']; ?>">
  76. <style type="text/css">
  77. body, table, td {
  78. color: black;
  79. font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
  80. font-size: <?php echo $hesk_settings['print_font_size']; ?>px;
  81. }
  82. p {
  83. color: black;
  84. font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
  85. font-size: <?php echo $hesk_settings['print_font_size']; ?>px;
  86. margin-top: 0;
  87. margin-bottom: 0;
  88. }
  89. table {
  90. border-collapse: collapse;
  91. }
  92. hr {
  93. border: 0;
  94. color: #9e9e9e;
  95. background-color: #9e9e9e;
  96. height: 1px;
  97. width: 100%;
  98. text-align: left;
  99. }
  100. </style>
  101. </head>
  102. <body onload="window.print()">
  103. <?php
  104. require_once(HESK_PATH . 'inc/print_template.inc.php');
  105. ?>
  106. </body>
  107. </html>