🚀 RELEASE: HESK v3.1.1

Signed-off-by: Luke Tainton <Luke.Tainton@mail.bcu.ac.uk>
This commit is contained in:
Luke Tainton
2020-06-27 10:54:38 +01:00
committed by Luke Tainton
parent d7fc040b1e
commit e0d6aa511b
175 changed files with 6334 additions and 6073 deletions

View File

@@ -649,13 +649,13 @@ function hesk_verifyGoto()
// Allowed files for redirect
$OK_urls = array(
'admin_main.php' => '',
'admin_settings_email.php' => '',
'admin_settings_general.php' => '',
'admin_settings_help_desk.php' => '',
'admin_settings_knowledgebase.php' => '',
'admin_settings_email.php' => '',
'admin_settings_ticket_list.php' => '',
'admin_settings_misc.php' => '',
'admin_settings_save.php' => 'admin_settings_general.php',
'admin_settings_ticket_list.php' => '',
'admin_ticket.php' => '',
'archive.php' => '',
'assign_owner.php' => '',
@@ -678,6 +678,7 @@ function hesk_verifyGoto()
'manage_knowledgebase.php' => '',
'manage_ticket_templates.php' => '',
'manage_users.php' => '',
'module_statistics.php' => '',
'new_ticket.php' => '',
'profile.php' => '',
'reports.php' => '',

View File

@@ -0,0 +1,33 @@
<?php
/**
*
* This file is part of HESK - PHP Help Desk Software.
*
* (c) Copyright Klemen Stirn. All rights reserved.
* https://www.hesk.com
*
* For the full copyright and license agreement information visit
* https://www.hesk.com/eula.php
*
*/
/* Check if this is a valid include */
if (!defined('IN_SCRIPT')) {die('Invalid attempt');}
// Override sensitive settings in the demo mode
$hesk_settings['db_host'] = $hesklang['hdemo'];
$hesk_settings['db_name'] = $hesklang['hdemo'];
$hesk_settings['db_user'] = $hesklang['hdemo'];
$hesk_settings['db_pass'] = $hesklang['hdemo'];
$hesk_settings['db_pfix'] = $hesklang['hdemo'];
$hesk_settings['smtp_host_name'] = $hesklang['hdemo'];
$hesk_settings['smtp_user'] = $hesklang['hdemo'];
$hesk_settings['smtp_password'] = $hesklang['hdemo'];
$hesk_settings['pop3_host_name'] = $hesklang['hdemo'];
$hesk_settings['pop3_user'] = $hesklang['hdemo'];
$hesk_settings['pop3_password'] = $hesklang['hdemo'];
$hesk_settings['imap_host_name'] = $hesklang['hdemo'];
$hesk_settings['imap_user'] = $hesklang['hdemo'];
$hesk_settings['imap_password'] = $hesklang['hdemo'];
$hesk_settings['recaptcha_public_key'] = $hesklang['hdemo'];
$hesk_settings['recaptcha_private_key'] = $hesklang['hdemo'];

View File

@@ -0,0 +1,183 @@
<?php
/**
*
* This file is part of HESK - PHP Help Desk Software.
*
* (c) Copyright Klemen Stirn. All rights reserved.
* https://www.hesk.com
*
* For the full copyright and license agreement information visit
* https://www.hesk.com/eula.php
*
*/
/* Check if this is a valid include */
if (!defined('IN_SCRIPT')) {die('Invalid attempt');}
?>
<div class="settings__status">
<h3><?php echo $hesklang['check_status']; ?></h3>
<ul class="settings__status_list">
<li>
<div class="list--name"><?php echo $hesklang['v']; ?></div>
<div class="list--status">
<?php echo $hesk_settings['hesk_version']; ?>
<?php
if ($hesk_settings['check_updates']) {
$latest = hesk_checkVersion();
if ($latest === true) {
echo ' - <span style="color:green">' . $hesklang['hud'] . '</span> ';
} elseif ($latest != -1) {
// Is this a beta/dev version?
if (strpos($hesk_settings['hesk_version'], 'beta') || strpos($hesk_settings['hesk_version'], 'dev') || strpos($hesk_settings['hesk_version'], 'RC')) {
echo ' <span style="color:darkorange">' . $hesklang['beta'] . '</span> '; ?><br><a href="https://www.hesk.com/update.php?v=<?php echo $hesk_settings['hesk_version']; ?>" target="_blank"><?php echo $hesklang['check4updates']; ?></a><?php
} else {
echo ' - <span style="color:darkorange;font-weight:bold">' . $hesklang['hnw'] . '</span> '; ?><br><a href="https://www.hesk.com/update.php?v=<?php echo $hesk_settings['hesk_version']; ?>" target="_blank"><?php echo $hesklang['getup']; ?></a><?php
}
} else {
?> - <a href="https://www.hesk.com/update.php?v=<?php echo $hesk_settings['hesk_version']; ?>" target="_blank"><?php echo $hesklang['check4updates']; ?></a><?php
}
} else {
?> - <a href="https://www.hesk.com/update.php?v=<?php echo $hesk_settings['hesk_version']; ?>" target="_blank"><?php echo $hesklang['check4updates']; ?></a><?php
}
?>
</div>
</li>
<li>
<div class="list--name"><?php echo $hesklang['phpv']; ?></div>
<div class="list--status"><?php echo defined('HESK_DEMO') ? $hesklang['hdemo'] : PHP_VERSION . ' ' . (function_exists('mysqli_connect') ? '(MySQLi)' : '(MySQL)'); ?></div>
</li>
<li>
<div class="list--name"><?php echo $hesklang['mysqlv']; ?></div>
<div class="list--status"><?php echo defined('HESK_DEMO') ? $hesklang['hdemo'] : hesk_dbResult( hesk_dbQuery('SELECT VERSION() AS version') ); ?></div>
</li>
<li>
<div class="list--name">/hesk_settings.inc.php</div>
<div class="list--status">
<?php
if (is_writable(HESK_PATH . 'hesk_settings.inc.php')) {
$enable_save_settings = 1;
echo '<span style="color:green">'.$hesklang['exists'].'</span>, <span style="color:green">'.$hesklang['writable'].'</span>';
} else {
echo '<span style="color:green">'.$hesklang['exists'].'</span><br><span style="color:red">'.$hesklang['not_writable'].'</span></div></li><li><div style="text-align:justify">'.$hesklang['e_settings'];
}
?>
</div>
</li>
<li>
<div class="list--name">/<?php echo $hesk_settings['attach_dir']; ?></div>
<div class="list--status">
<?php
if (is_dir(HESK_PATH . $hesk_settings['attach_dir'])) {
echo '<span style="color:green">'.$hesklang['exists'].'</span>, ';
if (is_writable(HESK_PATH . $hesk_settings['attach_dir'])) {
$enable_use_attachments = 1;
echo '<span style="color:green">'.$hesklang['writable'].'</span>';
} else {
echo '<br><span style="color:red">'.$hesklang['not_writable'].'</span></div></li><li><div style="text-align:justify">'.$hesklang['e_attdir'];
}
} else {
echo '<span style="color:red">'.$hesklang['no_exists'].'</span><br><span style="color:red">'.$hesklang['not_writable'].'</span></div></li><li><div style="text-align:justify">'.$hesklang['e_attdir'];
}
?>
</div>
</li>
<li>
<div class="list--name">/<?php echo $hesk_settings['cache_dir']; ?></div>
<div class="list--status">
<?php
if (is_dir(HESK_PATH . $hesk_settings['cache_dir'])) {
echo '<span style="color:green">'.$hesklang['exists'].'</span>, ';
if (is_writable(HESK_PATH . $hesk_settings['cache_dir'])) {
$enable_use_attachments = 1;
echo '<span style="color:green">'.$hesklang['writable'].'</span>';
} else {
echo '<br><span style="color:red">'.$hesklang['not_writable'].'</span></div></li><li><div style="text-align:justify">'.$hesklang['e_cdir'];
}
} else {
echo '<span style="color:red">'.$hesklang['no_exists'].'</span><br><span style="color:red">'.$hesklang['not_writable'].'</span></div></li><li><div style="text-align:justify">'.$hesklang['e_cdir'];
}
?>
</div>
</li>
</ul>
</div>
<?php
function hesk_checkVersion()
{
global $hesk_settings;
if ($latest = hesk_getLatestVersion() )
{
if ( strlen($latest) > 12 )
{
return -1;
}
elseif ($latest == $hesk_settings['hesk_version'])
{
return true;
}
else
{
return $latest;
}
}
else
{
return -1;
}
} // END hesk_checkVersion()
function hesk_getLatestVersion()
{
global $hesk_settings;
// Do we have a cached version file?
if ( file_exists(HESK_PATH . $hesk_settings['cache_dir'] . '/__latest.txt') )
{
if ( preg_match('/^(\d+)\|([\d.]+)+$/', @file_get_contents(HESK_PATH . $hesk_settings['cache_dir'] . '/__latest.txt'), $matches) && (time() - intval($matches[1])) < 3600 )
{
return $matches[2];
}
}
// No cached file or older than 3600 seconds, try to get an update
$hesk_version_url = 'http://hesk.com/version';
// Try using cURL
if ( function_exists('curl_init') )
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $hesk_version_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 6);
$latest = curl_exec($ch);
curl_close($ch);
return hesk_cacheLatestVersion($latest);
}
// Try using a simple PHP function instead
if ($latest = @file_get_contents($hesk_version_url) )
{
return hesk_cacheLatestVersion($latest);
}
// Can't check automatically, will need a manual check
return false;
} // END hesk_getLatestVersion()
function hesk_cacheLatestVersion($latest)
{
global $hesk_settings;
@file_put_contents(HESK_PATH . $hesk_settings['cache_dir'] . '/__latest.txt', time() . '|' . $latest);
return $latest;
} // END hesk_cacheLatestVersion()

File diff suppressed because one or more lines are too long

View File

@@ -49,11 +49,29 @@ if (isset($login_wrapper)) {
</div> <!-- End wrapper -->
<input type="hidden" name="HESK_PATH" value="<?php echo HESK_PATH; ?>">
<script src="<?php echo HESK_PATH; ?>js/svg4everybody.min.js"></script>
<script src="<?php echo HESK_PATH; ?>js/jquery.scrollbar.min.js"></script>
<script src="<?php echo HESK_PATH; ?>js/selectize.min.js"></script>
<?php
// Do we need the calendar functions?
if (defined('CALENDAR'))
{
?>
<script src="<?php echo HESK_PATH; ?>js/datepicker.min.js"></script>
<script src="<?php echo HESK_PATH; ?>js/datepicker.en.js"></script>
<script src="<?php echo HESK_PATH; ?>js/jquery.autocomplete.js"></script>
<script type="text/javascript">
(function ($) { $.fn.datepicker.language['en'] = {
days: ['<?php echo $hesklang['d0']; ?>', '<?php echo $hesklang['d1']; ?>', '<?php echo $hesklang['d2']; ?>', '<?php echo $hesklang['d3']; ?>', '<?php echo $hesklang['d4']; ?>', '<?php echo $hesklang['d5']; ?>', '<?php echo $hesklang['d6']; ?>'],
daysShort: ['<?php echo $hesklang['sun']; ?>', '<?php echo $hesklang['mon']; ?>', '<?php echo $hesklang['tue']; ?>', '<?php echo $hesklang['wed']; ?>', '<?php echo $hesklang['thu']; ?>', '<?php echo $hesklang['fri']; ?>', '<?php echo $hesklang['sat']; ?>'],
daysMin: ['<?php echo $hesklang['su']; ?>', '<?php echo $hesklang['mo']; ?>', '<?php echo $hesklang['tu']; ?>', '<?php echo $hesklang['we']; ?>', '<?php echo $hesklang['th']; ?>', '<?php echo $hesklang['fr']; ?>', '<?php echo $hesklang['sa']; ?>'],
months: ['<?php echo $hesklang['m1']; ?>','<?php echo $hesklang['m2']; ?>','<?php echo $hesklang['m3']; ?>','<?php echo $hesklang['m4']; ?>','<?php echo $hesklang['m5']; ?>','<?php echo $hesklang['m6']; ?>', '<?php echo $hesklang['m7']; ?>','<?php echo $hesklang['m8']; ?>','<?php echo $hesklang['m9']; ?>','<?php echo $hesklang['m10']; ?>','<?php echo $hesklang['m11']; ?>','<?php echo $hesklang['m12']; ?>'],
monthsShort: ['<?php echo $hesklang['ms01']; ?>','<?php echo $hesklang['ms02']; ?>','<?php echo $hesklang['ms03']; ?>','<?php echo $hesklang['ms04']; ?>','<?php echo $hesklang['ms05']; ?>','<?php echo $hesklang['ms06']; ?>', '<?php echo $hesklang['ms07']; ?>','<?php echo $hesklang['ms08']; ?>','<?php echo $hesklang['ms09']; ?>','<?php echo $hesklang['ms10']; ?>','<?php echo $hesklang['ms11']; ?>','<?php echo $hesklang['ms12']; ?>'],
today: '<?php echo $hesklang['r1']; ?>',
clear: '<?php echo $hesklang['clear']; ?>',
dateFormat: 'mm/dd/yyyy',
timeFormat: 'hh:ii aa',
firstDay: <?php echo $hesklang['first_day_of_week']; ?>
}; })(jQuery);
</script>
<?php
}
?>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/app<?php echo $hesk_settings['debug_mode'] ? '' : '.min'; ?>.js"></script>
<?php
@@ -86,6 +104,12 @@ if (defined('AUTOFOCUS'))
<?php
}
// Apply status coloring to drop-down box; needs to be called after app.js
if (isset($hesk_settings['print_status_select_box_jquery']))
{
hesk_print_status_select_box_jquery();
}
echo '
</body>
</html>

View File

@@ -24,10 +24,20 @@ $onload='';
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0">
<link rel="apple-touch-icon" sizes="180x180" href="<?php echo HESK_PATH; ?>img/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="<?php echo HESK_PATH; ?>img/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="<?php echo HESK_PATH; ?>img/favicon/favicon-16x16.png">
<link rel="manifest" href="<?php echo HESK_PATH; ?>img/favicon/site.webmanifest">
<link rel="mask-icon" href="<?php echo HESK_PATH; ?>img/favicon/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="<?php echo HESK_PATH; ?>img/favicon/favicon.ico">
<meta name="msapplication-TileColor" content="#2d89ef">
<meta name="msapplication-config" content="<?php echo HESK_PATH; ?>img/favicon/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" media="all" href="<?php echo HESK_PATH; ?>css/app<?php echo $hesk_settings['debug_mode'] ? '' : '.min'; ?>.css?<?php echo $hesk_settings['hesk_version']; ?>">
<script src="<?php echo HESK_PATH; ?>js/jquery-3.4.1.min.js"></script>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/hesk_javascript<?php echo $hesk_settings['debug_mode'] ? '' : '.min'; ?>.js?<?php echo $hesk_settings['hesk_version']; ?>"></script>
<script src="<?php echo HESK_PATH; ?>js/selectize.min.js"></script>
<?php
/* Tickets shouldn't be indexed by search engines */
@@ -46,6 +56,15 @@ $onload='';
<?php
}
/* If page styles <code> blocks */
if (defined('STYLE_CODE'))
{
?>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/prism.js?<?php echo $hesk_settings['hesk_version']; ?>"></script>
<link rel="stylesheet" media="all" href="<?php echo HESK_PATH; ?>css/prism.css?<?php echo $hesk_settings['hesk_version']; ?>">
<?php
}
/* If page requires timer load Javascript */
if (defined('TIMER'))
{
@@ -135,8 +154,66 @@ $onload='';
</script>
<?php
}
// Timeago
if (defined('TIMEAGO'))
{
?>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/timeago/jquery.timeago.js?<?php echo $hesk_settings['hesk_version']; ?>"></script>
<?php
// Load language file if not English
if ($hesklang['TIMEAGO_LANG_FILE'] != 'jquery.timeago.en.js')
{
?>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/timeago/locales/<?php echo $hesklang['TIMEAGO_LANG_FILE']; ?>?<?php echo $hesk_settings['hesk_version']; ?>"></script>
<?php
}
?>
<script type="text/javascript">
jQuery(document).ready(function() {
$("time.timeago").timeago();
});
</script>
<?php
}
// Back to top button
if (defined('BACK2TOP'))
{
?>
<script type="text/javascript">
jQuery(document).ready(function() {
var offset = 800;
var duration = 250;
jQuery(window).scroll(function() {
if (jQuery(this).scrollTop() > offset) {
jQuery('.back-to-top').fadeIn(duration);
} else {
jQuery('.back-to-top').fadeOut(duration);
}
});
jQuery('.back-to-top').click(function(event) {
event.preventDefault();
jQuery('html, body').animate({scrollTop: 0}, duration);
return false;
})
});
</script>
<?php
}
?>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/zebra_tooltips.min.js?<?php echo $hesk_settings['hesk_version']; ?>"></script>
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/zebra_tooltips.css">
<script type="text/javascript">
$(document).ready(function() {
// show tooltips for any element that has a class named "tooltip"
// the content of the tooltip will be taken from the element's "title" attribute
new $.Zebra_Tooltips($('.tooltip'), {animation_offset: 0, animation_speed: 100, hide_delay: 0, show_delay: 0, vertical_alignment: 'above', vertical_offset: 5});
});
</script>
</head>
<body onload="<?php echo $onload; unset($onload); ?>">

View File

@@ -16,6 +16,49 @@ if (!defined('IN_SCRIPT')) {die('Invalid attempt');}
/*** FUNCTIONS ***/
function hesk_kbCategoriesArray($public_only = true)
{
global $hesk_settings, $hesklang;
$res = hesk_dbQuery("SELECT * FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` " . ($public_only ? "WHERE `type`='0'" : "") . " ORDER BY `cat_order` ASC");
$categories = array();
while ($category = hesk_dbFetchAssoc($res))
{
$categories[$category['id']] = $category;
}
// Get the full parent path for each category
foreach ($categories as $id => $category)
{
$categories[$id]['parents'] = array();
// Top category? Just translate name.
if ($category['parent'] == 0)
{
$categories[$id]['name'] = $hesklang['kb_text'];
continue;
}
$current_parrent = $category['parent'];
$categories[$id]['parents'][] = $current_parrent;
while ($current_parrent > 0)
{
if (($current_parrent = $categories[$current_parrent]['parent']) > 0)
{
$categories[$id]['parents'][] = $current_parrent;
}
}
$categories[$id]['parents'] = array_reverse($categories[$id]['parents']);
}
return $categories;
} // END hesk_kbCategoriesArray()
function hesk_kbArticleContentPreview($txt)
{
global $hesk_settings;
@@ -61,7 +104,7 @@ function hesk_kbTopArticles($how_many, $index = 1)
}
/* Get list of articles from the database */
$res = hesk_dbQuery("SELECT `t1`.`id`,`t1`.`subject`,`t1`.`views`, `t1`.`content`, `t2`.`name` AS `category`, `t1`.`rating` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` AS `t1`
$res = hesk_dbQuery("SELECT `t1`.`id`,`t1`.`catid`,`t1`.`subject`,`t1`.`views`, `t1`.`content`, `t2`.`name` AS `category`, `t1`.`rating`, `t1`.`votes` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` AS `t1`
LEFT JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` AS `t2` ON `t1`.`catid` = `t2`.`id`
WHERE `t1`.`type`='0' AND `t2`.`type`='0'
ORDER BY `t1`.`sticky` DESC, `t1`.`views` DESC, `t1`.`art_order` ASC LIMIT ".intval($how_many));
@@ -73,8 +116,16 @@ function hesk_kbTopArticles($how_many, $index = 1)
while ($article = hesk_dbFetchAssoc($res))
{
// Top category? Translate name
if ($article['catid'] == 1)
{
$article['category'] = $hesklang['kb_text'];
}
$hesk_settings['kb_top_articles_printed'][] = $article['id'];
$article['content_preview'] = hesk_kbArticleContentPreview($article['content']);
$article['views_formatted'] = number_format($article['views'], 0, null, $hesklang['sep_1000']);
$article['votes_formatted'] = number_format($article['votes'], 0, null, $hesklang['sep_1000']);
$articles[] = $article;
}
@@ -119,14 +170,22 @@ function hesk_kbLatestArticles($how_many, $index = 1)
}
/* Get list of articles from the database */
$res = hesk_dbQuery("SELECT `t1`.`id`,`t1`.`subject`,`t1`.`dt`,`t1`.`views`, `t1`.`content`, `t1`.`rating`, `t2`.`name` AS `category` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` AS `t1`
$res = hesk_dbQuery("SELECT `t1`.`id`,`t1`.`catid`,`t1`.`subject`,`t1`.`dt`,`t1`.`views`, `t1`.`content`, `t1`.`rating`, `t1`.`votes`, `t2`.`name` AS `category` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` AS `t1`
LEFT JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` AS `t2` ON `t1`.`catid` = `t2`.`id`
WHERE `t1`.`type`='0' AND `t2`.`type`='0' {$sql_top}
ORDER BY `t1`.`dt` DESC LIMIT ".intval($how_many));
while ($article = hesk_dbFetchAssoc($res))
{
// Top category? Translate name
if ($article['catid'] == 1)
{
$article['category'] = $hesklang['kb_text'];
}
$article['content_preview'] = hesk_kbArticleContentPreview($article['content']);
$article['views_formatted'] = number_format($article['views'], 0, null, $hesklang['sep_1000']);
$article['votes_formatted'] = number_format($article['votes'], 0, null, $hesklang['sep_1000']);
$articles[] = $article;
}

View File

@@ -63,7 +63,7 @@ $calling_script = basename($_SERVER['PHP_SELF'], '.php');
</a>
</div>
<div class="listitem__menu">
<a href="#" class="listitem__caption">Templates</a>
<a href="#" class="listitem__caption"><?php echo $hesklang['nav_templates']; ?></a>
<ul class="submenu__list">
<li class="submenu__listitem <?php if ($calling_script === 'manage_canned') { ?>current<?php } ?>">
<a href="manage_canned.php">
@@ -186,7 +186,7 @@ $calling_script = basename($_SERVER['PHP_SELF'], '.php');
//Reports
if (hesk_checkPermission('can_run_reports',0)) {
$pages = array('reports', 'export');
$pages = array('reports', 'export', 'module_statistics');
$open_menu = in_array($calling_script, $pages) ? 'current submenu-is-opened' : '';
?>
<li class="listitem submenu <?php echo $open_menu; ?>">
@@ -206,9 +206,20 @@ $calling_script = basename($_SERVER['PHP_SELF'], '.php');
<?php echo $hesklang['reports_tab']; ?>
</a>
</li>
<li class="submenu__listitem <?php if ($calling_script === 'export') { ?>current<?php } ?>">
<a href="export.php">
<?php echo $hesklang['export']; ?>
<?php
if (hesk_checkPermission('can_export',0)) {
?>
<li class="submenu__listitem <?php if ($calling_script === 'export') { ?>current<?php } ?>">
<a href="export.php">
<?php echo $hesklang['export']; ?>
</a>
</li>
<?php
}
?>
<li class="submenu__listitem <?php if ($calling_script === 'module_statistics') { ?>current<?php } ?>">
<a href="module_statistics.php">
<?php echo $hesklang['statistics']['tab']; ?>
</a>
</li>
</ul>
@@ -422,7 +433,7 @@ $calling_script = basename($_SERVER['PHP_SELF'], '.php');
</a>
<div class="profile">
<div class="profile__item profile__item--mail">
<a href="mail.php" class="btn btn-empty">
<a href="mail.php" class="btn btn-empty tooltip" title="<?php echo $hesklang['m_h']; ?>">
<div class="profile__item_rel">
<svg class="icon icon-mail">
<use xlink:href="<?php echo HESK_PATH; ?>img/sprite.svg#icon-mail"></use>

View File

@@ -115,7 +115,7 @@ function hesk_get_status_select($ignore_status = '', $can_resolve = true, $selec
foreach ($hesk_settings['statuses'] as $k => $v)
{
if ($k == $ignore_status)
if ($k === $ignore_status)
{
continue;
}
@@ -198,7 +198,7 @@ function hesk_get_ticket_status($status, $append = '', $check_change = 1)
{
if (isset($hesk_settings['statuses'][$status]['color']))
{
return '<span style="color:'.$hesk_settings['statuses'][$status]['color'].'">'.$hesk_settings['statuses'][$status]['name'].'</font>';
return '<span style="color:'.$hesk_settings['statuses'][$status]['color'].'">'.$hesk_settings['statuses'][$status]['name'].'</span>';
}
return $hesk_settings['statuses'][$status]['name'];
@@ -207,13 +207,13 @@ function hesk_get_ticket_status($status, $append = '', $check_change = 1)
// Is this a default status? Use style class to add color
if (isset($hesk_settings['statuses'][$status]['class']))
{
return '<span class="'.$hesk_settings['statuses'][$status]['class'].'">'.$hesk_settings['statuses'][$status]['name'].'</font>' . $append;
return '<span class="'.$hesk_settings['statuses'][$status]['class'].'">'.$hesk_settings['statuses'][$status]['name'].'</span>' . $append;
}
// Does this status have a color code?
if (isset($hesk_settings['statuses'][$status]['color']))
{
return '<span style="color:'.$hesk_settings['statuses'][$status]['color'].'">'.$hesk_settings['statuses'][$status]['name'].'</font>' . $append;
return '<span style="color:'.$hesk_settings['statuses'][$status]['color'].'">'.$hesk_settings['statuses'][$status]['name'].'</span>' . $append;
}
// Just return the name if nothing matches
@@ -227,3 +227,40 @@ function hesk_can_customer_change_status($status)
global $hesk_settings;
return ( ! isset($hesk_settings['statuses'][$status]['can_customers_change']) || $hesk_settings['statuses'][$status]['can_customers_change'] == '1') ? true : false;
} // END hesk_get_ticket_status()
function hesk_print_status_select_box_jquery()
{
global $hesk_settings;
?>
<script>
$(document).ready(function() {
<?php
foreach ($hesk_settings['statuses'] as $id => $data)
{
// Is this a default status? Use style class to add color
if (isset($data['class']))
{
echo '$("#ticket-status-div > div.dropdown-select > ul.dropdown-list > li[data-option=\''.$id.'\']").addClass("'.$data['class'].'");'."\n";
echo '
$("#ticket-status-div > div.dropdown-select > div.label > span").filter(function () {
return $(this).text() == "'.addslashes($data['name']).'";
}).addClass("'.$data['class'].'");'."\n";
continue;
}
// Does this status have a color code?
if (isset($data['color']))
{
echo '$("#ticket-status-div > div.dropdown-select > ul.dropdown-list > li[data-option=\''.$id.'\']").css("color", "'.$data['color'].'");'."\n";
echo '
$("#ticket-status-div > div.dropdown-select > div.label > span").filter(function () {
return $(this).text() == "'.addslashes($data['name']).'";
}).css("color", "'.$data['color'].'");'."\n";
}
}
?>
});
</script>
<?php
} // END hesk_print_status_select_box_jquery()

View File

@@ -230,7 +230,7 @@ if ($total > 0)
// Start ticket row
echo '
<tr title="'.$ticket['message'].'"'.($ticket['owner'] ? '' : ' class="new"').'>
<tr title="'.$ticket['message'].'" class="'.($ticket['owner'] ? '' : 'new').($ticket['priority'] == 'critical' ? ' bg-critical' : '').'">
<td class="table__first_th sindu_handle">
<div class="checkbox-custom">
<input type="checkbox" id="ticket_check_'.$ticket['id'].'" name="id[]" value="'.$ticket['id'].'">
@@ -311,7 +311,7 @@ if ($total > 0)
// Print subject and link to the ticket page
if ( hesk_show_column('subject') )
{
echo '<td class="subject">'.($ticket['archive'] ? '<svg class="icon icon-tag" style="margin-right: 3px">
echo '<td class="subject">'.($ticket['archive'] ? '<svg class="icon icon-tag '.($ticket['owner'] != $_SESSION['id'] ? 'fill-gray' : '').'" style="margin-right: 3px">
<use xlink:href="'. HESK_PATH .'img/sprite.svg#icon-tag"></use>
</svg>' : '').$owner.'<a class="link" href="admin_ticket.php?track='.$ticket['trackid'].'&amp;Refresh='.$random.'">'.$ticket['subject'].'</a></td>';
}