Merge branch '3-0-0' into 'master'
3.0.0 Update See merge request !29merge-requests/30/head 3.0.0-beta-1
commit
38d56f195f
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,393 +0,0 @@
|
||||
<?php
|
||||
/*******************************************************************************
|
||||
* Title: Help Desk Software HESK
|
||||
* Version: 2.6.8 from 10th August 2016
|
||||
* Author: Klemen Stirn
|
||||
* Website: http://www.hesk.com
|
||||
********************************************************************************
|
||||
* COPYRIGHT AND TRADEMARK NOTICE
|
||||
* Copyright 2005-2015 Klemen Stirn. All Rights Reserved.
|
||||
* HESK is a registered trademark of Klemen Stirn.
|
||||
* The HESK may be used and modified free of charge by anyone
|
||||
* AS LONG AS COPYRIGHT NOTICES AND ALL THE COMMENTS REMAIN INTACT.
|
||||
* By using this code you agree to indemnify Klemen Stirn from any
|
||||
* liability that might arise from it's use.
|
||||
* Selling the code for this program, in part or full, without prior
|
||||
* written consent is expressly forbidden.
|
||||
* Using this code, in part or full, to create derivate work,
|
||||
* new scripts or products is expressly forbidden. Obtain permission
|
||||
* before redistributing this software over the Internet or in
|
||||
* any other medium. In all cases copyright and header must remain intact.
|
||||
* This Copyright is in full effect in any country that has International
|
||||
* Trade Agreements with the United States of America or
|
||||
* with the European Union.
|
||||
* Removing any of the copyright notices without purchasing a license
|
||||
* is expressly forbidden. To remove HESK copyright notice you must purchase
|
||||
* a license for this script. For more information on how to obtain
|
||||
* a license please visit the page below:
|
||||
* https://www.hesk.com/buy.php
|
||||
*******************************************************************************/
|
||||
|
||||
define('IN_SCRIPT', 1);
|
||||
define('HESK_PATH', '../');
|
||||
|
||||
/* Get all the required files and functions */
|
||||
require(HESK_PATH . 'hesk_settings.inc.php');
|
||||
require(HESK_PATH . 'inc/common.inc.php');
|
||||
require(HESK_PATH . 'inc/admin_functions.inc.php');
|
||||
|
||||
$id = hesk_input(hesk_GET('i'));
|
||||
$query = hesk_input(hesk_utf8_urldecode(hesk_GET('q')));
|
||||
$type = hesk_input(hesk_GET('t', 'text'));
|
||||
$maxlen = intval(hesk_GET('m', 255));
|
||||
$query = stripslashes($query);
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML; 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<head>
|
||||
<title><?php echo $hesklang['opt']; ?></title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=<?php echo $hesklang['ENCODING']; ?>"/>
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin: 5px 5px;
|
||||
padding: 0;
|
||||
background: #fff;
|
||||
color: black;
|
||||
font: 68.8%/1.5 Verdana, Geneva, Arial, Helvetica, sans-serif;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
p {
|
||||
color: black;
|
||||
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 1.0em;
|
||||
}
|
||||
|
||||
h3 {
|
||||
color: #AF0000;
|
||||
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
|
||||
font-weight: bold;
|
||||
font-size: 1.0em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
color: black;
|
||||
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
|
||||
font-weight: bold;
|
||||
font-size: 1.0em;
|
||||
}
|
||||
|
||||
.wrong {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.correct {
|
||||
color: green;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h3><?php echo $hesklang['opt']; ?></h3>
|
||||
|
||||
<p><i><?php echo $hesklang['ns']; ?></i></p>
|
||||
|
||||
<?php
|
||||
|
||||
switch ($type) {
|
||||
case 'text':
|
||||
echo '
|
||||
<script language="javascript">
|
||||
function hesk_saveOptions()
|
||||
{
|
||||
window.opener.document.getElementById(\'s_' . $id . '_val\').value = document.getElementById(\'o2\').value;
|
||||
window.opener.document.getElementById(\'s_' . $id . '_maxlen\').value = document.getElementById(\'o1\').value;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>' . $hesklang['custom_l'] . ':<td>
|
||||
<td><input type="text" name="o1" id="o1" value="' . $maxlen . '" size="30" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>' . $hesklang['defw'] . ':<td>
|
||||
<td><input type="text" name="o2" id="o2" value="' . $query . '" size="30" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p><input type="button" value=" ' . $hesklang['ok'] . ' " onclick="Javascript:hesk_saveOptions()" /></p>
|
||||
';
|
||||
break;
|
||||
case 'hidden':
|
||||
echo '
|
||||
<script language="javascript">
|
||||
function hesk_saveOptions()
|
||||
{
|
||||
window.opener.document.getElementById(\'s_' . $id . '_val\').value = document.getElementById(\'o1\').value;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
<p>' . $hesklang['hidden_custom_field_help'] . '</p>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>' . $hesklang['value_colon'] . '<td>
|
||||
<td><input type="text" name="o1" id="o1" value="' . $query . '" size="30" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p><input type="button" value=" ' . $hesklang['ok'] . ' " onclick="Javascript:hesk_saveOptions()" /></p>
|
||||
';
|
||||
break;
|
||||
case 'readonly':
|
||||
echo '
|
||||
<script language="javascript">
|
||||
function hesk_saveOptions()
|
||||
{
|
||||
window.opener.document.getElementById(\'s_' . $id . '_val\').value = document.getElementById(\'o1\').value;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
<p>' . $hesklang['readonly_custom_field_help'] . '</p>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>' . $hesklang['value_colon'] . '<td>
|
||||
<td><input type="text" name="o1" id="o1" value="' . $query . '" size="30" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p><input type="button" value=" ' . $hesklang['ok'] . ' " onclick="Javascript:hesk_saveOptions()" /></p>
|
||||
';
|
||||
break;
|
||||
case 'textarea':
|
||||
if (strpos($query, '#') !== false) {
|
||||
list($rows, $cols) = explode('#', $query);
|
||||
} else {
|
||||
$rows = '';
|
||||
$cols = '';
|
||||
}
|
||||
echo '
|
||||
<script language="javascript">
|
||||
function hesk_saveOptions()
|
||||
{
|
||||
window.opener.document.getElementById(\'s_' . $id . '_val\').value = document.getElementById(\'o1\').value + "#" + document.getElementById(\'o2\').value;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>' . $hesklang['rows'] . ':<td>
|
||||
<td><input type="text" name="o1" id="o1" value="' . $rows . '" size="5" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>' . $hesklang['cols'] . ':<td>
|
||||
<td><input type="text" name="o2" id="o2" value="' . $cols . '" size="5" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p><input type="button" value=" ' . $hesklang['ok'] . ' " onclick="Javascript:hesk_saveOptions()" /></p>
|
||||
';
|
||||
break;
|
||||
case 'radio':
|
||||
$options = str_replace('#HESK#', "\n", $query);
|
||||
echo '
|
||||
<script language="javascript">
|
||||
function hesk_saveOptions()
|
||||
{
|
||||
text = document.getElementById(\'o1\').value;
|
||||
text = text.replace(/^\s\s*/, \'\').replace(/\s\s*$/, \'\');
|
||||
text = escape(text);
|
||||
if(text.indexOf(\'%0D%0A\') > -1)
|
||||
{
|
||||
re_nlchar = /%0D%0A/g ;
|
||||
}
|
||||
else if(text.indexOf(\'%0A\') > -1)
|
||||
{
|
||||
re_nlchar = /%0A/g ;
|
||||
}
|
||||
else if(text.indexOf(\'%0D\') > -1)
|
||||
{
|
||||
re_nlchar = /%0D/g ;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(\'' . addslashes($hesklang['atl2']) . '\');
|
||||
return false;
|
||||
}
|
||||
text = unescape(text.replace(re_nlchar,\'#HESK#\'));
|
||||
|
||||
window.opener.document.getElementById(\'s_' . $id . '_val\').value = text;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
|
||||
<p>' . $hesklang['opt2'] . '</p>
|
||||
<textarea name="o1" id="o1" rows="6" cols="40">' . $options . '</textarea>
|
||||
<p><input type="button" value=" ' . $hesklang['ok'] . ' " onclick="Javascript:hesk_saveOptions()" /></p>
|
||||
';
|
||||
break;
|
||||
case 'select':
|
||||
$query = str_replace('{HESK_SELECT}', '', $query, $show_select);
|
||||
|
||||
$options = str_replace('#HESK#', "\n", $query);
|
||||
echo '
|
||||
<script language="javascript">
|
||||
function hesk_saveOptions()
|
||||
{
|
||||
text = document.getElementById(\'o1\').value;
|
||||
text = text.replace(/^\s\s*/, \'\').replace(/\s\s*$/, \'\');
|
||||
text = escape(text);
|
||||
if(text.indexOf(\'%0D%0A\') > -1)
|
||||
{
|
||||
re_nlchar = /%0D%0A/g ;
|
||||
}
|
||||
else if(text.indexOf(\'%0A\') > -1)
|
||||
{
|
||||
re_nlchar = /%0A/g ;
|
||||
}
|
||||
else if(text.indexOf(\'%0D\') > -1)
|
||||
{
|
||||
re_nlchar = /%0D/g ;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(\'' . addslashes($hesklang['atl2']) . '\');
|
||||
return false;
|
||||
}
|
||||
text = unescape(text.replace(re_nlchar,\'#HESK#\'));
|
||||
|
||||
if (document.getElementById(\'show_select\').checked)
|
||||
{
|
||||
text = "{HESK_SELECT}" + text;
|
||||
}
|
||||
|
||||
window.opener.document.getElementById(\'s_' . $id . '_val\').value = text;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
|
||||
<p>' . $hesklang['opt3'] . '</p>
|
||||
<p><label><input type="checkbox" name="show_select" id="show_select" value="1" ' . ($show_select ? 'checked="checked"' : '') . ' /> ' . $hesklang['show_select'] . '</label></p>
|
||||
<textarea name="o1" id="o1" rows="6" cols="40">' . $options . '</textarea>
|
||||
<p><input type="button" value=" ' . $hesklang['ok'] . ' " onclick="Javascript:hesk_saveOptions()" /></p>
|
||||
';
|
||||
break;
|
||||
case 'checkbox':
|
||||
$options = str_replace('#HESK#', "\n", $query);
|
||||
echo '
|
||||
<script language="javascript">
|
||||
function hesk_saveOptions()
|
||||
{
|
||||
text = document.getElementById(\'o1\').value;
|
||||
text = text.replace(/^\s\s*/, \'\').replace(/\s\s*$/, \'\');
|
||||
text = escape(text);
|
||||
if(text.indexOf(\'%0D%0A\') > -1)
|
||||
{
|
||||
re_nlchar = /%0D%0A/g ;
|
||||
}
|
||||
else if(text.indexOf(\'%0A\') > -1)
|
||||
{
|
||||
re_nlchar = /%0A/g ;
|
||||
}
|
||||
else if(text.indexOf(\'%0D\') > -1)
|
||||
{
|
||||
re_nlchar = /%0D/g ;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(\'' . addslashes($hesklang['atl2']) . '\');
|
||||
return false;
|
||||
}
|
||||
text = unescape(text.replace(re_nlchar,\'#HESK#\'));
|
||||
|
||||
window.opener.document.getElementById(\'s_' . $id . '_val\').value = text;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
|
||||
<p>' . $hesklang['opt4'] . '</p>
|
||||
<textarea name="o1" id="o1" rows="6" cols="40">' . $options . '</textarea>
|
||||
<p><input type="button" value=" ' . $hesklang['ok'] . ' " onclick="Javascript:hesk_saveOptions()" /></p>
|
||||
';
|
||||
break;
|
||||
case 'date':
|
||||
echo '<p>' . $hesklang['date_custom_field_text'] . '</p>';
|
||||
break;
|
||||
case 'multiselect':
|
||||
$options = str_replace('#HESK#', "\n", $query);
|
||||
echo '
|
||||
<script language="javascript">
|
||||
function hesk_saveOptions()
|
||||
{
|
||||
text = document.getElementById(\'o1\').value;
|
||||
text = text.replace(/^\s\s*/, \'\').replace(/\s\s*$/, \'\');
|
||||
text = escape(text);
|
||||
if(text.indexOf(\'%0D%0A\') > -1)
|
||||
{
|
||||
re_nlchar = /%0D%0A/g ;
|
||||
}
|
||||
else if(text.indexOf(\'%0A\') > -1)
|
||||
{
|
||||
re_nlchar = /%0A/g ;
|
||||
}
|
||||
else if(text.indexOf(\'%0D\') > -1)
|
||||
{
|
||||
re_nlchar = /%0D/g ;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(\'' . addslashes($hesklang['atl2']) . '\');
|
||||
return false;
|
||||
}
|
||||
text = unescape(text.replace(re_nlchar,\'#HESK#\'));
|
||||
|
||||
window.opener.document.getElementById(\'s_' . $id . '_val\').value = text;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
|
||||
<p>' . $hesklang['multiple_select_custom_field_text'] . '</p>
|
||||
<textarea name="o1" id="o1" rows="6" cols="40">' . $options . '</textarea>
|
||||
<p><input type="button" value=" ' . $hesklang['ok'] . ' " onclick="Javascript:hesk_saveOptions()" /></p>
|
||||
';
|
||||
break;
|
||||
case 'email':
|
||||
$ccSelected = $query == 'cc' ? 'selected="selected"' : '';
|
||||
$bccSelected = $query == 'bcc' ? 'selected="selected"' : '';
|
||||
echo '
|
||||
<script language="javascript">
|
||||
function hesk_saveOptions()
|
||||
{
|
||||
var dropdown = document.getElementById(\'o1\');
|
||||
window.opener.document.getElementById(\'s_' . $id . '_val\').value = dropdown.options[dropdown.selectedIndex].value;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
<p>' . $hesklang['email_custom_field_help'] . '</p>
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td>' . $hesklang['email_custom_field_label'] . ':</td>
|
||||
<td>
|
||||
<select name="o1" id="o1">
|
||||
<option value="cc" ' . $ccSelected . '>' . $hesklang['cc'] . '</option>
|
||||
<option value="bcc" ' . $bccSelected . '>' . $hesklang['bcc'] . '</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p><input type="button" value=" ' . $hesklang['ok'] . ' " onclick="Javascript:hesk_saveOptions()" /></p>
|
||||
';
|
||||
break;
|
||||
default:
|
||||
die('Invalid type');
|
||||
}
|
||||
?>
|
||||
|
||||
<p align="center"><a href="#" onclick="Javascript:window.close()"><?php echo $hesklang['cwin']; ?></a></p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php
|
||||
exit();
|
||||
?>
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
|
||||
// Define the current build
|
||||
define('MODS_FOR_HESK_BUILD', 31);
|
||||
define('MODS_FOR_HESK_BUILD', 32);
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,51 @@
|
||||
.white {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.red,
|
||||
.important,
|
||||
.critical-priority {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.green {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.orange,
|
||||
.rating {
|
||||
color: orange;
|
||||
}
|
||||
|
||||
.medium {
|
||||
color: #FF9900;
|
||||
}
|
||||
|
||||
.gray {
|
||||
color: grey;
|
||||
}
|
||||
|
||||
.critical {
|
||||
color: #9400d3;
|
||||
}
|
||||
|
||||
.blue {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.med-low-priority {
|
||||
background-color: #8BB467;
|
||||
}
|
||||
|
||||
.high-priority {
|
||||
background-color: #ff6a00;
|
||||
}
|
||||
|
||||
/* Hover colors */
|
||||
.red-on-hover:hover {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.gray-on-hover:hover {
|
||||
color: grey;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
.hide-on-overflow {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.no-wrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.event-category {
|
||||
border-radius: 4px;
|
||||
padding: 5px;
|
||||
}
|
@ -0,0 +1,179 @@
|
||||
.navbar-nav > .messages-menu > .dropdown-menu >li .menu > li > a,
|
||||
.sidebar-menu, .main-sidebar .user-panel, .sidebar-menu > li.header{
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.icon-link {
|
||||
font-size: 16px; !important;
|
||||
}
|
||||
|
||||
#due-date:hover,
|
||||
.click-to-edit:hover {
|
||||
font-weight: bolder;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.linkless-dropdown {
|
||||
display: block;
|
||||
padding: 3px 20px;
|
||||
clear: both;
|
||||
font-weight: normal;
|
||||
line-height: 1.42857143;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.dropdown-menu>li>span>.fa {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.no-margins {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 991px) {
|
||||
.ticket-cell-admin {
|
||||
border-bottom: solid 1px #ddd;
|
||||
border-right: 0;
|
||||
padding-top: 5px;
|
||||
height: 100px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.ticket-cell-admin {
|
||||
border-bottom: 0;
|
||||
border-right: solid 1px #ddd;
|
||||
margin-top: 1px;
|
||||
height: 100px;
|
||||
padding-top: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.ticket-property-title {
|
||||
color: rgba(255, 255, 255, .75);
|
||||
font-size: 11px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.ticketPropertyText {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.ticketPropertyText:hover {
|
||||
white-space: normal;
|
||||
overflow: visible;
|
||||
}
|
||||
}
|
||||
|
||||
.ticketPropertyText {
|
||||
font-size: 16px;
|
||||
line-height: 1em;
|
||||
color: #fff;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
.status-row {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.push-down-10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
|
||||
.attachment-table > tbody > tr > td > i {
|
||||
color: #ddd;
|
||||
text-shadow: 2px 2px #ccc;
|
||||
}
|
||||
|
||||
.attachment-table > tbody > tr > td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.attachment-table > tbody > tr > td > span > img {
|
||||
max-height: 80px;
|
||||
max-width: 80px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.note {
|
||||
border-bottom: solid 1px #000;
|
||||
}
|
||||
|
||||
.fileinput-button {
|
||||
width: 100%;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
margin-top: -2px;
|
||||
}
|
||||
|
||||
.file-row p.name {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.timeline-footer {
|
||||
border-top: 1px solid #f4f4f4;
|
||||
}
|
||||
|
||||
.timeline > .today-top {
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
|
||||
.white-readonly {
|
||||
cursor: text !important;
|
||||
background-color: #fff !important;
|
||||
}
|
||||
|
||||
button.dropdown-submit {
|
||||
background: none !important;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.form-signin {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.loginError {
|
||||
padding-top: 20px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.login-box {
|
||||
width: 500px;
|
||||
}
|
||||
|
||||
.login-box-body {
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.button-link {
|
||||
color: #4a5571;
|
||||
}
|
||||
|
||||
.button-link:hover {
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.button-link .col-xs-1 {
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.button-link .panel-body:hover {
|
||||
background-color: #EEE;
|
||||
}
|
||||
|
||||
.timeline-header.header-info {
|
||||
font-size: 14px !important;
|
||||
}
|
||||
|
||||
.full-width {
|
||||
width: 100%;
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
.move-down-20 {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.move-right-20 {
|
||||
margin-left: 20px;
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,249 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* This file is part of HESK - PHP Help Desk Software.
|
||||
*
|
||||
* (c) Copyright Klemen Stirn. All rights reserved.
|
||||
* http://www.hesk.com
|
||||
*
|
||||
* For the full copyright and license agreement information visit
|
||||
* http://www.hesk.com/eula.php
|
||||
*
|
||||
*/
|
||||
|
||||
/* Check if this is a valid include */
|
||||
if (!defined('IN_SCRIPT')) {die('Invalid attempt');}
|
||||
|
||||
// Get and append custom fields setup to the settings
|
||||
hesk_load_custom_fields();
|
||||
|
||||
// Save number of custom fields
|
||||
$hesk_settings['num_custom_fields'] = count($hesk_settings['custom_fields']);
|
||||
|
||||
// Load custom fields for admin functions
|
||||
if (function_exists('hesk_checkPermission'))
|
||||
{
|
||||
foreach ($hesk_settings['custom_fields'] as $k => $v)
|
||||
{
|
||||
$hesk_settings['possible_ticket_list'][$k] = $hesk_settings['custom_fields'][$k]['title'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*** FUNCTIONS ***/
|
||||
|
||||
|
||||
function hesk_load_custom_fields($category=0, $use_cache=1)
|
||||
{
|
||||
global $hesk_settings, $hesklang;
|
||||
|
||||
// Do we have a cached version available
|
||||
$cache_dir = dirname(dirname(__FILE__)).'/'.$hesk_settings['cache_dir'].'/';
|
||||
$cache_file = $cache_dir . 'cf_' . sha1($hesk_settings['language']).'.cache.php';
|
||||
|
||||
if ($use_cache && file_exists($cache_file))
|
||||
{
|
||||
require($cache_file);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Get custom fields from the database
|
||||
$hesk_settings['custom_fields'] = array();
|
||||
|
||||
// Make sure we have database connection
|
||||
hesk_load_database_functions();
|
||||
hesk_dbConnect();
|
||||
|
||||
$res = hesk_dbQuery("SELECT * FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."custom_fields` WHERE `use` IN ('1', '2') ORDER BY `place` ASC, `order` ASC");
|
||||
while ($row = hesk_dbFetchAssoc($res))
|
||||
{
|
||||
$id = 'custom' . $row['id'];
|
||||
unset($row['id']);
|
||||
|
||||
// Let's set field name for current language (or the first one we find)
|
||||
$names = json_decode($row['name'], true);
|
||||
$row['name'] = (isset($names[$hesk_settings['language']])) ? $names[$hesk_settings['language']] : reset($names);
|
||||
|
||||
// Name for display in ticket list; punctuation removed and shortened
|
||||
$row['title'] = hesk_remove_punctuation($row['name']);
|
||||
$row['title'] = strlen($row['title']) > 30 ? substr($row['title'], 0, 30) . '...' : $row['title'];
|
||||
|
||||
// A version with forced punctuation
|
||||
$row['name:'] = in_array(substr($row['name'], -1), array(':', '?', '!', '.') ) ? $row['name'] : $row['name'] . ':';
|
||||
|
||||
// Decode categories
|
||||
$row['category'] = strlen($row['category']) ? json_decode($row['category'], true) : array();
|
||||
|
||||
// Decode options
|
||||
$row['value'] = json_decode($row['value'], true);
|
||||
|
||||
// Add to custom_fields array
|
||||
$hesk_settings['custom_fields'][$id] = $row;
|
||||
}
|
||||
|
||||
// Try to cache results
|
||||
if ($use_cache && (is_dir($cache_dir) || ( @mkdir($cache_dir, 0777) && is_writable($cache_dir) ) ) )
|
||||
{
|
||||
// Is there an index.htm file?
|
||||
if ( ! file_exists($cache_dir.'index.htm'))
|
||||
{
|
||||
@file_put_contents($cache_dir.'index.htm', '');
|
||||
}
|
||||
|
||||
// Write data
|
||||
@file_put_contents($cache_file, '<?php if (!defined(\'IN_SCRIPT\')) {die();} $hesk_settings[\'custom_fields\']=' . var_export($hesk_settings['custom_fields'], true) . ';' );
|
||||
}
|
||||
|
||||
return true;
|
||||
} // END hesk_load_custom_fields()
|
||||
|
||||
|
||||
function hesk_is_custom_field_in_category($custom_id, $category_id)
|
||||
{
|
||||
global $hesk_settings;
|
||||
|
||||
return (
|
||||
empty($hesk_settings['custom_fields'][$custom_id]['category']) ||
|
||||
in_array($category_id, $hesk_settings['custom_fields'][$custom_id]['category'])
|
||||
) ? true : false;
|
||||
} // END hesk_is_custom_field_in_category()
|
||||
|
||||
|
||||
function hesk_custom_field_type($type)
|
||||
{
|
||||
global $hesklang;
|
||||
|
||||
switch ($type)
|
||||
{
|
||||
case 'text':
|
||||
return $hesklang['stf'];
|
||||
case 'textarea':
|
||||
return $hesklang['stb'];
|
||||
case 'radio':
|
||||
return $hesklang['srb'];
|
||||
case 'select':
|
||||
return $hesklang['ssb'];
|
||||
case 'checkbox':
|
||||
return $hesklang['scb'];
|
||||
case 'email':
|
||||
return $hesklang['email'];
|
||||
case 'date':
|
||||
return $hesklang['date'];
|
||||
case 'hidden':
|
||||
return $hesklang['sch'];
|
||||
case 'readonly':
|
||||
return $hesklang['readonly'];
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
} // END hesk_custom_field_type()
|
||||
|
||||
|
||||
function hesk_custom_date_display_format($timestamp, $format = 'F j, Y')
|
||||
{
|
||||
global $hesklang;
|
||||
|
||||
if ($timestamp == '')
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
if ( ! is_int($timestamp))
|
||||
{
|
||||
$timestamp = $timestamp * 1;
|
||||
}
|
||||
|
||||
if ($hesklang['LANGUAGE']=='English')
|
||||
{
|
||||
return gmdate($format, $timestamp);
|
||||
}
|
||||
|
||||
// Attempt to translate date for non-English users
|
||||
|
||||
$translate_months = array(
|
||||
'January' => $hesklang['m1'],
|
||||
'February' => $hesklang['m2'],
|
||||
'March' => $hesklang['m3'],
|
||||
'April' => $hesklang['m4'],
|
||||
'May' => $hesklang['m5'],
|
||||
'June' => $hesklang['m6'],
|
||||
'July' => $hesklang['m7'],
|
||||
'August' => $hesklang['m8'],
|
||||
'September' => $hesklang['m9'],
|
||||
'October' => $hesklang['m10'],
|
||||
'November' => $hesklang['m11'],
|
||||
'December' => $hesklang['m12']
|
||||
);
|
||||
|
||||
$translate_months_short = array(
|
||||
'Jan' => $hesklang['ms01'],
|
||||
'Feb' => $hesklang['ms02'],
|
||||
'Mar' => $hesklang['ms03'],
|
||||
'Apr' => $hesklang['ms04'],
|
||||
'May' => $hesklang['ms05'],
|
||||
'Jun' => $hesklang['ms06'],
|
||||
'Jul' => $hesklang['ms07'],
|
||||
'Aug' => $hesklang['ms08'],
|
||||
'Sep' => $hesklang['ms09'],
|
||||
'Oct' => $hesklang['ms10'],
|
||||
'Nov' => $hesklang['ms11'],
|
||||
'Dec' => $hesklang['ms12']
|
||||
);
|
||||
|
||||
$translate_days = array(
|
||||
'Monday' => $hesklang['d1'],
|
||||
'Tuesday' => $hesklang['d2'],
|
||||
'Wednesday' => $hesklang['d3'],
|
||||
'Thursday' => $hesklang['d4'],
|
||||
'Friday' => $hesklang['d5'],
|
||||
'Saturday' => $hesklang['d6'],
|
||||
'Sunday' => $hesklang['d0']
|
||||
);
|
||||
|
||||
$translate_days_short = array(
|
||||
'Mon' => $hesklang['mo'],
|
||||
'Tuw' => $hesklang['tu'],
|
||||
'Wes' => $hesklang['we'],
|
||||
'Thu' => $hesklang['th'],
|
||||
'Fri' => $hesklang['fr'],
|
||||
'Sat' => $hesklang['sa'],
|
||||
'Sun' => $hesklang['su']
|
||||
);
|
||||
|
||||
$date_translate = array();
|
||||
|
||||
if (strpos($format, 'F') !== false)
|
||||
{
|
||||
$date_translate = array_merge($date_translate, $translate_months);
|
||||
}
|
||||
|
||||
if (strpos($format, 'M') !== false)
|
||||
{
|
||||
$date_translate = array_merge($date_translate, $translate_months_short);
|
||||
}
|
||||
|
||||
if (strpos($format, 'l') !== false)
|
||||
{
|
||||
$date_translate = array_merge($date_translate, $translate_days);
|
||||
}
|
||||
|
||||
if (strpos($format, 'D') !== false)
|
||||
{
|
||||
$date_translate = array_merge($date_translate, $translate_days_short);
|
||||
}
|
||||
|
||||
if (count($date_translate))
|
||||
{
|
||||
return str_replace( array_keys($date_translate), array_values($date_translate), gmdate($format, $timestamp));
|
||||
}
|
||||
|
||||
return gmdate($format, $timestamp);
|
||||
|
||||
} // END hesk_custom_date_display_format()
|
||||
|
||||
|
||||
function hesk_remove_punctuation($in)
|
||||
{
|
||||
return rtrim($in, ':?!.');
|
||||
} // END hesk_remove_punctuation()
|
@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* This file is part of HESK - PHP Help Desk Software.
|
||||
*
|
||||
* (c) Copyright Klemen Stirn. All rights reserved.
|
||||
* http://www.hesk.com
|
||||
*
|
||||
* For the full copyright and license agreement information visit
|
||||
* http://www.hesk.com/eula.php
|
||||
*
|
||||
*/
|
||||
|
||||
// Check if this is a valid include
|
||||
if (!defined('IN_SCRIPT')) {die('Invalid attempt');}
|
||||
|
||||
// Auto-select first empty or error field on non-staff pages?
|
||||
if (defined('AUTOFOCUS'))
|
||||
{
|
||||
?>
|
||||
<script language="javascript">
|
||||
(function(){
|
||||
var forms = document.forms || [];
|
||||
for(var i = 0; i < forms.length; i++)
|
||||
{
|
||||
for(var j = 0; j < forms[i].length; j++)
|
||||
{
|
||||
if(
|
||||
!forms[i][j].readonly != undefined &&
|
||||
forms[i][j].type != "hidden" &&
|
||||
forms[i][j].disabled != true &&
|
||||
forms[i][j].style.display != 'none' &&
|
||||
(forms[i][j].className == 'isError' || forms[i][j].className == 'isNotice' || forms[i][j].value == '')
|
||||
)
|
||||
{
|
||||
forms[i][j].focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
// Users online
|
||||
if (defined('SHOW_ONLINE'))
|
||||
{
|
||||
hesk_printOnline();
|
||||
}
|
||||
|
||||
// The closing div here is to close the content area on each page. Annoying, but necessary.
|
||||
if (defined('ADMIN_PAGE')) {
|
||||
echo '
|
||||
</div>
|
||||
<footer class="main-footer">';
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
The code below handles HESK licensing. Removing or modifying this code without
|
||||
purchasing a HESK license is strictly prohibited.
|
||||
|
||||
To purchase a HESK license and support future HESK development please visit:
|
||||
https://www.hesk.com/buy.php
|
||||
*******************************************************************************/
|
||||
$hesk_settings['hesk_license']('HMgPSAxOw0KaWYgKGZpbGVfZXhpc3RzKEhFU0tfUEFUSCAuI
|
||||
CdoZXNrX2xpY2Vuc2UucGhwJykpDQp7DQokaCA9ICghZW1wdHkoJF9TRVJWRVJbJ0hUVFBfSE9TVCddK
|
||||
SkgPyAkX1NFUlZFUlsnSFRUUF9IT1NUJ10gOiAoKCFlbXB0eSgkX1NFUlZFUlsnU0VSVkVSX05BTUUnX
|
||||
SkpID8gJF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10gOiBnZXRlbnYoJ1NFUlZFUl9OQU1FJykpOw0KJGggP
|
||||
SBzdHJfcmVwbGFjZSgnd3d3LicsJycsc3RydG9sb3dlcigkaCkpOw0KaW5jbHVkZShIRVNLX1BBVEggL
|
||||
iAnaGVza19saWNlbnNlLnBocCcpOw0KaWYgKGlzc2V0KCRoZXNrX3NldHRpbmdzWydsaWNlbnNlJ10pI
|
||||
CYmIHN0cnBvcygkaGVza19zZXR0aW5nc1snbGljZW5zZSddLHNoYTEoJGguJ2gzJkZwMiNMYUEmNTkhd
|
||||
yg4LlpjXSordVI1MTInKSkgIT09IGZhbHNlKQ0Kew0KJHMgPSAwOw0KfQ0KZWxzZQ0Kew0KZWNobyAnP
|
||||
HAgc3R5bGU9InRleHQtYWxpZ246Y2VudGVyO2NvbG9yOnJlZDsiPklOVkFMSUQgTElDRU5TRSAoTk9UI
|
||||
FJFR0lTVEVSRUQgRk9SICcuJGguJykhPC9wPic7DQp9DQp9DQppZiAoJHMpDQp7DQplY2hvICc8cCBzd
|
||||
HlsZT0idGV4dC1hbGlnbjpjZW50ZXIiPjxzcGFuIGNsYXNzPSJzbWFsbGVyIj4mbmJzcDs8YnIgLz5Qb
|
||||
3dlcmVkIGJ5IDxhIGhyZWY9Imh0dHA6Ly93d3cuaGVzay5jb20iIGNsYXNzPSJzbWFsbGVyIiB0aXRsZ
|
||||
T0iRnJlZSBQSFAgSGVscCBEZXNrIFNvZnR3YXJlIj5IZWxwIERlc2sgU29mdHdhcmU8L2E+IDxiPkhFU
|
||||
0s8L2I+LCBicm91Z2h0IHRvIHlvdSBieSA8YSBocmVmPSJodHRwczovL3d3dy5zeXNhaWQuY29tLz91d
|
||||
G1fc291cmNlPUhlc2smYW1wO3V0bV9tZWRpdW09Y3BjJmFtcDt1dG1fY2FtcGFpZ249SGVza1Byb2R1Y
|
||||
3RfVG9fSFAiPlN5c0FpZDwvYT48L3NwYW4+PC9wPic7DQp9DQplY2hvICc8L3RkPjwvdHI+PC90YWJsZ
|
||||
T48L2Rpdj4nOw0KaW5jbHVkZShIRVNLX1BBVEggLiAnZm9vdGVyLnR4dCcpOw0KZWNobyAnPC9ib2R5P
|
||||
jwvaHRtbD4nOw==',"\112");
|
||||
|
||||
if (defined('ADMIN_PAGE')) {
|
||||
echo '</footer>';
|
||||
}
|
||||
|
||||
exit();
|
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
function mfh_get_mail_headers_for_dropdown($user_id, $hesk_settings, $hesklang) {
|
||||
$deleted_user_text = hesk_dbEscape($hesklang['deleted_user_title_case']);
|
||||
$sql = "SELECT `mail`.`id` AS `id`, `mail`.`subject` AS `subject`,
|
||||
`users`.`name` AS `from`, `mail`.`dt` AS `date`, `mail`.`from` AS `from_id`
|
||||
FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mail` AS `mail`
|
||||
LEFT JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` AS `users`
|
||||
ON `mail`.`from` = `users`.`id`
|
||||
WHERE `to` = " . hesk_dbEscape($user_id) . "
|
||||
AND `read` = '0'
|
||||
ORDER BY `mail`.`dt` DESC";
|
||||
|
||||
$rs = hesk_dbQuery($sql);
|
||||
|
||||
$mails = array();
|
||||
while ($row = hesk_dbFetchAssoc($rs)) {
|
||||
if ($row['from'] == null) {
|
||||
if ($row['from_id'] == 9999) {
|
||||
$row['from'] = 'HESK.com';
|
||||
} else {
|
||||
$row['from'] = $deleted_user_text;
|
||||
}
|
||||
}
|
||||
|
||||
$mails[] = $row;
|
||||
}
|
||||
|
||||
return $mails;
|
||||
}
|
@ -1,286 +1,451 @@
|
||||
<?php
|
||||
/*******************************************************************************
|
||||
* Title: Help Desk Software HESK
|
||||
* Version: 2.6.8 from 10th August 2016
|
||||
* Author: Klemen Stirn
|
||||
* Website: http://www.hesk.com
|
||||
********************************************************************************
|
||||
* COPYRIGHT AND TRADEMARK NOTICE
|
||||
* Copyright 2005-2015 Klemen Stirn. All Rights Reserved.
|
||||
* HESK is a registered trademark of Klemen Stirn.
|
||||
* The HESK may be used and modified free of charge by anyone
|
||||
* AS LONG AS COPYRIGHT NOTICES AND ALL THE COMMENTS REMAIN INTACT.
|
||||
* By using this code you agree to indemnify Klemen Stirn from any
|
||||
* liability that might arise from it's use.
|
||||
* Selling the code for this program, in part or full, without prior
|
||||
* written consent is expressly forbidden.
|
||||
* Using this code, in part or full, to create derivate work,
|
||||
* new scripts or products is expressly forbidden. Obtain permission
|
||||
* before redistributing this software over the Internet or in
|
||||
* any other medium. In all cases copyright and header must remain intact.
|
||||
* This Copyright is in full effect in any country that has International
|
||||
* Trade Agreements with the United States of America or
|
||||
* with the European Union.
|
||||
* Removing any of the copyright notices without purchasing a license
|
||||
* is expressly forbidden. To remove HESK copyright notice you must purchase
|
||||
* a license for this script. For more information on how to obtain
|
||||
* a license please visit the page below:
|
||||
* https://www.hesk.com/buy.php
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*
|
||||
* This file is part of HESK - PHP Help Desk Software.
|
||||
*
|
||||
* (c) Copyright Klemen Stirn. All rights reserved.
|
||||
* http://www.hesk.com
|
||||
*
|
||||
* For the full copyright and license agreement information visit
|
||||
* http://www.hesk.com/eula.php
|
||||
*
|
||||
*/
|
||||
|
||||
/* Check if this is a valid include */
|
||||
if (!defined('IN_SCRIPT')) {
|
||||
die('Invalid attempt');
|
||||
}
|
||||
|
||||
$num_mail = hesk_checkNewMail();
|
||||
$mails = mfh_get_mail_headers_for_dropdown($_SESSION['id'], $hesk_settings, $hesklang);
|
||||
?>
|
||||
<?php
|
||||
// Show a notice if we are in maintenance mode
|
||||
if (hesk_check_maintenance(false)) {
|
||||
echo '<div style="margin-bottom: -20px">';
|
||||
hesk_show_notice($hesklang['mma2'], $hesklang['mma1'], false);
|
||||
echo '</div>';
|
||||
}
|
||||
<div class="wrapper">
|
||||
<header class="main-header">
|
||||
|
||||
// Show a notice if we are in "Knowledgebase only" mode
|
||||
if (hesk_check_kb_only(false)) {
|
||||
echo '<div style="margin-bottom: -20px">';
|
||||
hesk_show_notice($hesklang['kbo2'], $hesklang['kbo1'], false);
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
<div class="enclosing">
|
||||
<nav class="navbar navbar-default navbar-static-top" role="navigation">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<!-- Logo -->
|
||||
<a href="<?php echo $modsForHesk_settings['navbar_title_url']; ?>" class="logo">
|
||||
<!-- mini logo for sidebar mini 50x50 pixels -->
|
||||
<span class="logo-mini"><!-- TODO Add setting for "Mini Title" --></span>
|
||||
<!-- logo for regular state and mobile devices -->
|
||||
<span class="logo-lg"><?php echo $hesk_settings['hesk_title'] ?></span>
|
||||
</a>
|
||||
|
||||
<!-- Header Navbar: style can be found in header.less -->
|
||||
<nav class="navbar navbar-static-top">
|
||||
<!-- Sidebar toggle button-->
|
||||
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="<?php echo $modsForHesk_settings['navbar_title_url']; ?>"><?php echo $hesk_settings['hesk_title'] ?></a>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||
<ul class="nav navbar-nav">
|
||||
</a>
|
||||
<!-- Navbar Right Menu -->
|
||||
<div class="navbar-custom-menu">
|
||||
<ul class="nav navbar-nav">
|
||||
<!-- Messages: style can be found in dropdown.less-->
|
||||
<?php
|
||||
$number_of_maintenance_warnings = 0;
|
||||
if (hesk_check_maintenance(false)) {
|
||||
$number_of_maintenance_warnings++;
|
||||
}
|
||||
if (hesk_check_kb_only(false)) {
|
||||
$number_of_maintenance_warnings++;
|
||||
}
|
||||
if ($number_of_maintenance_warnings > 0): ?>
|
||||
<li class="dropdown messages-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-exclamation-triangle"></i>
|
||||
<?php echo sprintf($hesklang['x_system_warnings'],
|
||||
$number_of_maintenance_warnings,
|
||||
$number_of_maintenance_warnings == 1
|
||||
? $hesklang['warning_title_case']
|
||||
: $hesklang['warnings_title_case']); ?>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li class="header"><?php echo sprintf($hesklang['x_system_warnings'],
|
||||
$number_of_maintenance_warnings,
|
||||
$number_of_maintenance_warnings == 1
|
||||
? $hesklang['warning_title_case']
|
||||
: $hesklang['warnings_title_case']); ?></li>
|
||||
<li>
|
||||
<ul class="menu">
|
||||
<?php if (hesk_check_maintenance(false)): ?>
|
||||
<li>
|
||||
<a href="#">
|
||||
<div class="pull-left">
|
||||
<i class="fa fa-exclamation-triangle orange fa-2x"></i>
|
||||
</div>
|
||||
<h4>
|
||||
<?php echo $hesklang['mma1']; ?>
|
||||
</h4>
|
||||
<p><?php echo $hesklang['mma2']; ?></p>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
endif;
|
||||
if (hesk_check_kb_only(false)):
|
||||
?>
|
||||
<li>
|
||||
<a href="#">
|
||||
<div class="pull-left">
|
||||
<i class="fa fa-exclamation-triangle orange fa-2x"></i>
|
||||
</div>
|
||||
<h4>
|
||||
<?php echo $hesklang['kbo1']; ?>
|
||||
</h4>
|
||||
<p><?php echo $hesklang['kbo2']; ?></p>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<li class="dropdown messages-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-envelope-o"></i>
|
||||
<?php if (count($mails) > 0): ?>
|
||||
<span class="label label-success"><?php echo count($mails); ?></span>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li class="header"><?php echo sprintf($hesklang['you_have_x_messages'],
|
||||
count($mails),
|
||||
count($mails) == 1
|
||||
? $hesklang['message_lower_case']
|
||||
: $hesklang['messages_lower_case']); ?></li>
|
||||
<!-- Begin New Messages -->
|
||||
<li>
|
||||
<!-- inner menu: contains the actual data -->
|
||||
<ul class="menu">
|
||||
<?php foreach ($mails as $mail): ?>
|
||||
<li><!-- start message -->
|
||||
<a href="mail.php?a=read&id=<?php echo $mail['id']; ?>">
|
||||
<h4>
|
||||
<?php echo $mail['from']; ?>
|
||||
<small><i class="fa fa-clock-o"></i> <?php echo hesk_dateToString($mail['date'], 0, 0, 0, true); ?></small>
|
||||
</h4>
|
||||
<p><?php echo $mail['subject']; ?></p>
|
||||
</a>
|
||||
</li>
|
||||
<!-- end message -->
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="footer"><a href="mail.php">See All Messages</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<!-- User Account: style can be found in dropdown.less -->
|
||||
<li class="dropdown user user-menu">
|
||||
<a href="profile.php">
|
||||
<!--<img src="dist/img/user2-160x160.jpg" class="user-image" alt="User Image">-->
|
||||
<i class="fa fa-user"></i>
|
||||
<span class="hidden-xs"><?php echo hesk_SESSION('name'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<!-- Control Sidebar Toggle Button -->
|
||||
<li>
|
||||
<a href="index.php?a=logout&token=<?php echo hesk_token_echo(); ?>">
|
||||
<i class="octicon octicon-sign-out"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
</header>
|
||||
<aside class="main-sidebar">
|
||||
<!-- sidebar: style can be found in sidebar.less -->
|
||||
<section class="sidebar">
|
||||
<!-- sidebar menu: : style can be found in sidebar.less -->
|
||||
<ul class="sidebar-menu">
|
||||
<li class="header"><?php echo $hesklang['main_navigation_uppercase']; ?></li>
|
||||
<?php
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_HOME') {
|
||||
$active = ' class="active"';
|
||||
$active = 'active';
|
||||
}
|
||||
?>
|
||||
<li<?php echo $active; ?>><a href="admin_main.php"><i
|
||||
class="fa fa-home" <?php echo $iconDisplay; ?>></i> <?php echo $hesklang['main_page']; ?>
|
||||
</a></li>
|
||||
<?php if (hesk_checkPermission('can_man_users', 0) && hesk_checkPermission('can_man_permission_tpl', 0)) {
|
||||
<li class="<?php echo $active; ?> treeview">
|
||||
<a href="admin_main.php">
|
||||
<i class="fa fa-home" <?php echo $iconDisplay; ?>></i> <span><?php echo $hesklang['main_page']; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php if (hesk_checkPermission('can_man_users', 0) && hesk_checkPermission('can_man_permission_tpl', 0)) :
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_USERS') {
|
||||
$active = ' active';
|
||||
$active = 'active';
|
||||
}
|
||||
echo '<li class="dropdown'.$active.'">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
<i class="fa fa-users" ' . $iconDisplay . '></i> ' . $hesklang['menu_users'] . '<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="manage_users.php">' . $hesklang['manage_users'] . '</a></li>
|
||||
<li><a href="manage_permission_templates.php">' . $hesklang['permission_tpl_man'] . '</a></li>
|
||||
</ul>
|
||||
</li>';
|
||||
} elseif (hesk_checkPermission('can_man_users', 0)) {
|
||||
?>
|
||||
<li class="<?php echo $active; ?> treeview">
|
||||
<a href="#">
|
||||
<i class="fa fa-users" <?php echo $iconDisplay; ?>></i>
|
||||
<span><?php echo $hesklang['menu_users']; ?></span>
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li>
|
||||
<a href="manage_users.php"><i class="fa fa-circle-o"></i> <?php echo $hesklang['manage_users']; ?></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="manage_permission_templates.php"><i class="fa fa-circle-o"></i> <?php echo $hesklang['permission_tpl_man']; ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php
|
||||
elseif (hesk_checkPermission('can_man_users', 0)) :
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_USERS') {
|
||||
$active = ' class="active"';
|
||||
$active = 'active';
|
||||
}
|
||||
echo '<li'.$active.'><a href="manage_users.php"><i class="fa fa-users" ' . $iconDisplay . '></i> ' . $hesklang['menu_users'] . '</a></li>';
|
||||
} elseif (hesk_checkPermission('can_man_permission_tpl', 0)) {
|
||||
?>
|
||||
<li class="<?php echo $active; ?> treeview">
|
||||
<a href="manage_users.php">
|
||||
<i class="fa fa-users" <?php echo $iconDisplay; ?>></i>
|
||||
<span><?php echo $hesklang['menu_users']; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
elseif (hesk_checkPermission('can_man_permission_tpl', 0)) :
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_USERS') {
|
||||
$active = ' class="active"';
|
||||
$active = 'active';
|
||||
}
|
||||
echo '<li'.$active.'><a href="manage_permission_templates.php">
|
||||
<i class="fa fa-users" ' . $iconDisplay . '></i> ' . $hesklang['permission_templates'] . '</a></li>';
|
||||
}
|
||||
if (hesk_checkPermission('can_man_cat', 0)) {
|
||||
?>
|
||||
<li class="<?php echo $active; ?> treeview">
|
||||
<a href="manage_permission_templates.php">
|
||||
<i class="fa fa-users" <?php echo $iconDisplay; ?>></i>
|
||||
<span><?php echo $hesklang['permission_templates']; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
endif;
|
||||
if (hesk_checkPermission('can_man_cat', 0)):
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_CATEGORIES') {
|
||||
$active = ' class="active"';
|
||||
$active = 'active';
|
||||
}
|
||||
echo '<li'.$active.'><a href="manage_categories.php"><i class="fa fa-pie-chart" ' . $iconDisplay . '></i> ' . $hesklang['menu_cat'] . '</a></li>';
|
||||
}
|
||||
if (hesk_checkPermission('can_man_canned', 0) && hesk_checkPermission('can_man_ticket_tpl', 0)) {
|
||||
?>
|
||||
<li class="<?php echo $active; ?> treeview">
|
||||
<a href="manage_categories.php">
|
||||
<i class="fa fa-pie-chart" <?php echo $iconDisplay; ?>></i>
|
||||
<span><?php echo $hesklang['menu_cat']; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
endif;
|
||||
if (hesk_checkPermission('can_man_canned', 0) && hesk_checkPermission('can_man_ticket_tpl', 0)):
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_CANNED') {
|
||||
$active = ' active';
|
||||
$active = 'active';
|
||||
}
|
||||
echo '<li class="dropdown'.$active.'">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
<i class="fa fa-file-text-o" ' . $iconDisplay . '></i> ' . $hesklang['menu_can'] . '<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="manage_canned.php">' . $hesklang['can_man_canned'] . '</a></li>
|
||||
<li><a href="manage_ticket_templates.php">' . $hesklang['ticket_tpl_man'] . '</a></li>
|
||||
</ul>
|
||||
</li>';
|
||||
} elseif (hesk_checkPermission('can_man_canned', 0)) {
|
||||
?>
|
||||
<li class="<?php echo $active; ?> treeview">
|
||||
<a href="#">
|
||||
<i class="fa fa-file-text-o" <?php echo $iconDisplay; ?>></i>
|
||||
<span><?php echo $hesklang['menu_can']; ?></span>
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li>
|
||||
<a href="manage_canned.php"><i class="fa fa-circle-o"></i> <?php echo $hesklang['can_man_canned']; ?></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="manage_ticket_templates.php"><i class="fa fa-circle-o"></i> <?php echo $hesklang['ticket_tpl_man']; ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php
|
||||
elseif (hesk_checkPermission('can_man_canned', 0)):
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_CANNED') {
|
||||
$active = ' class="active"';
|
||||
$active = 'active';
|
||||
}
|
||||
echo '<li'.$active.'><a href="manage_canned.php"><i class="fa fa-file-text-o" ' . $iconDisplay . '></i> ' . $hesklang['menu_can'] . '</a></li>';
|
||||
} elseif (hesk_checkPermission('can_man_ticket_tpl', 0)) {
|
||||
?>
|
||||
<li class="<?php echo $active; ?> treeview">
|
||||
<a href="manage_canned.php">
|
||||
<i class="fa fa-file-text-o" <?php echo $iconDisplay; ?>></i>
|
||||
<span><?php echo $hesklang['menu_can']; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
elseif (hesk_checkPermission('can_man_ticket_tpl', 0)):
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_CANNED') {
|
||||
$active = ' class="active"';
|
||||
$active = 'active';
|
||||
}
|
||||
echo '<li'.$active.'><a href="manage_ticket_templates.php"><i class="fa fa-file-text-o" ' . $iconDisplay . '></i> ' . $hesklang['menu_can'] . '</a></li>';
|
||||
}
|
||||
if ($hesk_settings['kb_enable']) {
|
||||
?>
|
||||
<li class="<?php echo $active; ?> treeview">
|
||||
<a href="manage_ticket_templates.php">
|
||||
<i class="fa fa-file-text-o" <?php echo $iconDisplay; ?>></i>
|
||||
<span><?php echo $hesklang['menu_can']; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
endif;
|
||||
if ($hesk_settings['kb_enable']):
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_KB') {
|
||||
$active = ' class="active"';
|
||||
$active = 'active';
|
||||
}
|
||||
if (hesk_checkPermission('can_man_kb', 0)) {
|
||||
echo '<li'.$active.'><a href="manage_knowledgebase.php"><i class="fa fa-book" ' . $iconDisplay . '></i> ' . $hesklang['menu_kb'] . '</a></li>';
|
||||
} else {
|
||||
echo '<li'.$active.'><a href="knowledgebase_private.php"><i class="fa fa-book" ' . $iconDisplay . '></i> ' . $hesklang['menu_kb'] . '</a></li>';
|
||||
}
|
||||
}
|
||||
if ($modsForHesk_settings['enable_calendar'] != 0) {
|
||||
if (hesk_checkPermission('can_man_kb', 0)):
|
||||
?>
|
||||
<li class="<?php echo $active; ?> treeview">
|
||||
<a href="manage_knowledgebase.php">
|
||||
<i class="fa fa-book" <?php echo $iconDisplay; ?>></i>
|
||||
<span><?php echo $hesklang['menu_kb']; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php else: ?>
|
||||
<li class="<?php echo $active; ?> treeview">
|
||||
<a href="knowledgebase_private.php">
|
||||
<i class="fa fa-book" <?php echo $iconDisplay; ?>></i>
|
||||
<span><?php echo $hesklang['menu_kb']; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
endif;
|
||||
if ($modsForHesk_settings['enable_calendar'] != 0):
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_CALENDAR') {
|
||||
$active = ' class="active"';
|
||||
$active = 'active';
|
||||
}
|
||||
echo '<li'.$active.'><a href="calendar.php"><i class="fa fa-calendar" ' . $iconDisplay . '></i> ' . $hesklang['calendar_title_case'] . '</a></li>';
|
||||
}
|
||||
if (hesk_checkPermission('can_run_reports', 0)) {
|
||||
?>
|
||||
<li class="<?php echo $active; ?> treeview">
|
||||
<a href="calendar.php">
|
||||
<i class="fa fa-calendar" <?php echo $iconDisplay; ?>></i>
|
||||
<span><?php echo $hesklang['calendar_title_case']; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
endif;
|
||||
if (hesk_checkPermission('can_run_reports', 0)):
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_REPORTS') {
|
||||
$active = ' class="active"';
|
||||
$active = 'active';
|
||||
}
|
||||
echo '<li'.$active.'><a href="reports.php"><i class="fa fa-line-chart" ' . $iconDisplay . '></i> ' . $hesklang['reports'] . '</a></li>';
|
||||
} elseif (hesk_checkPermission('can_export', 0)) {
|
||||
?>
|
||||
<li class="<?php echo $active; ?> treeview">
|
||||
<a href="reports.php">
|
||||
<i class="fa fa-line-chart" <?php echo $iconDisplay; ?>></i>
|
||||
<span><?php echo $hesklang['reports']; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
elseif (hesk_checkPermission('can_export', 0)):
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_REPORTS') {
|
||||
$active = ' class="active"';
|
||||
$active = 'active';
|
||||
}
|
||||
echo '<li'.$active.'><a href="export.php"><i class="fa fa-line-chart" ' . $iconDisplay . '></i> ' . $hesklang['reports'] . '</a></li>';
|
||||
}
|
||||
?>
|
||||
<li class="<?php echo $active; ?> treeview">
|
||||
<a href="export.php">
|
||||
<i class="fa fa-line-chart" <?php echo $iconDisplay; ?>></i>
|
||||
<span><?php echo $hesklang['reports']; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
$tools_count = 0;
|
||||
$dropdown_items = '<ul class="dropdown-menu" role="menu">';
|
||||
$dropdown_items = array();
|
||||
if (hesk_checkPermission('can_ban_emails', 0)) {
|
||||
$tools_count++;
|
||||
$dropdown_items .= '<li><a href="banned_emails.php">' . $hesklang['manage_banned_emails'] . '</a></li>';
|
||||
$dropdown_items['banned_emails'] = $hesklang['manage_banned_emails'];
|
||||
}
|
||||
if (hesk_checkPermission('can_ban_ips', 0)) {
|
||||
$tools_count++;
|
||||
$dropdown_items .= '<li><a href="banned_ips.php">' . $hesklang['manage_banned_ips'] . '</a></li>';
|
||||
$dropdown_items['banned_ips'] = $hesklang['manage_banned_ips'];
|
||||
}
|
||||
if (hesk_checkPermission('can_service_msg', 0)) {
|
||||
$tools_count++;
|
||||
$dropdown_items .= '<li><a href="service_messages.php">' . $hesklang['manage_service_messages'] . '</a></li>';
|
||||
$dropdown_items['service_messages'] = $hesklang['manage_service_messages'];
|
||||
}
|
||||
if (hesk_checkPermission('can_man_email_tpl', 0)) {
|
||||
$tools_count++;
|
||||
$dropdown_items .= '<li><a href="manage_email_templates.php">' . $hesklang['manage_email_templates'] . '</a></li>';
|
||||
$dropdown_items['manage_email_templates'] = $hesklang['manage_email_templates'];
|
||||
}
|
||||
if (hesk_checkPermission('can_man_ticket_statuses', 0)) {
|
||||
$tools_count++;
|
||||
$dropdown_items .= '<li><a href="manage_statuses.php">' . $hesklang['manage_statuses'] . '</a></li>';
|
||||
$dropdown_items['manage_statuses'] = $hesklang['manage_statuses'];
|
||||
}
|
||||
if (hesk_checkPermission('can_man_settings', 0)) {
|
||||
$tools_count++;
|
||||
$dropdown_items['custom_fields'] = $hesklang['manage_custom_fields'];
|
||||
}
|
||||
if (hesk_checkPermission('can_view_logs', 0)) {
|
||||
$tools_count++;
|
||||
$dropdown_items .= '<li><a href="view_message_log.php">' . $hesklang['view_message_log'] . '</a></li>';
|
||||
$dropdown_items['view_message_log'] = $hesklang['view_message_log'];
|
||||
}
|
||||
$dropdown_items .= '</ul>';
|
||||
|
||||
if ($tools_count > 1) {
|
||||
if (count($dropdown_items) > 1):
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_TOOLS') {
|
||||
$active = ' active';
|
||||
$active = 'active';
|
||||
}
|
||||
echo '<li class="dropdown'.$active.'">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
<i class="fa fa-wrench" ' . $iconDisplay . '></i> ' . $hesklang['tools'] . '<span class="caret"></span>
|
||||
</a>
|
||||
'.$dropdown_items.'
|
||||
</li>';
|
||||
} else {
|
||||
if (hesk_checkPermission('can_ban_emails', 0)) {
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_TOOLS') {
|
||||
$active = ' class="active"';
|
||||
}
|
||||
echo '<li'.$active.'><a href="banned_emails.php"><i class="fa fa-wrench" ' . $iconDisplay . '></i> ' . $hesklang['tools'] . '</a></li>';
|
||||
} elseif (hesk_checkPermission('can_ban_ips', 0)) {
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_TOOLS') {
|
||||
$active = ' class="active"';
|
||||
}
|
||||
echo '<li'.$active.'><a href="banned_ips.php"><i class="fa fa-wrench" ' . $iconDisplay . '></i> ' . $hesklang['tools'] . '</a></li>';
|
||||
} elseif (hesk_checkPermission('can_service_msg', 0)) {
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_TOOLS') {
|
||||
$active = ' class="active"';
|
||||
}
|
||||
echo '<li'.$active.'><a href="service_messages.php"><i class="fa fa-wrench" ' . $iconDisplay . '></i> ' . $hesklang['tools'] . '</a></li>';
|
||||
} elseif (hesk_checkPermission('can_man_email_tpl', 0)) {
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_TOOLS') {
|
||||
$active = ' class="active"';
|
||||
}
|
||||
echo '<li'.$active.'><a href="manage_email_templates.php"><i class="fa fa-wrench" ' . $iconDisplay . '></i> ' . $hesklang['tools'] . '</a></li>';
|
||||
} elseif (hesk_checkPermission('can_man_ticket_statuses', 0)) {
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_TOOLS') {
|
||||
$active = ' class="active"';
|
||||
}
|
||||
echo '<li'.$active.'><a href="manage_statuses.php"><i class="fa fa-wrench" ' . $iconDisplay . '></i> ' . $hesklang['tools'] . '</a></li>';
|
||||
} elseif (hesk_checkPermission('can_view_logs', 0)) {
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_TOOLS') {
|
||||
$active = ' class="active"';
|
||||
}
|
||||
echo '<li'.$active.'><a href="view_message_log.php"><i class="fa fa-wrench" ' . $iconDisplay . '></i> ' . $hesklang['tools'] . '</a></li>';
|
||||
?>
|
||||
<li class="<?php echo $active; ?> treeview">
|
||||
<a href="#">
|
||||
<i class="fa fa-wrench" <?php echo $iconDisplay; ?>></i>
|
||||
<span><?php echo $hesklang['tools']; ?></span>
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<?php foreach($dropdown_items as $path => $text): ?>
|
||||
<li>
|
||||
<a href="<?php echo $path; ?>.php"><i class="fa fa-circle-o"></i> <?php echo $text; ?></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php
|
||||
elseif (count($dropdown_items) == 1):
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_TOOLS') {
|
||||
$active = 'active';
|
||||
}
|
||||
}
|
||||
if (hesk_checkPermission('can_man_settings', 0)) {
|
||||
reset($dropdown_items);
|
||||
$page = key($dropdown_items);
|
||||
?>
|
||||
<li class="<?php echo $active; ?> treeview">
|
||||
<a href="<?php echo $page; ?>.php">
|
||||
<i class="fa fa-wrench" <?php echo $iconDisplay; ?>></i>
|
||||
<span><?php echo $dropdown_items[$page]; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
endif;
|
||||
if (hesk_checkPermission('can_man_settings', 0)):
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_SETTINGS') {
|
||||
$active = ' class="active"';
|
||||
$active = 'active';
|
||||
}
|
||||
echo '<li'.$active.'><a href="admin_settings.php"><i class="fa fa-cog" ' . $iconDisplay . '></i> ' . $hesklang['settings'] . '</a></li>';
|
||||
}
|
||||
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_PROFILE') {
|
||||
$active = ' class="active"';
|
||||
}
|
||||
?>
|
||||
<li<?php echo $active; ?>><a href="profile.php"><i
|
||||
class="fa fa-user" <?php echo $iconDisplay; ?>></i> <?php echo $hesklang['menu_profile']; ?>
|
||||
</a></li>
|
||||
<li class="<?php echo $active; ?> treeview">
|
||||
<a href="admin_settings.php">
|
||||
<i class="fa fa-cog" <?php echo $iconDisplay; ?>></i>
|
||||
<span><?php echo $hesklang['settings']; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
endif;
|
||||
$active = '';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_MAIL') {
|
||||
$active = ' class="active"';
|
||||
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_PROFILE') {
|
||||
$active = 'active';
|
||||
}
|
||||
?>
|
||||
<li<?php echo $active; ?>><a href="mail.php"><i
|
||||
class="fa fa-envelope-o" <?php echo $iconDisplay; ?>></i> <?php echo $hesklang['menu_msg']; ?>
|
||||
<?php if ($num_mail != 0) {
|
||||
echo '<span class="badge">';
|
||||
echo $num_mail;
|
||||
unset($num_mail);
|
||||
echo '</span>';
|
||||
} ?>
|
||||
</a></li>
|
||||
<?php include('custom/show_admin_nav-custom.inc.php');
|
||||
$iconDisplay = ($iconDisplay == '') ? 'style="font-size: 14px"' : $iconDisplay;
|
||||
?>
|
||||
<li><a href="index.php?a=logout&token=<?php echo hesk_token_echo(); ?>"><span
|
||||
class="octicon octicon-sign-out" <?php echo $iconDisplay; ?>></span> <?php echo $hesklang['logout']; ?>
|
||||
</a></li>
|
||||
<li class="<?php echo $active; ?> treeview">
|
||||
<a href="profile.php">
|
||||
<i class="fa fa-user" <?php echo $iconDisplay; ?>></i>
|
||||
<span><?php echo $hesklang['menu_profile']; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- /.navbar-collapse -->
|
||||
</nav>
|
||||
</section>
|
||||
<!-- /.sidebar -->
|
||||
</aside>
|
||||
<div class="content-wrapper">
|
@ -0,0 +1,168 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @param $search_filter Filter to search by. Valid criteria:
|
||||
* //TODO
|
||||
*/
|
||||
function get_tickets($search_filter, $hesk_settings) {
|
||||
$sql = "SELECT `id`, `trackid`, `name`, `email`, `category`, `priority`, `subject`, LEFT(`message`, 400) AS `message`,
|
||||
`dt`, `lastchange`, `firstreply`, `closedat`, `status`, `openedby`, `firstreplyby`, `closedby`, `replies`, `staffreplies`, `owner`,
|
||||
`time_worked`, `lastreplier`, `replierid`, `archive`, `locked`, `merged`, `due_date`, `latitude`, `longitude`, `user_agent`,
|
||||
`screen_resolution_width`, `screen_resolution_height`";
|
||||
|
||||
foreach ($hesk_settings['custom_fields'] as $k => $v) {
|
||||
if ($v['use']) {
|
||||
$sql .= ", `" . $k . "`";
|
||||
}
|
||||
}
|
||||
|
||||
$sql .= " FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` WHERE ";
|
||||
|
||||
// --> CATEGORY
|
||||
$category = $search_filter['category'];
|
||||
if ($category > 0 && hesk_okCategory($category, 0)) {
|
||||
$sql .= " `category`='{$category}' ";
|
||||
} else {
|
||||
$sql .= hesk_myCategories();
|
||||
}
|
||||
|
||||
// --> TAGGED
|
||||
$tagged = $search_filter['tagged'];
|
||||
if ($tagged) {
|
||||
$sql .= " AND `archive`='1' ";
|
||||
}
|
||||
|
||||
// --> TICKET ASSIGNMENT
|
||||
$sql = handle_ticket_assignments($search_filter, $sql);
|
||||
|
||||
// --> TICKET STATUS
|
||||
$statuses = $search_filter['status'];
|
||||
if (count($statuses) > 0) {
|
||||
$sql .= " AND `status` IN ('" . implode("','", $statuses) . "') ";
|
||||
}
|
||||
|
||||
// --> TICKET PRIORITY
|
||||
$priorities = $search_filter['priority'];
|
||||
|
||||
if (count($priorities) > 0) {
|
||||
$sql .= " AND `priority` IN ('" . implode("','", array_keys($priority)) . "') ";
|
||||
}
|
||||
|
||||
// Sorting
|
||||
$sql .= " ORDER BY ";
|
||||
|
||||
// --> PUSH TO TOP
|
||||
$force_to_top = $search_filter['force_to_top'];
|
||||
$direction = $search_filter['force_direction'];
|
||||
if ($force_to_top != NULL) {
|
||||
if ($force_to_top == 'owner') {
|
||||
$sql .= " CASE WHEN `owner` = '".intval($_SESSION['id'])."' THEN 1 ELSE 0 END DESC, `owner` ASC, ";
|
||||
} else {
|
||||
$sql .= ' `'.hesk_dbEscape($force_to_top).'` ';
|
||||
$sql .= $direction == 'ascending' ? 'ASC, ' : 'DESC, ';
|
||||
}
|
||||
}
|
||||
|
||||
// --> CRITICAL ON TOP
|
||||
$critical_on_top = $search_filter['critical_on_top'];
|
||||
if ($critical_on_top) {
|
||||
$sql .= " CASE WHEN `priority` = '0' THEN 1 ELSE 0 END DESC , ";
|
||||
}
|
||||
|
||||
// --> SORT BY
|
||||
$sort_by = $search_filter['sort_by'];
|
||||
$sort_direction = $search_filter['sort_direction'];
|
||||
|
||||
if ($sort_by) {
|
||||
$sql .= $sort_by == 'lastreplier'
|
||||
? " CASE WHEN `lastreplier` = '0' THEN 0 ELSE 1 END DESC, COALESCE(`replierid`, NULLIF(`lastreplier`, '0'), `name`) "
|
||||
: ' `'.hesk_dbEscape($sort_by).'` ';
|
||||
} else {
|
||||
$sql .= ' `status` ';
|
||||
$sort_by = 'status';
|
||||
}
|
||||
|
||||
$sql .= $sort_direction == 'ascending'
|
||||
? ' ASC '
|
||||
: ' DESC ';
|
||||
|
||||
if ($sort_by != 'priority') {
|
||||
$sql .= ' , `priority` ASC ';
|
||||
}
|
||||
|
||||
//Uncomment for debugging purposes
|
||||
//echo "SQL: $sql";
|
||||
$results = hesk_dbQuery($sql);
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
function handle_ticket_assignments($search_filter, $sql) {
|
||||
$assigned_to_self = $search_filter['assignment']['self'];
|
||||
$assigned_to_others = $search_filter['assignment']['others'];
|
||||
$assigned_to_no_one = $search_filter['assignment']['no_one'];
|
||||
|
||||
if (!$assigned_to_self && !$assigned_to_others && !$assigned_to_no_one) {
|
||||
$assigned_to_self = true;
|
||||
$assigned_to_others = true;
|
||||
$assigned_to_no_one = true;
|
||||
|
||||
if (!defined('MAIN_PAGE')) {
|
||||
hesk_show_notice($hesklang['e_nose']);
|
||||
}
|
||||
}
|
||||
|
||||
/* If the user doesn't have permission to view assigned to others block those */
|
||||
if (!hesk_checkPermission('can_view_ass_others',0)) {
|
||||
$assigned_to_others = 0;
|
||||
}
|
||||
|
||||
/* If the user doesn't have permission to view unassigned tickets block those */
|
||||
if (!hesk_checkPermission('can_view_unassigned',0)) {
|
||||
$assigned_to_no_one = 0;
|
||||
}
|
||||
|
||||
/* Process assignments */
|
||||
if (!$assigned_to_self || !$assigned_to_others || !$assigned_to_no_one) {
|
||||
if ($assigned_to_self && $assigned_to_others) {
|
||||
// All but unassigned
|
||||
$sql .= " AND `owner` > 0 ";
|
||||
} elseif ($assigned_to_self && $assigned_to_no_one) {
|
||||
// My tickets + unassigned
|
||||
$sql .= " AND `owner` IN ('0', '" . intval($_SESSION['id']) . "') ";
|
||||
} elseif ($assigned_to_others && $assigned_to_no_one) {
|
||||
// Assigned to others + unassigned
|
||||
$sql .= " AND `owner` != '" . intval($_SESSION['id']) . "' ";
|
||||
}
|
||||
elseif ($assigned_to_self) {
|
||||
// Assigned to me only
|
||||
$sql .= " AND `owner` = '" . intval($_SESSION['id']) . "' ";
|
||||
} elseif ($assigned_to_others) {
|
||||
// Assigned to others
|
||||
$sql .= " AND `owner` NOT IN ('0', '" . intval($_SESSION['id']) . "') ";
|
||||
} elseif ($assigned_to_no_one) {
|
||||
// Only unassigned
|
||||
$sql .= " AND `owner` = 0 ";
|
||||
}
|
||||
}
|
||||
|
||||
return $sql;
|
||||
}
|
||||
|
||||
function get_empty_filter() {
|
||||
$search_filter['category'] = NULL;
|
||||
$search_filter['tagged'] = NULL;
|
||||
$search_filter['status'] = NULL;
|
||||
$search_filter['priority'] = NULL;
|
||||
$search_filter['force_to_top'] = NULL;
|
||||
$search_filter['force_direction'] = NULL;
|
||||
$search_filter['critical_on_top'] = NULL;
|
||||
$search_filter['sort_by'] = NULL;
|
||||
$search_filter['sort_direction'] = NULL;
|
||||
$search_filter['assignment'] = array();
|
||||
$search_filter['assignment']['self'] = 0;
|
||||
$search_filter['assignment']['others'] = 0;
|
||||
$search_filter['assignment']['no_one'] = 0;
|
||||
|
||||
return $search_filter;
|
||||
}
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue