Merge branch 'new-staff-page' into '3-0-0'

New staff page



See merge request !27
merge-requests/29/head
Mike Koch 8 years ago
commit ccb8931157

@ -41,6 +41,7 @@ require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/status_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -53,50 +54,51 @@ define('PAGE_TITLE', 'ADMIN_HOME');
/* Print header */
require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
/* Print admin navigation */
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
<div class="row">
<div class="col-md-12 pad-down-20">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
/* Print tickets? */
if (hesk_checkPermission('can_view_tickets', 0)) {
if (!isset($_SESSION['hide']['ticket_list'])) //Number of tickets (table header. NOT ACTUAL TABLE)
{
echo '
<div class="panel panel-default">
<div class="panel-heading">
<h4>' . $hesklang['open_tickets'] . ' <span class="nu-floatRight panel-button"><a href="new_ticket.php" class="btn btn-success"><span class="glyphicon glyphicon-plus-sign"></span> ' . $hesklang['nti'] . '</a></span></h4>
</div>'; // The rest of the panel will be printed by print_tickets.inc.php
}
/* Reset default settings? */
if (isset($_GET['reset']) && hesk_token_check()) {
$res = hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` SET `default_list`='' WHERE `id` = '" . intval($_SESSION['id']) . "' LIMIT 1");
$_SESSION['default_list'] = '';
} /* Get default settings */
else {
parse_str($_SESSION['default_list'], $defaults);
$_GET = isset($_GET) && is_array($_GET) ? array_merge($_GET, $defaults) : $defaults;
}
/* Reset default settings? */
if (isset($_GET['reset']) && hesk_token_check()) {
$res = hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` SET `default_list`='' WHERE `id` = '" . intval($_SESSION['id']) . "' LIMIT 1");
$_SESSION['default_list'] = '';
} /* Get default settings */
else {
parse_str($_SESSION['default_list'], $defaults);
$_GET = isset($_GET) && is_array($_GET) ? array_merge($_GET, $defaults) : $defaults;
?>
<section class="content">
<?php hesk_handle_messages(); ?>
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['tickets']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<?php
/* Print tickets? */
if (hesk_checkPermission('can_view_tickets', 0)) {
/* Print the list of tickets */
require(HESK_PATH . 'inc/print_tickets.inc.php');
echo '<br>';
/* Print forms for listing and searching tickets */
require(HESK_PATH . 'inc/show_search_form.inc.php');
} else {
echo '<p><i>' . $hesklang['na_view_tickets'] . '</i></p>';
}
/* Print the list of tickets */
require(HESK_PATH . 'inc/print_tickets.inc.php');
echo "&nbsp;<br />";
/* Print forms for listing and searching tickets */
require(HESK_PATH . 'inc/show_search_form.inc.php');
} else {
echo '<p><i>' . $hesklang['na_view_tickets'] . '</i></p>';
}
$hesk_settings['hesk_license']('HMgPSAxOw0KaWYgKGZpbGVfZXhpc3RzKEhFU0tfUEFUSCAuI
?>
</div>
</div>
<div class="box">
<div class="box-body">
<?php
$hesk_settings['hesk_license']('HMgPSAxOw0KaWYgKGZpbGVfZXhpc3RzKEhFU0tfUEFUSCAuI
CdoZXNrX2xpY2Vuc2UucGhwJykpDQp7DQokaCA9ICghZW1wdHkoJF9TRVJWRVJbJ0hUVFBfSE9TVCddK
SkgPyAkX1NFUlZFUlsnSFRUUF9IT1NUJ10gOiAoKCFlbXB0eSgkX1NFUlZFUlsnU0VSVkVSX05BTUUnX
SkpID8gJF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10gOiBnZXRlbnYoJ1NFUlZFUl9OQU1FJykpOw0KJGggP
@ -114,13 +116,12 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
29tL2J1eS5waHAiIHRhcmdldD0iX2JsYW5rIj4nLiRoZXNrbGFuZ1snY2xpY2tfaW5mbyddLic8L2E+P
C9wPic7DQp9DQo=', "\112");
echo '<hr />&nbsp;<br />';
/* Clean unneeded session variables */
hesk_cleanSessionVars('hide');
?>
/* Clean unneeded session variables */
hesk_cleanSessionVars('hide');
?>
</div>
</div>
</div>
</section>
<?php

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -41,6 +41,7 @@ if (is_dir(HESK_PATH . 'install')) {
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -60,86 +61,103 @@ require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
// Print main manage users page
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
<div class="row move-down-20">
<div class="col-sm-4">
<div class="panel panel-default">
<div class="panel-heading">
API Information
<section class="content">
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['api_information']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<table class="table table-striped table-fixed">
<tr>
<td class="text-right">
API Version
<?php echo $hesklang['api_version']; ?>
</td>
<td class="pad-right-10 warning">
<td class="warning">
<?php echo $hesklang['beta_text']; ?>
</td>
</tr>
<tr>
<td class="text-right">
External API
<?php echo $hesklang['external_api']; ?>
</td>
<td class="pad-right-10 success" id="public-api-sidebar">
<td class="success" id="public-api-sidebar">
<?php
$enabled = $modsForHesk_settings['public_api'] == '1' ? '' : 'hide';
$disabled = $modsForHesk_settings['public_api'] == '1' ? 'hide' : '';
?>
<span id="public-api-sidebar-disabled" class="<?php echo $disabled; ?>">Disabled</span>
<span id="public-api-sidebar-enabled" class="<?php echo $enabled; ?>">Enabled</span>
<span id="public-api-sidebar-disabled" class="<?php echo $disabled; ?>">
<?php echo $hesklang['disabled_title_case']; ?>
</span>
<span id="public-api-sidebar-enabled" class="<?php echo $enabled; ?>">
<?php echo $hesklang['enabled_title_case']; ?>
</span>
</td>
</tr>
</table>
</div>
</div>
<div class="col-sm-8">
<h3>API Settings</h3>
<div class="footerWithBorder blankSpace"></div>
<ul class="nav nav-tabs">
<li class="active"><a href="#general" data-toggle="tab"><?php echo $hesklang['tab_1']; ?></a></li>
<li><a href="#user-security" data-toggle="tab">User Security</a></li>
<li><a href="#" target="_blank">API Documentation <i class="fa fa-external-link"></i></a></li>
</ul>
<div class="tab-content summaryList tabPadding">
<div class="tab-pane fade in active" id="general">
<form class="form-horizontal">
<div class="form-group">
<label for="public-api" class="col-sm-3 control-label">
Public API
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="Public API"
data-content="Enable or Disable the Public REST API."></i>
</label>
<div class="col-sm-9">
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['api_settings']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body nav-tabs-custom">
<ul class="nav nav-tabs">
<li class="active"><a href="#general" data-toggle="tab"><?php echo $hesklang['tab_1']; ?></a></li>
<li><a href="#user-security" data-toggle="tab"><?php echo $hesklang['user_security']; ?></a></li>
<li><a href="#" target="_blank"><?php echo $hesklang['api_documentation']; ?> <i class="fa fa-external-link"></i></a></li>
</ul>
<div class="tab-content summaryList tabPadding">
<div class="tab-pane fade in active" id="general">
<form class="form-horizontal">
<div class="form-group">
<label for="public-api" class="col-sm-3 control-label">
<?php echo $hesklang['external_api']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo $hesklang['external_api']; ?>"
data-content="<?php echo $hesklang['external_api_help']; ?>"></i>
</label>
<div class="col-sm-9">
<span class="btn-group" data-toggle="buttons">
<?php
$on = $modsForHesk_settings['public_api'] == '1' ? 'active' : '';
$off = $modsForHesk_settings['public_api'] == '1' ? '' : 'active';
?>
<label id="enable-api-button" class="btn btn-success <?php echo $on; ?>">
<input type="radio" name="public-api" value="1" checked> <i class="fa fa-check-circle"></i> Enable
<input type="radio" name="public-api" value="1"> <i class="fa fa-check-circle"></i>
<?php echo $hesklang['enable']; ?>
</label>
<label id="disable-api-button" class="btn btn-danger <?php echo $off; ?>">
<input type="radio" name="public-api" value="0"> <i class="fa fa-times-circle"></i> Disable
<input type="radio" name="public-api" value="0"> <i class="fa fa-times-circle"></i>
<?php echo $hesklang['disable']; ?>
</label>
</span>
<span>
<i id="public-api-success" class="fa fa-check-circle fa-2x green hide media-middle"
data-toggle="tooltip" title="Changes saved!"></i>
data-toggle="tooltip" title="<?php echo $hesklang['changes_saved']; ?>"></i>
<i id="public-api-failure" class="fa fa-times-circle fa-2x red hide media-middle"
data-toggle="tooltip" title="Saving changes failed. Check the logs for more information."></i>
data-toggle="tooltip" title="<?php echo $hesklang['save_failed_check_logs']; ?>"></i>
<i id="public-api-saving" class="fa fa-spin fa-spinner fa-2x hide media-middle"
data-toggle="tooltip" title="Saving..."></i>
data-toggle="tooltip" title="<?php echo $hesklang['saving']; ?>"></i>
</span>
</div>
</div>
</div>
</form>
</div>
<div class="tab-pane fade in" id="user-security">
<div class="panel panel-default">
<div class="panel-heading">
User Security
</div>
</form>
</div>
<div class="tab-pane fade in" id="user-security">
<?php
$users = array();
$userRs = hesk_dbQuery("SELECT `id`, `user`, `name` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` WHERE `active` = '1'");
@ -155,51 +173,53 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<table class="table table-striped">
<thead>
<tr>
<th>Username</th>
<th>Name</th>
<th>Number of Tokens</th>
<th>Actions</th>
<th><?php echo $hesklang['username']; ?></th>
<th><?php echo $hesklang['name']; ?></th>
<th><?php echo $hesklang['number_of_tokens']; ?></th>
<th><?php echo $hesklang['actions']; ?></th>
</tr>
</thead>
<tbody>
<?php
foreach ($users as $row):
?>
<tr>
<td><?php echo $row['user']; ?></td>
<td><?php echo $row['name']; ?></td>
<td id="token-<?php echo $row['id']; ?>-count"><?php echo $row['number_of_tokens']; ?></td>
<td>
?>
<tr>
<td><?php echo $row['user']; ?></td>
<td><?php echo $row['name']; ?></td>
<td id="token-<?php echo $row['id']; ?>-count"><?php echo $row['number_of_tokens']; ?></td>
<td>
<span class="btn-group">
<button class="btn btn-default btn-xs" onclick="generateToken(<?php echo $row['id']; ?>)">
<i class="fa fa-plus-circle"></i> Generate New Token
<i class="fa fa-plus-circle"></i>
<?php echo $hesklang['generate_new_token']; ?>
</button>
<button class="btn btn-danger btn-xs" onclick="clearTokens(<?php echo $row['id']; ?>)">
<i class="fa fa-undo"></i> Reset Tokens
<i class="fa fa-times"></i>
<?php echo $hesklang['revoke_all_tokens']; ?>
</button>
</span>
<span>
<i id="token-<?php echo $row['id']; ?>-success" class="fa fa-check-circle fa-2x green hide media-middle"
data-toggle="tooltip" title="Changes saved!"></i>
data-toggle="tooltip" title="<?php echo $hesklang['changes_saved']; ?>"></i>
<i id="token-<?php echo $row['id']; ?>-failure" class="fa fa-times-circle fa-2x red hide media-middle"
data-toggle="tooltip" title="Saving changes failed. Check the logs for more information."></i>
data-toggle="tooltip" title="<?php echo $hesklang['save_failed_check_logs']; ?>"></i>
<i id="token-<?php echo $row['id']; ?>-saving" class="fa fa-spin fa-spinner fa-2x hide media-middle"
data-toggle="tooltip" title="Saving..."></i>
data-toggle="tooltip" title="<?php echo $hesklang['saving']; ?>"></i>
</span>
</td>
</tr>
<tr id="token-<?php echo $row['id']; ?>-created" class="success hide">
<td colspan="4">
Generated Token: <code class="token"></code>
<p><b>NOTE:</b> Please record this token, as this is the only time you will be able to view it!</p>
</td>
</tr>
<tr id="token-<?php echo $row['id']; ?>-reset" class="success hide">
<td colspan="4">
<p>All tokens for this user have been removed!</p>
</td>
</tr>
<?php
</td>
</tr>
<tr id="token-<?php echo $row['id']; ?>-created" class="success hide">
<td colspan="4">
<?php echo $hesklang['generated_token_colon']; ?> <code class="token"></code>
<p><b><?php echo $hesklang['record_this_token_warning']; ?></b></p>
</td>
</tr>
<tr id="token-<?php echo $row['id']; ?>-reset" class="success hide">
<td colspan="4">
<p><?php echo $hesklang['all_tokens_revoked']; ?></p>
</td>
</tr>
<?php
endforeach;
?>
</tbody>
@ -208,7 +228,8 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
</div>
</div>
</div>
</section>
<?php
require_once(HESK_PATH . 'inc/footer.inc.php');
exit();
<?php
require_once(HESK_PATH . 'inc/footer.inc.php');
exit();

@ -36,6 +36,7 @@ define('PAGE_TITLE', 'ADMIN_TOOLS');
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -66,175 +67,184 @@ require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
/* Print main manage users page */
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
<div class="row pad-down-20">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active">
<a href="#"><?php echo $hesklang['banemail']; ?> <i class="fa fa-question-circle settingsquestionmark"
onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['banemail_intro']); ?>')"></i></a>
</li>
<?php
// Show a link to banned_ips.php if user has permission to do so
if (hesk_checkPermission('can_ban_ips', 0)) {
echo '
<section class="content">
<div class="box">
<div class="box-body">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active">
<a href="#"><?php echo $hesklang['banemail']; ?> <i class="fa fa-question-circle settingsquestionmark"
onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['banemail_intro']); ?>')"></i></a>
</li>
<?php
// Show a link to banned_ips.php if user has permission to do so
if (hesk_checkPermission('can_ban_ips', 0)) {
echo '
<li role="presentation">
<a title="' . $hesklang['banip'] . '" href="banned_ips.php">' . $hesklang['banip'] . '</a>
</li>';
}
// Show a link to status_message.php if user has permission to do so
if (hesk_checkPermission('can_service_msg', 0)) {
echo '
}
// Show a link to status_message.php if user has permission to do so
if (hesk_checkPermission('can_service_msg', 0)) {
echo '
<li role="presentation">
<a title="' . $hesklang['sm_title'] . '" href="service_messages.php">' . $hesklang['sm_title'] . '</a>
</li>';
}
}
// Show a link to email tpl management if user has permission to do so
if (hesk_checkPermission('can_man_email_tpl', 0)) {
echo '
// Show a link to email tpl management if user has permission to do so
if (hesk_checkPermission('can_man_email_tpl', 0)) {
echo '
<li role="presentation">
<a title="' . $hesklang['email_templates'] . '" href="manage_email_templates.php">' . $hesklang['email_templates'] . '</a>
</li>
';
}
if (hesk_checkPermission('can_man_ticket_statuses', 0)) {
echo '
}
if (hesk_checkPermission('can_man_ticket_statuses', 0)) {
echo '
<li role="presentation">
<a title="' . $hesklang['statuses'] . '" href="manage_statuses.php">' . $hesklang['statuses'] . '</a>
</li>
';
}
?>
</ul>
<div class="tab-content summaryList tabPadding">
<script language="javascript" type="text/javascript"><!--
function confirm_delete() {
if (confirm('<?php echo hesk_makeJsString($hesklang['delban_confirm']); ?>')) {
return true;
}
else {
return false;
}
}
//-->
</script>
<div class="row">
<div class="col-md-8">
<br><br>
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
?>
<form action="banned_emails.php" method="post" name="form1" role="form" class="form-horizontal" data-toggle="validator">
<div class="form-group">
<label for="text" class="col-sm-3 control-label"><?php echo $hesklang['bananemail']; ?></label>
<div class="col-sm-9">
<input type="text" class="form-control" name="email" size="30" maxlength="255" data-error="<?php echo htmlspecialchars($hesklang['enterbanemail']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>" required>
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
<input type="hidden" name="a" value="ban"/>
<div class="help-block with-errors"></div>
}
?>
</ul>
<div class="tab-content summaryList tabPadding">
<script language="javascript" type="text/javascript"><!--
function confirm_delete() {
if (confirm('<?php echo hesk_makeJsString($hesklang['delban_confirm']); ?>')) {
return true;
}
else {
return false;
}
}
//-->
</script>
<div class="row">
<div class="col-md-8">
<br><br>
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
?>
<form action="banned_emails.php" method="post" name="form1" role="form" class="form-horizontal" data-toggle="validator">
<div class="form-group">
<label for="text" class="col-sm-3 control-label"><?php echo $hesklang['bananemail']; ?></label>
<div class="col-sm-9">
<input type="text" class="form-control" name="email" size="30" maxlength="255" data-error="<?php echo htmlspecialchars($hesklang['enterbanemail']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>" required>
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
<input type="hidden" name="a" value="ban"/>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<div class="col-sm-9 col-sm-offset-3">
<input type="submit" value="<?php echo $hesklang['savebanemail']; ?>"
class="btn btn-default">
</div>
</div>
</form>
</div>
</div>
<div class="form-group">
<div class="col-sm-9 col-sm-offset-3">
<input type="submit" value="<?php echo $hesklang['savebanemail']; ?>"
class="btn btn-default">
<div class="col-md-4">
<h6 class="bold"><?php echo $hesklang['banex']; ?></h6>
<div class="footerWithBorder blankSpace"></div>
<b>john@email.com</b><br/>
<b>@domain.com</b>
</div>
</div>
</form>
</div>
<div class="col-md-4">
<h6 class="bold"><?php echo $hesklang['banex']; ?></h6>
<div class="footerWithBorder blankSpace"></div>
<b>john@email.com</b><br/>
<b>@domain.com</b>
</div>
</div>
<div class="row">
<?php
// Get banned emails from database
$res = hesk_dbQuery('SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'banned_emails` ORDER BY `email` ASC');
$num = hesk_dbNumRows($res);
echo '<h4>' . $hesklang['eperm'] . '</h4>';
if ($num < 1) {
echo '<p>' . $hesklang['no_banemails'] . '</p>';
} else {
// List of staff
if (!isset($admins)) {
$admins = array();
$res2 = hesk_dbQuery("SELECT `id`,`name` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users`");
while ($row = hesk_dbFetchAssoc($res2)) {
$admins[$row['id']] = $row['name'];
}
}
?>
<table class="table table-hover">
<thead>
<tr>
<th><?php echo $hesklang['email']; ?></th>
<th><?php echo $hesklang['banby']; ?></th>
<th><?php echo $hesklang['date']; ?></th>
<div class="row">
<div class="col-sm-12">
<?php
if ($can_unban) {
?>
<th><?php echo $hesklang['opt']; ?></th>
<?php
}
?>
</tr>
</thead>
<tbody>
<?php
while ($ban = hesk_dbFetchAssoc($res)) {
$color = '';
if (isset($_SESSION['ban_email']['id']) && $ban['id'] == $_SESSION['ban_email']['id']) {
$color = 'success';
unset($_SESSION['ban_email']['id']);
}
echo '
// Get banned emails from database
$res = hesk_dbQuery('SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'banned_emails` ORDER BY `email` ASC');
$num = hesk_dbNumRows($res);
echo '<h4>' . $hesklang['eperm'] . '</h4>';
if ($num < 1) {
echo '<p>' . $hesklang['no_banemails'] . '</p>';
} else {
// List of staff
if (!isset($admins)) {
$admins = array();
$res2 = hesk_dbQuery("SELECT `id`,`name` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users`");
while ($row = hesk_dbFetchAssoc($res2)) {
$admins[$row['id']] = $row['name'];
}
}
?>
<table class="table table-hover">
<thead>
<tr>
<th><?php echo $hesklang['email']; ?></th>
<th><?php echo $hesklang['banby']; ?></th>
<th><?php echo $hesklang['date']; ?></th>
<?php
if ($can_unban) {
?>
<th><?php echo $hesklang['opt']; ?></th>
<?php
}
?>
</tr>
</thead>
<tbody>
<?php
while ($ban = hesk_dbFetchAssoc($res)) {
$color = '';
if (isset($_SESSION['ban_email']['id']) && $ban['id'] == $_SESSION['ban_email']['id']) {
$color = 'success';
unset($_SESSION['ban_email']['id']);
}
echo '
<tr>
<td class="' . $color . ' text-left">' . $ban['email'] . '</td>
<td class="' . $color . ' text-left">' . (isset($admins[$ban['banned_by']]) ? $admins[$ban['banned_by']] : $hesklang['e_udel']) . '</td>
<td class="' . $color . ' text-left">' . $ban['dt'] . '</td>
';
if ($can_unban) {
echo '
if ($can_unban) {
echo '
<td class="' . $color . ' text-left">
<a href="banned_emails.php?a=unban&amp;id=' . $ban['id'] . '&amp;token=' . hesk_token_echo(0) . '" onclick="return confirm_delete();">
<i class="fa fa-times red font-size-16p" data-toggle="tooltip" data-placement="top" data-original-title="' . $hesklang['delban'] . '"></i>
</a>
</td>
';
}
}
echo '</tr>';
} // End while
?>
</tbody>
</table>
<div align="center">
<table border="0" cellspacing="1" cellpadding="3" class="white" width="100%">
<?php
echo '</tr>';
} // End while
?>
</tbody>
</table>
<div align="center">
<table border="0" cellspacing="1" cellpadding="3" class="white" width="100%">
<?php
?>
</table>
</div>
<?php
}
?>
</table>
</div>
</div>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
</section>
<?php
require_once(HESK_PATH . 'inc/footer.inc.php');

@ -36,6 +36,7 @@ define('PAGE_TITLE', 'ADMIN_TOOLS');
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -68,131 +69,134 @@ require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
/* Print main manage users page */
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
<div class="row pad-20">
<ul class="nav nav-tabs" role="tablist">
<?php
// Show a link to banned_emails.php if user has permission to do so
if (hesk_checkPermission('can_ban_emails', 0)) {
echo '
<section class="content">
<div class="box">
<div class="box-body">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs" role="tablist">
<?php
// Show a link to banned_emails.php if user has permission to do so
if (hesk_checkPermission('can_ban_emails', 0)) {
echo '
<li role="presentation">
<a title="' . $hesklang['banemail'] . '" href="banned_emails.php">' . $hesklang['banemail'] . '</a>
</li>';
}
?>
<li role="presentation" class="active">
<a href="#"><?php echo $hesklang['banip']; ?> <i class="fa fa-question-circle settingsquestionmark"
onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['banip_intro']); ?>')"></i></a>
</li>
<?php
// Show a link to status_message.php if user has permission to do so
if (hesk_checkPermission('can_service_msg', 0)) {
echo '
}
?>
<li role="presentation" class="active">
<a href="#"><?php echo $hesklang['banip']; ?> <i class="fa fa-question-circle settingsquestionmark"
onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['banip_intro']); ?>')"></i></a>
</li>
<?php
// Show a link to status_message.php if user has permission to do so
if (hesk_checkPermission('can_service_msg', 0)) {
echo '
<li role="presentation">
<a title="' . $hesklang['sm_title'] . '" href="service_messages.php">' . $hesklang['sm_title'] . '</a>
</li>';
}
}
// Show a link to email tpl management if user has permission to do so
if (hesk_checkPermission('can_man_email_tpl', 0)) {
echo '
// Show a link to email tpl management if user has permission to do so
if (hesk_checkPermission('can_man_email_tpl', 0)) {
echo '
<li role="presentation">
<a title="' . $hesklang['email_templates'] . '" href="manage_email_templates.php">' . $hesklang['email_templates'] . '</a>
</li>
';
}
if (hesk_checkPermission('can_man_ticket_statuses', 0)) {
echo '
}
if (hesk_checkPermission('can_man_ticket_statuses', 0)) {
echo '
<li role="presentation">
<a title="' . $hesklang['statuses'] . '" href="manage_statuses.php">' . $hesklang['statuses'] . '</a>
</li>
';
}
?>
</ul>
<div class="tab-content summaryList tabPadding">
<script language="javascript" type="text/javascript"><!--
function confirm_delete() {
if (confirm('<?php echo hesk_makeJsString($hesklang['delban_confirm']); ?>')) {
return true;
}
else {
return false;
}
}
//-->
</script>
<div class="row">
<div class="col-md-8">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
?>
<form action="banned_ips.php" method="post" name="form1" role="form" class="form-horizontal" data-toggle="validator">
<div class="form-group">
<label for="ip" class="col-sm-3 control-label"><?php echo $hesklang['bananip']; ?></label>
<div class="col-sm-9">
<input type="text" name="ip" size="30" maxlength="255" class="form-control" data-error="<?php echo htmlspecialchars($hesklang['enterbanip']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['iprange']); ?>" required>
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
<input type="hidden" name="a" value="ban"/>
<div class="help-block with-errors"></div>
}
?>
</ul>
<div class="tab-content summaryList tabPadding">
<script language="javascript" type="text/javascript"><!--
function confirm_delete() {
if (confirm('<?php echo hesk_makeJsString($hesklang['delban_confirm']); ?>')) {
return true;
}
else {
return false;
}
}
//-->
</script>
<div class="row">
<div class="col-md-8">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
?>
<form action="banned_ips.php" method="post" name="form1" role="form" class="form-horizontal" data-toggle="validator">
<div class="form-group">
<label for="ip" class="col-sm-3 control-label"><?php echo $hesklang['bananip']; ?></label>
<div class="col-sm-9">
<input type="text" name="ip" size="30" maxlength="255" class="form-control" data-error="<?php echo htmlspecialchars($hesklang['enterbanip']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['iprange']); ?>" required>
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
<input type="hidden" name="a" value="ban"/>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<div class="col-sm-9 col-sm-offset-3">
<input type="submit" value="<?php echo $hesklang['savebanip']; ?>" class="btn btn-default">
</div>
</div>
</form>
</div>
</div>
<div class="form-group">
<div class="col-sm-9 col-sm-offset-3">
<input type="submit" value="<?php echo $hesklang['savebanip']; ?>" class="btn btn-default">
<div class="col-md-4">
<h6 class="bold"><?php echo $hesklang['banex']; ?></h6>
<div class="footerWithBorder blankSpace"></div>
<b>123.0.0.0</b><br/>
<b>123.0.0.1 - 123.0.0.53</b><br/>
<b>123.0.0.0/24</b><br/>
<b>123.0.*.*</b>
</div>
</div>
</form>
</div>
<div class="col-md-4">
<h6 class="bold"><?php echo $hesklang['banex']; ?></h6>
<div class="footerWithBorder blankSpace"></div>
<b>123.0.0.0</b><br/>
<b>123.0.0.1 - 123.0.0.53</b><br/>
<b>123.0.0.0/24</b><br/>
<b>123.0.*.*</b>
</div>
</div>
<div class="row">
<?php
// Get login failures
$res = hesk_dbQuery("SELECT `ip`, TIMESTAMPDIFF(MINUTE, NOW(), DATE_ADD(`last_attempt`, INTERVAL " . intval($hesk_settings['attempt_banmin']) . " MINUTE) ) AS `minutes` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "logins` WHERE `number` >= " . intval($hesk_settings['attempt_limit']) . " AND `last_attempt` > (NOW() - INTERVAL " . intval($hesk_settings['attempt_banmin']) . " MINUTE)");
$num = hesk_dbNumRows($res);
echo '<h4>' . $hesklang['iptemp'] . '</h4>';
if ($num > 0) {
?>
<table class="table table-hover">
<thead>
<tr>
<th><?php echo $hesklang['ip']; ?></th>
<th><?php echo $hesklang['m2e']; ?></th>
<div class="row">
<div class="col-sm-12">
<?php
if ($can_unban) {
// Get login failures
$res = hesk_dbQuery("SELECT `ip`, TIMESTAMPDIFF(MINUTE, NOW(), DATE_ADD(`last_attempt`, INTERVAL " . intval($hesk_settings['attempt_banmin']) . " MINUTE) ) AS `minutes` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "logins` WHERE `number` >= " . intval($hesk_settings['attempt_limit']) . " AND `last_attempt` > (NOW() - INTERVAL " . intval($hesk_settings['attempt_banmin']) . " MINUTE)");
$num = hesk_dbNumRows($res);
echo '<h4>' . $hesklang['iptemp'] . '</h4>';
if ($num > 0) {
?>
<th><?php echo $hesklang['opt']; ?></th>
<?php
}
?>
</tr>
</thead>
<tbody>
<?php
while ($ban = hesk_dbFetchAssoc($res)) {
echo '
<table class="table table-hover">
<thead>
<tr>
<th><?php echo $hesklang['ip']; ?></th>
<th><?php echo $hesklang['m2e']; ?></th>
<?php
if ($can_unban) {
?>
<th><?php echo $hesklang['opt']; ?></th>
<?php
}
?>
</tr>
</thead>
<tbody>
<?php
while ($ban = hesk_dbFetchAssoc($res)) {
echo '
<tr>
<td>' . $ban['ip'] . '</td>
<td>' . $ban['minutes'] . '</td>
';
if ($can_unban) {
echo '
if ($can_unban) {
echo '
<td>
<a href="banned_ips.php?a=ban&amp;ip=' . urlencode($ban['ip']) . '&amp;token=' . hesk_token_echo(0) . '">
<i class="fa fa-ban red font-size-16p" data-toggle="tooltip" data-placement="top" data-original-title="' . $hesklang['ippermban'] . '"></i></a>
@ -200,64 +204,64 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<i class="fa fa-times red font-size-16p" data-toggle="tooltip" data-placement="top" data-original-title="' . $hesklang['delban'] . '"></i></a>
</td>
';
}
}
echo '</tr>';
} // End while
echo '</tr>';
} // End while
?>
</tbody>
</table>
<?php
} else {
echo '<p>' . $hesklang['no_banips'] . '</p>';
}
// Get banned ips from database
$res = hesk_dbQuery('SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'banned_ips` ORDER BY `ip_from` ASC');
$num = hesk_dbNumRows($res);
echo '<br><h4>' . $hesklang['ipperm'] . '</h4>';
if ($num < 1) {
echo '<p>' . $hesklang['no_banips'] . '</p>';
} else {
// List of staff
if (!isset($admins)) {
$admins = array();
$res2 = hesk_dbQuery("SELECT `id`,`name` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users`");
while ($row = hesk_dbFetchAssoc($res2)) {
$admins[$row['id']] = $row['name'];
}
}
?>
<table class="table table-hover">
<thead>
<tr>
<th><?php echo $hesklang['ip']; ?></th>
<th><?php echo $hesklang['iprange']; ?></th>
<th><?php echo $hesklang['banby']; ?></th>
<th><?php echo $hesklang['date']; ?></th>
<?php
if ($can_unban) {
?>
<th><?php echo $hesklang['opt']; ?></th>
?>
</tbody>
</table>
<?php
}
?>
</tr>
</thead>
<tbody>
<?php
while ($ban = hesk_dbFetchAssoc($res)) {
$color = '';
if (isset($_SESSION['ban_ip']['id']) && $ban['id'] == $_SESSION['ban_ip']['id']) {
$color = 'success';
unset($_SESSION['ban_ip']['id']);
} else {
echo '<p>' . $hesklang['no_banips'] . '</p>';
}
echo '
// Get banned ips from database
$res = hesk_dbQuery('SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'banned_ips` ORDER BY `ip_from` ASC');
$num = hesk_dbNumRows($res);
echo '<br><h4>' . $hesklang['ipperm'] . '</h4>';
if ($num < 1) {
echo '<p>' . $hesklang['no_banips'] . '</p>';
} else {
// List of staff
if (!isset($admins)) {
$admins = array();
$res2 = hesk_dbQuery("SELECT `id`,`name` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users`");
while ($row = hesk_dbFetchAssoc($res2)) {
$admins[$row['id']] = $row['name'];
}
}
?>
<table class="table table-hover">
<thead>
<tr>
<th><?php echo $hesklang['ip']; ?></th>
<th><?php echo $hesklang['iprange']; ?></th>
<th><?php echo $hesklang['banby']; ?></th>
<th><?php echo $hesklang['date']; ?></th>
<?php
if ($can_unban) {
?>
<th><?php echo $hesklang['opt']; ?></th>
<?php
}
?>
</tr>
</thead>
<tbody>
<?php
while ($ban = hesk_dbFetchAssoc($res)) {
$color = '';
if (isset($_SESSION['ban_ip']['id']) && $ban['id'] == $_SESSION['ban_ip']['id']) {
$color = 'success';
unset($_SESSION['ban_ip']['id']);
}
echo '
<tr>
<td class="' . $color . '">' . $ban['ip_display'] . '</td>
<td class="' . $color . '">' . (($ban['ip_to'] == $ban['ip_from']) ? long2ip($ban['ip_to']) : long2ip($ban['ip_from']) . ' - ' . long2ip($ban['ip_to'])) . '</td>
@ -265,27 +269,32 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<td class="' . $color . '">' . $ban['dt'] . '</td>
';
if ($can_unban) {
echo '
if ($can_unban) {
echo '
<td class="' . $color . ' text-left">
<a href="banned_ips.php?a=unban&amp;id=' . $ban['id'] . '&amp;token=' . hesk_token_echo(0) . '" onclick="return confirm_delete();">
<i class="fa fa-times red font-size-16p" data-toggle="tooltip" data-placement="top" data-original-title="' . $hesklang['delban'] . '"></i></a>
</td>
';
}
}
echo '</tr>';
} // End while
?>
</tbody>
</table>
<?php
}
echo '</tr>';
} // End while
?>
</tbody>
</table>
<?php
}
?>
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<?php
require_once(HESK_PATH . 'inc/footer.inc.php');

@ -37,6 +37,7 @@ define('PAGE_TITLE', 'ADMIN_CALENDAR');
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -75,51 +76,85 @@ require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
/* Print main manage users page */
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
<div class="row pad-20">
<div class="col-lg-3">
<div class="panel panel-default">
<div class="panel-heading">
<h4><?php echo $hesklang['calendar_categories']; ?></h4>
<section class="content">
<div class="row">
<div class="col-md-4">
<div class="box">
<div class="box-header">
<h1 class="box-title">
<?php echo $hesklang['calendar_categories']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<div class="btn-group btn-group-sm">
<button id="select-all" class="btn btn-default" data-select-all="category-toggle"><?php echo $hesklang['select_all_title_case']; ?></button>
<button id="deselect-all" class="btn btn-default" data-deselect-all="category-toggle"><?php echo $hesklang['deselect_all_title_case']; ?></button>
</div>
<ul class="list-unstyled">
<?php foreach ($categories as $category): ?>
<li class="move-down-20 move-right-20">
<div class="checkbox">
<input type="checkbox" data-select-target="category-toggle" name="category-toggle" value="<?php echo $category['id']; ?>" checked>
</div>
<div class="hide-on-overflow no-wrap event-category background-volatile" style="<?php echo $category['css_style']; ?>">
<?php echo $category['name']; ?>
</div>
</li>
<?php endforeach; ?>
</ul>
</div>
</div>
<div class="panel-body">
<div class="btn-group btn-group-sm">
<button id="select-all" class="btn btn-default" data-select-all="category-toggle"><?php echo $hesklang['select_all_title_case']; ?></button>
<button id="deselect-all" class="btn btn-default" data-deselect-all="category-toggle"><?php echo $hesklang['deselect_all_title_case']; ?></button>
<div class="box">
<div class="box-header">
<h1 class="box-title">
<?php echo $hesklang['legend']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<ul class="list-unstyled">
<?php foreach ($categories as $category): ?>
<li class="move-down-20 move-right-20">
<div class="checkbox">
<input type="checkbox" data-select-target="category-toggle" name="category-toggle" value="<?php echo $category['id']; ?>" checked>
<div class="box-body">
<div class="row">
<div class="col-sm-6">
<i class="fa fa-calendar"></i> <?php echo $hesklang['event']; ?>
</div>
<div class="col-sm-6">
<i class="fa fa-ticket"></i> <?php echo $hesklang['ticket']; ?>
</div>
<div class="hide-on-overflow no-wrap event-category background-volatile" style="<?php echo $category['css_style']; ?>">
<?php echo $category['name']; ?>
<div class="col-sm-6">
<i class="fa fa-exclamation-triangle"></i> <?php echo $hesklang['overdue_ticket_legend']; ?>
</div>
</li>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4><?php echo $hesklang['legend']; ?></h4>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-6">
<i class="fa fa-calendar"></i> <?php echo $hesklang['event']; ?>
</div>
<div class="col-sm-6">
<i class="fa fa-ticket"></i> <?php echo $hesklang['ticket']; ?>
</div>
<div class="col-sm-6">
<i class="fa fa-exclamation-triangle"></i> <?php echo $hesklang['overdue_ticket_legend']; ?>
<div class="col-md-8">
<div class="box">
<div class="box-header">
<h1 class="box-title">
<?php echo $hesklang['calendar_title_case']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body no-padding">
<div id="calendar"></div>
</div>
</div>
</div>
</div>
</section>
<div class="row pad-20">
<div class="col-lg-9">
<div class="panel panel-default">
<div class="panel-heading">
@ -138,7 +173,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
</h4>
</div>
<div class="panel-body">
<div id="calendar"></div>
</div>
</div>
</div>

@ -35,6 +35,7 @@ define('HESK_PATH', '../');
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -104,34 +105,44 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<li class="active"><?php echo $hesklang['ednote']; ?></li>
</ol>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h3><?php echo $hesklang['ednote']; ?></h3>
<div class="footerWithBorder blankSpace"></div>
<form method="post" action="edit_note.php" name="form1" class="form-horizontal" role="form">
<div class="form-group">
<label for="message" class="col-md-2 control-label"><?php echo $hesklang['message']; ?></label>
<section class="content">
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['ednote']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<form method="post" action="edit_note.php" name="form1" class="form-horizontal" role="form">
<div class="form-group">
<label for="message" class="col-md-2 control-label"><?php echo $hesklang['message']; ?></label>
<div class="col-md-10">
<div class="col-md-10">
<textarea name="message" class="form-control" rows="12"
cols="60"><?php echo $note['message']; ?></textarea>
</div>
</div>
</div>
<div class="form-group">
<div class="col-md-10 col-md-offset-2">
<input type="hidden" name="save" value="1"/><input type="hidden" name="track"
value="<?php echo $trackingID; ?>"/>
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
<input type="hidden" name="note" value="<?php echo $noteID; ?>"/>
<input type="submit" value="<?php echo $hesklang['save_changes']; ?>" class="btn btn-primary">
<a href="javascript:history.go(-1)" class="btn btn-default"><?php echo $hesklang['back']; ?></a>
<div class="form-group">
<div class="col-md-10 col-md-offset-2">
<input type="hidden" name="save" value="1">
<input type="hidden" name="track" value="<?php echo $trackingID; ?>">
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>">
<input type="hidden" name="note" value="<?php echo $noteID; ?>">
<div class="btn-group">
<input type="submit" value="<?php echo $hesklang['save_changes']; ?>" class="btn btn-primary">
<a href="javascript:history.go(-1)" class="btn btn-default"><?php echo $hesklang['back']; ?></a>
</div>
</div>
</div>
</div>
</form>
</form>
</div>
</div>
</div>
</section>
<?php
require_once(HESK_PATH . 'inc/footer.inc.php');

@ -36,6 +36,7 @@ define('WYSIWYG', 1);
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -208,176 +209,183 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<li class="active"><?php echo $hesklang['edtt']; ?></li>
</ol>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h3><?php echo $hesklang['edtt']; ?></h3>
<div class="footerWithBorder blankSpace"></div>
<form role="form" class="form-horizontal" method="post" action="edit_post.php" name="form1">
<?php
/* If it's not a reply edit all the fields */
if (!$is_reply) {
if ($hesk_settings['can_sel_lang']) {
?>
<section class="content">
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['edtt']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<form role="form" class="form-horizontal" method="post" action="edit_post.php" name="form1">
<?php
/* If it's not a reply edit all the fields */
if (!$is_reply) {
if ($hesk_settings['can_sel_lang']) {
?>
<div class="form-group">
<label for="customerLanguage" class="col-sm-3 control-label"><?php echo $hesklang['chol']; ?>
:</label>
<div class="col-sm-9">
<select name="customerLanguage" id="customerLanguage" class="form-control">
<?php hesk_listLanguages(); ?>
</select>
</div>
</div>
<?php } else {
echo '<input type="hidden" name="customerLanguage" value="' . $ticket['language'] . '">';
} ?>
<div class="form-group">
<label for="customerLanguage" class="col-sm-3 control-label"><?php echo $hesklang['chol']; ?>
:</label>
<label for="subject" class="col-sm-3 control-label"><?php echo $hesklang['subject']; ?>:</label>
<div class="col-sm-9">
<select name="customerLanguage" id="customerLanguage" class="form-control">
<?php hesk_listLanguages(); ?>
</select>
<input class="form-control" type="text" name="subject" size="40" maxlength="40"
value="<?php echo $ticket['subject']; ?>"
placeholder="<?php echo htmlspecialchars($hesklang['subject']); ?>"/>
</div>
</div>
<?php } else {
echo '<input type="hidden" name="customerLanguage" value="' . $ticket['language'] . '">';
} ?>
<div class="form-group">
<label for="subject" class="col-sm-3 control-label"><?php echo $hesklang['subject']; ?>:</label>
<div class="col-sm-9">
<input class="form-control" type="text" name="subject" size="40" maxlength="40"
value="<?php echo $ticket['subject']; ?>"
placeholder="<?php echo htmlspecialchars($hesklang['subject']); ?>"/>
</div>
</div>
<div class="form-group">
<label for="name" class="col-sm-3 control-label"><?php echo $hesklang['name']; ?>:</label>
<div class="form-group">
<label for="name" class="col-sm-3 control-label"><?php echo $hesklang['name']; ?>:</label>
<div class="col-sm-9">
<input class="form-control" type="text" name="name" size="40" maxlength="30"
value="<?php echo $ticket['name']; ?>"
placeholder="<?php echo htmlspecialchars($hesklang['name']); ?>"/>
<div class="col-sm-9">
<input class="form-control" type="text" name="name" size="40" maxlength="30"
value="<?php echo $ticket['name']; ?>"
placeholder="<?php echo htmlspecialchars($hesklang['name']); ?>"/>
</div>
</div>
</div>
<div class="form-group">
<label for="email" class="col-sm-3 control-label"><?php echo $hesklang['email']; ?>:</label>
<div class="form-group">
<label for="email" class="col-sm-3 control-label"><?php echo $hesklang['email']; ?>:</label>
<div class="col-sm-9">
<input class="form-control" type="text" name="email" size="40" maxlength="1000"
value="<?php echo $ticket['email']; ?>"
placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>"/>
<div class="col-sm-9">
<input class="form-control" type="text" name="email" size="40" maxlength="1000"
value="<?php echo $ticket['email']; ?>"
placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>"/>
</div>
</div>
</div>
<?php
foreach ($hesk_settings['custom_fields'] as $k => $v) {
if ($v['use']) {
if ($modsForHesk_settings['custom_field_setting']) {
$v['name'] = $hesklang[$v['name']];
}
$k_value = $ticket[$k];
if ($v['type'] == 'checkbox') {
$k_value = explode('<br />', $k_value);
}
switch ($v['type']) {
/* Radio box */
case 'radio':
echo '
<?php
foreach ($hesk_settings['custom_fields'] as $k => $v) {
if ($v['use']) {
if ($modsForHesk_settings['custom_field_setting']) {
$v['name'] = $hesklang[$v['name']];
}
$k_value = $ticket[$k];
if ($v['type'] == 'checkbox') {
$k_value = explode('<br />', $k_value);
}
switch ($v['type']) {
/* Radio box */
case 'radio':
echo '
<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': </label>
<div class="col-sm-9">';
$options = explode('#HESK#', $v['value']);
$options = explode('#HESK#', $v['value']);
foreach ($options as $option) {
foreach ($options as $option) {
if (strlen($k_value) == 0 || $k_value == $option) {
$k_value = $option;
$checked = 'checked="checked"';
} else {
$checked = '';
}
if (strlen($k_value) == 0 || $k_value == $option) {
$k_value = $option;
$checked = 'checked="checked"';
} else {
$checked = '';
}
echo '<div class="radio"><label><input type="radio" name="' . $k . '" value="' . $option . '" ' . $checked . ' /> ' . $option . '</label></div>';
}
echo '<div class="radio"><label><input type="radio" name="' . $k . '" value="' . $option . '" ' . $checked . ' /> ' . $option . '</label></div>';
}
echo '</div>
echo '</div>
</div>
';
break;
break;
/* Select drop-down box */
case 'select':
echo '
/* Select drop-down box */
case 'select':
echo '
<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': </label>
<div class="col-sm-9"><select class="form-control" name="' . $k . '">';
// Show "Click to select"?
$v['value'] = str_replace('{HESK_SELECT}', '', $v['value'], $num);
if ($num) {
echo '<option value="">' . $hesklang['select'] . '</option>';
}
// Show "Click to select"?
$v['value'] = str_replace('{HESK_SELECT}', '', $v['value'], $num);
if ($num) {
echo '<option value="">' . $hesklang['select'] . '</option>';
}
$options = explode('#HESK#', $v['value']);
$options = explode('#HESK#', $v['value']);
foreach ($options as $option) {
foreach ($options as $option) {
if (strlen($k_value) == 0 || $k_value == $option) {
$k_value = $option;
$selected = 'selected="selected"';
} else {
$selected = '';
}
if (strlen($k_value) == 0 || $k_value == $option) {
$k_value = $option;
$selected = 'selected="selected"';
} else {
$selected = '';
}
echo '<option ' . $selected . '>' . $option . '</option>';
}
echo '<option ' . $selected . '>' . $option . '</option>';
}
echo '</select></div>
echo '</select></div>
</div>
';
break;
break;
/* Checkbox */
case 'checkbox':
echo '
/* Checkbox */
case 'checkbox':
echo '
<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': </label>
<div class="col-sm-9">';
$options = explode('#HESK#', $v['value']);
$options = explode('#HESK#', $v['value']);
foreach ($options as $option) {
foreach ($options as $option) {
if (in_array($option, $k_value)) {
$checked = 'checked="checked"';
} else {
$checked = '';
}
if (in_array($option, $k_value)) {
$checked = 'checked="checked"';
} else {
$checked = '';
}
echo '<div class="checkbox"><label><input type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' /> ' . $option . '</label></div>';
}
echo '<div class="checkbox"><label><input type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' /> ' . $option . '</label></div>';
}
echo '</div>
echo '</div>
</div>
';
break;
break;
/* Large text box */
case 'textarea':
$size = explode('#', $v['value']);
$size[0] = empty($size[0]) ? 5 : intval($size[0]);
$size[1] = empty($size[1]) ? 30 : intval($size[1]);
$k_value = hesk_msgToPlain($k_value, 0, 0);
/* Large text box */
case 'textarea':
$size = explode('#', $v['value']);
$size[0] = empty($size[0]) ? 5 : intval($size[0]);
$size[1] = empty($size[1]) ? 30 : intval($size[1]);
$k_value = hesk_msgToPlain($k_value, 0, 0);
echo '
echo '
<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': </label>
<div class="col-sm-9">
<textarea class="form-control" name="' . $k . '" rows="' . $size[0] . '" placeholder="' . htmlspecialchars($v['name']) . '" cols="' . $size[1] . '">' . $k_value . '</textarea>
</div>
</div>';
break;
break;
case 'date':
if (strlen($k_value) != 0) {
$v['value'] = $k_value;
}
echo '
case 'date':
if (strlen($k_value) != 0) {
$v['value'] = $k_value;
}
echo '
<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': </label>
<div class="col-sm-9">
@ -385,63 +393,63 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
maxlength="' . $v['maxlen'] . '" value="' . date('Y-m-d', $v['value']) . '" readonly/>
</div>
</div>';
break;
case 'multiselect':
echo '<div class="form-group"><label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': </label>
break;
case 'multiselect':
echo '<div class="form-group"><label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': </label>
<div class="col-sm-9"><select class="form-control" id="' . $v['name'] . '" name="' . $k . '" multiple>';
$options = explode('#HESK#', $v['value']);
foreach ($options as $option) {
if (strlen($k_value) == 0 || $k_value == $option) {
$k_value = $option;
$selected = 'selected="selected"';
} else {
$selected = '';
$options = explode('#HESK#', $v['value']);
foreach ($options as $option) {
if (strlen($k_value) == 0 || $k_value == $option) {
$k_value = $option;
$selected = 'selected="selected"';
} else {
$selected = '';
}
echo '<option ' . $selected . '>' . $option . '</option>';
}
echo '<option ' . $selected . '>' . $option . '</option>';
}
echo '</select>
echo '</select>
<div class="btn-group" role="group">
<button type="button" class="btn btn-default" onclick="selectAll(\'' . $v['name'] . '\')">'.$hesklang['select_all_title_case'].'</button>
<button type="button" class="btn btn-default" onclick="deselectAll(\'' . $v['name'] . '\')">'.$hesklang['deselect_all_title_case'].'</button>
</div></div></div>';
break;
break;
case 'hidden':
//Clean up multiple dashes or whitespaces
$formattedId = preg_replace("/[\s-]+/", " ", $v['name']);
$formattedId = preg_replace("/[\s_]/", "-", $formattedId);
case 'hidden':
//Clean up multiple dashes or whitespaces
$formattedId = preg_replace("/[\s-]+/", " ", $v['name']);
$formattedId = preg_replace("/[\s_]/", "-", $formattedId);
if (strlen($k_value) != 0) {
$v['value'] = $k_value;
}
if (strlen($k_value) != 0) {
$v['value'] = $k_value;
}
echo '<input type="hidden" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '"/>';
echo '<input type="hidden" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '"/>';
break;
break;
case 'readonly':
//Clean up multiple dashes or whitespaces
$formattedId = preg_replace("/[\s-]+/", " ", $v['name']);
$formattedId = preg_replace("/[\s_]/", "-", $formattedId);
case 'readonly':
//Clean up multiple dashes or whitespaces
$formattedId = preg_replace("/[\s-]+/", " ", $v['name']);
$formattedId = preg_replace("/[\s_]/", "-", $formattedId);
if (strlen($k_value) != 0) {
$v['value'] = $k_value;
}
if (strlen($k_value) != 0) {
$v['value'] = $k_value;
}
echo '<div class="form-group">
echo '<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': </label>
<div class="col-sm-9"><input type="text" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" readonly></div>
</div>';
break;
break;
/* Default text input */
default:
if (strlen($k_value) != 0) {
$k_value = hesk_msgToPlain($k_value, 0, 0);
$v['value'] = $k_value;
}
echo '
/* Default text input */
default:
if (strlen($k_value) != 0) {
$k_value = hesk_msgToPlain($k_value, 0, 0);
$v['value'] = $k_value;
}
echo '
<div class="form-group">
<label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': </label>
<div class="col-sm-9">
@ -449,12 +457,14 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
</div>
</div>
';
}
}
}
}
} ?>
<div class="form-group">
<label for="message" class="col-sm-3 control-label"><?php echo $hesklang['message']; ?>:</label>
?>
<?php } ?>
<div class="form-group">
<label for="message" class="col-sm-3 control-label"><?php echo $hesklang['message']; ?>:</label>
<div class="col-sm-9">
<?php

@ -37,6 +37,7 @@ require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/reporting_functions.inc.php');
require(HESK_PATH . 'inc/status_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -649,272 +650,262 @@ require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
/* Print main manage users page */
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
<div class="row move-down-20">
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading"><?php echo $hesklang['export']; ?></div>
<section class="content">
<div class="box">
<div class="box-header">
<h1 class="box-title">
<?php echo $hesklang['export']; ?>
</h1>
<?php
if (hesk_checkPermission('can_run_reports', 0)) {
$canRunReports = true;
} else {
$canRunReports = false;
echo '<br><small><a href="reports.php">' . $hesklang['reports_tab'] . '</a></small>';
}
?>
<div class="panel-body" <?php if ($canRunReports) {
echo 'style="margin-top: -15px;"';
} ?>>
<?php if ($canRunReports) {
echo '<small><a href="reports.php">' . $hesklang['reports_tab'] . '</a></small><div class="blankSpace"></div>';
} ?>
<p><?php echo $hesklang['export_intro']; ?></p>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
</div>
<div class="col-md-8">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
// If an export was generated, show the link to download
if (isset($flush_me)) {
if ($tickets_exported > 0) {
hesk_show_success($flush_me);
} else {
hesk_show_notice($hesklang['n2ex']);
<div class="box-body">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
// If an export was generated, show the link to download
if (isset($flush_me)) {
if ($tickets_exported > 0) {
hesk_show_success($flush_me);
} else {
hesk_show_notice($hesklang['n2ex']);
}
}
}
?>
<h3><?php echo $hesklang['export']; ?></h3>
<div class="footerWithBorder blankSpace"></div>
<form name="showt" action="export.php" method="get" class="form-horizontal" role="form">
<div class="form-group">
<label for="time" class="control-label col-sm-2"><?php echo $hesklang['dtrg']; ?>:</label>
<div class="col-sm-10">
<!-- START DATE -->
<input type="radio" name="w" value="0" id="w0" <?php echo $selected['w'][0]; ?> />
<select name="time" onclick="document.getElementById('w0').checked = true"
onfocus="document.getElementById('w0').checked = true"
style="margin-top:5px;margin-bottom:5px;">
<option value="1" <?php echo $selected['time'][1]; ?>><?php echo $hesklang['r1']; ?>
(<?php echo $hesklang['d' . date('w')]; ?>)
</option>
<option value="2" <?php echo $selected['time'][2]; ?>><?php echo $hesklang['r2']; ?>
(<?php echo $hesklang['d' . date('w', mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')))]; ?>
)
</option>
<option value="3" <?php echo $selected['time'][3]; ?>><?php echo $hesklang['r3']; ?>
(<?php echo $hesklang['m' . date('n')]; ?>)
</option>
<option value="4" <?php echo $selected['time'][4]; ?>><?php echo $hesklang['r4']; ?>
(<?php echo $hesklang['m' . date('n', mktime(0, 0, 0, date('m') - 1, date('d'), date('Y')))]; ?>
)
</option>
<option value="5" <?php echo $selected['time'][5]; ?>><?php echo $hesklang['r5']; ?></option>
<option value="6" <?php echo $selected['time'][6]; ?>><?php echo $hesklang['r6']; ?></option>
<option value="7" <?php echo $selected['time'][7]; ?>><?php echo $hesklang['r7']; ?></option>
<option value="8" <?php echo $selected['time'][8]; ?>><?php echo $hesklang['r8']; ?></option>
<option value="9" <?php echo $selected['time'][9]; ?>><?php echo $hesklang['r9']; ?></option>
<option value="10" <?php echo $selected['time'][10]; ?>><?php echo $hesklang['r10']; ?>
(<?php echo date('Y'); ?>)
</option>
<option value="11" <?php echo $selected['time'][11]; ?>><?php echo $hesklang['r11']; ?>
(<?php echo date('Y', mktime(0, 0, 0, date('m'), date('d'), date('Y') - 1)); ?>)
</option>
<option value="12" <?php echo $selected['time'][12]; ?>><?php echo $hesklang['r12']; ?></option>
</select>
<br/>
<input type="radio" name="w" value="1" id="w1" <?php echo $selected['w'][1]; ?> />
<?php echo $hesklang['from']; ?> <input type="text" name="datefrom"
value="<?php echo $input_datefrom; ?>" id="datefrom"
class="tcal" size="10"
onclick="document.getElementById('w1').checked = true"
onfocus="document.getElementById('w1').checked = true;this.focus;"/>
<?php echo $hesklang['to']; ?> <input type="text" name="dateto" value="<?php echo $input_dateto; ?>"
id="dateto" class="tcal" size="10"
onclick="document.getElementById('w1').checked = true"
onfocus="document.getElementById('w1').checked = true; this.focus;"/>
<!-- END DATE -->
?>
<form name="showt" action="export.php" method="get" role="form">
<div class="form-group">
<label for="time" class="control-label col-sm-2"><?php echo $hesklang['dtrg']; ?>:</label>
<div class="col-sm-10">
<!-- START DATE -->
<input type="radio" name="w" value="0" id="w0" <?php echo $selected['w'][0]; ?> />
<select name="time" onclick="document.getElementById('w0').checked = true"
onfocus="document.getElementById('w0').checked = true"
style="margin-top:5px;margin-bottom:5px;">
<option value="1" <?php echo $selected['time'][1]; ?>><?php echo $hesklang['r1']; ?>
(<?php echo $hesklang['d' . date('w')]; ?>)
</option>
<option value="2" <?php echo $selected['time'][2]; ?>><?php echo $hesklang['r2']; ?>
(<?php echo $hesklang['d' . date('w', mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')))]; ?>
)
</option>
<option value="3" <?php echo $selected['time'][3]; ?>><?php echo $hesklang['r3']; ?>
(<?php echo $hesklang['m' . date('n')]; ?>)
</option>
<option value="4" <?php echo $selected['time'][4]; ?>><?php echo $hesklang['r4']; ?>
(<?php echo $hesklang['m' . date('n', mktime(0, 0, 0, date('m') - 1, date('d'), date('Y')))]; ?>
)
</option>
<option value="5" <?php echo $selected['time'][5]; ?>><?php echo $hesklang['r5']; ?></option>
<option value="6" <?php echo $selected['time'][6]; ?>><?php echo $hesklang['r6']; ?></option>
<option value="7" <?php echo $selected['time'][7]; ?>><?php echo $hesklang['r7']; ?></option>
<option value="8" <?php echo $selected['time'][8]; ?>><?php echo $hesklang['r8']; ?></option>
<option value="9" <?php echo $selected['time'][9]; ?>><?php echo $hesklang['r9']; ?></option>
<option value="10" <?php echo $selected['time'][10]; ?>><?php echo $hesklang['r10']; ?>
(<?php echo date('Y'); ?>)
</option>
<option value="11" <?php echo $selected['time'][11]; ?>><?php echo $hesklang['r11']; ?>
(<?php echo date('Y', mktime(0, 0, 0, date('m'), date('d'), date('Y') - 1)); ?>)
</option>
<option value="12" <?php echo $selected['time'][12]; ?>><?php echo $hesklang['r12']; ?></option>
</select>
<br/>
<input type="radio" name="w" value="1" id="w1" <?php echo $selected['w'][1]; ?> />
<?php echo $hesklang['from']; ?> <input type="text" name="datefrom"
value="<?php echo $input_datefrom; ?>" id="datefrom"
class="tcal" size="10"
onclick="document.getElementById('w1').checked = true"
onfocus="document.getElementById('w1').checked = true;this.focus;"/>
<?php echo $hesklang['to']; ?> <input type="text" name="dateto" value="<?php echo $input_dateto; ?>"
id="dateto" class="tcal" size="10"
onclick="document.getElementById('w1').checked = true"
onfocus="document.getElementById('w1').checked = true; this.focus;"/>
<!-- END DATE -->
</div>
</div>
</div>
<div class="form-group">
<label for="status" class="control-label col-sm-2"><?php echo $hesklang['status']; ?>:</label>
<div class="form-group">
<label for="status" class="control-label col-sm-2"><?php echo $hesklang['status']; ?>:</label>
<div class="col-sm-10">
<?php
$statuses = mfh_getAllStatuses();
foreach ($statuses as $row) {
<div class="col-sm-10">
<?php
$statuses = mfh_getAllStatuses();
foreach ($statuses as $row) {
?>
<div class="col-xs-4">
<div class="checkbox">
<label><input type="checkbox" name="s<?php echo $row['ID']; ?>"
value="1" <?php if (isset($status[$row['ID']])) {
echo 'checked="checked"';
} ?> /> <span
style="color: <?php echo $row['TextColor']; ?>"><?php echo $row['text']; ?></span></label>
</div>
</div>
<?php
}
?>
</div>
</div>
<div class="form-group">
<label for="priority" class="col-sm-2 control-label"><?php echo $hesklang['priority']; ?>:</label>
<div class="col-sm-10">
<div class="col-xs-4">
<div class="checkbox">
<label><input type="checkbox" name="s<?php echo $row['ID']; ?>"
value="1" <?php if (isset($status[$row['ID']])) {
<label><input type="checkbox" name="p0" value="1" <?php if (isset($priority[0])) {
echo 'checked="checked"';
} ?> /> <span
style="color: <?php echo $row['TextColor']; ?>"><?php echo $row['text']; ?></span></label>
} ?> /> <span class="critical"><?php echo $hesklang['critical']; ?></span></label>
</div>
<div class="checkbox">
<label><input type="checkbox" name="p1" value="1" <?php if (isset($priority[1])) {
echo 'checked="checked"';
} ?> /> <span class="important"><?php echo $hesklang['high']; ?></span></label>
</div>
</div>
<?php
}
?>
</div>
</div>
<div class="form-group">
<label for="priority" class="col-sm-2 control-label"><?php echo $hesklang['priority']; ?>:</label>
<div class="col-sm-10">
<div class="col-xs-4">
<div class="checkbox">
<label><input type="checkbox" name="p0" value="1" <?php if (isset($priority[0])) {
echo 'checked="checked"';
} ?> /> <span class="critical"><?php echo $hesklang['critical']; ?></span></label>
</div>
<div class="checkbox">
<label><input type="checkbox" name="p1" value="1" <?php if (isset($priority[1])) {
echo 'checked="checked"';
} ?> /> <span class="important"><?php echo $hesklang['high']; ?></span></label>
</div>
</div>
<div class="col-xs-4">
<div class="checkbox">
<label><input type="checkbox" name="p2" value="1" <?php if (isset($priority[2])) {
echo 'checked="checked"';
} ?> /> <span class="medium"><?php echo $hesklang['medium']; ?></span></label>
</div>
<div class="checkbox">
<label><input type="checkbox" name="p3" value="1" <?php if (isset($priority[3])) {
echo 'checked="checked"';
} ?> /> <span class="normal"><?php echo $hesklang['low']; ?></span></label>
<div class="col-xs-4">
<div class="checkbox">
<label><input type="checkbox" name="p2" value="1" <?php if (isset($priority[2])) {
echo 'checked="checked"';
} ?> /> <span class="medium"><?php echo $hesklang['medium']; ?></span></label>
</div>
<div class="checkbox">
<label><input type="checkbox" name="p3" value="1" <?php if (isset($priority[3])) {
echo 'checked="checked"';
} ?> /> <span class="normal"><?php echo $hesklang['low']; ?></span></label>
</div>
</div>
</div>
</div>
</div>
<div class="form-group">
<label for="assign" class="col-sm-2 control-label"><?php echo $hesklang['show']; ?>:</label>
<div class="col-sm-10">
<div class="col-xs-4">
<div class="checkbox">
<label><input type="checkbox" name="s_my"
value="1" <?php if ($s_my[1]) echo 'checked="checked"'; ?> /> <?php echo $hesklang['s_my']; ?>
</label>
</div>
<?php
if ($can_view_unassigned) {
?>
<div class="form-group">
<label for="assign" class="col-sm-2 control-label"><?php echo $hesklang['show']; ?>:</label>
<div class="col-sm-10">
<div class="col-xs-4">
<div class="checkbox">
<label><input type="checkbox" name="s_un"
value="1" <?php if ($s_un[1]) echo 'checked="checked"'; ?> /> <?php echo $hesklang['s_un']; ?>
<label><input type="checkbox" name="s_my"
value="1" <?php if ($s_my[1]) echo 'checked="checked"'; ?> /> <?php echo $hesklang['s_my']; ?>
</label>
</div>
<?php
}
?>
</div>
<div class="col-xs-4">
<?php
if ($can_view_ass_others) {
if ($can_view_unassigned) {
?>
<div class="checkbox">
<label><input type="checkbox" name="s_un"
value="1" <?php if ($s_un[1]) echo 'checked="checked"'; ?> /> <?php echo $hesklang['s_un']; ?>
</label>
</div>
<?php
}
?>
</div>
<div class="col-xs-4">
<?php
if ($can_view_ass_others) {
?>
<div class="checkbox">
<label><input type="checkbox" name="s_ot"
value="1" <?php if ($s_ot[1]) echo 'checked="checked"'; ?> /> <?php echo $hesklang['s_ot']; ?>
</label>
</div>
<?php
}
?>
<div class="checkbox">
<label><input type="checkbox" name="s_ot"
value="1" <?php if ($s_ot[1]) echo 'checked="checked"'; ?> /> <?php echo $hesklang['s_ot']; ?>
<label><input type="checkbox" name="archive"
value="1" <?php if ($archive[1]) echo 'checked="checked"'; ?> /> <?php echo $hesklang['disp_only_archived']; ?>
</label>
</div>
<?php
}
?>
<div class="checkbox">
<label><input type="checkbox" name="archive"
value="1" <?php if ($archive[1]) echo 'checked="checked"'; ?> /> <?php echo $hesklang['disp_only_archived']; ?>
</label>
</div>
</div>
</div>
</div>
<div class="form-group">
<label for="sort" class="col-sm-2 control-label"><?php echo $hesklang['sort_by']; ?>:</label>
<div class="col-sm-10">
<div class="col-xs-4">
<div class="radio">
<label><input type="radio" name="sort" value="priority" <?php if ($sort == 'priority') {
echo 'checked="checked"';
} ?> /> <?php echo $hesklang['priority']; ?></label>
</div>
<div class="radio">
<label><input type="radio" name="sort" value="lastchange" <?php if ($sort == 'lastchange') {
echo 'checked="checked"';
} ?> /> <?php echo $hesklang['last_update']; ?></label>
</div>
</div>
<div class="col-xs-4">
<div class="radio">
<label><input type="radio" name="sort" value="name" <?php if ($sort == 'name') {
echo 'checked="checked"';
} ?> /> <?php echo $hesklang['name']; ?></label>
</div>
<div class="radio">
<label><input type="radio" name="sort" value="subject" <?php if ($sort == 'subject') {
echo 'checked="checked"';
} ?> /> <?php echo $hesklang['subject']; ?></label>
<div class="form-group">
<label for="sort" class="col-sm-2 control-label"><?php echo $hesklang['sort_by']; ?>:</label>
<div class="col-sm-10">
<div class="col-xs-4">
<div class="radio">
<label><input type="radio" name="sort" value="priority" <?php if ($sort == 'priority') {
echo 'checked="checked"';
} ?> /> <?php echo $hesklang['priority']; ?></label>
</div>
<div class="radio">
<label><input type="radio" name="sort" value="lastchange" <?php if ($sort == 'lastchange') {
echo 'checked="checked"';
} ?> /> <?php echo $hesklang['last_update']; ?></label>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="radio">
<label><input type="radio" name="sort" value="status" <?php if ($sort == 'status') {
echo 'checked="checked"';
} ?> /> <?php echo $hesklang['status']; ?></label>
<div class="col-xs-4">
<div class="radio">
<label><input type="radio" name="sort" value="name" <?php if ($sort == 'name') {
echo 'checked="checked"';
} ?> /> <?php echo $hesklang['name']; ?></label>
</div>
<div class="radio">
<label><input type="radio" name="sort" value="subject" <?php if ($sort == 'subject') {
echo 'checked="checked"';
} ?> /> <?php echo $hesklang['subject']; ?></label>
</div>
</div>
<div class="radio">
<label><input type="radio" name="sort" value="id" <?php if ($sort == 'id') {
echo 'checked="checked"';
} ?> /> <?php echo $hesklang['sequentially']; ?></label>
<div class="col-xs-4">
<div class="radio">
<label><input type="radio" name="sort" value="status" <?php if ($sort == 'status') {
echo 'checked="checked"';
} ?> /> <?php echo $hesklang['status']; ?></label>
</div>
<div class="radio">
<label><input type="radio" name="sort" value="id" <?php if ($sort == 'id') {
echo 'checked="checked"';
} ?> /> <?php echo $hesklang['sequentially']; ?></label>
</div>
</div>
</div>
</div>
</div>
<div class="form-group">
<label for="asc" class="col-sm-2 control-label"><?php echo $hesklang['category']; ?>:</label>
<div class="col-sm-10">
<select name="category" class="form-control">
<option value="0"><?php echo $hesklang['any_cat']; ?></option>
<?php echo $category_options; ?>
</select>
<div class="form-group">
<label for="asc" class="col-sm-2 control-label"><?php echo $hesklang['category']; ?>:</label>
<div class="col-sm-10">
<select name="category" class="form-control">
<option value="0"><?php echo $hesklang['any_cat']; ?></option>
<?php echo $category_options; ?>
</select>
</div>
</div>
</div>
<div class="form-group">
<label for="asc" class="col-sm-2 control-label"><?php echo $hesklang['order']; ?>:</label>
<div class="col-sm-10">
<div class="col-xs-4">
<div class="radio">
<label><input type="radio" name="asc" value="1" <?php if ($asc) {
echo 'checked="checked"';
} ?> /> <?php echo $hesklang['ascending']; ?></label>
</div>
<div class="radio">
<label><input type="radio" name="asc" value="0" <?php if (!$asc) {
echo 'checked="checked"';
} ?> /> <?php echo $hesklang['descending']; ?></label>
<div class="form-group">
<label for="asc" class="col-sm-2 control-label"><?php echo $hesklang['order']; ?>:</label>
<div class="col-sm-10">
<div class="col-xs-4">
<div class="radio">
<label><input type="radio" name="asc" value="1" <?php if ($asc) {
echo 'checked="checked"';
} ?> /> <?php echo $hesklang['ascending']; ?></label>
</div>
<div class="radio">
<label><input type="radio" name="asc" value="0" <?php if (!$asc) {
echo 'checked="checked"';
} ?> /> <?php echo $hesklang['descending']; ?></label>
</div>
</div>
</div>
</div>
</div>
<div class="form-group text-center">
<input type="submit" value="<?php echo $hesklang['export_btn']; ?>" class="btn btn-default"/>
<input type="hidden" name="cot" value="1"/>
</div>
</form>
<div class="form-group">
<input type="submit" value="<?php echo $hesklang['export_btn']; ?>" class="btn btn-default"/>
<input type="hidden" name="cot" value="1"/>
</div>
</form>
</div>
</div>
</div>
</section>
<?php
require_once(HESK_PATH . 'inc/footer.inc.php');
exit();

@ -30,6 +30,7 @@
define('IN_SCRIPT', 1);
define('HESK_PATH', '../');
define('PAGE_TITLE', 'LOGIN');
/* Get all the required files and functions */
require(HESK_PATH . 'hesk_settings.inc.php');
@ -58,9 +59,6 @@ switch ($action) {
hesk_autoLogin();
print_login();
}
/* Print footer */
require_once(HESK_PATH . 'inc/footer.inc.php');
exit();
/*** START FUNCTIONS ***/
@ -274,7 +272,7 @@ function print_login()
}
$hesk_settings['tmp_title'] = $hesk_settings['hesk_title'] . ' - ' .$hesklang['admin_login'];
require_once(HESK_PATH . 'inc/header.inc.php');
require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
if ( hesk_isREQUEST('notice') )
{
@ -287,29 +285,37 @@ function print_login()
}
?>
<div class="loginError"><?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
?></div>
<div>
<div class="panel panel-default form-signin">
<div class="panel-heading">
<h4><span <?php echo $iconDisplay; ?>><span class="mega-octicon octicon-sign-in"></span>&nbsp;</span><?php echo $hesklang['admin_login']; ?></h4>
<div class="login-box">
<div class="login-logo">
<?php echo $hesk_settings['hesk_title']; ?>
</div>
<div class="login-box-body">
<div class="loginError">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
?>
</div>
<div class="panel-body">
<form class="form-signin form-horizontal" role="form" action="index.php" method="post" name="form1">
<?php if (in_array('pass',$_SESSION['a_iserror'])) { echo '<div class="form-group has-error">';} else { echo '<div class="form-group">';}?>
<label for="user" class="col-sm-4 control-label"><?php echo $hesklang['username']; ?>:</label>
<h4 class="login-box-msg">
<?php echo $hesklang['staff_login_title']; ?>
</h4>
<form class="form-horizontal" role="form" action="index.php" method="post" name="form1">
<?php
$has_error = '';
if (in_array('pass',$_SESSION['a_iserror'])) {
$has_error = 'has-error';
}
?>
<div class="form-group <?php echo $has_error; ?>">
<label for="user" class="col-sm-4 control-label">
<?php echo $hesklang['username']; ?>
</label>
<div class="col-sm-8">
<?php
if (defined('HESK_USER'))
{
if (defined('HESK_USER')) {
$savedUser = HESK_USER;
}
else
{
$savedUser = hesk_htmlspecialchars( hesk_COOKIE('hesk_username') );
} else {
$savedUser = hesk_htmlspecialchars(hesk_COOKIE('hesk_username'));
}
$is_1 = '';
@ -318,44 +324,48 @@ function print_login()
$remember_user = hesk_POST('remember_user');
if ($hesk_settings['autologin'] && (isset($_COOKIE['hesk_p']) || $remember_user == 'AUTOLOGIN') )
{
$is_1 = 'checked="checked"';
if ($hesk_settings['autologin'] && (isset($_COOKIE['hesk_p']) || $remember_user == 'AUTOLOGIN')) {
$is_1 = 'checked';
} elseif (isset($_COOKIE['hesk_username']) || $remember_user == 'JUSTUSER') {
$is_2 = 'checked';
} else {
$is_3 = 'checked';
}
elseif (isset($_COOKIE['hesk_username']) || $remember_user == 'JUSTUSER' )
{
$is_2 = 'checked="checked"';
}
else
{
$is_3 = 'checked="checked"';
}
if ($hesk_settings['list_users'])
{
echo '<select class="form-control" name="user">';
$res = hesk_dbQuery('SELECT `user` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'users` ORDER BY `user` ASC');
while ($row=hesk_dbFetchAssoc($res))
{
$sel = (strtolower($savedUser) == strtolower($row['user'])) ? 'selected="selected"' : '';
echo '<option value="'.$row['user'].'" '.$sel.'>'.$row['user'].'</option>';
}
echo '</select>';
}
else
{
echo '<input class="form-control" type="text" name="user" size="35" placeholder="'.htmlspecialchars($hesklang['username']).'" value="'.$savedUser.'" />';
}
if ($hesk_settings['list_users']) :
$res = hesk_dbQuery("SELECT `user` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` WHERE `active` = '1' ORDER BY `user` ASC");
?>
<select class="form-control" name="user">
<?php
while ($row = hesk_dbFetchAssoc($res)):
$sel = (strtolower($savedUser) == strtolower($row['user'])) ? 'selected' : '';
?>
<option value="<?php echo $row['user']; ?>" <?php echo $sel; ?>>
<?php echo $row['user']; ?>
</option>
<?php endwhile; ?>
</select>
<?php else: ?>
<input class="form-control" type="text" name="user" size="35"
placeholder="<?php echo htmlspecialchars($hesklang['username']); ?>"
value="<?php echo $savedUser; ?>">
<?php endif; ?>
</div>
</div>
<?php if (in_array('pass',$_SESSION['a_iserror'])) { echo '<div class="form-group has-error">';} else { echo '<div class="form-group">';}?>
<label for="pass" class="col-sm-4 control-label"><?php echo $hesklang['pass']; ?>:</label>
<div class="col-sm-8">
<input type="password" class="form-control" id="pass" name="pass" size="35" placeholder="<?php echo htmlspecialchars($hesklang['pass']); ?>" />
<?php
$has_error = '';
if (in_array('pass',$_SESSION['a_iserror'])) {
$has_error = 'has-error';
}
?>
<div class="form-group <?php echo $has_error; ?>">
<label for="pass" class="col-sm-4 control-label">
<?php echo $hesklang['pass']; ?>
</label>
<div class="col-sm-8">
<input type="password" class="form-control" id="pass" name="pass" size="35" placeholder="<?php echo htmlspecialchars($hesklang['pass']); ?>">
</div>
</div>
</div>
<?php
if ($hesk_settings['secimg_use'] == 2)
{
@ -387,22 +397,22 @@ function print_login()
}
};
</script>
<?php
require_once(HESK_PATH . 'inc/recaptcha/recaptchalib.php');
echo '<div class="form-group"><div class="col-md-8 col-md-offset-4">';
echo recaptcha_get_html($hesk_settings['recaptcha_public_key'], null, true);
echo '</div></div>';
<?php
require_once(HESK_PATH . 'inc/recaptcha/recaptchalib.php');
echo '<div class="form-group"><div class="col-md-8 col-md-offset-4">';
echo recaptcha_get_html($hesk_settings['recaptcha_public_key'], null, true);
echo '</div></div>';
}
// Use reCaptcha API v2?
elseif ($hesk_settings['recaptcha_use'] == 2)
{
?>
?>
<div class="form-group">
<div class="col-md-8 col-md-offset-4">
<div class="g-recaptcha" data-sitekey="<?php echo $hesk_settings['recaptcha_public_key']; ?>"></div>
</div>
</div>
<?php
<?php
}
// At least use some basic PHP generated image (better than nothing)
else
@ -410,9 +420,9 @@ function print_login()
echo '<div class="form-group"><div class="col-md-8 col-md-offset-4">';
$cls = in_array('mysecnum',$_SESSION['a_iserror']) ? ' class="isError" ' : '';
echo $hesklang['sec_enter'].'<br />&nbsp;<br /><img src="'.HESK_PATH.'print_sec_img.php?'.rand(10000,99999).'" width="150" height="40" alt="'.$hesklang['sec_img'].'" title="'.$hesklang['sec_img'].'" border="1" name="secimg" style="vertical-align:text-bottom" /> '.
'<a href="javascript:void(0)" onclick="javascript:document.form1.secimg.src=\''.HESK_PATH.'print_sec_img.php?\'+ ( Math.floor((90000)*Math.random()) + 10000);"><img src="'.HESK_PATH.'img/reload.png" height="24" width="24" alt="'.$hesklang['reload'].'" title="'.$hesklang['reload'].'" border="0" style="vertical-align:text-bottom" /></a>'.
'<br />&nbsp;<br /><input type="text" name="mysecnum" size="20" maxlength="5" '.$cls.' />';
echo $hesklang['sec_enter'].'<br><br><img src="'.HESK_PATH.'print_sec_img.php?'.rand(10000,99999).'" width="150" height="40" alt="'.$hesklang['sec_img'].'" title="'.$hesklang['sec_img'].'" border="1" name="secimg" style="vertical-align:text-bottom"> '.
'<a href="javascript:void(0)" onclick="javascript:document.form1.secimg.src=\''.HESK_PATH.'print_sec_img.php?\'+ ( Math.floor((90000)*Math.random()) + 10000);"><img src="'.HESK_PATH.'img/reload.png" height="24" width="24" alt="'.$hesklang['reload'].'" title="'.$hesklang['reload'].'" border="0" style="vertical-align:text-bottom"></a>'.
'<br><br><input type="text" name="mysecnum" size="20" maxlength="5" '.$cls.'>';
echo '</div></div>';
}
} // End if $hesk_settings['secimg_use'] == 2
@ -423,17 +433,17 @@ function print_login()
<div class="form-group">
<div class="col-md-offset-4 col-md-8">
<div class="radio">
<label><input type="radio" name="remember_user" value="AUTOLOGIN" <?php echo $is_1; ?> /> <?php echo $hesklang['autologin']; ?></label>
<label><input type="radio" name="remember_user" value="AUTOLOGIN" <?php echo $is_1; ?>> <?php echo $hesklang['autologin']; ?></label>
</div>
<div class="radio">
<label><input type="radio" name="remember_user" value="JUSTUSER" <?php echo $is_2; ?> /> <?php echo $hesklang['just_user']; ?></label>
<label><input type="radio" name="remember_user" value="JUSTUSER" <?php echo $is_2; ?>> <?php echo $hesklang['just_user']; ?></label>
</div>
<div class="radio">
<label><input type="radio" name="remember_user" value="NOTHANKS" <?php echo $is_3; ?> /> <?php echo $hesklang['nothx']; ?></label>
<label><input type="radio" name="remember_user" value="NOTHANKS" <?php echo $is_3; ?>> <?php echo $hesklang['nothx']; ?></label>
</div>
</div>
</div>
<?php
<?php
}
else
{
@ -445,40 +455,33 @@ function print_login()
</div>
</div>
</div>
<?php
<?php
} // End if $hesk_settings['autologin']
?>
<div class="form-group">
<div class="col-md-offset-4 col-md-8">
<input type="submit" value="<?php echo $hesklang['click_login']; ?>" class="btn btn-default" />
<input type="hidden" name="a" value="do_login" />
<input type="submit" value="<?php echo $hesklang['click_login']; ?>" class="btn btn-default">
<input type="hidden" name="a" value="do_login">
<?php
if ( hesk_isREQUEST('goto') && $url=hesk_REQUEST('goto') )
{
echo '<input type="hidden" name="goto" value="'.$url.'" />';
echo '<input type="hidden" name="goto" value="'.$url.'">';
}
// Do we allow staff password reset?
if ($hesk_settings['reset_pass'])
{
echo '<br />&nbsp;<br /><a href="password.php" class="smaller">'.$hesklang['fpass'].'</a>';
echo '<br><br><a href="password.php" class="smaller">'.$hesklang['fpass'].'</a>';
}
?>
</div>
</div>
</form>
</div>
</form>
</div>
</div>
<p>&nbsp;</p>
<?php
</div>
<?php
hesk_cleanSessionVars('a_iserror');
require_once(HESK_PATH . 'inc/footer.inc.php');
exit();
} // End print_login()

@ -37,6 +37,7 @@ require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/knowledgebase_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -56,6 +57,7 @@ $can_man_kb = hesk_checkPermission('can_man_kb',0);
$catid = intval( hesk_GET('category', 1) );
$artid = intval( hesk_GET('article', 0) );
if (isset($_GET['search']))
{
$query = hesk_input( hesk_GET('search') );
@ -69,7 +71,9 @@ $hesk_settings['kb_link'] = ($artid || $catid != 1 || $query) ? '<a href="knowle
if ($hesk_settings['kb_search'] && $query)
{
hesk_kb_search($query);
if (hesk_kb_search($query)) {
hesk_show_kb_category(1,1);
}
}
elseif ($artid)
{
@ -98,7 +102,7 @@ else
{
hesk_show_kb_category($catid);
}
?> </div> <?php
require_once(HESK_PATH . 'inc/footer.inc.php');
exit();
@ -114,11 +118,6 @@ function hesk_kb_header($kb_link, $catid=1)
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
</td>
</tr>
<tr>
<td>
<ol class="breadcrumb">
<?php
if ($can_man_kb)
@ -130,15 +129,10 @@ function hesk_kb_header($kb_link, $catid=1)
?>
<li class="active"><?php echo $kb_link; ?></li>
</ol>
<!-- SUB NAVIGATION -->
<?php show_subnav('view', $catid); ?>
<!-- SUB NAVIGATION -->
<div style="margin-left:40px;margin-right:40px">
<?php hesk_kbSearchLarge(1); ?>
<section style="padding: 15px;">
<?php hesk_kbSearchLarge(1); ?>
</section>
<?php
} // END hesk_kb_header()
@ -154,41 +148,43 @@ function hesk_kb_search($query)
$res = hesk_dbQuery('SELECT t1.`id`, t1.`subject`, LEFT(`t1`.`content`, '.max(200, $hesk_settings['kb_substrart'] * 2).') AS `content`, t1.`rating` 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` IN ('0','1') AND MATCH(`subject`,`content`,`keywords`) AGAINST ('".hesk_dbEscape($query)."') LIMIT ".intval($hesk_settings['kb_search_limit']));
$num = hesk_dbNumRows($res);
$show_default_category = false;
?>
<h4><?php echo $hesklang['sr']; ?> (<?php echo $num; ?>)</h4>
<div class="footerWithBorder blankSpace"></div>
<?php
if ($num == 0)
{
echo '<p style="margin-left:20px"><i>'.$hesklang['nosr'].'</i></p>';
hesk_show_kb_category(1,1);
}
else
{
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div align="center">
<table border="0" cellspacing="1" cellpadding="3" width="100%">
<?php
while ($article = hesk_dbFetchAssoc($res))
{
$txt = hesk_kbArticleContentPreview($article['content']);
if ($hesk_settings['kb_rating'])
{
$alt = $article['rating'] ? sprintf($hesklang['kb_rated'], sprintf("%01.1f", $article['rating'])) : $hesklang['kb_not_rated'];
$rat = '<td width="1" valign="top"><img src="../img/star_'.(hesk_round_to_half($article['rating'])*10).'.png" width="85" height="16" alt="'.$alt.'" border="0" style="vertical-align:text-bottom" /></td>';
}
else
{
$rat = '';
}
echo '
<section style="padding: 15px">
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['sr']; ?> (<?php echo $num; ?>)
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<?php
if ($num == 0) {
echo '<i>'.$hesklang['nosr'].'</i>';
$show_default_category = true;
} else {
?>
<table class="table table-striped">
<?php
while ($article = hesk_dbFetchAssoc($res))
{
$txt = hesk_kbArticleContentPreview($article['content']);
if ($hesk_settings['kb_rating'])
{
$rat = '<td width="1" valign="top">' . mfh_get_stars($article['rating']) . '</td>';
}
else
{
$rat = '';
}
echo '
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="1">
@ -207,18 +203,16 @@ function hesk_kb_search($query)
</td>
</tr>';
}
?>
</table>
</div>
</td>
</tr>
</table>
<p><br /><a href="javascript:history.go(-1)"><span class="glyphicon glyphicon-circle-arrow-left"></span>&nbsp;<?php echo $hesklang['back']; ?></a></p>
}
?>
</table>
<a href="javascript:history.go(-1)"><span class="glyphicon glyphicon-circle-arrow-left"></span>&nbsp;<?php echo $hesklang['back']; ?></a>
<?php } ?>
</div>
</div>
</section>
<?php
} // END else
return $show_default_category;
} // END hesk_kb_search()
@ -233,132 +227,163 @@ function hesk_show_kb_article($artid)
// Update views by 1
hesk_dbQuery('UPDATE `'.hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` SET `views`=`views`+1 WHERE `id`={$artid} LIMIT 1");
echo '<h3>'.$article['subject'].'</h3>
<div class="footerWithBorder blankSpace"></div>
?>
<section class="content">
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $article['subject']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<?php echo $article['content']; ?>
</div>
<?php if (!empty($article['attachments'])): ?>
<div class="box-footer">
<p><b><?php echo $hesklang['attachments']; ?></b></p>
<?php
$att=explode(',',substr($article['attachments'], 0, -1));
foreach ($att as $myatt)
{
list($att_id, $att_name) = explode('#', $myatt);
echo '<i class="fa fa-paperclip"></i> <a href="../download_attachment.php?kb_att='.$att_id.'" rel="nofollow">'.$att_name.'</a><br />';
}
?>
</div>
<?php endif; ?>
</div>
<?php
if ($article['catid']==1)
{
$link = 'knowledgebase_private.php';
}
else
{
$link = 'knowledgebase_private.php?category='.$article['catid'];
}
?>
<br><br>
<div class="row">
<?php
$showRelated = false;
$column = 'col-md-12';
require(HESK_PATH . 'inc/mail/email_parser.php');
$query = hesk_dbEscape( $article['subject'] . ' ' . convert_html_to_text($article['content']) );
<h4>'.$hesklang['as'].'</h4>
'. $article['content'];
// Get relevant articles from the database
$res = hesk_dbQuery("SELECT `id`, `subject`, MATCH(`subject`,`content`,`keywords`) AGAINST ('{$query}') AS `score` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `type` IN ('0','1') AND MATCH(`subject`,`content`,`keywords`) AGAINST ('{$query}') LIMIT ".intval($hesk_settings['kb_related']+1));
if ( ! empty($article['attachments']))
{
echo '<p><b>'.$hesklang['attachments'].':</b><br />';
$att=explode(',',substr($article['attachments'], 0, -1));
foreach ($att as $myatt)
{
list($att_id, $att_name) = explode('#', $myatt);
echo '<i class="fa fa-papercip"></i> <a href="../download_attachment.php?kb_att='.$att_id.'" rel="nofollow">'.$att_name.'</a><br />';
}
echo '</p>';
}
// Array with related articles
$related_articles = array();
while ($related = hesk_dbFetchAssoc($res))
{
// Get base match score from the first (this) article
if ( ! isset($base_score) )
{
$base_score = $related['score'];
}
// Ignore this article
if ($related['id'] == $artid)
{
continue;
}
if ($article['catid']==1)
{
$link = 'knowledgebase_private.php';
}
else
{
$link = 'knowledgebase_private.php?category='.$article['catid'];
}
?>
<br><br>
<div class="row">
<?php
$showRelated = false;
$column = 'col-md-12';
require(HESK_PATH . 'inc/mail/email_parser.php');
$query = hesk_dbEscape( $article['subject'] . ' ' . convert_html_to_text($article['content']) );
// Get relevant articles from the database
$res = hesk_dbQuery("SELECT `id`, `subject`, MATCH(`subject`,`content`,`keywords`) AGAINST ('{$query}') AS `score` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `type` IN ('0','1') AND MATCH(`subject`,`content`,`keywords`) AGAINST ('{$query}') LIMIT ".intval($hesk_settings['kb_related']+1));
// Array with related articles
$related_articles = array();
while ($related = hesk_dbFetchAssoc($res))
{
// Get base match score from the first (this) article
if ( ! isset($base_score) )
{
$base_score = $related['score'];
}
// Ignore this article
if ($related['id'] == $artid)
{
continue;
}
// Stop when articles reach less than 10% of base score
if ($related['score'] / $base_score < 0.10)
{
break;
}
// This is a valid related article
$related_articles[$related['id']] = $related['subject'];
}
// Print related articles if we have any valid matches
if ( count($related_articles) ) {
$column = 'col-md-6';
$showRelated = true;
}
?>
<div class="<?php echo $column; ?> col-sm-12">
<h4><?php echo $hesklang['ad']; ?></h4>
<div class="footerWithBorder blankSpace"></div>
<table border="0">
<tr>
<td><?php echo $hesklang['aid']; ?>: </td>
<td><?php echo $article['id']; ?></td>
</tr>
<tr>
<td><?php echo $hesklang['category']; ?>: </td>
<td><a href="<?php echo $link; ?>"><?php echo $article['cat_name']; ?></a></td>
</tr>
<tr>
<td><?php echo $hesklang['dta']; ?>: </td>
<td><?php echo hesk_date($article['dt'], true); ?></td>
</tr>
<tr>
<td><?php echo $hesklang['views']; ?>: </td>
<td><?php echo (isset($_GET['rated']) ? $article['views'] : $article['views']+1); ?></td>
</tr>
</table>
</div>
<?php if ($showRelated) { ?>
<div class="col-md-6 col-sm-12">
<h4><?php echo $hesklang['relart']; ?></h4>
<div class="footerWithBorder blankSpace"></div>
<?php
// Related articles
foreach ($related_articles as $id => $subject)
{
echo '<span class="glyphicon glyphicon-file" style="font-size: 16px;"></span> <a href="knowledgebase_private.php?article='.$id.'">'.$subject.'</a><br />';
}
?>
</div>
<?php } ?>
</div>
// Stop when articles reach less than 10% of base score
if ($related['score'] / $base_score < 0.10)
{
break;
}
<?php
if (!isset($_GET['back']))
{
?>
<p><br /><a href="javascript:history.go(-1)"><span class="glyphicon glyphicon-circle-arrow-left"></span>&nbsp;<?php echo $hesklang['back']; ?></a></p>
<?php
}
else
{
?>
<p>&nbsp;</p>
<?php
}
// This is a valid related article
$related_articles[$related['id']] = $related['subject'];
}
// Print related articles if we have any valid matches
if ( count($related_articles) ) {
$column = 'col-md-6';
$showRelated = true;
}
?>
<div class="<?php echo $column; ?> col-sm-12">
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['ad']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<table border="0">
<tr>
<td><?php echo $hesklang['aid']; ?>: </td>
<td><?php echo $article['id']; ?></td>
</tr>
<tr>
<td><?php echo $hesklang['category']; ?>: </td>
<td><a href="<?php echo $link; ?>"><?php echo $article['cat_name']; ?></a></td>
</tr>
<tr>
<td><?php echo $hesklang['dta']; ?>: </td>
<td><?php echo hesk_date($article['dt'], true); ?></td>
</tr>
<tr>
<td><?php echo $hesklang['views']; ?>: </td>
<td><?php echo (isset($_GET['rated']) ? $article['views'] : $article['views']+1); ?></td>
</tr>
</table>
</div>
</div>
</div>
<?php if ($showRelated) { ?>
<div class="col-md-6 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['relart']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<?php
// Related articles
foreach ($related_articles as $id => $subject)
{
echo '<span class="glyphicon glyphicon-file" style="font-size: 16px;"></span> <a href="knowledgebase_private.php?article='.$id.'">'.$subject.'</a><br />';
}
?>
</div>
</div>
</div>
<?php } ?>
</div>
<?php
if (!isset($_GET['back']))
{
?>
<p><br /><a href="javascript:history.go(-1)"><span class="glyphicon glyphicon-circle-arrow-left"></span>&nbsp;<?php echo $hesklang['back']; ?></a></p>
<?php
}
?>
</section>
<?php
} // END hesk_show_kb_article()
@ -370,148 +395,151 @@ function hesk_show_kb_category($catid, $is_search = 0) {
{
/* Print header */
hesk_kb_header($hesk_settings['kb_link'], $catid);
if ($catid == 1)
{
echo $hesklang['priv'];
}
}
$res = hesk_dbQuery("SELECT `name`,`parent` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` WHERE `id`='".intval($catid)."' LIMIT 1");
$thiscat = hesk_dbFetchAssoc($res) or hesk_error($hesklang['kb_cat_inv']);
if ($thiscat['parent'])
{
$link = ($thiscat['parent'] == 1) ? 'knowledgebase_private.php' : 'knowledgebase_private.php?category='.$thiscat['parent'];
echo '<h3>'.$hesklang['kb_cat'].': '.$thiscat['name'].'</h3>
<p align="left"><a href="javascript:history.go(-1)"><span class="glyphicon glyphicon-circle-arrow-left"></span>'.$hesklang['back'].'</a></p>
<div class="footerWithBorder blankSpace"></div>';
}
$result = hesk_dbQuery("SELECT `id`,`name`,`articles`,`type` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` WHERE `parent`='".intval($catid)."' ORDER BY `parent` ASC, `cat_order` ASC");
if (hesk_dbNumRows($result) > 0)
{
?>
<h4><?php echo $hesklang['kb_cat_sub']; ?></h4>
<div class="footerWithBorder blankSpace"></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="0" cellspacing="1" cellpadding="3" width="100%">
?>
<section class="content">
<?php if ($thiscat['parent']): ?>
<h3><?php echo $hesklang['kb_cat'].': '.$thiscat['name']; ?></h3>
<p align="left"><a href="javascript:history.go(-1)">
<span class="glyphicon glyphicon-circle-arrow-left"></span>
<?php echo $hesklang['back']; ?>
</a></p>
<?php
$per_col = $hesk_settings['kb_cols'];
$i = 1;
while ($cat = hesk_dbFetchAssoc($result))
{
if ($i == 1)
{
echo '<tr>';
}
endif;
$private = ($cat['type'] == 1) ? ' *' : '';
$result = hesk_dbQuery("SELECT `id`,`name`,`articles`,`type` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_categories` WHERE `parent`='".intval($catid)."' ORDER BY `parent` ASC, `cat_order` ASC");
echo '
if (hesk_dbNumRows($result) > 0) {
?>
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['kb_cat_sub']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<table class="table table-striped">
<?php
$per_col = $hesk_settings['kb_cols'];
$i = 1;
while ($cat = hesk_dbFetchAssoc($result))
{
if ($i == 1)
{
echo '<tr>';
}
$private = ($cat['type'] == 1) ? ' *' : '';
echo '
<td width="50%" valign="top">
<table border="0">
<tr><td><span class="glyphicon glyphicon-folder-close"></span>&nbsp;<a href="knowledgebase_private.php?category='.$cat['id'].'">'.$cat['name'].'</a>'.$private.'</td></tr>
';
/* Print most popular/sticky articles */
if ($hesk_settings['kb_numshow'] && $cat['articles'])
{
$res = hesk_dbQuery("SELECT `id`,`subject`,`type` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `catid`='".intval($cat['id'])."' AND `type` IN ('0','1') ORDER BY `sticky` DESC, `views` DESC, `art_order` ASC LIMIT " . (intval($hesk_settings['kb_numshow']) + 1) );
$num = 1;
while ($art = hesk_dbFetchAssoc($res))
{
$private = ($art['type'] == 1) ? ' *' : '';
echo '
/* Print most popular/sticky articles */
if ($hesk_settings['kb_numshow'] && $cat['articles'])
{
$res = hesk_dbQuery("SELECT `id`,`subject`,`type` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `catid`='".intval($cat['id'])."' AND `type` IN ('0','1') ORDER BY `sticky` DESC, `views` DESC, `art_order` ASC LIMIT " . (intval($hesk_settings['kb_numshow']) + 1) );
$num = 1;
while ($art = hesk_dbFetchAssoc($res))
{
$private = ($art['type'] == 1) ? ' *' : '';
echo '
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="glyphicon glyphicon-file"></span>
<a href="knowledgebase_private.php?article='.$art['id'].'" class="article">'.$art['subject'].'</a>'.$private.'</td>
</tr>';
if ($num == $hesk_settings['kb_numshow'])
{
break;
}
else
{
$num++;
}
}
if (hesk_dbNumRows($res) > $hesk_settings['kb_numshow'])
{
echo '<tr><td>&raquo; <a href="knowledgebase_private.php?category='.$cat['id'].'"><i>'.$hesklang['m'].'</i></a></td></tr>';
}
}
echo '
if ($num == $hesk_settings['kb_numshow'])
{
break;
}
else
{
$num++;
}
}
if (hesk_dbNumRows($res) > $hesk_settings['kb_numshow'])
{
echo '<tr><td>&raquo; <a href="knowledgebase_private.php?category='.$cat['id'].'"><i>'.$hesklang['m'].'</i></a></td></tr>';
}
}
echo '
</table>
</td>
';
if ($i == $per_col)
{
echo '</tr>';
$i = 0;
}
$i++;
}
/* Finish the table if needed */
if ($i != 1)
{
for ($j=1;$j<=$per_col;$j++)
{
echo '<td width="50%">&nbsp;</td>';
if ($i == $per_col)
{
echo '</tr>';
break;
}
$i++;
}
}
?>
</table>
</td>
</tr>
</table>
<?php
} // END if NumRows > 0
?>
<br>
<h4><?php echo $hesklang['ac']; ?></h4>
<div class="footerWithBorder blankSpace"></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<?php
$res = hesk_dbQuery("SELECT `id`, `subject`, LEFT(`content`, ".max(200, $hesk_settings['kb_substrart'] * 2).") AS `content`, `rating`, `type` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `catid`='".intval($catid)."' AND `type` IN ('0','1') ORDER BY `sticky` DESC, `art_order` ASC");
if (hesk_dbNumRows($res) == 0)
{
echo '<p><i>'.$hesklang['noac'].'</i></p>';
}
else
{
echo '<div align="center"><table border="0" cellspacing="1" cellpadding="3" width="100%">';
while ($article = hesk_dbFetchAssoc($res))
{
$private = ($article['type'] == 1) ? ' *' : '';
if ($i == $per_col)
{
echo '</tr>';
$i = 0;
}
$i++;
}
/* Finish the table if needed */
if ($i != 1)
{
for ($j=1;$j<=$per_col;$j++)
{
echo '<td width="50%">&nbsp;</td>';
if ($i == $per_col)
{
echo '</tr>';
break;
}
$i++;
}
}
?>
</table>
</div>
<div class="box-footer">
<?php echo $hesklang['private_category_star']; ?>
</div>
</div>
<?php } ?>
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['ac']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<?php
$res = hesk_dbQuery("SELECT `id`, `subject`, LEFT(`content`, ".max(200, $hesk_settings['kb_substrart'] * 2).") AS `content`, `rating`, `type` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_articles` WHERE `catid`='".intval($catid)."' AND `type` IN ('0','1') ORDER BY `sticky` DESC, `art_order` ASC");
if (hesk_dbNumRows($res) == 0)
{
echo '<i>'.$hesklang['noac'].'</i>';
}
else
{
echo '<table border="0" cellspacing="1" cellpadding="3" width="100%">';
while ($article = hesk_dbFetchAssoc($res))
{
$private = ($article['type'] == 1) ? ' *' : '';
$txt = hesk_kbArticleContentPreview($article['content']);
$txt = hesk_kbArticleContentPreview($article['content']);
echo '
echo '
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="1">
@ -528,14 +556,16 @@ function hesk_show_kb_category($catid, $is_search = 0) {
</table>
</td>
</tr>';
}
echo '</table></div>';
}
?>
</td>
</tr>
</table>
}
echo '</table>';
}
?>
</div>
<div class="box-footer">
<?php echo $hesklang['private_article_star']; ?>
</div>
</div>
</section>
<?php
} // END hesk_show_kb_category()

@ -36,6 +36,7 @@ define('PAGE_TITLE', 'ADMIN_MAIL');
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -124,51 +125,72 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
//-->
</script>
<div class="row move-down-20">
<div class="col-md-3">
<div class="panel panel-default">
<div class="panel-heading"><?php echo $hesklang['navigation']; ?></div>
<ul class="list-group">
<?php
/* Print sub-navigation */
echo
'<li class="list-group-item">' . $hesk_settings['mailtmp']['inbox'] . '</li>
<li class="list-group-item">' . $hesk_settings['mailtmp']['outbox'] . '</li>
<li class="list-group-item">' . $hesk_settings['mailtmp']['new'] . '</li>';
?>
</ul>
<section class="content">
<div class="row">
<div class="col-md-3">
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['navigation']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<ul class="products-list product-list-in-box">
<li class="item">
<?php echo $hesk_settings['mailtmp']['inbox']; ?>
</li>
<li class="item">
<?php echo $hesk_settings['mailtmp']['outbox']; ?>
</li>
<li class="item">
<?php echo $hesk_settings['mailtmp']['new']; ?>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="col-md-7">
<h3><?php echo $hesklang['m_h']; ?></h3>
<div class="footerWithBorder blankSpace"></div>
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
/* Show a message? */
if ($action == 'read') {
show_message();
}
/* Hide list of messages? */
if (!isset($_SESSION['hide']['list'])) {
mail_list_messages();
} // END hide list of messages
<div class="col-md-9">
<?php
hesk_handle_messages();
/* Show a message? */
if ($action == 'read') {
show_message();
}
if (!isset($_SESSION['hide']['list'])):
?>
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['m_h']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<?php mail_list_messages(); ?>
</div>
</div>
<?php endif; ?>
/* Show new message form */
show_new_form();
<?php
/* Show new message form */
show_new_form();
/* Clean unneeded session variables */
hesk_cleanSessionVars('hide');
hesk_cleanSessionVars('mail');
?>
/* Clean unneeded session variables */
hesk_cleanSessionVars('hide');
hesk_cleanSessionVars('mail');
?>
</div>
</div>
</div>
</section>
<?php
require_once(HESK_PATH . 'inc/footer.inc.php');
exit();
@ -403,58 +425,62 @@ function show_message()
}
$pm['name'] = isset($admins[$pm[$hesk_settings['mailtmp']['other']]]) ? '<a href="mail.php?a=new&amp;id='.$pm[$hesk_settings['mailtmp']['other']].'">'.$admins[$pm[$hesk_settings['mailtmp']['other']]].'</a>' : (($pm['from'] == 9999) ? '<a href="http://www.hesk.com" target="_blank">HESK.com</a>' : $hesklang['e_udel']);
echo $pm['dt'];
$pm['dt'] = hesk_dateToString($pm['dt'],0,1,0,true);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td valign="top">
<table border="0">
<tr>
<td><b><?php echo $hesk_settings['mailtmp']['m_from']; ?></b></td>
<td><?php echo $pm['name']; ?></td>
</tr>
<tr>
<td><b><?php echo $hesklang['date']; ?></b></td>
<td><?php echo $pm['dt']; ?></td>
</tr>
<tr>
<td><b><?php echo $hesklang['m_sub']; ?></b></td>
<td><?php echo $pm['subject']; ?></td>
</tr>
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['private_message_header']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<div class="callout callout-info">
<div class="row">
<div class="col-md-4 col-sm-6">
<b><?php echo $hesk_settings['mailtmp']['m_from']; ?></b>
<?php echo $pm['name']; ?>
</div>
<div class="col-md-4 col-sm-6">
<b><?php echo $hesklang['date_colon']; ?></b>
<?php echo $pm['dt']; ?>
</div>
<div class="col-md-4 col-sm-6">
<b><?php echo $hesklang['m_sub']; ?></b>
<?php echo $pm['subject']; ?>
</div>
</div>
</div>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td class="text-right" style="vertical-align:top;">
</td>
</tr>
</table>
</td>
<td class="text-right" style="vertical-align:top;">
<?php
$folder = '&amp;folder=outbox';
if ($pm['to'] == $_SESSION['id'])
{
echo '<a href="mail.php?a=mark_unread&amp;id='.$id.'&amp;token='.hesk_token_echo(0).'"><i class="fa fa-envelope-o font-size-14p"></i></a> ';
$folder = '';
}
echo '<a href="mail.php?a=delete&amp;id='.$id.'&amp;token='.hesk_token_echo(0).$folder.'" onclick="return hesk_confirmExecute(\''.hesk_makeJsString($hesklang['delm']).'?\');"><i class="fa fa-times font-size-14p red"></i></a>';
?>
</td>
</tr>
</table>
<p><?php echo $pm['message']; ?></p>
</td>
</tr>
</table>
</div><hr />
<p><?php echo $pm['message']; ?></p>
</div>
<div class="box-footer">
<div class="pull-right">
<?php
$folder = '&amp;folder=outbox';
if ($pm['to'] == $_SESSION['id'])
{
echo '<a class="btn btn-default" href="mail.php?a=mark_unread&amp;id='.$id.'&amp;token='.hesk_token_echo(0).'"><i class="fa fa-envelope-o icon-link"></i> '.$hesklang['mau'].'</a> ';
$folder = '';
}
echo '<a class="btn btn-danger" href="mail.php?a=delete&amp;id='.$id.'&amp;token='.hesk_token_echo(0).$folder.'" onclick="return hesk_confirmExecute(\''.hesk_makeJsString($hesklang['delm']).'?\');"><i class="fa fa-times icon-link"></i> '.$hesklang['delm'].'</a>';
?>
</div>
</div>
</div>
<?php
} // END if $num
@ -547,7 +573,7 @@ function mail_list_messages()
<th><input type="checkbox" name="checkall" value="2" onclick="hesk_changeAll(this)"/></th>
<th><?php echo $hesklang['m_sub']; ?></th>
<th><?php echo $hesk_settings['mailtmp']['m_from']; ?></th>
<th><?php echo $hesklang['date']; ?></th>
<th><?php echo $hesklang['date_colon']; ?></th>
</tr>
</thead>
<tbody>
@ -620,78 +646,89 @@ function show_new_form()
{
global $hesk_settings, $hesklang, $admins;
?>
<br/>
<form action="mail.php" method="post" name="form2" class="form-horizontal" role="form" data-toggle="validator">
<h3><?php echo $hesklang['new_mail']; ?></h3>
<div class="footerWithBorder blankSpace"></div>
<div class="form-group">
<label for="to" class="col-sm-3 control-label"><?php echo $hesklang['m_to']; ?></label>
<div class="col-sm-9">
<select class="form-control" name="to" type="number"
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>" required>
<option value="" selected="selected"><?php echo $hesklang['select']; ?></option>
<?php
foreach ($admins as $k => $v) {
if ($k != $_SESSION['id']) {
if (isset($_SESSION['mail']) && $k == $_SESSION['mail']['to']) {
echo '<option value="' . $k . '" selected="selected">' . $v . '</option>';
} else {
echo '<option value="' . $k . '">' . $v . '</option>';
}
}
}
?>
</select>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label for="subject" class="col-sm-3 control-label"><?php echo $hesklang['m_sub']; ?></label>
<div class="col-sm-9">
<input type="text" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['subject']); ?>"
name="subject" size="40" maxlength="50"
<?php
if (isset($_SESSION['mail']['subject'])) {
echo ' value="' . stripslashes($_SESSION['mail']['subject']) . '" ';
}
?> data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>" required>
<div class="help-block with-errors"></div>
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['new_mail']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
</div>
<div class="form-group">
<label for="message" class="col-sm-3 control-label"><?php echo $hesklang['message']; ?>:</label>
<div class="box-body">
<div class="form-group">
<label for="to" class="col-sm-3 control-label"><?php echo $hesklang['m_to']; ?></label>
<div class="col-sm-9">
<select class="form-control" name="to" type="number"
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>" required>
<option value="" selected="selected"><?php echo $hesklang['select']; ?></option>
<?php
foreach ($admins as $k => $v) {
if ($k != $_SESSION['id']) {
if (isset($_SESSION['mail']) && $k == $_SESSION['mail']['to']) {
echo '<option value="' . $k . '" selected="selected">' . $v . '</option>';
} else {
echo '<option value="' . $k . '">' . $v . '</option>';
}
}
}
?>
</select>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label for="subject" class="col-sm-3 control-label"><?php echo $hesklang['m_sub']; ?></label>
<div class="col-sm-9">
<input type="text" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['subject']); ?>"
name="subject" size="40" maxlength="50"
<?php
if (isset($_SESSION['mail']['subject'])) {
echo ' value="' . stripslashes($_SESSION['mail']['subject']) . '" ';
}
?> data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>" required>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label for="message" class="col-sm-3 control-label"><?php echo $hesklang['message']; ?>:</label>
<div class="col-sm-9">
<div class="col-sm-9">
<textarea name="message" class="form-control" data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>" rows="15" cols="70" required><?php
if (isset($_SESSION['mail']['message'])) {
echo stripslashes($_SESSION['mail']['message']);
}
?></textarea>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<div class="col-sm-9 col-sm-offset-3">
<div class="checkbox">
<label>
<input type="checkbox" name="signature" value="1" checked>
<?php echo $hesklang['attach_sign']; ?>
</label> (<a href="profile.php"><?php echo $hesklang['profile_settings']; ?></a>)
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<div class="col-sm-9 col-sm-offset-3">
<div class="checkbox">
<label>
<input type="checkbox" name="signature" value="1" checked>
<?php echo $hesklang['attach_sign']; ?>
</label> (<a href="profile.php"><?php echo $hesklang['profile_settings']; ?></a>)
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-9 col-sm-offset-3">
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
<input type="hidden" name="a" value="send"/>
<input type="submit" value="<?php echo $hesklang['m_send']; ?>" class="btn btn-default"/>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-9 col-sm-offset-3">
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
<input type="hidden" name="a" value="send"/>
<input type="submit" value="<?php echo $hesklang['m_send']; ?>" class="btn btn-default"/>
</div>
</div>
</form>
<?php
} // END show_new_form()
?>

@ -37,6 +37,7 @@ define('PAGE_TITLE', 'ADMIN_CANNED');
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -125,82 +126,89 @@ $i = 1;
$j = 0;
$num = hesk_dbNumRows($result);
?>
<div class="row move-down-20">
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading"><?php echo $hesklang['savedResponses']; ?></div>
<div class="panel-body">
<?php if ($num < 1)
{
echo '<p>' . $hesklang['no_saved'] . '</p>';
}
else
{ ?>
<table class="table table-hover">
<tr>
<th><?php echo $hesklang['saved_title']; ?></th>
<th><?php echo $hesklang['opt']; ?></th>
</tr>
<?php
while ($mysaved = hesk_dbFetchAssoc($result)) {
$j++;
if (isset($_SESSION['canned']['selcat2']) && $mysaved['id'] == $_SESSION['canned']['selcat2']) {
$color = 'admin_green';
unset($_SESSION['canned']['selcat2']);
} else {
$color = $i ? 'admin_white' : 'admin_gray';
}
<section class="content">
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['savedResponses']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<?php if ($num < 1)
{
echo '<p>' . $hesklang['no_saved'] . '</p>';
}
else
{ ?>
<table class="table table-hover">
<tr>
<th><?php echo $hesklang['saved_title']; ?></th>
<th><?php echo $hesklang['opt']; ?></th>
</tr>
<?php
while ($mysaved = hesk_dbFetchAssoc($result)) {
$j++;
if (isset($_SESSION['canned']['selcat2']) && $mysaved['id'] == $_SESSION['canned']['selcat2']) {
$color = 'admin_green';
unset($_SESSION['canned']['selcat2']);
} else {
$color = $i ? 'admin_white' : 'admin_gray';
}
$tmp = $i ? 'White' : 'Blue';
$style = 'class="option' . $tmp . 'OFF" onmouseover="this.className=\'option' . $tmp . 'ON\'" onmouseout="this.className=\'option' . $tmp . 'OFF\'"';
$i = $i ? 0 : 1;
$tmp = $i ? 'White' : 'Blue';
$style = 'class="option' . $tmp . 'OFF" onmouseover="this.className=\'option' . $tmp . 'ON\'" onmouseout="this.className=\'option' . $tmp . 'OFF\'"';
$i = $i ? 0 : 1;
$options .= '<option value="' . $mysaved['id'] . '"';
$options .= (isset($_SESSION['canned']['id']) && $_SESSION['canned']['id'] == $mysaved['id']) ? ' selected="selected" ' : '';
$options .= '>' . $mysaved['title'] . '</option>';
$options .= '<option value="' . $mysaved['id'] . '"';
$options .= (isset($_SESSION['canned']['id']) && $_SESSION['canned']['id'] == $mysaved['id']) ? ' selected="selected" ' : '';
$options .= '>' . $mysaved['title'] . '</option>';
$javascript_titles .= 'myTitle[' . $mysaved['id'] . ']=\'' . addslashes($mysaved['title']) . "';\n";
if ($modsForHesk_settings['rich_text_for_tickets']) {
$theMessage = hesk_html_entity_decode($mysaved['message']);
$theMessage = addslashes($theMessage);
$javascript_messages .= 'myMsgTxt[' . $mysaved['id'] . ']=\'' . str_replace("\r\n", "\\r\\n' + \r\n'", $theMessage) . "';\n";
} else {
$javascript_messages .= 'myMsgTxt[' . $mysaved['id'] . ']=\'' . str_replace("\r\n", "\\r\\n' + \r\n'", addslashes($mysaved['message'])) . "';\n";
}
$javascript_titles .= 'myTitle[' . $mysaved['id'] . ']=\'' . addslashes($mysaved['title']) . "';\n";
if ($modsForHesk_settings['rich_text_for_tickets']) {
$theMessage = hesk_html_entity_decode($mysaved['message']);
$theMessage = addslashes($theMessage);
$javascript_messages .= 'myMsgTxt[' . $mysaved['id'] . ']=\'' . str_replace("\r\n", "\\r\\n' + \r\n'", $theMessage) . "';\n";
} else {
$javascript_messages .= 'myMsgTxt[' . $mysaved['id'] . ']=\'' . str_replace("\r\n", "\\r\\n' + \r\n'", addslashes($mysaved['message'])) . "';\n";
}
echo '
echo '
<tr>
<td>' . $mysaved['title'] . '</td>
<td>
';
if ($num > 1) {
if ($j == 1) {
echo '<img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" /> <a href="manage_canned.php?a=order&amp;replyid=' . $mysaved['id'] . '&amp;move=15&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-down icon-link green" data-toggle="tooltip" data-placement="top" title="' . $hesklang['move_dn'] . '"></i></a>';
} elseif ($j == $num) {
echo '<a href="manage_canned.php?a=order&amp;replyid=' . $mysaved['id'] . '&amp;move=-15&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-up icon-link green" data-toggle="tooltip" data-placement="top" title="' . $hesklang['move_up'] . '"></i></a> <img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" />';
} else {
echo '
if ($num > 1) {
if ($j == 1) {
echo '<img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" /> <a href="manage_canned.php?a=order&amp;replyid=' . $mysaved['id'] . '&amp;move=15&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-down icon-link green" data-toggle="tooltip" data-placement="top" title="' . $hesklang['move_dn'] . '"></i></a>';
} elseif ($j == $num) {
echo '<a href="manage_canned.php?a=order&amp;replyid=' . $mysaved['id'] . '&amp;move=-15&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-up icon-link green" data-toggle="tooltip" data-placement="top" title="' . $hesklang['move_up'] . '"></i></a> <img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" />';
} else {
echo '
<a href="manage_canned.php?a=order&amp;replyid=' . $mysaved['id'] . '&amp;move=-15&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-up icon-link green" data-toggle="tooltip" data-placement="top" title="' . $hesklang['move_up'] . '"></i></a>
<a href="manage_canned.php?a=order&amp;replyid=' . $mysaved['id'] . '&amp;move=15&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-down icon-link green" data-toggle="tooltip" data-placement="top" title="' . $hesklang['move_dn'] . '"></i></a>
';
}
} else {
echo '';
}
} else {
echo '';
}
echo '
echo '
<a href="manage_canned.php?a=remove&amp;id=' . $mysaved['id'] . '&amp;token=' . hesk_token_echo(0) . '" onclick="return confirm_delete();"><i class="fa fa-times icon-link red" data-toggle="tooltip" data-placement="top" title="' . $hesklang['delete'] . '"></i></a>&nbsp;</td>
</tr>
';
} // End while
}
?>
</table>
</div>
} // End while
}
?>
</table>
</div>
</div>
<?php if ($modsForHesk_settings['rich_text_for_tickets']): ?>
@ -225,117 +233,123 @@ $num = hesk_dbNumRows($result);
/* ]]> */
</script>
<?php endif; ?>
<div class="col-md-8">
<script language="javascript" type="text/javascript"><!--
// -->
var myMsgTxt = new Array();
var myTitle = new Array();
myMsgTxt[0] = '';
myTitle[0] = '';
<?php
echo $javascript_titles;
echo $javascript_messages;
?>
function setMessage(msgid) {
var useHtmlEditor = <?php echo $modsForHesk_settings['rich_text_for_tickets']; ?>;
var myMsg = myMsgTxt[msgid];
var mySubject = myTitle[msgid];
if (myMsg == '') {
if (useHtmlEditor) {
tinymce.get("message").setContent('');
tinymce.get("message").execCommand('mceInsertRawHTML', false, '');
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['manage_saved']; ?> <a href="javascript:void(0)"
onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['manage_intro']); ?>')"><i
class="fa fa-question-circle settingsquestionmark"></i></a>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<script language="javascript" type="text/javascript"><!--
// -->
var myMsgTxt = new Array();
var myTitle = new Array();
myMsgTxt[0] = '';
myTitle[0] = '';
<?php
echo $javascript_titles;
echo $javascript_messages;
?>
function setMessage(msgid) {
var useHtmlEditor = <?php echo $modsForHesk_settings['rich_text_for_tickets']; ?>;
var myMsg = myMsgTxt[msgid];
var mySubject = myTitle[msgid];
if (myMsg == '') {
if (useHtmlEditor) {
tinymce.get("message").setContent('');
tinymce.get("message").execCommand('mceInsertRawHTML', false, '');
}
else {
$('#message').val('');
}
$('#subject').val('');
return true;
}
if (document.getElementById) {
if (useHtmlEditor) {
tinymce.get("message").setContent('');
tinymce.get("message").execCommand('mceInsertRawHTML', false, myMsg);
} else {
myMsg = $('<textarea />').html(myMsg).text();
$('#message').val(myMsg).trigger('input');
}
mySubject = $('<textarea />').html(mySubject).text();
$('#subject').val(mySubject).trigger('input');
}
else {
$('#message').val('');
document.form1.message.value = myMsg;
document.form1.subject.value = mySubject;
}
$('#subject').val('');
return true;
}
if (document.getElementById) {
if (useHtmlEditor) {
tinymce.get("message").setContent('');
tinymce.get("message").execCommand('mceInsertRawHTML', false, myMsg);
if (msgid == 0) {
document.form1.a[0].checked = true;
} else {
myMsg = $('<textarea />').html(myMsg).text();
$('#message').val(myMsg).trigger('input');
document.form1.a[1].checked = true;
}
mySubject = $('<textarea />').html(mySubject).text();
$('#subject').val(mySubject).trigger('input');
}
else {
document.form1.message.value = myMsg;
document.form1.subject.value = mySubject;
}
if (msgid == 0) {
document.form1.a[0].checked = true;
} else {
document.form1.a[1].checked = true;
}
//-->
</script>
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
?>
<?php
$onsubmit = '';
if ($modsForHesk_settings['rich_text_for_tickets']) {
$onsubmit = 'onsubmit="return validateRichText(\'message-help-block\', \'message-group\', \'message\', \''.htmlspecialchars($hesklang['this_field_is_required']).'\')"';
}
//-->
</script>
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
?>
<h3><?php echo $hesklang['manage_saved']; ?> <a href="javascript:void(0)"
onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['manage_intro']); ?>')"><i
class="fa fa-question-circle settingsquestionmark"></i></a></h3>
<div class="footerWithBorder blankSpace"></div>
<?php
$onsubmit = '';
if ($modsForHesk_settings['rich_text_for_tickets']) {
$onsubmit = 'onsubmit="return validateRichText(\'message-help-block\', \'message-group\', \'message\', \''.htmlspecialchars($hesklang['this_field_is_required']).'\')"';
}
?>
<form action="manage_canned.php" method="post" name="form1" class="form-horizontal" role="form" data-toggle="validator" <?php echo $onsubmit; ?>>
<h3><?php echo $hesklang['new_saved']; ?></h3>
<div class="footerWithBorder blankSpace"></div>
<div class="form-group">
<div class="col-sm-12">
<?php
if ($num > 0) {
?>
<div class="col-sm-12">
<div class="radio">
<label><input type="radio" name="a"
value="new" <?php echo (!isset($_SESSION['canned']['what']) || $_SESSION['canned']['what'] != 'EDIT') ? 'checked="checked"' : ''; ?> /> <?php echo $hesklang['canned_add']; ?>
</label>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="radio">
<label><input type="radio" name="a"
value="edit" <?php echo (isset($_SESSION['canned']['what']) && $_SESSION['canned']['what'] == 'EDIT') ? 'checked="checked"' : ''; ?> /> <?php echo $hesklang['canned_edit']; ?>
</label>:
?>
<form action="manage_canned.php" method="post" name="form1" class="form-horizontal" role="form" data-toggle="validator" <?php echo $onsubmit; ?>>
<div class="form-group">
<div class="col-sm-12">
<?php
if ($num > 0) {
?>
<div class="row">
<div class="col-sm-12">
<div class="radio">
<label><input type="radio" name="a"
value="new" <?php echo (!isset($_SESSION['canned']['what']) || $_SESSION['canned']['what'] != 'EDIT') ? 'checked="checked"' : ''; ?> /> <?php echo $hesklang['canned_add']; ?>
</label>
</div>
</div>
</div>
<div class="col-sm-6">
<select class="form-control" name="saved_replies" onchange="setMessage(this.value)">
<option value="0"> - <?php echo $hesklang['select_empty']; ?>-
</option><?php echo $options; ?></select>
<div class="row">
<div class="col-sm-6">
<div class="radio">
<label><input type="radio" name="a"
value="edit" <?php echo (isset($_SESSION['canned']['what']) && $_SESSION['canned']['what'] == 'EDIT') ? 'checked="checked"' : ''; ?> /> <?php echo $hesklang['canned_edit']; ?>
</label>:
</div>
</div>
<div class="col-sm-6">
<select class="form-control" name="saved_replies" onchange="setMessage(this.value)">
<option value="0"> - <?php echo $hesklang['select_empty']; ?>-
</option><?php echo $options; ?></select>
</div>
</div>
</div>
<?php
} else {
echo '<input type="hidden" name="a" value="new" /><label> ' . $hesklang['canned_add'] . '</label>';
}
?>
<?php
} else {
echo '<input type="hidden" name="a" value="new" /><label> ' . $hesklang['canned_add'] . '</label>';
}
?>
</div>
</div>
</div>
<div class="form-group">
<label for="name" class="col-sm-2 control-label"><?php echo $hesklang['saved_title']; ?></label>
<div class="form-group">
<label for="name" class="col-sm-2 control-label"><?php echo $hesklang['saved_title']; ?></label>
<div class="col-sm-10">
<div class="col-sm-10">
<span id="HeskTitle"><input id="subject" class="form-control"
placeholder="<?php echo htmlspecialchars($hesklang['saved_title']); ?>"
type="text" name="name" size="40"
@ -343,13 +357,13 @@ $num = hesk_dbNumRows($result);
maxlength="50" <?php if (isset($_SESSION['canned']['name'])) {
echo ' value="' . stripslashes($_SESSION['canned']['name']) . '" ';
} ?> required></span>
<div class="help-block with-errors"></div>
<div class="help-block with-errors"></div>
</div>
</div>
</div>
<div class="form-group" id="message-group">
<label for="msg" class="col-sm-2 control-label"><?php echo $hesklang['message']; ?></label>
<div class="form-group" id="message-group">
<label for="msg" class="col-sm-2 control-label"><?php echo $hesklang['message']; ?></label>
<div class="col-sm-10">
<div class="col-sm-10">
<span id="HeskMsg">
<textarea id="message" class="htmlEditor form-control"
placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>" name="msg"
@ -360,38 +374,39 @@ $num = hesk_dbNumRows($result);
}
?></textarea>
</span>
<div class="help-block with-errors" id="message-help-block"></div>
<?php echo $hesklang['insert_special']; ?>:
<a href="javascript:void(0)"
onclick="hesk_insertTag('HESK_ID')"><?php echo $hesklang['seqid']; ?></a> |
<a href="javascript:void(0)"
onclick="hesk_insertTag('HESK_TRACK_ID')"><?php echo $hesklang['trackID']; ?></a> |
<a href="javascript:void(0)"
onclick="hesk_insertTag('HESK_NAME')"><?php echo $hesklang['name']; ?></a> |
<a href="javascript:void(0)"
onclick="hesk_insertTag('HESK_EMAIL')"><?php echo $hesklang['email']; ?></a> |
<a href="javascript:void(0)"
onclick="hesk_insertTag('HESK_OWNER')"><?php echo $hesklang['owner']; ?></a>
<?php
foreach ($hesk_settings['custom_fields'] as $k => $v) {
if ($v['use']) {
if ($modsForHesk_settings['custom_field_setting']) {
$v['name'] = $hesklang[$v['name']];
}
<div class="help-block with-errors" id="message-help-block"></div>
<?php echo $hesklang['insert_special']; ?>:
<a href="javascript:void(0)"
onclick="hesk_insertTag('HESK_ID')"><?php echo $hesklang['seqid']; ?></a> |
<a href="javascript:void(0)"
onclick="hesk_insertTag('HESK_TRACK_ID')"><?php echo $hesklang['trackID']; ?></a> |
<a href="javascript:void(0)"
onclick="hesk_insertTag('HESK_NAME')"><?php echo $hesklang['name']; ?></a> |
<a href="javascript:void(0)"
onclick="hesk_insertTag('HESK_EMAIL')"><?php echo $hesklang['email']; ?></a> |
<a href="javascript:void(0)"
onclick="hesk_insertTag('HESK_OWNER')"><?php echo $hesklang['owner']; ?></a>
<?php
foreach ($hesk_settings['custom_fields'] as $k => $v) {
if ($v['use']) {
if ($modsForHesk_settings['custom_field_setting']) {
$v['name'] = $hesklang[$v['name']];
}
echo '| <a href="javascript:void(0)" onclick="hesk_insertTag(\'HESK_' . $k . '\')">' . $v['name'] . '</a> ';
echo '| <a href="javascript:void(0)" onclick="hesk_insertTag(\'HESK_' . $k . '\')">' . $v['name'] . '</a> ';
}
}
}
?>
?>
</div>
</div>
</div>
<div class="form-group text-center">
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
<input type="submit" value="<?php echo $hesklang['save_changes']; ?>" class="btn btn-default"/>
</div>
</form>
<div class="form-group text-center">
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
<input type="submit" value="<?php echo $hesklang['save_changes']; ?>" class="btn btn-default"/>
</div>
</form>
</div>
</div>
</div>
</section>
<?php
require_once(HESK_PATH . 'inc/footer.inc.php');

@ -37,6 +37,7 @@ define('PAGE_TITLE', 'ADMIN_CATEGORIES');
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -49,9 +50,9 @@ hesk_checkPermission('can_man_cat');
// Possible priorities
$priorities = array(
3 => array('value' => 3, 'text' => $hesklang['low'], 'formatted' => $hesklang['low']),
2 => array('value' => 2, 'text' => $hesklang['medium'], 'formatted' => '<font class="medium">' . $hesklang['medium'] . '</font>'),
1 => array('value' => 1, 'text' => $hesklang['high'], 'formatted' => '<font class="important">' . $hesklang['high'] . '</font>'),
0 => array('value' => 0, 'text' => $hesklang['critical'], 'formatted' => '<font class="critical">' . $hesklang['critical'] . '</font>'),
2 => array('value' => 2, 'text' => $hesklang['medium'], 'formatted' => '<span class="medium">' . $hesklang['medium'] . '</span>'),
1 => array('value' => 1, 'text' => $hesklang['high'], 'formatted' => '<span class="important">' . $hesklang['high'] . '</span>'),
0 => array('value' => 0, 'text' => $hesklang['critical'], 'formatted' => '<span class="critical">' . $hesklang['critical'] . '</span>'),
);
/* What should we do? */
@ -106,221 +107,232 @@ while ($mycat = hesk_dbFetchAssoc($res)) {
$options .= '>' . $mycat['name'] . '</option>';
}
?>
<div class="row move-down-20">
<div align="left" class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<section class="content">
<div class="box collapsed-box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['add_cat']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-plus"></i>
</button>
</div>
<div class="panel-body">
<form action="manage_categories.php" method="post" role="form" class="form-horizontal" data-toggle="validator">
<div class="form-group">
<p class="col-sm-4 control-label" style="font-size: .87em">
<b><?php echo $hesklang['cat_name']; ?></b> (<?php echo $hesklang['max_chars']; ?>)</p>
<div class="col-sm-8">
<input class="form-control"
placeholder="<?php echo htmlspecialchars($hesklang['cat_name']); ?>" type="text"
name="name" size="40" maxlength="40"
<?php
if (isset($_SESSION['catname'])) {
echo ' value="' . hesk_input($_SESSION['catname']) . '" ';
}
?>
data-error="<?php echo htmlspecialchars($hesklang['enter_cat_name']); ?>"
required>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="box-body">
<form action="manage_categories.php" method="post" role="form" class="form-horizontal" data-toggle="validator">
<div class="form-group">
<p class="col-sm-4 control-label" style="font-size: .87em">
<b><?php echo $hesklang['cat_name']; ?></b> (<?php echo $hesklang['max_chars']; ?>)</p>
<div class="col-sm-8">
<input class="form-control"
placeholder="<?php echo htmlspecialchars($hesklang['cat_name']); ?>" type="text"
name="name" size="40" maxlength="40"
<?php
if (isset($_SESSION['catname'])) {
echo ' value="' . hesk_input($_SESSION['catname']) . '" ';
}
?>
data-error="<?php echo htmlspecialchars($hesklang['enter_cat_name']); ?>"
required>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<label for="priority" class="col-sm-4 control-label"
style="font-size: .87em"><?php echo $hesklang['def_pri']; ?> <a href="#"
onclick="alert('<?php echo hesk_makeJsString($hesklang['cat_pri']); ?>')"><i
class="fa fa-question-circle settingsquestionmark"></i> </a> </label>
<div class="col-sm-8">
<select name="priority" class="form-control">
<?php
// Default priority: low
if (!isset($_SESSION['cat_priority'])) {
$_SESSION['cat_priority'] = 3;
}
// List possible priorities
foreach ($priorities as $value => $info) {
echo '<option value="' . $value . '"' . ($_SESSION['cat_priority'] == $value ? ' selected="selected"' : '') . '>' . $info['text'] . '</option>';
}
?>
</select></p>
</div>
<div class="form-group">
<label for="priority" class="col-sm-4 control-label"
style="font-size: .87em"><?php echo $hesklang['def_pri']; ?> <a href="#"
onclick="alert('<?php echo hesk_makeJsString($hesklang['cat_pri']); ?>')"><i
class="fa fa-question-circle settingsquestionmark"></i> </a> </label>
<div class="col-sm-8">
<select name="priority" class="form-control">
<?php
// Default priority: low
if (!isset($_SESSION['cat_priority'])) {
$_SESSION['cat_priority'] = 3;
}
// List possible priorities
foreach ($priorities as $value => $info) {
echo '<option value="' . $value . '"' . ($_SESSION['cat_priority'] == $value ? ' selected="selected"' : '') . '>' . $info['text'] . '</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="color" class="col-sm-4 control-label">
<?php echo $hesklang['category_color']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo htmlspecialchars($hesklang['category_color']); ?>"
data-content="<?php echo htmlspecialchars($hesklang['category_color_help']); ?>"></i>
</label>
<div class="col-sm-8">
<input class="form-control colorpicker-trigger"
placeholder="<?php echo htmlspecialchars($hesklang['category_color']); ?>" type="text"
name="color" maxlength="7">
</div>
</div>
<div class="form-group">
<label for="color" class="col-sm-4 control-label">
<?php echo $hesklang['category_color']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo htmlspecialchars($hesklang['category_color']); ?>"
data-content="<?php echo htmlspecialchars($hesklang['category_color_help']); ?>"></i>
</label>
<div class="col-sm-8">
<input class="form-control colorpicker-trigger"
placeholder="<?php echo htmlspecialchars($hesklang['category_color']); ?>" type="text"
name="color" maxlength="7">
</div>
<div class="form-group">
<label for="usage" class="col-sm-4 control-label"><?php echo $hesklang['usage']; ?></label>
<div class="col-sm-8">
<select name="usage" class="form-control">
<option value="0"><?php echo $hesklang['tickets_and_events']; ?></option>
<option value="1"><?php echo $hesklang['tickets_only']; ?></option>
<option value="2"><?php echo $hesklang['events_only']; ?></option>
</select>
</div>
</div>
<div class="form-group">
<label for="usage" class="col-sm-4 control-label"><?php echo $hesklang['usage']; ?></label>
<div class="col-sm-8">
<select name="usage" class="form-control">
<option value="0"><?php echo $hesklang['tickets_and_events']; ?></option>
<option value="1"><?php echo $hesklang['tickets_only']; ?></option>
<option value="2"><?php echo $hesklang['events_only']; ?></option>
</select>
</div>
<div class="form-group">
<label for="options" class="col-sm-4 control-label"><?php echo $hesklang['opt']; ?></label>
</div>
<div class="form-group">
<label for="options" class="col-sm-4 control-label"><?php echo $hesklang['opt']; ?></label>
<div class="col-sm-8">
<?php
if ($hesk_settings['autoassign']) {
?>
<div class="checkbox">
<label><input type="checkbox" name="autoassign"
value="Y" <?php if (!isset($_SESSION['cat_autoassign']) || $_SESSION['cat_autoassign'] == 1) {
echo 'checked="checked"';
} ?> /> <?php echo $hesklang['cat_aa']; ?></label><br/>
</div>
<?php
}
<div class="col-sm-8">
<?php
if ($hesk_settings['autoassign']) {
?>
<div class="checkbox">
<label><input type="checkbox" name="type"
value="Y" <?php if (isset($_SESSION['cat_type']) && $_SESSION['cat_type'] == 1) {
<label><input type="checkbox" name="autoassign"
value="Y" <?php if (!isset($_SESSION['cat_autoassign']) || $_SESSION['cat_autoassign'] == 1) {
echo 'checked="checked"';
} ?> /> <?php echo $hesklang['cat_type']; ?></label>
} ?> /> <?php echo $hesklang['cat_aa']; ?></label><br/>
</div>
<?php
}
?>
<div class="checkbox">
<label><input type="checkbox" name="type"
value="Y" <?php if (isset($_SESSION['cat_type']) && $_SESSION['cat_type'] == 1) {
echo 'checked="checked"';
} ?> /> <?php echo $hesklang['cat_type']; ?></label>
</div>
</div>
<div class="form-group text-center">
<input type="hidden" name="a" value="new"/>
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
<input type="submit" value="<?php echo $hesklang['create_cat']; ?>" class="btn btn-default"/>
</div>
</form>
</div>
</div>
<div class="form-group text-center">
<input type="hidden" name="a" value="new"/>
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
<input type="submit" value="<?php echo $hesklang['create_cat']; ?>" class="btn btn-default"/>
</div>
</form>
</div>
</div>
<div class="col-md-8">
<div class="panel panel-default">
<div class="panel-heading">
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['manage_cat']; ?> <a href="javascript:void(0)"
onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['cat_intro']); ?>')"><i
class="fa fa-question-circle settingsquestionmark"></i></a>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
<div class="panel-body">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
</div>
<div class="box-body">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
if ($hesk_settings['cust_urgency']) {
hesk_show_notice($hesklang['cat_pri_info'] . ' ' . $hesklang['cpri']);
if ($hesk_settings['cust_urgency']) {
hesk_show_notice($hesklang['cat_pri_info'] . ' ' . $hesklang['cpri']);
}
?>
<table class="table table-hover">
<tr>
<th style="display: none"><?php echo $hesklang['id']; ?></th>
<th><?php echo $hesklang['cat_name']; ?></th>
<th><?php echo $hesklang['priority']; ?></th>
<th><?php echo $hesklang['not']; ?></th>
<th><?php echo $hesklang['graph']; ?></th>
<th><?php echo $hesklang['usage']; ?></th>
<th><?php echo $hesklang['manager']; ?></th>
<th><?php echo $hesklang['opt']; ?></th>
</tr>
<?php
/* Get number of tickets per category */
$tickets_all = array();
$tickets_total = 0;
$res = hesk_dbQuery('SELECT COUNT(*) AS `cnt`, `category` FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'tickets` GROUP BY `category`');
while ($tmp = hesk_dbFetchAssoc($res)) {
$tickets_all[$tmp['category']] = $tmp['cnt'];
$tickets_total += $tmp['cnt'];
}
?>
<table class="table table-hover">
<tr>
<th style="display: none"><?php echo $hesklang['id']; ?></th>
<th><?php echo $hesklang['cat_name']; ?></th>
<th><?php echo $hesklang['priority']; ?></th>
<th><?php echo $hesklang['not']; ?></th>
<th><?php echo $hesklang['graph']; ?></th>
<th><?php echo $hesklang['usage']; ?></th>
<th><?php echo $hesklang['manager']; ?></th>
<th><?php echo $hesklang['opt']; ?></th>
</tr>
<?php
/* Get number of tickets per category */
$tickets_all = array();
$tickets_total = 0;
$res = hesk_dbQuery('SELECT COUNT(*) AS `cnt`, `category` FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'tickets` GROUP BY `category`');
while ($tmp = hesk_dbFetchAssoc($res)) {
$tickets_all[$tmp['category']] = $tmp['cnt'];
$tickets_total += $tmp['cnt'];
}
/* Get list of categories */
$res = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` ORDER BY `" . $orderBy . "` ASC");
$usersRes = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` WHERE `isadmin` = '0' ORDER BY `name` ASC");
$users = array();
while ($userRow = hesk_dbFetchAssoc($usersRes)) {
array_push($users, $userRow);
}
/* Get list of categories */
$res = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` ORDER BY `" . $orderBy . "` ASC");
$usersRes = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` WHERE `isadmin` = '0' ORDER BY `name` ASC");
$users = array();
while ($userRow = hesk_dbFetchAssoc($usersRes)) {
array_push($users, $userRow);
}
$i = 1;
$j = 0;
$num = hesk_dbNumRows($res);
$i = 1;
$j = 0;
$num = hesk_dbNumRows($res);
$usage = array(
0 => '<i class="fa fa-fw fa-ticket icon-link" data-toggle="tooltip" title="' . $hesklang['tickets'] . '"></i>
$usage = array(
0 => '<i class="fa fa-fw fa-ticket icon-link" data-toggle="tooltip" title="' . $hesklang['tickets'] . '"></i>
<i class="fa fa-fw fa-calendar icon-link" data-toggle="tooltip" title="' . $hesklang['events'] . '"></i>',
1 => '<i class="fa fa-fw fa-ticket icon-link" data-toggle="tooltip" title="' . $hesklang['tickets'] . '"></i><i class="fa fa-fw"></i>',
2 => '<i class="fa fa-fw icon-link">&nbsp;</i> <i class="fa fa-fw fa-calendar icon-link" data-toggle="tooltip" title="' . $hesklang['events'] . '"></i>'
);
while ($mycat = hesk_dbFetchAssoc($res)) {
$j++;
if (isset($_SESSION['selcat2']) && $mycat['id'] == $_SESSION['selcat2']) {
$color = 'admin_green';
unset($_SESSION['selcat2']);
} else {
$color = $i ? 'admin_white' : 'admin_gray';
}
1 => '<i class="fa fa-fw fa-ticket icon-link" data-toggle="tooltip" title="' . $hesklang['tickets'] . '"></i><i class="fa fa-fw"></i>',
2 => '<i class="fa fa-fw icon-link">&nbsp;</i> <i class="fa fa-fw fa-calendar icon-link" data-toggle="tooltip" title="' . $hesklang['events'] . '"></i>'
);
while ($mycat = hesk_dbFetchAssoc($res)) {
$j++;
if (isset($_SESSION['selcat2']) && $mycat['id'] == $_SESSION['selcat2']) {
$color = 'admin_green';
unset($_SESSION['selcat2']);
} else {
$color = $i ? 'admin_white' : 'admin_gray';
}
$tmp = $i ? 'White' : 'Blue';
$style = '';
if ($mycat['color'] == null) {
$style .= 'color: black; border: solid 1px #000';
} else {
$style .= 'background: ' . $mycat['color'];
}
$i = $i ? 0 : 1;
$tmp = $i ? 'White' : 'Blue';
$style = '';
if ($mycat['color'] == null) {
$style .= 'color: black; border: solid 1px #000';
} else {
$style .= 'background: ' . $mycat['color'];
}
$i = $i ? 0 : 1;
/* Number of tickets and graph width */
$all = isset($tickets_all[$mycat['id']]) ? $tickets_all[$mycat['id']] : 0;
$width_all = 0;
if ($tickets_total && $all) {
$width_all = round(($all / $tickets_total) * 100);
}
/* Number of tickets and graph width */
$all = isset($tickets_all[$mycat['id']]) ? $tickets_all[$mycat['id']] : 0;
$width_all = 0;
if ($tickets_total && $all) {
$width_all = round(($all / $tickets_total) * 100);
}
/* Deleting category with ID 1 (default category) is not allowed */
if ($mycat['id'] == 1) {
$remove_code = ' <img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" />';
} else {
$remove_code = ' <a href="manage_categories.php?a=remove&amp;catid=' . $mycat['id'] . '&amp;token=' . hesk_token_echo(0) . '" onclick="return confirm_delete();"><i class="fa fa-times icon-link red" data-toggle="tooltip" data-placement="top" title="' . $hesklang['delete'] . '"></i></a>';
}
/* Deleting category with ID 1 (default category) is not allowed */
if ($mycat['id'] == 1) {
$remove_code = ' <img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" />';
} else {
$remove_code = ' <a href="manage_categories.php?a=remove&amp;catid=' . $mycat['id'] . '&amp;token=' . hesk_token_echo(0) . '" onclick="return confirm_delete();"><i class="fa fa-times icon-link red" data-toggle="tooltip" data-placement="top" title="' . $hesklang['delete'] . '"></i></a>';
}
/* Is category private or public? */
if ($mycat['type']) {
$type_code = '<a href="manage_categories.php?a=type&amp;s=0&amp;catid=' . $mycat['id'] . '&amp;token=' . hesk_token_echo(0) . '"><span class="glyphicon glyphicon-user gray" data-toggle="tooltip" data-placement="top" title="' . $hesklang['cat_private'] . '"></span></a>';
} else {
$type_code = '<a href="manage_categories.php?a=type&amp;s=1&amp;catid=' . $mycat['id'] . '&amp;token=' . hesk_token_echo(0) . '"><span class="glyphicon glyphicon-user blue" data-toggle="tooltip" data-placement="top" title="' . $hesklang['cat_public'] . '"></span></a>';
}
/* Is category private or public? */
if ($mycat['type']) {
$type_code = '<a href="manage_categories.php?a=type&amp;s=0&amp;catid=' . $mycat['id'] . '&amp;token=' . hesk_token_echo(0) . '"><span class="glyphicon glyphicon-user gray" data-toggle="tooltip" data-placement="top" title="' . $hesklang['cat_private'] . '"></span></a>';
} else {
$type_code = '<a href="manage_categories.php?a=type&amp;s=1&amp;catid=' . $mycat['id'] . '&amp;token=' . hesk_token_echo(0) . '"><span class="glyphicon glyphicon-user blue" data-toggle="tooltip" data-placement="top" title="' . $hesklang['cat_public'] . '"></span></a>';
}
/* Is auto assign enabled? */
if ($hesk_settings['autoassign']) {
if ($mycat['autoassign']) {
$autoassign_code = '<a href="manage_categories.php?a=autoassign&amp;s=0&amp;catid=' . $mycat['id'] . '&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-bolt icon-link orange" data-toggle="tooltip" data-placement="top" title="' . $hesklang['aaon'] . '"></i></a>';
} else {
$autoassign_code = '<a href="manage_categories.php?a=autoassign&amp;s=1&amp;catid=' . $mycat['id'] . '&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-bolt icon-link gray" data-toggle="tooltip" data-placement="top" title="' . $hesklang['aaoff'] . '"></i></a>';
}
/* Is auto assign enabled? */
if ($hesk_settings['autoassign']) {
if ($mycat['autoassign']) {
$autoassign_code = '<a href="manage_categories.php?a=autoassign&amp;s=0&amp;catid=' . $mycat['id'] . '&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-bolt icon-link orange" data-toggle="tooltip" data-placement="top" title="' . $hesklang['aaon'] . '"></i></a>';
} else {
$autoassign_code = '';
$autoassign_code = '<a href="manage_categories.php?a=autoassign&amp;s=1&amp;catid=' . $mycat['id'] . '&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-bolt icon-link gray" data-toggle="tooltip" data-placement="top" title="' . $hesklang['aaoff'] . '"></i></a>';
}
} else {
$autoassign_code = '';
}
echo '
echo '
<tr data-category-id="' . $mycat['id'] . '" data-name="' . htmlspecialchars($mycat['name']) . '"
data-color="'. htmlspecialchars($mycat['color']) . '" data-priority="' . $mycat['priority'] . '"
data-manager="' . $mycat['manager'] . '" data-usage="'. $mycat['usage'] .'">
@ -342,31 +354,30 @@ while ($mycat = hesk_dbFetchAssoc($res)) {
' . $autoassign_code . '
' . $type_code . ' ';
if ($orderBy != 'name' && $num > 1) {
if ($j == 1) {
echo '<img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" /> <a href="manage_categories.php?a=order&amp;catid=' . $mycat['id'] . '&amp;move=15&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-down icon-link green" data-toggle="tooltip" data-placement="top" title="' . $hesklang['move_dn'] . '"></i></a>&nbsp;';
} elseif ($j == $num) {
echo '<a href="manage_categories.php?a=order&amp;catid=' . $mycat['id'] . '&amp;move=-15&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-up icon-link green" data-toggle="tooltip" data-placement="top" title="' . $hesklang['move_up'] . '"></i></a> <img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" />';
} else {
echo '
if ($orderBy != 'name' && $num > 1) {
if ($j == 1) {
echo '<img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" /> <a href="manage_categories.php?a=order&amp;catid=' . $mycat['id'] . '&amp;move=15&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-down icon-link green" data-toggle="tooltip" data-placement="top" title="' . $hesklang['move_dn'] . '"></i></a>&nbsp;';
} elseif ($j == $num) {
echo '<a href="manage_categories.php?a=order&amp;catid=' . $mycat['id'] . '&amp;move=-15&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-up icon-link green" data-toggle="tooltip" data-placement="top" title="' . $hesklang['move_up'] . '"></i></a> <img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" />';
} else {
echo '
<a href="manage_categories.php?a=order&amp;catid=' . $mycat['id'] . '&amp;move=-15&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-up icon-link green" data-toggle="tooltip" data-placement="top" title="' . $hesklang['move_up'] . '"></i></a>
<a href="manage_categories.php?a=order&amp;catid=' . $mycat['id'] . '&amp;move=15&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-down icon-link green" data-toggle="tooltip" data-placement="top" title="' . $hesklang['move_dn'] . '"></i></a>&nbsp;
';
}
}
echo '<a href="javascript:;" class="category-modal-trigger" data-category-id="' . $mycat['id'] . '"><i class="fa fa-pencil icon-link orange" data-toggle="tooltip" title="Edit"></i></a>';
echo $remove_code . '</td>
}
echo '<a href="javascript:;" class="category-modal-trigger" data-category-id="' . $mycat['id'] . '"><i class="fa fa-pencil icon-link orange" data-toggle="tooltip" title="Edit"></i></a>';
echo $remove_code . '</td>
</tr>
';
} // End while
} // End while
?>
</table>
</div>
?>
</table>
</div>
</div>
</div>
</section>
<!-- Edit category modal -->
<div class="modal fade" id="edit-category-modal" tabindex="-1" role="dialog" style="overflow: hidden">
<div class="modal-dialog modal-lg" role="document">

@ -8,6 +8,7 @@ define('PAGE_TITLE', 'ADMIN_TOOLS');
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -60,192 +61,199 @@ if ($modsForHesk_settings['html_emails']) {
/* Print main manage users page */
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
<div class="row pad-20">
<ul class="nav nav-tabs" role="tablist">
<?php
// Show a link to banned_emails.php if user has permission
if (hesk_checkPermission('can_ban_emails', 0)) {
echo '
<section class="content">
<div class="box">
<div class="box-body">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs" role="tablist">
<?php
// Show a link to banned_emails.php if user has permission
if (hesk_checkPermission('can_ban_emails', 0)) {
echo '
<li role="presentation">
<a title="' . $hesklang['banemail'] . '" href="banned_emails.php">' . $hesklang['banemail'] . '</a>
</li>
';
}
if (hesk_checkPermission('can_ban_ips', 0)) {
echo '
}
if (hesk_checkPermission('can_ban_ips', 0)) {
echo '
<li role="presentation">
<a title="' . $hesklang['banip'] . '" href="banned_ips.php">' . $hesklang['banip'] . '</a>
</li>';
}
// Show a link to status_message.php if user has permission to do so
if (hesk_checkPermission('can_service_msg', 0)) {
echo '
}
// Show a link to status_message.php if user has permission to do so
if (hesk_checkPermission('can_service_msg', 0)) {
echo '
<li role="presentation">
<a title="' . $hesklang['sm_title'] . '" href="service_messages.php">' . $hesklang['sm_title'] . '</a>
</li>';
}
?>
<li role="presentation" class="active">
<a href="#"><?php echo $hesklang['email_templates']; ?> <i
class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo $hesklang['email_templates']; ?>"
data-content="<?php echo $hesklang['email_templates_intro']; ?>"></i></a>
</li>
<?php
if (hesk_checkPermission('can_man_ticket_statuses', 0)) {
echo '
}
?>
<li role="presentation" class="active">
<a href="#"><?php echo $hesklang['email_templates']; ?> <i
class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo $hesklang['email_templates']; ?>"
data-content="<?php echo $hesklang['email_templates_intro']; ?>"></i></a>
</li>
<?php
if (hesk_checkPermission('can_man_ticket_statuses', 0)) {
echo '
<li role="presentation">
<a title="' . $hesklang['statuses'] . '" href="manage_statuses.php">' . $hesklang['statuses'] . '</a>
</li>
';
}
?>
</ul>
<div class="tab-content summaryList tabPadding">
<?php if ($showEditPanel): ?>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<h4>
<?php
$isHtml = ($_GET['html'] == 'true');
$class = 'plaintext-editor';
if ($isHtml) {
$class = 'htmlEditor';
echo sprintf($hesklang['editing_html_template'], $_GET['template']);
} else {
echo sprintf($hesklang['editing_plain_text_template'], $_GET['template']);
} ?>
</h4>
</div>
<div class="panel-body">
<?php
$fileContent = '';
if ($isHtml) {
$fileContent = file_get_contents(HESK_PATH . 'language/' . urldecode($_GET['language']) . '/emails/html/' . $_GET['template']);
} else {
$fileContent = file_get_contents(HESK_PATH . 'language/' . urldecode($_GET['language']) . '/emails/' . $_GET['template']);
}
if ($fileContent === false) {
//throw error
}
?>
<a href="#" id="showSpecialTags"
onclick="toggleContainers(['specialTags'],['showSpecialTags'])">
<?php echo $hesklang['show_special_tags']; ?>
</a>
<div id="specialTags" style="display: none">
<a href="#" onclick="toggleContainers(['showSpecialTags'],['specialTags'])">
<?php echo $hesklang['hide_special_tags']; ?>
</a>
<table class="table table-striped table-responsive table-condensed">
<thead>
<tr>
<th><?php echo $hesklang['special_tag']; ?></th>
<th><?php echo $hesklang['description'] ?></th>
</tr>
</thead>
<tbody>
}
?>
</ul>
<div class="tab-content summaryList tabPadding">
<?php if ($showEditPanel): ?>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<h4>
<?php
$isHtml = ($_GET['html'] == 'true');
$class = 'plaintext-editor';
if ($isHtml) {
$class = 'htmlEditor';
echo sprintf($hesklang['editing_html_template'], $_GET['template']);
} else {
echo sprintf($hesklang['editing_plain_text_template'], $_GET['template']);
} ?>
</h4>
</div>
<div class="panel-body">
<?php
$tags = getSpecialTagMap();
foreach ($tags as $tag => $text): ?>
<tr>
<td><?php echo $tag; ?></td>
<td><?php echo $text; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<form action="manage_email_templates.php" method="post">
$fileContent = '';
if ($isHtml) {
$fileContent = file_get_contents(HESK_PATH . 'language/' . urldecode($_GET['language']) . '/emails/html/' . $_GET['template']);
} else {
$fileContent = file_get_contents(HESK_PATH . 'language/' . urldecode($_GET['language']) . '/emails/' . $_GET['template']);
}
if ($fileContent === false) {
//throw error
}
?>
<a href="#" id="showSpecialTags"
onclick="toggleContainers(['specialTags'],['showSpecialTags'])">
<?php echo $hesklang['show_special_tags']; ?>
</a>
<div id="specialTags" style="display: none">
<a href="#" onclick="toggleContainers(['showSpecialTags'],['specialTags'])">
<?php echo $hesklang['hide_special_tags']; ?>
</a>
<table class="table table-striped table-responsive table-condensed">
<thead>
<tr>
<th><?php echo $hesklang['special_tag']; ?></th>
<th><?php echo $hesklang['description'] ?></th>
</tr>
</thead>
<tbody>
<?php
$tags = getSpecialTagMap();
foreach ($tags as $tag => $text): ?>
<tr>
<td><?php echo $tag; ?></td>
<td><?php echo $text; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<form action="manage_email_templates.php" method="post">
<textarea name="text" rows="15"
class="form-control <?php echo $class; ?>"><?php echo $fileContent; ?></textarea>
<input type="hidden" name="action" value="save">
<input type="hidden" name="template"
value="<?php echo htmlspecialchars($_GET['template']); ?>">
<input type="hidden" name="language"
value="<?php echo htmlspecialchars($_GET['language']); ?>">
<input type="hidden" name="html" value="<?php echo $isHtml; ?>">
<br>
<?php
$fileWritable = false;
if ($isHtml) {
$fileWritable = is_writable(HESK_PATH . 'language/' . $_GET['language'] . '/emails/html/' . $_GET['template']);
} else {
$fileWritable = is_writable(HESK_PATH . 'language/' . $_GET['language'] . '/emails/' . $_GET['template']);
}
<input type="hidden" name="action" value="save">
<input type="hidden" name="template"
value="<?php echo htmlspecialchars($_GET['template']); ?>">
<input type="hidden" name="language"
value="<?php echo htmlspecialchars($_GET['language']); ?>">
<input type="hidden" name="html" value="<?php echo $isHtml; ?>">
<br>
<?php
$fileWritable = false;
if ($isHtml) {
$fileWritable = is_writable(HESK_PATH . 'language/' . $_GET['language'] . '/emails/html/' . $_GET['template']);
} else {
$fileWritable = is_writable(HESK_PATH . 'language/' . $_GET['language'] . '/emails/' . $_GET['template']);
}
if (!$fileWritable) {
echo '<div class="alert alert-danger">
if (!$fileWritable) {
echo '<div class="alert alert-danger">
<p>' . sprintf($hesklang['email_template_directory_not_writable'], $_GET['template']) . '</p>
</div>';
} else {
echo '<input type="submit" class="btn btn-default" value="' . $hesklang['save'] . '">';
}
?>
</form>
} else {
echo '<input type="submit" class="btn btn-default" value="' . $hesklang['save'] . '">';
}
?>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
<div class="row">
<div class="col-md-12">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
<?php endif; ?>
<div class="row">
<div class="col-md-12">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
// Output list of templates, and provide links to edit the plaintext and HTML versions for each language
// First get list of languages
$languages = array();
foreach ($hesk_settings['languages'] as $key => $value) {
$languages[$key] = $hesk_settings['languages'][$key]['folder'];
}
// Output list of templates, and provide links to edit the plaintext and HTML versions for each language
// First get list of languages
$languages = array();
foreach ($hesk_settings['languages'] as $key => $value) {
$languages[$key] = $hesk_settings['languages'][$key]['folder'];
}
// Get all files, but don't worry about index.htm, items beginning with '.', or the html folder
// We'll also assume the template file exists in all language folders and in the html folder
reset($languages);
$firstKey = key($languages);
$firstDirectory = HESK_PATH . 'language/' . $languages[$firstKey] . '/emails';
$directoryListing = preg_grep('/^([^.])/', scandir($firstDirectory));
$emailTemplates = array_diff($directoryListing, array('html', 'index.htm'));
// Get all files, but don't worry about index.htm, items beginning with '.', or the html folder
// We'll also assume the template file exists in all language folders and in the html folder
reset($languages);
$firstKey = key($languages);
$firstDirectory = HESK_PATH . 'language/' . $languages[$firstKey] . '/emails';
$directoryListing = preg_grep('/^([^.])/', scandir($firstDirectory));
$emailTemplates = array_diff($directoryListing, array('html', 'index.htm'));
?>
<table class="table table-striped table-responsive">
<thead>
<tr>
<th><?php echo $hesklang['file_name']; ?></th>
<?php foreach ($languages as $language => $languageCode): ?>
<th><?php echo $language; ?></th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ($emailTemplates as $template): ?>
<tr>
<td><?php echo $template; ?></td>
<?php foreach ($languages as $language => $languageCode): ?>
<td>
<?php
echo getTemplateMarkup($template, $languageCode);
echo '&nbsp;&nbsp;&nbsp;';
if ($modsForHesk_settings['html_emails']) {
echo getTemplateMarkup($template, $languageCode, true);
}
?>
</td>
?>
<table class="table table-striped table-responsive">
<thead>
<tr>
<th><?php echo $hesklang['file_name']; ?></th>
<?php foreach ($languages as $language => $languageCode): ?>
<th><?php echo $language; ?></th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ($emailTemplates as $template): ?>
<tr>
<td><?php echo $template; ?></td>
<?php foreach ($languages as $language => $languageCode): ?>
<td>
<?php
echo getTemplateMarkup($template, $languageCode);
echo '&nbsp;&nbsp;&nbsp;';
if ($modsForHesk_settings['html_emails']) {
echo getTemplateMarkup($template, $languageCode, true);
}
?>
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<?php
require_once(HESK_PATH . 'inc/footer.inc.php');

File diff suppressed because it is too large Load Diff

@ -37,6 +37,7 @@ define('PAGE_TITLE', 'ADMIN_USERS');
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -96,23 +97,25 @@ while ($row = hesk_dbFetchAssoc($res)) {
array_push($categories, $row);
}
?>
<div class="row move-down-20">
<div class="col-md-12">
<?php
hesk_handle_messages();
?>
<div class="panel panel-default">
<div class="panel-heading">
<h4><?php echo $hesklang['manage_permission_templates']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="tooltip" data-placement="right"
title="<?php echo $hesklang['manage_permission_templates_help']; ?>"></i>
<span class="nu-floatRight panel-button">
<a href="#" data-toggle="modal" data-target="#modal-template-new" class="btn btn-success nu-floatRight">
<i class="fa fa-plus-circle"></i> <?php echo $hesklang['create_new_template']; ?>
</a>
</span>
</h4>
<section class="content">
<?php hesk_handle_messages(); ?>
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['manage_permission_templates']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="tooltip" data-placement="right"
title="<?php echo $hesklang['manage_permission_templates_help']; ?>"></i>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<a href="#" data-toggle="modal" data-target="#modal-template-new" class="btn btn-success nu-floatRight">
<i class="fa fa-plus-circle"></i> <?php echo $hesklang['create_new_template']; ?>
</a>
<table class="table table-striped">
<thead>
<th><?php echo $hesklang['name']; ?></th>
@ -129,23 +132,23 @@ while ($row = hesk_dbFetchAssoc($res)) {
<i class="fa fa-pencil icon-link" data-toggle="tooltip"
title="<?php echo $hesklang['view_permissions_for_this_template'] ?>"></i></a>
<?php if ($row['id'] == 1) { ?>
<i class="fa fa-star icon-link orange" data-toggle="tooltip"
title="<?php echo $hesklang['admin_cannot_be_staff']; ?>"></i></a>
<?php } elseif ($row['heskprivileges'] == 'ALL' && $row['categories'] == 'ALL'){ ?>
<a href="manage_permission_templates.php?a=deladmin&amp;id=<?php echo $row['id']; ?>">
<i class="fa fa-star icon-link orange" data-toggle="tooltip"
title="<?php echo $hesklang['template_has_admin_privileges']; ?>"></i></a>
<?php } elseif ($row['id'] != 2) { ?>
<a href="manage_permission_templates.php?a=addadmin&amp;id=<?php echo $row['id']; ?>">
<i class="fa fa-star-o icon-link gray" data-toggle="tooltip"
title="<?php echo $hesklang['template_has_no_admin_privileges']; ?>"></i></a>
<?php
} else {
?>
<i class="fa fa-star-o icon-link gray" data-toggle="tooltip"
title="<?php echo $hesklang['staff_cannot_be_admin']; ?>"></i>
<?php
}
<i class="fa fa-star icon-link orange" data-toggle="tooltip"
title="<?php echo $hesklang['admin_cannot_be_staff']; ?>"></i></a>
<?php } elseif ($row['heskprivileges'] == 'ALL' && $row['categories'] == 'ALL'){ ?>
<a href="manage_permission_templates.php?a=deladmin&amp;id=<?php echo $row['id']; ?>">
<i class="fa fa-star icon-link orange" data-toggle="tooltip"
title="<?php echo $hesklang['template_has_admin_privileges']; ?>"></i></a>
<?php } elseif ($row['id'] != 2) { ?>
<a href="manage_permission_templates.php?a=addadmin&amp;id=<?php echo $row['id']; ?>">
<i class="fa fa-star-o icon-link gray" data-toggle="tooltip"
title="<?php echo $hesklang['template_has_no_admin_privileges']; ?>"></i></a>
<?php
} else {
?>
<i class="fa fa-star-o icon-link gray" data-toggle="tooltip"
title="<?php echo $hesklang['staff_cannot_be_admin']; ?>"></i>
<?php
}
if ($row['id'] != 1 && $row['id'] != 2):
?>
<a href="manage_permission_templates.php?a=delete&amp;id=<?php echo $row['id']; ?>">
@ -159,7 +162,7 @@ while ($row = hesk_dbFetchAssoc($res)) {
</table>
</div>
</div>
</div>
</section>
<?php
foreach ($templates as $template) {
createEditModal($template, $featureArray, $categories);
@ -207,8 +210,10 @@ function createEditModal($template, $features, $categories)
<div class="modal-body">
<div class="row">
<?php if ($showNotice): ?>
<div class="alert alert-info">
<i class="fa fa-info-circle"></i> <?php echo $hesklang['template_is_admin_cannot_change']; ?>
<div class="col-sm-12">
<div class="alert alert-info">
<i class="fa fa-info-circle"></i> <?php echo $hesklang['template_is_admin_cannot_change']; ?>
</div>
</div>
<?php endif; ?>
<div class="form-group">

@ -9,6 +9,7 @@ require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/status_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -45,318 +46,325 @@ require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
/* Print main manage users page */
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
<div class="row pad-20">
<ul class="nav nav-tabs" role="tablist">
<?php
// Show a link to banned_emails.php if user has permission
if (hesk_checkPermission('can_ban_emails', 0)) {
echo '
<section class="content">
<div class="box">
<div class="box-body">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs" role="tablist">
<?php
// Show a link to banned_emails.php if user has permission
if (hesk_checkPermission('can_ban_emails', 0)) {
echo '
<li role="presentation">
<a title="' . $hesklang['banemail'] . '" href="banned_emails.php">' . $hesklang['banemail'] . '</a>
</li>
';
}
if (hesk_checkPermission('can_ban_ips', 0)) {
echo '
}
if (hesk_checkPermission('can_ban_ips', 0)) {
echo '
<li role="presentation">
<a title="' . $hesklang['banip'] . '" href="banned_ips.php">' . $hesklang['banip'] . '</a>
</li>';
}
// Show a link to status_message.php if user has permission to do so
if (hesk_checkPermission('can_service_msg', 0)) {
echo '
}
// Show a link to status_message.php if user has permission to do so
if (hesk_checkPermission('can_service_msg', 0)) {
echo '
<li role="presentation">
<a title="' . $hesklang['sm_title'] . '" href="service_messages.php">' . $hesklang['sm_title'] . '</a>
</li>';
}
if (hesk_checkPermission('can_man_email_tpl', 0)) {
echo '
}
if (hesk_checkPermission('can_man_email_tpl', 0)) {
echo '
<li role="presentation">
<a title="' . $hesklang['email_templates'] . '" href="manage_email_templates.php">' . $hesklang['email_templates'] . '</a>
</li>
';
}
?>
<li role="presentation" class="active">
<a href="#"><?php echo $hesklang['statuses']; ?> <i class="fa fa-question-circle settingsquestionmark"
data-toggle="popover"
title="<?php echo $hesklang['statuses']; ?>"
data-content="<?php echo $hesklang['statuses_intro']; ?>"></i></a>
</li>
</ul>
<div class="tab-content summaryList tabPadding">
<div class="row">
<div class="col-md-12">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
//-- We need to get all of the statuses and dump the information to the page.
$numOfStatusesRS = hesk_dbQuery('SELECT 1 FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'statuses`');
$numberOfStatuses = hesk_dbNumRows($numOfStatusesRS);
$statuses = mfh_getAllStatuses();
}
?>
<form class="form-horizontal" method="post" action="manage_statuses.php" role="form">
<div class="panel panel-default">
<div class="panel-heading">
<h4>
<?php echo $hesklang['statuses']; ?>
<span class="nu-floatRight panel-button">
<button type="button" class="btn btn-success" data-toggle="modal" data-target="#modal-status-new">
<i class="fa fa-plus-circle"></i>
<?php
echo $hesklang['new_status'];
?>
</button>
</span>
</h4>
</div>
<table class="table table-hover">
<thead>
<tr>
<th><?php echo $hesklang['name']; ?></th>
<th><?php echo $hesklang['closable_question']; ?></th>
<th><?php echo $hesklang['closedQuestionMark']; ?></th>
<th><?php echo $hesklang['actions']; ?></th>
</tr>
</thead>
<tbody>
<?php
$j = 1;
foreach ($statuses as $key => $row):
?>
<tr id="s<?php echo $row['ID']; ?>_row">
<td class="bold" style="color: <?php echo $row['TextColor']; ?>">
<?php echo $row['text']; ?>
</td>
<td>
<?php
if ($row['Closable'] == 'yes') {
echo $hesklang['yes_title_case'];
} elseif ($row['Closable'] == 'conly') {
echo $hesklang['customers_only'];
} elseif ($row['Closable'] == 'sonly') {
echo $hesklang['staff_only'];
} elseif ($row['Closable'] == 'no') {
echo $hesklang['no_title_case'];
}
?>
</td>
<td>
<?php
if ($row['IsClosed']) {
echo '<i class="fa fa-check-circle icon-link green"></i>';
}
<li role="presentation" class="active">
<a href="#"><?php echo $hesklang['statuses']; ?> <i class="fa fa-question-circle settingsquestionmark"
data-toggle="popover"
title="<?php echo $hesklang['statuses']; ?>"
data-content="<?php echo $hesklang['statuses_intro']; ?>"></i></a>
</li>
</ul>
<div class="tab-content summaryList tabPadding">
<div class="row">
<div class="col-md-12">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
//-- We need to get all of the statuses and dump the information to the page.
$numOfStatusesRS = hesk_dbQuery('SELECT 1 FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'statuses`');
$numberOfStatuses = hesk_dbNumRows($numOfStatusesRS);
$statuses = mfh_getAllStatuses();
?>
<form class="form-horizontal" method="post" action="manage_statuses.php" role="form">
<div class="panel panel-default">
<div class="panel-heading">
<h4>
<?php echo $hesklang['statuses']; ?>
<span style="float: right; margin-top: -7px">
<button type="button" class="btn btn-success" data-toggle="modal" data-target="#modal-status-new">
<i class="fa fa-plus-circle"></i>
<?php
echo $hesklang['new_status'];
?>
</button>
</span>
</h4>
</div>
<table class="table table-hover">
<thead>
<tr>
<th><?php echo $hesklang['name']; ?></th>
<th><?php echo $hesklang['closable_question']; ?></th>
<th><?php echo $hesklang['closedQuestionMark']; ?></th>
<th><?php echo $hesklang['actions']; ?></th>
</tr>
</thead>
<tbody>
<?php
$j = 1;
foreach ($statuses as $key => $row):
?>
</td>
<td>
<tr id="s<?php echo $row['ID']; ?>_row">
<td class="bold" style="color: <?php echo $row['TextColor']; ?>">
<?php echo $row['text']; ?>
</td>
<td>
<?php
if ($row['Closable'] == 'yes') {
echo $hesklang['yes_title_case'];
} elseif ($row['Closable'] == 'conly') {
echo $hesklang['customers_only'];
} elseif ($row['Closable'] == 'sonly') {
echo $hesklang['staff_only'];
} elseif ($row['Closable'] == 'no') {
echo $hesklang['no_title_case'];
}
?>
</td>
<td>
<?php
if ($row['IsClosed']) {
echo '<i class="fa fa-check-circle icon-link green"></i>';
}
?>
</td>
<td>
<span data-toggle="modal" data-target="#modal-status-<?php echo $row['ID']; ?>"
style="cursor: pointer;">
<i class="fa fa-pencil icon-link orange"
data-toggle="tooltip" title="<?php echo $hesklang['edit']; ?>"></i>
</span>
<?php echoArrows($j, $numberOfStatuses, $row['ID'], $modsForHesk_settings); ?>
<?php
// Only show the delete button if (1) it's not a default action and (2) no tickets are set to that status
$delete = canStatusBeDeleted($row['ID']);
$cursor = 'cursor: pointer';
$iconStyle = 'color: red';
$dataTarget = 'data-target="#modal-status-delete-' . $row['ID'] . '"';
$tooltip = $hesklang['delete'];
if ($delete == 'no-default' || $delete == 'no-tickets') {
$cursor = '';
$dataTarget = '';
$iconStyle = 'color: grey';
}
if ($delete == 'no-default') {
$tooltip = $hesklang['whyCantIDeleteThisStatusReason'];
} elseif ($delete == 'no-tickets') {
$tooltip = $hesklang['cannot_delete_status_tickets'];
}
?>
<span data-toggle="modal" <?php echo $dataTarget; ?>
style="<?php echo $cursor; ?>;">
<?php echoArrows($j, $numberOfStatuses, $row['ID'], $modsForHesk_settings); ?>
<?php
// Only show the delete button if (1) it's not a default action and (2) no tickets are set to that status
$delete = canStatusBeDeleted($row['ID']);
$cursor = 'cursor: pointer';
$iconStyle = 'color: red';
$dataTarget = 'data-target="#modal-status-delete-' . $row['ID'] . '"';
$tooltip = $hesklang['delete'];
if ($delete == 'no-default' || $delete == 'no-tickets') {
$cursor = '';
$dataTarget = '';
$iconStyle = 'color: grey';
}
if ($delete == 'no-default') {
$tooltip = $hesklang['whyCantIDeleteThisStatusReason'];
} elseif ($delete == 'no-tickets') {
$tooltip = $hesklang['cannot_delete_status_tickets'];
}
?>
<span data-toggle="modal" <?php echo $dataTarget; ?>
style="<?php echo $cursor; ?>;">
<i class="fa fa-times icon-link" style="<?php echo $iconStyle; ?>"
data-toggle="tooltip" title="<?php echo $tooltip; ?>"></i>
</span>
</td>
</tr>
<?php
$j++;
endforeach; ?>
</tbody>
</table>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4><?php echo $hesklang['defaultStatusForAction']; ?></h4>
</div>
<div class="panel-body">
<div class="form-group">
<label for="newTicket"
class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['isNewTicketMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="newTicket" class="form-control" id="newTicket">
<?php
foreach ($statuses as $key => $row) {
if ($row['IsClosed'] == 1) {
continue;
}
$selectedEcho = ($row['IsNewTicketStatus'] == 1) ? 'selected="selected"' : '';
echo '<option value="' . $row['ID'] . '" ' . $selectedEcho . '>' . mfh_getDisplayTextForStatusId($row['ID']) . '</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="closedByClient"
class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['isClosedByClientMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="closedByClient" class="form-control" id="closedByClient">
<?php
foreach ($statuses as $key => $row) {
if ($row['IsClosed'] == 0) {
continue;
}
$selectedEcho = ($row['IsClosedByClient'] == 1) ? 'selected="selected"' : '';
echo '<option value="' . $row['ID'] . '" ' . $selectedEcho . '>' . mfh_getDisplayTextForStatusId($row['ID']) . '</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="replyFromClient"
class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['isRepliedByClientMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="replyFromClient" class="form-control" id="replyFromClient">
<?php
foreach ($statuses as $key => $row) {
if ($row['IsClosed'] == 1) {
continue;
}
$selectedEcho = ($row['IsCustomerReplyStatus'] == 1) ? 'selected="selected"' : '';
echo '<option value="' . $row['ID'] . '" ' . $selectedEcho . '>' . mfh_getDisplayTextForStatusId($row['ID']) . '</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="staffClosedOption"
class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['isStaffClosedOptionMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="staffClosedOption" class="form-control" id="staffClosedOption">
</td>
</tr>
<?php
foreach ($statuses as $key => $row) {
if ($row['IsClosed'] == 0) {
continue;
}
$selectedEcho = ($row['IsStaffClosedOption'] == 1) ? 'selected="selected"' : '';
echo '<option value="' . $row['ID'] . '" ' . $selectedEcho . '>' . mfh_getDisplayTextForStatusId($row['ID']) . '</option>';
}
?>
</select>
</div>
$j++;
endforeach; ?>
</tbody>
</table>
</div>
<div class="form-group">
<label for="staffReopenedStatus"
class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['isStaffReopenedStatusMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="staffReopenedStatus" class="form-control"
id="staffReopenedStatus">
<?php
foreach ($statuses as $key => $row) {
if ($row['IsClosed'] == 1) {
continue;
}
$selectedEcho = ($row['IsStaffReopenedStatus'] == 1) ? 'selected="selected"' : '';
echo '<option value="' . $row['ID'] . '" ' . $selectedEcho . '>' . mfh_getDisplayTextForStatusId($row['ID']) . '</option>';
}
?>
</select>
<div class="panel panel-default">
<div class="panel-heading">
<h4><?php echo $hesklang['defaultStatusForAction']; ?></h4>
</div>
</div>
<div class="form-group">
<label for="defaultStaffReplyStatus"
class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['isDefaultStaffReplyStatusMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="defaultStaffReplyStatus" class="form-control"
id="defaultStaffReplyStatus">
<?php
foreach ($statuses as $key => $row) {
if ($row['IsClosed'] == 1) {
continue;
}
$selectedEcho = ($row['IsDefaultStaffReplyStatus'] == 1) ? 'selected="selected"' : '';
echo '<option value="' . $row['ID'] . '" ' . $selectedEcho . '>' . mfh_getDisplayTextForStatusId($row['ID']) . '</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="lockedTicketStatus"
class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['lockedTicketStatusMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="lockedTicketStatus" class="form-control" id="lockedTicketStatus">
<?php
foreach ($statuses as $key => $row) {
$selectedEcho = ($row['LockedTicketStatus'] == 1) ? 'selected="selected"' : '';
echo '<option value="' . $row['ID'] . '" ' . $selectedEcho . '>' . mfh_getDisplayTextForStatusId($row['ID']) . '</option>';
}
?>
</select>
<div class="panel-body">
<div class="form-group">
<label for="newTicket"
class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['isNewTicketMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="newTicket" class="form-control" id="newTicket">
<?php
foreach ($statuses as $key => $row) {
if ($row['IsClosed'] == 1) {
continue;
}
$selectedEcho = ($row['IsNewTicketStatus'] == 1) ? 'selected="selected"' : '';
echo '<option value="' . $row['ID'] . '" ' . $selectedEcho . '>' . mfh_getDisplayTextForStatusId($row['ID']) . '</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="closedByClient"
class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['isClosedByClientMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="closedByClient" class="form-control" id="closedByClient">
<?php
foreach ($statuses as $key => $row) {
if ($row['IsClosed'] == 0) {
continue;
}
$selectedEcho = ($row['IsClosedByClient'] == 1) ? 'selected="selected"' : '';
echo '<option value="' . $row['ID'] . '" ' . $selectedEcho . '>' . mfh_getDisplayTextForStatusId($row['ID']) . '</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="replyFromClient"
class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['isRepliedByClientMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="replyFromClient" class="form-control" id="replyFromClient">
<?php
foreach ($statuses as $key => $row) {
if ($row['IsClosed'] == 1) {
continue;
}
$selectedEcho = ($row['IsCustomerReplyStatus'] == 1) ? 'selected="selected"' : '';
echo '<option value="' . $row['ID'] . '" ' . $selectedEcho . '>' . mfh_getDisplayTextForStatusId($row['ID']) . '</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="staffClosedOption"
class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['isStaffClosedOptionMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="staffClosedOption" class="form-control" id="staffClosedOption">
<?php
foreach ($statuses as $key => $row) {
if ($row['IsClosed'] == 0) {
continue;
}
$selectedEcho = ($row['IsStaffClosedOption'] == 1) ? 'selected="selected"' : '';
echo '<option value="' . $row['ID'] . '" ' . $selectedEcho . '>' . mfh_getDisplayTextForStatusId($row['ID']) . '</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="staffReopenedStatus"
class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['isStaffReopenedStatusMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="staffReopenedStatus" class="form-control"
id="staffReopenedStatus">
<?php
foreach ($statuses as $key => $row) {
if ($row['IsClosed'] == 1) {
continue;
}
$selectedEcho = ($row['IsStaffReopenedStatus'] == 1) ? 'selected="selected"' : '';
echo '<option value="' . $row['ID'] . '" ' . $selectedEcho . '>' . mfh_getDisplayTextForStatusId($row['ID']) . '</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="defaultStaffReplyStatus"
class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['isDefaultStaffReplyStatusMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="defaultStaffReplyStatus" class="form-control"
id="defaultStaffReplyStatus">
<?php
foreach ($statuses as $key => $row) {
if ($row['IsClosed'] == 1) {
continue;
}
$selectedEcho = ($row['IsDefaultStaffReplyStatus'] == 1) ? 'selected="selected"' : '';
echo '<option value="' . $row['ID'] . '" ' . $selectedEcho . '>' . mfh_getDisplayTextForStatusId($row['ID']) . '</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="lockedTicketStatus"
class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['lockedTicketStatusMsg']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="lockedTicketStatus" class="form-control" id="lockedTicketStatus">
<?php
foreach ($statuses as $key => $row) {
$selectedEcho = ($row['LockedTicketStatus'] == 1) ? 'selected="selected"' : '';
echo '<option value="' . $row['ID'] . '" ' . $selectedEcho . '>' . mfh_getDisplayTextForStatusId($row['ID']) . '</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="autocloseTicketOption"
class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['autoclose_ticket_status']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="autocloseTicketOption" class="form-control"
id="autocloseTicketOption">
<?php
foreach ($statuses as $key => $row) {
if ($row['IsClosed'] == 0) {
continue;
}
$selectedEcho = ($row['IsAutocloseOption'] == 1) ? 'selected' : '';
echo '<option value="' . $row['ID'] . '" ' . $selectedEcho . '>' . mfh_getDisplayTextForStatusId($row['ID']) . '</option>';
}
?>
</select>
</div>
</div>
</div>
</div>
<div class="form-group">
<label for="autocloseTicketOption"
class="col-sm-6 col-xs-12 control-label"><?php echo $hesklang['autoclose_ticket_status']; ?></label>
<div class="col-sm-6 col-xs-12">
<select name="autocloseTicketOption" class="form-control"
id="autocloseTicketOption">
<?php
foreach ($statuses as $key => $row) {
if ($row['IsClosed'] == 0) {
continue;
}
$selectedEcho = ($row['IsAutocloseOption'] == 1) ? 'selected' : '';
echo '<option value="' . $row['ID'] . '" ' . $selectedEcho . '>' . mfh_getDisplayTextForStatusId($row['ID']) . '</option>';
}
?>
</select>
</div>
<div class="col-sm-6 col-sm-offset-6">
<input type="hidden" name="a" value="save">
<input type="submit" class="btn btn-default"
value="<?php echo $hesklang['save_changes']; ?>">
</div>
</div>
</div>
<div class="col-sm-6 col-sm-offset-6">
<input type="hidden" name="a" value="save">
<input type="submit" class="btn btn-default"
value="<?php echo $hesklang['save_changes']; ?>">
</form>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</section>
<?php
foreach ($statuses as $status) {

@ -37,6 +37,7 @@ define('PAGE_TITLE', 'ADMIN_CANNED');
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -78,10 +79,6 @@ require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
<div class="row">
</div>
<script language="javascript" type="text/javascript"><!--
function confirm_delete() {
if (confirm('<?php echo hesk_makeJsString($hesklang['delete_tpl']); ?>')) {
@ -105,141 +102,159 @@ $i = 1;
$j = 0;
$num = hesk_dbNumRows($result);
?>
<div class="row move-down-20">
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<section class="content">
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['saved_ticket_tpl']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
<div class="panel-body">
<?php if ($num < 1) {
echo '<p>' . $hesklang['no_ticket_tpl'] . '</p>';
} else {
?>
<table class="table table-hover">
<thead>
<tr>
<th><?php echo $hesklang['ticket_tpl_title']; ?></th>
<th><?php echo $hesklang['opt']; ?></th>
</tr>
</thead>
<tbody>
<?php
while ($mysaved = hesk_dbFetchAssoc($result)) {
$j++;
$color = '';
if (isset($_SESSION['canned']['selcat2']) && $mysaved['id'] == $_SESSION['canned']['selcat2']) {
$color = 'success';
unset($_SESSION['canned']['selcat2']);
}
$options .= '<option class="form-control" value="' . $mysaved['id'] . '"';
$options .= (isset($_SESSION['canned']['id']) && $_SESSION['canned']['id'] == $mysaved['id']) ? ' selected="selected" ' : '';
$options .= '>' . $mysaved['title'] . '</option>';
if ($modsForHesk_settings['rich_text_for_tickets']) {
$theMessage = html_entity_decode($mysaved['message']);
$theMessage = addslashes($theMessage);
$javascript_messages .= 'myMsgTxt[' . $mysaved['id'] . ']=\'' . str_replace("\r\n", "\\r\\n' + \r\n'", $theMessage) . "';\n";
} else {
$javascript_messages .= 'myMsgTxt[' . $mysaved['id'] . ']=\'' . str_replace("\r\n", "\\r\\n' + \r\n'", addslashes($mysaved['message'])) . "';\n";
}
$javascript_titles .= 'myTitle[' . $mysaved['id'] . ']=\'' . addslashes($mysaved['title']) . "';\n";
</div>
<div class="box-body">
<?php if ($num < 1) {
echo '<p>' . $hesklang['no_ticket_tpl'] . '</p>';
} else {
?>
<table class="table table-hover">
<thead>
<tr>
<th><?php echo $hesklang['ticket_tpl_title']; ?></th>
<th><?php echo $hesklang['opt']; ?></th>
</tr>
</thead>
<tbody>
<?php
echo '
while ($mysaved = hesk_dbFetchAssoc($result)) {
$j++;
$color = '';
if (isset($_SESSION['canned']['selcat2']) && $mysaved['id'] == $_SESSION['canned']['selcat2']) {
$color = 'success';
unset($_SESSION['canned']['selcat2']);
}
$options .= '<option class="form-control" value="' . $mysaved['id'] . '"';
$options .= (isset($_SESSION['canned']['id']) && $_SESSION['canned']['id'] == $mysaved['id']) ? ' selected="selected" ' : '';
$options .= '>' . $mysaved['title'] . '</option>';
if ($modsForHesk_settings['rich_text_for_tickets']) {
$theMessage = html_entity_decode($mysaved['message']);
$theMessage = addslashes($theMessage);
$javascript_messages .= 'myMsgTxt[' . $mysaved['id'] . ']=\'' . str_replace("\r\n", "\\r\\n' + \r\n'", $theMessage) . "';\n";
} else {
$javascript_messages .= 'myMsgTxt[' . $mysaved['id'] . ']=\'' . str_replace("\r\n", "\\r\\n' + \r\n'", addslashes($mysaved['message'])) . "';\n";
}
$javascript_titles .= 'myTitle[' . $mysaved['id'] . ']=\'' . addslashes($mysaved['title']) . "';\n";
echo '
<tr>
<td>' . $mysaved['title'] . '</td>
<td class="text-left">
';
if ($num > 1) {
if ($j == 1) {
echo '<img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" />
if ($num > 1) {
if ($j == 1) {
echo '<img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" />
<a href="manage_ticket_templates.php?a=order&amp;replyid=' . $mysaved['id'] . '&amp;move=15&amp;token=' . hesk_token_echo(0) . '">
<i class="fa fa-arrow-down icon-link green" data-toggle="tooltip" data-placement="top" data-original-title="' . $hesklang['move_dn'] . '"></i></a>';
} elseif ($j == $num) {
echo '<a href="manage_ticket_templates.php?a=order&amp;replyid=' . $mysaved['id'] . '&amp;move=-15&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-up icon-link green" data-toggle="tooltip" data-placement="top" data-original-title="' . $hesklang['move_up'] . '"></i></a> <img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" />';
} else {
echo '
} elseif ($j == $num) {
echo '<a href="manage_ticket_templates.php?a=order&amp;replyid=' . $mysaved['id'] . '&amp;move=-15&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-up icon-link green" data-toggle="tooltip" data-placement="top" data-original-title="' . $hesklang['move_up'] . '"></i></a> <img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" />';
} else {
echo '
<a href="manage_ticket_templates.php?a=order&amp;replyid=' . $mysaved['id'] . '&amp;move=-15&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-up icon-link green" data-toggle="tooltip" data-placement="top" data-original-title="' . $hesklang['move_up'] . '"></i></a>
<a href="manage_ticket_templates.php?a=order&amp;replyid=' . $mysaved['id'] . '&amp;move=15&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-down icon-link green" data-toggle="tooltip" data-placement="top" data-original-title="' . $hesklang['move_dn'] . '"></i></a>
';
}
} else {
echo '';
}
} else {
echo '';
}
echo '
echo '
<a href="manage_ticket_templates.php?a=remove&amp;id=' . $mysaved['id'] . '&amp;token=' . hesk_token_echo(0) . '" onclick="return confirm_delete();"><i class="fa fa-times icon-link red" data-toggle="tooltip" data-placement="top" data-original-title="' . $hesklang['delete'] . '"></i></a></td>
</tr>
';
} // End while
} // End while
?>
</tbody>
</table>
<?php
}
?>
</div>
?>
</tbody>
</table>
<?php
}
?>
</div>
</div>
<div class="col-md-8">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
$onsubmit = '';
if ($modsForHesk_settings['rich_text_for_tickets']) {
$onsubmit = 'onsubmit="return validateRichText(\'message-help-block\', \'message-group\', \'message\', \''.htmlspecialchars($hesklang['this_field_is_required']).'\')"';
}
?>
<form class="form-horizontal" action="manage_ticket_templates.php" method="post" name="form1" role="form" data-toggle="validator" <?php echo $onsubmit; ?>>
<h3><?php echo $hesklang['new_ticket_tpl']; ?> <a href="javascript:void(0)"
onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['ticket_tpl_intro']); ?>')"><i
class="fa fa-question-circle settingsquestionmark"></i></a></h3>
<div class="footerWithBorder blankSpace"></div>
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['new_ticket_tpl']; ?>
<a href="javascript:void(0)"
onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['ticket_tpl_intro']); ?>')"><i
class="fa fa-question-circle settingsquestionmark"></i></a>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<?php
if ($num > 0) {
?>
<div class="form-group">
<div class="col-sm-12">
<div class="radio">
<label>
<input type="radio" name="a"
value="new" <?php echo (!isset($_SESSION['canned']['what']) || $_SESSION['canned']['what'] != 'EDIT') ? 'checked=' : ''; ?>>
<?php echo $hesklang['ticket_tpl_add']; ?>
</label>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="radio">
<label>
<input type="radio" name="a"
value="edit" <?php echo (isset($_SESSION['canned']['what']) && $_SESSION['canned']['what'] == 'EDIT') ? 'checked' : ''; ?>>
<?php echo $hesklang['ticket_tpl_edit']; ?>
</label>
/* This will handle error, success and notice messages */
hesk_handle_messages();
$onsubmit = '';
if ($modsForHesk_settings['rich_text_for_tickets']) {
$onsubmit = 'onsubmit="return validateRichText(\'message-help-block\', \'message-group\', \'message\', \''.htmlspecialchars($hesklang['this_field_is_required']).'\')"';
}
?>
<form class="form-horizontal" action="manage_ticket_templates.php" method="post" name="form1" role="form" data-toggle="validator" <?php echo $onsubmit; ?>>
<?php
if ($num > 0) {
?>
<div class="form-group">
<div class="col-sm-12">
<div class="row">
<div class="col-sm-12">
<div class="radio">
<label>
<input type="radio" name="a"
value="new" <?php echo (!isset($_SESSION['canned']['what']) || $_SESSION['canned']['what'] != 'EDIT') ? 'checked=' : ''; ?>>
<?php echo $hesklang['ticket_tpl_add']; ?>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="radio">
<label>
<input type="radio" name="a"
value="edit" <?php echo (isset($_SESSION['canned']['what']) && $_SESSION['canned']['what'] == 'EDIT') ? 'checked' : ''; ?>>
<?php echo $hesklang['ticket_tpl_edit']; ?>
</label>
</div>
</div>
<div class="col-sm-6">
<select class="form-control" name="saved_replies" onchange="setMessage(this.value)">
<option value="0"> - <?php echo $hesklang['select_empty']; ?>-
</option><?php echo $options; ?></select>
</div>
</div>
</div>
<div class="col-sm-6">
<select class="form-control" name="saved_replies" onchange="setMessage(this.value)">
<option value="0"> - <?php echo $hesklang['select_empty']; ?>-
</option><?php echo $options; ?></select>
</div>
</div>
</div>
<?php
} else {
echo '<p><input type="hidden" name="a" value="new" /> ' . $hesklang['ticket_tpl_add'] . '</label></p>';
}
?>
<div class="form-group">
<label for="name" class="col-sm-2 control-label"><?php echo $hesklang['ticket_tpl_title']; ?></label>
<?php
} else {
echo '<p><input type="hidden" name="a" value="new" /> ' . $hesklang['ticket_tpl_add'] . '</label></p>';
}
?>
<div class="form-group">
<label for="name" class="col-sm-2 control-label"><?php echo $hesklang['ticket_tpl_title']; ?></label>
<div class="col-sm-10">
<div class="col-sm-10">
<span id="HeskTitle">
<input id="subject" class="form-control" type="text" name="name" size="40" maxlength="50"
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
@ -248,13 +263,13 @@ $num = hesk_dbNumRows($result);
echo ' value="' . stripslashes($_SESSION['canned']['name']) . '" ';
} ?> required>
</span>
<div class="help-block with-errors"></div>
<div class="help-block with-errors"></div>
</div>
</div>
</div>
<div class="form-group" id="message-group">
<label for="msg" class="col-sm-2 control-label"><?php echo $hesklang['message']; ?></label>
<div class="form-group" id="message-group">
<label for="msg" class="col-sm-2 control-label"><?php echo $hesklang['message']; ?></label>
<div class="col-sm-10">
<div class="col-sm-10">
<span id="HeskMsg">
<textarea id="message" class="form-control htmlEditor"
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
@ -269,18 +284,19 @@ $num = hesk_dbNumRows($result);
}
?></textarea>
</span>
<div class="help-block with-errors" id="message-help-block"></div>
<div class="help-block with-errors" id="message-help-block"></div>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-10 col-sm-offset-2">
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
<input type="submit" value="<?php echo $hesklang['save_ticket_tpl']; ?>" class="btn btn-default">
<div class="form-group">
<div class="col-sm-10 col-sm-offset-2">
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
<input type="submit" value="<?php echo $hesklang['save_ticket_tpl']; ?>" class="btn btn-default">
</div>
</div>
</div>
</form>
</form>
</div>
</div>
</div>
</section>
<?php if ($modsForHesk_settings['rich_text_for_tickets']): ?>
<script type="text/javascript">
/* <![CDATA[ */

@ -38,6 +38,7 @@ require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/profile_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -169,38 +170,60 @@ if ($action = hesk_REQUEST('a')) {
unset($_SESSION['edit_userdata']);
}
/* Print header */
require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
/* Print main manage users page */
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
<div class="row move-down-20">
<div class="col-md-10 col-md-offset-1">
<script language="Javascript" type="text/javascript"><!--
function confirm_delete() {
if (confirm('<?php echo addslashes($hesklang['sure_remove_user']); ?>')) {
return true;
}
else {
return false;
}
}
//-->
</script>
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
?>
<h3 style="padding-bottom:5px"><?php echo $hesklang['manage_users']; ?> <a href="javascript:void(0)"
onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['users_intro']); ?>')"><i
class="fa fa-question-circle settingsquestionmark"></i></a></h3>
<div class="footerWithBorder blankSpace"></div>
<section class="content">
<?php hesk_handle_messages(); ?>
<script language="Javascript" type="text/javascript"><!--
function confirm_delete() {
if (confirm('<?php echo addslashes($hesklang['sure_remove_user']); ?>')) {
return true;
}
else {
return false;
}
}
//-->
</script>
<div class="box collapsed-box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['add_user']; ?>
<a href="javascript:void(0)" onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['users_intro']); ?>')">
<i class="fa fa-question-circle settingsquestionmark"></i>
</a>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-plus"></i>
</button>
</div>
</div>
<div class="box-body">
<?php echo $hesklang['req_marked_with']; ?> <span class="red">*</span>
<form data-toggle="validator" name="form1" method="post" action="manage_users.php" class="form-horizontal" role="form">
<?php hesk_profile_tab('userdata', false, 'create_user'); ?>
</form>
</div>
</div>
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['manage_users']; ?>
<a href="javascript:void(0)" onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['users_intro']); ?>')">
<i class="fa fa-question-circle settingsquestionmark"></i>
</a>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<table class="table table-hover">
<tr>
<th><b><i><?php echo $hesklang['name']; ?></i></b></th>
@ -329,29 +352,15 @@ EOC;
} ?>
</div>
</div>
<div class="row">
<div class="col-md-10 col-md-offset-1">
<h3><?php echo $hesklang['add_user']; ?></h3>
<h6><?php echo $hesklang['req_marked_with']; ?> <font class="important">*</font></h6>
<div class="footerWithBorder blankSpace"></div>
<form data-toggle="validator" name="form1" method="post" action="manage_users.php" class="form-horizontal" role="form">
<?php hesk_profile_tab('userdata', false, 'create_user'); ?>
</form>
</div>
</div>
<script language="Javascript" type="text/javascript"><!--
hesk_checkPassword(document.form1.newpass.value);
//-->
</script>
</section>
<p>&nbsp;</p>
<?php
require_once(HESK_PATH . 'inc/footer.inc.php');
exit();
<?php
require_once(HESK_PATH . 'inc/footer.inc.php');
exit();
} // End else

File diff suppressed because it is too large Load Diff

@ -30,6 +30,7 @@
define('IN_SCRIPT', 1);
define('HESK_PATH', '../');
define('PAGE_TITLE', 'LOGIN');
/* Get all the required files and functions */
require(HESK_PATH . 'hesk_settings.inc.php');
@ -38,7 +39,6 @@ require(HESK_PATH . 'inc/common.inc.php');
// Connect to database and check for brute force attempts
hesk_load_database_functions();
hesk_dbConnect();
hesk_limitBfAttempts();
$modsForHesk_settings = mfh_getSettings();
@ -112,6 +112,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
}
}
}
hesk_limitBfAttempts();
// Get email
$email = hesk_validateEmail(hesk_POST('email'), 'ERR', 0) or $hesk_error_buffer['email'] = $hesklang['enter_valid_email'];
@ -236,32 +237,38 @@ if ($hesk_settings['recaptcha_use'] == 2) {
}
$hesk_settings['tmp_title'] = $hesk_settings['hesk_title'] . ' - ' . $hesklang['passr'];
require_once(HESK_PATH . 'inc/header.inc.php');
require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
?>
<ol class="breadcrumb">
<li><a href="<?php echo $hesk_settings['site_url']; ?>"><?php echo $hesk_settings['site_title']; ?></a></li>
<li><a href="index.php"><?php echo $hesklang['admin_login']; ?></a></li>
<li class="active"><?php echo $hesklang['passr']; ?></li>
</ol>
<div class="row">
<div class="col-md-10 col-md-offset-1">
<form action="password.php" method="post" name="form1" class="form-signin form-horizontal" role="form">
<div class="login-box">
<div class="login-logo">
<?php echo $hesk_settings['hesk_title']; ?>
</div>
<div class="login-box-body">
<h4 class="login-box-msg">
<?php echo $hesklang['passr']; ?>
</h4>
<form action="password.php" method="post" name="form1" class="form-horizontal" role="form">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
?>
<h2><span <?php echo $iconDisplay; ?>><span
class="mega-octicon octicon-sign-in"></span>&nbsp;</span><?php echo $hesklang['passr']; ?></h2>
<div class="footerWithBorder blankSpace"></div>
<div class="form-group <?php echo in_array('email', $_SESSION['a_iserror']) ? 'has-error' : ''; ?>">
<label for="email" class="col-sm-3 control-label"><?php echo $hesklang['email']; ?></label>
$has_error = '';
if (in_array('email', $_SESSION['a_iserror'])) {
$has_error = 'has-error';
}
$form_email = '';
if (isset($email)) {
$form_email = stripslashes(hesk_input($email));
}
?>
<div class="form-group <?php echo $has_error; ?>">
<label for="email" class="col-sm-3 control-label">
<?php echo $hesklang['email']; ?>
</label>
<div class="col-sm-9">
<input type="text" name="email" size="35" value="<?php if (isset($email)) {
echo stripslashes(hesk_input($email));
} ?>" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>">
<input type="text" name="email" size="35" value="<?php echo $form_email; ?>"
class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>">
</div>
</div>
<?php
@ -287,8 +294,8 @@ require_once(HESK_PATH . 'inc/header.inc.php');
play_again: "<?php echo hesk_slashJS($hesklang['play_again']); ?>",
cant_hear_this: "<?php echo hesk_slashJS($hesklang['cant_hear_this']); ?>",
incorrect_try_again: "<?php echo hesk_slashJS($hesklang['incorrect_try_again']); ?>",
image_alt_text: "<?php echo hesk_slashJS($hesklang['image_alt_text']); ?>",
},
image_alt_text: "<?php echo hesk_slashJS($hesklang['image_alt_text']); ?>"
}
};
</script>
<?php
@ -318,19 +325,15 @@ require_once(HESK_PATH . 'inc/header.inc.php');
}
?>
<div class="form-group">
<div class="col-sm-10 col-sm-offset-1">
<div class="col-sm-9 col-sm-offset-3">
<input type="submit" value="<?php echo $hesklang['passs']; ?>" class="btn btn-default">
</div>
</div>
</form>
</div>
</div>
<?php
// Clean session errors
hesk_cleanSessionVars('a_iserror');
hesk_cleanSessionVars('img_a_verified');
// Print footer
require_once(HESK_PATH . 'inc/footer.inc.php');
?>

@ -37,6 +37,7 @@ require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/profile_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -84,75 +85,80 @@ require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
/* Print admin navigation */
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
<section class="content">
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['profile_for']; ?> <b><?php echo $_SESSION['new']['user']; ?></b>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<?php echo $hesklang['req_marked_with']; ?> <span class="important">*</span>
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
<div class="row">
<div class="col-md-8 col-md-offset-2 pad-down-20">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
if (defined('WARN_PASSWORD')) {
hesk_show_notice($hesklang['chdp2'], $hesklang['security']);
}
?>
<h3><?php echo $hesklang['profile_for'] . ' <b>' . $_SESSION['new']['user']; ?></b></h3>
<h6><?php echo $hesklang['req_marked_with']; ?> <span class="important">*</span></h6>
<div class="footerWithBorder blankSpace"></div>
if (defined('WARN_PASSWORD')) {
hesk_show_notice($hesklang['chdp2'], $hesklang['security']);
}
<?php
if ($hesk_settings['can_sel_lang']) {
/* Update preferred language in the database? */
if (isset($_GET['save_language'])) {
$newlang = hesk_input(hesk_GET('language'));
if ($hesk_settings['can_sel_lang']) {
/* Update preferred language in the database? */
if (isset($_GET['save_language'])) {
$newlang = hesk_input(hesk_GET('language'));
/* Only update if it's a valid language */
if (isset($hesk_settings['languages'][$newlang])) {
$newlang = ($newlang == HESK_DEFAULT_LANGUAGE) ? "NULL" : "'" . hesk_dbEscape($newlang) . "'";
hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` SET `language`=$newlang WHERE `id`='" . intval($_SESSION['id']) . "' LIMIT 1");
/* Only update if it's a valid language */
if (isset($hesk_settings['languages'][$newlang])) {
$newlang = ($newlang == HESK_DEFAULT_LANGUAGE) ? "NULL" : "'" . hesk_dbEscape($newlang) . "'";
hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` SET `language`=$newlang WHERE `id`='" . intval($_SESSION['id']) . "' LIMIT 1");
}
}
}
$str = '<form class="form-horizontal" role="form" method="get" action="profile.php">';
$str .= '<input type="hidden" name="save_language" value="1" />';
$str .= '<div class="form-group">';
$str .= '<label for="language" class="col-sm-3 control-label">' . $hesklang['chol'] . ':</label>';
$str = '<form class="form-horizontal" role="form" method="get" action="profile.php">';
$str .= '<input type="hidden" name="save_language" value="1" />';
$str .= '<div class="form-group">';
$str .= '<label for="language" class="col-sm-3 control-label">' . $hesklang['chol'] . ':</label>';
if (!isset($_GET)) {
$_GET = array();
}
if (!isset($_GET)) {
$_GET = array();
}
foreach ($_GET as $k => $v) {
if ($k == 'language' || $k == 'save_language') {
continue;
foreach ($_GET as $k => $v) {
if ($k == 'language' || $k == 'save_language') {
continue;
}
$str .= '<input type="hidden" name="' . htmlentitieshesk_htmlentities($k) . '" value="' . hesk_htmlentities($v) . '" />';
}
$str .= '<input type="hidden" name="' . htmlentitieshesk_htmlentities($k) . '" value="' . hesk_htmlentities($v) . '" />';
}
$str .= '<div class="col-sm-9"><select class="form-control" name="language" onchange="this.form.submit()">';
$str .= hesk_listLanguages(0);
$str .= '</select></div>';
$str .= '</div>'
$str .= '<div class="col-sm-9"><select class="form-control" name="language" onchange="this.form.submit()">';
$str .= hesk_listLanguages(0);
$str .= '</select></div>';
$str .= '</div>'
?>
<script language="javascript" type="text/javascript">
document.write('<?php echo str_replace(array('"','<','=','>',"'"),array('\42','\74','\75','\76','\47'),$str . '</form>'); ?>');
</script>
<noscript>
<?php
echo $str . '<input type="submit" value="' . $hesklang['go'] . '" /></form>';
?>
</noscript>
<?php
}
?>
<script language="javascript" type="text/javascript">
document.write('<?php echo str_replace(array('"','<','=','>',"'"),array('\42','\74','\75','\76','\47'),$str . '</form>'); ?>');
</script>
<noscript>
<?php
echo $str . '<input type="submit" value="' . $hesklang['go'] . '" /></form>';
?>
</noscript>
<?php
}
?>
<form role="form" class="form-horizontal" method="post" action="profile.php" name="form1" data-toggle="validator">
<?php hesk_profile_tab('new'); ?>
</form>
<form role="form" class="form-horizontal" method="post" action="profile.php" name="form1" data-toggle="validator">
<?php hesk_profile_tab('new'); ?>
</form>
</div>
</div>
</div>
</section>
<?php
require_once(HESK_PATH . 'inc/footer.inc.php');

@ -37,6 +37,7 @@ require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/reporting_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -214,127 +215,137 @@ require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
/* Print main manage users page */
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
<div class="row move-down-20">
<div align="left" class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<?php echo $hesklang['reports_tab']; ?> <a href="#"
onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['reports_intro']); ?>')"><i
class="fa fa-question-circle settingsquestionmark"></i></a>
<section class="content">
<div class="box">
<?php if (hesk_checkPermission('can_export', 0)) {
$canExport = true;
$panelMargin = '-15px';
} else {
$canExport = false;
}
?>
<div class="box-header">
<h1 class="box-title">
<?php echo $hesklang['reports_tab']; ?> <a href="#"
onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['reports_intro']); ?>')"><i
class="fa fa-question-circle settingsquestionmark"></i></a>
</h1>
<?php
// Show a link to export.php if user has permission to do so
if ($canExport) {
echo '<br><small><a title="' . $hesklang['export'] . '" href="export.php">' . $hesklang['export'] . '</a></small><div class="blankSpace"></div>';
}
?>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<form action="reports.php" method="get" name="form1" role="form">
<div class="form-group">
<label for="dtrg" class="control-label"><?php echo $hesklang['dtrg']; ?>:</label>
<div class="radio move-right-20">
<input type="radio" name="w" value="0" id="w0" <?php echo $selected['w'][0]; ?> />
<select name="time" onclick="document.getElementById('w0').checked = true"
onfocus="document.getElementById('w0').checked = true"
style="margin-top:5px;margin-bottom:5px;">
<option value="1" <?php echo $selected['time'][1]; ?>><?php echo $hesklang['r1']; ?>
(<?php echo $hesklang['d' . date('w')]; ?>)
</option>
<option value="2" <?php echo $selected['time'][2]; ?>><?php echo $hesklang['r2']; ?>
(<?php echo $hesklang['d' . date('w', mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')))]; ?>
)
</option>
<option value="3" <?php echo $selected['time'][3]; ?>><?php echo $hesklang['r3']; ?>
(<?php echo $hesklang['m' . date('n')]; ?>)
</option>
<option value="4" <?php echo $selected['time'][4]; ?>><?php echo $hesklang['r4']; ?>
(<?php echo $hesklang['m' . date('n', mktime(0, 0, 0, date('m') - 1, date('d'), date('Y')))]; ?>
)
</option>
<option
value="5" <?php echo $selected['time'][5]; ?>><?php echo $hesklang['r5']; ?></option>
<option
value="6" <?php echo $selected['time'][6]; ?>><?php echo $hesklang['r6']; ?></option>
<option
value="7" <?php echo $selected['time'][7]; ?>><?php echo $hesklang['r7']; ?></option>
<option
value="8" <?php echo $selected['time'][8]; ?>><?php echo $hesklang['r8']; ?></option>
<option
value="9" <?php echo $selected['time'][9]; ?>><?php echo $hesklang['r9']; ?></option>
<option
value="10" <?php echo $selected['time'][10]; ?>><?php echo $hesklang['r10']; ?>
(<?php echo date('Y'); ?>)
</option>
<option
value="11" <?php echo $selected['time'][11]; ?>><?php echo $hesklang['r11']; ?>
(<?php echo date('Y', mktime(0, 0, 0, date('m'), date('d'), date('Y') - 1)); ?>)
</option>
<option
value="12" <?php echo $selected['time'][12]; ?>><?php echo $hesklang['r12']; ?></option>
</select>
</div>
<div class="radio move-right-20">
<input type="radio" name="w" value="1" id="w1" <?php echo $selected['w'][1]; ?> />
<?php echo $hesklang['from']; ?> <input type="text" name="datefrom"
value="<?php echo $input_datefrom; ?>"
id="datefrom" class="tcal" size="10"
onclick="document.getElementById('w1').checked = true"
onfocus="document.getElementById('w1').checked = true;this.focus;"/>
<?php echo $hesklang['to']; ?> <input type="text" name="dateto"
value="<?php echo $input_dateto; ?>" id="dateto"
class="tcal" size="10"
onclick="document.getElementById('w1').checked = true"
onfocus="document.getElementById('w1').checked = true; this.focus;"/>
</div>
</div>
<div class="form-group">
<label for="type" class="control-label"><?php echo $hesklang['crt']; ?></b>:</label>
<select name="type" class="form-control">
<option
value="1" <?php echo $selected['type'][1]; ?>><?php echo $hesklang['t1']; ?></option>
<option
value="2" <?php echo $selected['type'][2]; ?>><?php echo $hesklang['t2']; ?></option>
<option
value="3" <?php echo $selected['type'][3]; ?>><?php echo $hesklang['t3']; ?></option>
<option
value="4" <?php echo $selected['type'][4]; ?>><?php echo $hesklang['t4']; ?></option>
</select>
</div>
<div class="form-group">
<input type="submit" value="<?php echo $hesklang['dire']; ?>" class="btn btn-default"/>
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
</div>
<?php if (hesk_checkPermission('can_export', 0)) {
$canExport = true;
$panelMargin = '-15px';
</form>
</div>
</div>
<div class="box">
<div class="box-header">
<h1 class="box-title">
<?php
if ($date_from == $date_to) {
echo hesk_dateToString($date_from, 0);
} else {
$canExport = false;
echo hesk_dateToString($date_from, 0) . ' - ' . hesk_dateToString($date_to, 0);
}
?>
<div class="panel-body" <?php if ($canExport) echo 'style="margin-top: -15px";'; ?>>
<?php
// Show a link to export.php if user has permission to do so
if ($canExport) {
echo '<small><a title="' . $hesklang['export'] . '" href="export.php">' . $hesklang['export'] . '</a></small><div class="blankSpace"></div>';
}
?>
<form action="reports.php" method="get" name="form1" role="form">
<div class="form-group">
<label for="dtrg" class="control-label"><?php echo $hesklang['dtrg']; ?></b>:</label>
<div class="radio move-right-20">
<input type="radio" name="w" value="0" id="w0" <?php echo $selected['w'][0]; ?> />
<select name="time" onclick="document.getElementById('w0').checked = true"
onfocus="document.getElementById('w0').checked = true"
style="margin-top:5px;margin-bottom:5px;">
<option value="1" <?php echo $selected['time'][1]; ?>><?php echo $hesklang['r1']; ?>
(<?php echo $hesklang['d' . date('w')]; ?>)
</option>
<option value="2" <?php echo $selected['time'][2]; ?>><?php echo $hesklang['r2']; ?>
(<?php echo $hesklang['d' . date('w', mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')))]; ?>
)
</option>
<option value="3" <?php echo $selected['time'][3]; ?>><?php echo $hesklang['r3']; ?>
(<?php echo $hesklang['m' . date('n')]; ?>)
</option>
<option value="4" <?php echo $selected['time'][4]; ?>><?php echo $hesklang['r4']; ?>
(<?php echo $hesklang['m' . date('n', mktime(0, 0, 0, date('m') - 1, date('d'), date('Y')))]; ?>
)
</option>
<option
value="5" <?php echo $selected['time'][5]; ?>><?php echo $hesklang['r5']; ?></option>
<option
value="6" <?php echo $selected['time'][6]; ?>><?php echo $hesklang['r6']; ?></option>
<option
value="7" <?php echo $selected['time'][7]; ?>><?php echo $hesklang['r7']; ?></option>
<option
value="8" <?php echo $selected['time'][8]; ?>><?php echo $hesklang['r8']; ?></option>
<option
value="9" <?php echo $selected['time'][9]; ?>><?php echo $hesklang['r9']; ?></option>
<option
value="10" <?php echo $selected['time'][10]; ?>><?php echo $hesklang['r10']; ?>
(<?php echo date('Y'); ?>)
</option>
<option
value="11" <?php echo $selected['time'][11]; ?>><?php echo $hesklang['r11']; ?>
(<?php echo date('Y', mktime(0, 0, 0, date('m'), date('d'), date('Y') - 1)); ?>)
</option>
<option
value="12" <?php echo $selected['time'][12]; ?>><?php echo $hesklang['r12']; ?></option>
</select>
</div>
<div class="radio move-right-20">
<input type="radio" name="w" value="1" id="w1" <?php echo $selected['w'][1]; ?> />
<?php echo $hesklang['from']; ?> <input type="text" name="datefrom"
value="<?php echo $input_datefrom; ?>"
id="datefrom" class="tcal" size="10"
onclick="document.getElementById('w1').checked = true"
onfocus="document.getElementById('w1').checked = true;this.focus;"/>
<?php echo $hesklang['to']; ?> <input type="text" name="dateto"
value="<?php echo $input_dateto; ?>" id="dateto"
class="tcal" size="10"
onclick="document.getElementById('w1').checked = true"
onfocus="document.getElementById('w1').checked = true; this.focus;"/>
</div>
</div>
<div class="form-group">
<label for="type" class="control-label"><?php echo $hesklang['crt']; ?></b>:</label>
<select name="type" class="form-control">
<option
value="1" <?php echo $selected['type'][1]; ?>><?php echo $hesklang['t1']; ?></option>
<option
value="2" <?php echo $selected['type'][2]; ?>><?php echo $hesklang['t2']; ?></option>
<option
value="3" <?php echo $selected['type'][3]; ?>><?php echo $hesklang['t3']; ?></option>
<option
value="4" <?php echo $selected['type'][4]; ?>><?php echo $hesklang['t4']; ?></option>
</select>
</div>
<div class="form-group text-center">
<input type="submit" value="<?php echo $hesklang['dire']; ?>" class="btn btn-default"/>
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
</div>
</form>
</div>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="col-sm-8">
<div class="box-body">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
?>
<?php
if ($date_from == $date_to) {
?>
<h3><?php echo hesk_dateToString($date_from, 0); ?></h3>
<div class="footerWithBorder blankSpace"></div>
<?php
} else {
?>
<h3><?php echo hesk_dateToString($date_from, 0); ?> - <?php echo hesk_dateToString($date_to, 0); ?></h3>
<div class="footerWithBorder blankSpace"></div>
<?php
}
// Show a note if reports are limited
if (!$can_run_reports_full) {
@ -909,6 +920,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
</div>
</div>
</section>
<?php
require_once(HESK_PATH . 'inc/footer.inc.php');

@ -36,6 +36,7 @@ define('PAGE_TITLE', 'ADMIN_TOOLS');
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -72,384 +73,391 @@ require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
/* Print main manage users page */
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
<div class="row pad-20">
<ul class="nav nav-tabs" role="tablist">
<?php
// Show a link to banned_emails.php if user has permission to do so
if (hesk_checkPermission('can_ban_emails', 0)) {
echo '
<section class="content">
<div class="box">
<div class="box-body">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs" role="tablist">
<?php
// Show a link to banned_emails.php if user has permission to do so
if (hesk_checkPermission('can_ban_emails', 0)) {
echo '
<li role="presentation">
<a title="' . $hesklang['banemail'] . '" href="banned_emails.php">' . $hesklang['banemail'] . '</a>
</li>';
}
if (hesk_checkPermission('can_ban_ips', 0)) {
echo '
}
if (hesk_checkPermission('can_ban_ips', 0)) {
echo '
<li role="presentation">
<a title="' . $hesklang['banip'] . '" href="banned_ips.php">' . $hesklang['banip'] . '</a>
</li>';
}
?>
<li role="presentation" class="active">
<a href="#"><?php echo $hesklang['sm_title']; ?> <i class="fa fa-question-circle settingsquestionmark"
onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['sm_intro']); ?>')"></i></a>
</li>
<?php
// Show a link to email tpl management if user has permission to do so
if (hesk_checkPermission('can_man_email_tpl', 0)) {
echo '
}
?>
<li role="presentation" class="active">
<a href="#"><?php echo $hesklang['sm_title']; ?> <i class="fa fa-question-circle settingsquestionmark"
onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['sm_intro']); ?>')"></i></a>
</li>
<?php
// Show a link to email tpl management if user has permission to do so
if (hesk_checkPermission('can_man_email_tpl', 0)) {
echo '
<li role="presentation">
<a title="' . $hesklang['email_templates'] . '" href="manage_email_templates.php">' . $hesklang['email_templates'] . '</a>
</li>
';
}
if (hesk_checkPermission('can_man_ticket_statuses', 0)) {
echo '
}
if (hesk_checkPermission('can_man_ticket_statuses', 0)) {
echo '
<li role="presentation">
<a title="' . $hesklang['statuses'] . '" href="manage_statuses.php">' . $hesklang['statuses'] . '</a>
</li>
';
}
?>
</ul>
<div class="tab-content summaryList tabPadding">
<script language="javascript" type="text/javascript"><!--
function confirm_delete() {
if (confirm('<?php echo hesk_makeJsString($hesklang['delban_confirm']); ?>')) {
return true;
}
else {
return false;
}
}
//-->
</script>
<div class="row">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
if (isset($_SESSION['new_sm']) && !isset($_SESSION['edit_sm'])) {
$_SESSION['new_sm'] = hesk_stripArray($_SESSION['new_sm']);
}
if (isset($_SESSION['preview_sm'])) {
hesk_service_message($_SESSION['new_sm']);
}
if ($hesk_settings['kb_wysiwyg']) {
?>
<script type="text/javascript">
tinyMCE.init({
mode: "exact",
elements: "content",
theme: "advanced",
convert_urls: false,
gecko_spellcheck: true,
theme_advanced_buttons1: "cut,copy,paste,|,undo,redo,|,formatselect,fontselect,fontsizeselect,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull",
theme_advanced_buttons2: "sub,sup,|,charmap,|,bullist,numlist,|,outdent,indent,insertdate,inserttime,preview,|,forecolor,backcolor,|,hr,removeformat,visualaid,|,link,unlink,anchor,image,cleanup,code",
theme_advanced_buttons3: "",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_statusbar_location: "bottom",
theme_advanced_resizing: true
});
</script>
<?php
}
?>
<div class="panel panel-default">
<div class="panel-heading">
<h4><?php echo $hesklang['ex_sm']; ?></h4>
</div>
<div class="panel-body">
<?php
// Get service messages from database
$res = hesk_dbQuery('SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'service_messages` ORDER BY `order` ASC');
$num = hesk_dbNumRows($res);
if ($num < 1) {
echo '<p>' . $hesklang['no_sm'] . '</p>';
} else {
// List of staff
if (!isset($admins)) {
$admins = array();
$res2 = hesk_dbQuery("SELECT `id`,`name` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users`");
while ($row = hesk_dbFetchAssoc($res2)) {
$admins[$row['id']] = $row['name'];
}
?>
</ul>
<div class="tab-content summaryList tabPadding">
<script language="javascript" type="text/javascript"><!--
function confirm_delete() {
if (confirm('<?php echo hesk_makeJsString($hesklang['delban_confirm']); ?>')) {
return true;
}
else {
return false;
}
}
?>
<table class="table table-hover">
<thead>
<tr>
<th><?php echo $hesklang['sm_mtitle']; ?></th>
<th><?php echo $hesklang['sm_author']; ?></th>
<th><?php echo $hesklang['sm_type']; ?></th>
<th>&nbsp;<?php echo $hesklang['opt']; ?>&nbsp;</th>
</tr>
</thead>
<tbody>
//-->
</script>
<div class="row">
<div class="col-sm-12">
<?php
$j = 1;
$k = 1;
while ($sm = hesk_dbFetchAssoc($res)) {
$faIcon = $sm['icon'];
switch ($sm['style']) {
case 1:
$sm_style = "alert alert-success";
break;
case 2:
$sm_style = "alert alert-info";
break;
case 3:
$sm_style = "alert alert-warning";
break;
case 4:
$sm_style = "alert alert-danger";
break;
default:
$sm_style = "none";
}
$type = $sm['type'] ? $hesklang['sm_draft'] : $hesklang['sm_published'];
/* This will handle error, success and notice messages */
hesk_handle_messages();
if (isset($_SESSION['new_sm']) && !isset($_SESSION['edit_sm'])) {
$_SESSION['new_sm'] = hesk_stripArray($_SESSION['new_sm']);
}
if (isset($_SESSION['preview_sm'])) {
hesk_service_message($_SESSION['new_sm']);
}
if ($hesk_settings['kb_wysiwyg']) {
?>
<tr>
<td>
<div class="<?php echo $sm_style; ?>">
<i class="<?php echo $faIcon; ?>"></i>
<b><?php echo $sm['title']; ?></b>
</div>
</td>
<td><?php echo(isset($admins[$sm['author']]) ? $admins[$sm['author']] : $hesklang['e_udel']); ?></td>
<td><?php echo $type; ?></td>
<td>
<?php
if ($num > 1) {
if ($k == 1) {
?>
<img src="../img/blank.gif" width="16" height="16" alt=""
style="padding:3px;border:none;"/>
<a href="service_messages.php?a=order_sm&amp;id=<?php echo $sm['id']; ?>&amp;move=15&amp;token=<?php hesk_token_echo(); ?>">
<i class="fa fa-arrow-down font-size-16p green"
data-toggle="tooltip" data-placement="top"
data-original-title="<?php echo $hesklang['move_dn']; ?>"></i></a>
<?php
} elseif ($k == $num) {
?>
<a href="service_messages.php?a=order_sm&amp;id=<?php echo $sm['id']; ?>&amp;move=-15&amp;token=<?php hesk_token_echo(); ?>">
<i class="fa fa-arrow-up font-size-16p green" data-toggle="tooltip"
data-placement="top"
data-original-title="<?php echo $hesklang['move_up']; ?>"></i></a>
<img src="../img/blank.gif" width="16" height="16" alt=""
style="padding:3px;border:none;"/>
<?php
} else {
?>
<a href="service_messages.php?a=order_sm&amp;id=<?php echo $sm['id']; ?>&amp;move=-15&amp;token=<?php hesk_token_echo(); ?>">
<i class="fa fa-arrow-up font-size-16p green" data-toggle="tooltip"
data-placement="top"
data-original-title="<?php echo $hesklang['move_up']; ?>"></i></a>
<a href="service_messages.php?a=order_sm&amp;id=<?php echo $sm['id']; ?>&amp;move=15&amp;token=<?php hesk_token_echo(); ?>">
<i class="fa fa-arrow-down font-size-16p green"
data-toggle="tooltip" data-placement="top"
data-original-title="<?php echo $hesklang['move_dn']; ?>"></i></a>
<?php
<script type="text/javascript">
tinyMCE.init({
mode: "exact",
elements: "content",
theme: "advanced",
convert_urls: false,
gecko_spellcheck: true,
theme_advanced_buttons1: "cut,copy,paste,|,undo,redo,|,formatselect,fontselect,fontsizeselect,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull",
theme_advanced_buttons2: "sub,sup,|,charmap,|,bullist,numlist,|,outdent,indent,insertdate,inserttime,preview,|,forecolor,backcolor,|,hr,removeformat,visualaid,|,link,unlink,anchor,image,cleanup,code",
theme_advanced_buttons3: "",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_statusbar_location: "bottom",
theme_advanced_resizing: true
});
</script>
<?php
}
?>
<div class="panel panel-default">
<div class="panel-heading">
<h4><?php echo $hesklang['ex_sm']; ?></h4>
</div>
<div class="panel-body">
<?php
// Get service messages from database
$res = hesk_dbQuery('SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'service_messages` ORDER BY `order` ASC');
$num = hesk_dbNumRows($res);
if ($num < 1) {
echo '<p>' . $hesklang['no_sm'] . '</p>';
} else {
// List of staff
if (!isset($admins)) {
$admins = array();
$res2 = hesk_dbQuery("SELECT `id`,`name` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users`");
while ($row = hesk_dbFetchAssoc($res2)) {
$admins[$row['id']] = $row['name'];
}
}
?>
<a href="service_messages.php?a=edit_sm&amp;id=<?php echo $sm['id']; ?>">
<i class="fa fa-pencil font-size-16p orange" data-toggle="tooltip"
data-placement="top"
data-original-title="<?php echo $hesklang['edit']; ?>"></i></a>
<a href="service_messages.php?a=remove_sm&amp;id=<?php echo $sm['id']; ?>&amp;token=<?php hesk_token_echo(); ?>"
onclick="return hesk_confirmExecute('<?php echo hesk_makeJsString($hesklang['del_sm']); ?>');">
<i class="fa fa-times font-size-16p red" data-toggle="tooltip"
data-placement="top"
data-original-title="<?php echo $hesklang['delete']; ?>"></i></a>&nbsp;
</td>
</tr>
<?php
$j++;
$k++;
} // End while
<table class="table table-hover">
<thead>
<tr>
<th><?php echo $hesklang['sm_mtitle']; ?></th>
<th><?php echo $hesklang['sm_author']; ?></th>
<th><?php echo $hesklang['sm_type']; ?></th>
<th>&nbsp;<?php echo $hesklang['opt']; ?>&nbsp;</th>
</tr>
</thead>
<tbody>
<?php
$j = 1;
$k = 1;
while ($sm = hesk_dbFetchAssoc($res)) {
$faIcon = $sm['icon'];
switch ($sm['style']) {
case 1:
$sm_style = "alert alert-success";
break;
case 2:
$sm_style = "alert alert-info";
break;
case 3:
$sm_style = "alert alert-warning";
break;
case 4:
$sm_style = "alert alert-danger";
break;
default:
$sm_style = "none";
}
$type = $sm['type'] ? $hesklang['sm_draft'] : $hesklang['sm_published'];
?>
</tbody>
</table>
<?php
}
?>
<tr>
<td>
<div class="<?php echo $sm_style; ?>">
<i class="<?php echo $faIcon; ?>"></i>
<b><?php echo $sm['title']; ?></b>
</div>
</td>
<td><?php echo(isset($admins[$sm['author']]) ? $admins[$sm['author']] : $hesklang['e_udel']); ?></td>
<td><?php echo $type; ?></td>
<td>
<?php
if ($num > 1) {
if ($k == 1) {
?>
<img src="../img/blank.gif" width="16" height="16" alt=""
style="padding:3px;border:none;"/>
<a href="service_messages.php?a=order_sm&amp;id=<?php echo $sm['id']; ?>&amp;move=15&amp;token=<?php hesk_token_echo(); ?>">
<i class="fa fa-arrow-down font-size-16p green"
data-toggle="tooltip" data-placement="top"
data-original-title="<?php echo $hesklang['move_dn']; ?>"></i></a>
<?php
} elseif ($k == $num) {
?>
<a href="service_messages.php?a=order_sm&amp;id=<?php echo $sm['id']; ?>&amp;move=-15&amp;token=<?php hesk_token_echo(); ?>">
<i class="fa fa-arrow-up font-size-16p green" data-toggle="tooltip"
data-placement="top"
data-original-title="<?php echo $hesklang['move_up']; ?>"></i></a>
<img src="../img/blank.gif" width="16" height="16" alt=""
style="padding:3px;border:none;"/>
<?php
} else {
?>
<a href="service_messages.php?a=order_sm&amp;id=<?php echo $sm['id']; ?>&amp;move=-15&amp;token=<?php hesk_token_echo(); ?>">
<i class="fa fa-arrow-up font-size-16p green" data-toggle="tooltip"
data-placement="top"
data-original-title="<?php echo $hesklang['move_up']; ?>"></i></a>
<a href="service_messages.php?a=order_sm&amp;id=<?php echo $sm['id']; ?>&amp;move=15&amp;token=<?php hesk_token_echo(); ?>">
<i class="fa fa-arrow-down font-size-16p green"
data-toggle="tooltip" data-placement="top"
data-original-title="<?php echo $hesklang['move_dn']; ?>"></i></a>
<?php
}
}
?>
<a href="service_messages.php?a=edit_sm&amp;id=<?php echo $sm['id']; ?>">
<i class="fa fa-pencil font-size-16p orange" data-toggle="tooltip"
data-placement="top"
data-original-title="<?php echo $hesklang['edit']; ?>"></i></a>
<a href="service_messages.php?a=remove_sm&amp;id=<?php echo $sm['id']; ?>&amp;token=<?php hesk_token_echo(); ?>"
onclick="return hesk_confirmExecute('<?php echo hesk_makeJsString($hesklang['del_sm']); ?>');">
<i class="fa fa-times font-size-16p red" data-toggle="tooltip"
data-placement="top"
data-original-title="<?php echo $hesklang['delete']; ?>"></i></a>&nbsp;
</td>
</tr>
<?php
$j++;
$k++;
} // End while
?>
</div>
</div>
?>
</tbody>
</table>
<?php
}
<div class="panel panel-default">
<div class="panel-heading">
<h4><a name="new_article"></a><?php echo hesk_SESSION('edit_sm') ? $hesklang['edit_sm'] : $hesklang['new_sm']; ?></h4>
</div>
<div class="panel-body">
<form action="service_messages.php" method="post" name="form1" role="form" class="form-horizontal" data-toggle="validator">
<div class="form-group">
<label for="style"
class="col-md-2 control-label"><?php echo $hesklang['sm_style']; ?></label>
<div class="col-md-2">
<div class="radio alert pad-5" style="box-shadow: none; border-radius: 4px;">
<label>
<input type="radio" name="style" value="0" onclick="setIcon('')"
<?php if (!isset($_SESSION['new_sm']['style']) || (isset($_SESSION['new_sm']['style']) && $_SESSION['new_sm']['style'] == 0)) {
echo 'checked';
} ?>>
<?php echo $hesklang['sm_none']; ?>
</label>
?>
</div>
</div>
<div class="col-md-2">
<div class="radio alert alert-success pad-5">
<label style="margin-top: -5px">
<input type="radio" name="style" value="1"
onclick="setIcon('fa fa-check-circle')"
<?php if (isset($_SESSION['new_sm']['style']) && $_SESSION['new_sm']['style'] == 1) {
echo 'checked';
} ?>>
<?php echo $hesklang['sm_success']; ?>
</label>
</div>
</div>
<div class="col-md-2">
<div class="radio alert alert-info pad-5" onclick="setIcon('fa fa-comment')">
<label style="margin-top: -5px">
<input type="radio" name="style" value="2"
<?php if (isset($_SESSION['new_sm']['style']) && $_SESSION['new_sm']['style'] == 2) {
echo 'checked';
} ?>>
<?php echo $hesklang['sm_info']; ?>
</label>
</div>
</div>
<div class="col-md-2">
<div class="radio alert alert-warning pad-5"
onclick="setIcon('fa fa-exclamation-triangle')">
<label style="margin-top: -5px">
<input type="radio" name="style" value="3"
<?php if (isset($_SESSION['new_sm']['style']) && $_SESSION['new_sm']['style'] == 3) {
echo 'checked';
} ?>>
<?php echo $hesklang['sm_notice']; ?>
</label>
</div>
</div>
<div class="col-md-2">
<div class="radio alert alert-danger pad-5" onclick="setIcon('fa fa-times-circle')">
<label style="margin-top: -5px">
<input type="radio" name="style" value="4"
<?php if (isset($_SESSION['new_sm']['style']) && $_SESSION['new_sm']['style'] == 4) {
echo 'checked';
} ?> >
<?php echo $hesklang['sm_error']; ?>
</label>
<div class="panel panel-default">
<div class="panel-heading">
<h4><a name="new_article"></a><?php echo hesk_SESSION('edit_sm') ? $hesklang['edit_sm'] : $hesklang['new_sm']; ?></h4>
</div>
</div>
</div>
<div class="form-group">
<label for="icon" class="col-md-2 control-label"><?php echo $hesklang['sm_icon']; ?></label>
<?php
$icon = '';
if (isset($_SESSION['new_sm']['icon'])) {
$icon = $_SESSION['new_sm']['icon'];
}
?>
<div class="col-md-10">
<p style="display:none" id="no-icon"><?php echo $hesklang['sm_no_icon']; ?></p>
<div class="panel-body">
<form action="service_messages.php" method="post" name="form1" role="form" class="form-horizontal" data-toggle="validator">
<div class="form-group">
<label for="style"
class="col-md-2 control-label"><?php echo $hesklang['sm_style']; ?></label>
<div class="col-md-2">
<div class="radio alert pad-5" style="box-shadow: none; border-radius: 4px;">
<label>
<input type="radio" name="style" value="0" onclick="setIcon('')"
<?php if (!isset($_SESSION['new_sm']['style']) || (isset($_SESSION['new_sm']['style']) && $_SESSION['new_sm']['style'] == 0)) {
echo 'checked';
} ?>>
<?php echo $hesklang['sm_none']; ?>
</label>
</div>
</div>
<div class="col-md-2">
<div class="radio alert alert-success pad-5">
<label style="margin-top: -5px">
<input type="radio" name="style" value="1"
onclick="setIcon('fa fa-check-circle')"
<?php if (isset($_SESSION['new_sm']['style']) && $_SESSION['new_sm']['style'] == 1) {
echo 'checked';
} ?>>
<?php echo $hesklang['sm_success']; ?>
</label>
</div>
</div>
<div class="col-md-2">
<div class="radio alert alert-info pad-5" onclick="setIcon('fa fa-comment')">
<label style="margin-top: -5px">
<input type="radio" name="style" value="2"
<?php if (isset($_SESSION['new_sm']['style']) && $_SESSION['new_sm']['style'] == 2) {
echo 'checked';
} ?>>
<?php echo $hesklang['sm_info']; ?>
</label>
</div>
</div>
<div class="col-md-2">
<div class="radio alert alert-warning pad-5"
onclick="setIcon('fa fa-exclamation-triangle')">
<label style="margin-top: -5px">
<input type="radio" name="style" value="3"
<?php if (isset($_SESSION['new_sm']['style']) && $_SESSION['new_sm']['style'] == 3) {
echo 'checked';
} ?>>
<?php echo $hesklang['sm_notice']; ?>
</label>
</div>
</div>
<div class="col-md-2">
<div class="radio alert alert-danger pad-5" onclick="setIcon('fa fa-times-circle')">
<label style="margin-top: -5px">
<input type="radio" name="style" value="4"
<?php if (isset($_SESSION['new_sm']['style']) && $_SESSION['new_sm']['style'] == 4) {
echo 'checked';
} ?> >
<?php echo $hesklang['sm_error']; ?>
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="icon" class="col-md-2 control-label"><?php echo $hesklang['sm_icon']; ?></label>
<?php
$icon = '';
if (isset($_SESSION['new_sm']['icon'])) {
$icon = $_SESSION['new_sm']['icon'];
}
?>
<div class="col-md-10">
<p style="display:none" id="no-icon"><?php echo $hesklang['sm_no_icon']; ?></p>
<p style="display:none" id="search-icon"><?php echo $hesklang['sm_search_icon']; ?></p>
<p style="display:none" id="search-icon"><?php echo $hesklang['sm_search_icon']; ?></p>
<p style="display:none"
id="footer-icon"><?php echo $hesklang['sm_iconpicker_footer_label']; ?></p>
<p style="display:none"
id="footer-icon"><?php echo $hesklang['sm_iconpicker_footer_label']; ?></p>
<div name="icon" class="btn btn-default iconpicker-container" data-toggle="iconpicker"
data-icon="<?php echo $icon; ?>"></div>
</div>
</div>
<div class="form-group">
<label for="type" class="col-md-2 control-label"><?php echo $hesklang['sm_type']; ?></label>
<div class="col-md-2">
<div class="radio pad-5">
<label>
<input type="radio" name="type" value="0"
<?php if (!isset($_SESSION['new_sm']['type']) || (isset($_SESSION['new_sm']['type']) && $_SESSION['new_sm']['type'] == 0)) {
echo 'checked';
} ?> >
<?php echo $hesklang['sm_published']; ?>
</label>
</div>
</div>
<div class="col-md-2">
<div class="radio pad-5">
<label>
<input type="radio" name="type" value="1"
<?php if (isset($_SESSION['new_sm']['type']) && $_SESSION['new_sm']['type'] == 1) {
echo 'checked';
} ?> >
<?php echo $hesklang['sm_draft']; ?>
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="title"
class="col-md-2 control-label"><?php echo $hesklang['sm_mtitle']; ?></label>
<div class="col-md-10">
<input class="form-control"
placeholder="<?php echo htmlspecialchars($hesklang['sm_mtitle']); ?>"
type="text" name="title" size="70" maxlength="255"
<?php if (isset($_SESSION['new_sm']['title'])) {
echo 'value="' . $_SESSION['new_sm']['title'] . '"';
} ?> data-error="<?php echo htmlspecialchars($hesklang['sm_e_title']); ?>" required>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label for="message"
class="col-md-2 control-label"><?php echo $hesklang['sm_msg']; ?></label>
<div class="col-md-10">
<textarea placeholder="<?php echo htmlspecialchars($hesklang['sm_msg']); ?>"
class="form-control" name="message" rows="25" cols="70" id="content">
<?php if (isset($_SESSION['new_sm']['message'])) {
echo $_SESSION['new_sm']['message'];
} ?>
</textarea>
</div>
</div>
<div class="form-group">
<?php echo isset($_SESSION['edit_sm']) ? '<input type="hidden" name="a" value="save_sm" /><input type="hidden" name="id" value="' . intval($_SESSION['new_sm']['id']) . '" />' : '<input type="hidden" name="a" value="new_sm" />'; ?>
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
<div class="col-md-10 col-md-offset-2">
<div class="btn-group" role="group">
<input type="submit" name="sm_save" value="<?php echo $hesklang['sm_save']; ?>"
class="btn btn-primary">
<input type="submit" name="sm_preview"
value="<?php echo $hesklang['sm_preview']; ?>" class="btn btn-default">
<div name="icon" class="btn btn-default iconpicker-container" data-toggle="iconpicker"
data-icon="<?php echo $icon; ?>"></div>
</div>
</div>
<div class="form-group">
<label for="type" class="col-md-2 control-label"><?php echo $hesklang['sm_type']; ?></label>
<div class="col-md-2">
<div class="radio pad-5">
<label>
<input type="radio" name="type" value="0"
<?php if (!isset($_SESSION['new_sm']['type']) || (isset($_SESSION['new_sm']['type']) && $_SESSION['new_sm']['type'] == 0)) {
echo 'checked';
} ?> >
<?php echo $hesklang['sm_published']; ?>
</label>
</div>
</div>
<div class="col-md-2">
<div class="radio pad-5">
<label>
<input type="radio" name="type" value="1"
<?php if (isset($_SESSION['new_sm']['type']) && $_SESSION['new_sm']['type'] == 1) {
echo 'checked';
} ?> >
<?php echo $hesklang['sm_draft']; ?>
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="title"
class="col-md-2 control-label"><?php echo $hesklang['sm_mtitle']; ?></label>
<div class="col-md-10">
<input class="form-control"
placeholder="<?php echo htmlspecialchars($hesklang['sm_mtitle']); ?>"
type="text" name="title" size="70" maxlength="255"
<?php if (isset($_SESSION['new_sm']['title'])) {
echo 'value="' . $_SESSION['new_sm']['title'] . '"';
} ?> data-error="<?php echo htmlspecialchars($hesklang['sm_e_title']); ?>" required>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label for="message"
class="col-md-2 control-label"><?php echo $hesklang['sm_msg']; ?></label>
<div class="col-md-10">
<textarea placeholder="<?php echo htmlspecialchars($hesklang['sm_msg']); ?>"
class="form-control" name="message" rows="25" cols="70" id="content">
<?php if (isset($_SESSION['new_sm']['message'])) {
echo $_SESSION['new_sm']['message'];
} ?>
</textarea>
</div>
</div>
<div class="form-group">
<?php echo isset($_SESSION['edit_sm']) ? '<input type="hidden" name="a" value="save_sm" /><input type="hidden" name="id" value="' . intval($_SESSION['new_sm']['id']) . '" />' : '<input type="hidden" name="a" value="new_sm" />'; ?>
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
<div class="col-md-10 col-md-offset-2">
<div class="btn-group" role="group">
<input type="submit" name="sm_save" value="<?php echo $hesklang['sm_save']; ?>"
class="btn btn-primary">
<input type="submit" name="sm_preview"
value="<?php echo $hesklang['sm_preview']; ?>" class="btn btn-default">
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<?php

@ -37,6 +37,7 @@ require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/status_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -48,30 +49,31 @@ define('CALENDAR', 1);
/* Check permissions for this feature */
hesk_checkPermission('can_view_tickets');
/* Print header */
require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
/* Print admin navigation */
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
<div class="row">
<div class="col-md-12 move-down-20">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
?>
<div class="panel panel-default">
<div class="panel-heading">
<h4><?php echo $hesklang['tickets']; ?> <span class="nu-floatRight panel-button"><a
href="new_ticket.php" class="btn btn-success"><span
class="glyphicon glyphicon-plus-sign"></span> <?php echo $hesklang['nti']; ?></a></span></h4>
<section class="content">
<?php hesk_handle_messages(); ?>
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['tickets']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<?php
/* Print the list of tickets */
$is_search = 1;
require_once(HESK_PATH . 'inc/print_tickets.inc.php');
echo '<br>';
/* Update staff default settings? */
if (!empty($_GET['def'])) {
hesk_updateStaffDefaults();
@ -82,12 +84,39 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
</div>
</div>
<?php
<div class="box">
<div class="box-body">
<?php
$hesk_settings['hesk_license']('HMgPSAxOw0KaWYgKGZpbGVfZXhpc3RzKEhFU0tfUEFUSCAuI
CdoZXNrX2xpY2Vuc2UucGhwJykpDQp7DQokaCA9ICghZW1wdHkoJF9TRVJWRVJbJ0hUVFBfSE9TVCddK
SkgPyAkX1NFUlZFUlsnSFRUUF9IT1NUJ10gOiAoKCFlbXB0eSgkX1NFUlZFUlsnU0VSVkVSX05BTUUnX
SkpID8gJF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10gOiBnZXRlbnYoJ1NFUlZFUl9OQU1FJykpOw0KJGggP
SBzdHJfcmVwbGFjZSgnd3d3LicsJycsc3RydG9sb3dlcigkaCkpOw0KaW5jbHVkZShIRVNLX1BBVEggL
iAnaGVza19saWNlbnNlLnBocCcpOw0KaWYgKGlzc2V0KCRoZXNrX3NldHRpbmdzWydsaWNlbnNlJ10pI
CYmIHN0cnBvcygkaGVza19zZXR0aW5nc1snbGljZW5zZSddLHNoYTEoJGguJ2gzJkZwMiNMYUEmNTkhd
yg4LlpjXSordVI1MTInKSkgIT09IGZhbHNlKQ0Kew0KJHMgPSAwOw0KfQ0KZWxzZQ0Kew0KZWNobyAnP
HAgc3R5bGU9InRleHQtYWxpZ246Y2VudGVyO2NvbG9yOnJlZDsiPklOVkFMSUQgTElDRU5TRSAoTk9UI
FJFR0lTVEVSRUQgRk9SICcuJGguJykhPC9wPic7DQp9DQp9DQppZiAoJHMpDQp7DQplY2hvICc8aHIgL
z48dGFibGUgYm9yZGVyPSIwIiB3aWR0aD0iMTAwJSI+PHRyPjx0ZD48Yj4nLiRoZXNrbGFuZ1sncmVtb
3ZlX3N0YXRlbWVudCddLic8L2I+PC90ZD48dGQgc3R5bGU9InRleHQtYWxpZ246cmlnaHQiPjxhIGhyZ
WY9IkphdmFzY3JpcHQ6dm9pZCgwKSIgb25jbGljaz0iYWxlcnQoXCcnLiRoZXNrbGFuZ1snc3VwcG9yd
F9ub3RpY2UnXS4nXCcpIj4nLiRoZXNrbGFuZ1snc2gnXS4nPC9hPjwvdGQ+PC90cj48L3RhYmxlPjxwP
icuJGhlc2tsYW5nWydzdXBwb3J0X3JlbW92ZSddLicuIDxhIGhyZWY9Imh0dHBzOi8vd3d3Lmhlc2suY
29tL2J1eS5waHAiIHRhcmdldD0iX2JsYW5rIj4nLiRoZXNrbGFuZ1snY2xpY2tfaW5mbyddLic8L2E+P
C9wPic7DQp9DQo=', "\112");
/* Clean unneeded session variables */
hesk_cleanSessionVars('hide');
?>
</div>
</div>
</section>
<?php
/* Print footer */
require_once(HESK_PATH . 'inc/footer.inc.php');
exit();
?>
/* Print footer */
require_once(HESK_PATH . 'inc/footer.inc.php');
exit();
?>

@ -8,6 +8,7 @@ define('PAGE_TITLE', 'ADMIN_TOOLS');
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -24,75 +25,83 @@ require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
/* Print main manage users page */
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?>
<div class="row pad-20">
<div class="col-sm-4">
<div class="panel panel-default">
<div class="panel-heading">
<?php echo $hesklang['search_logs']; ?>
<section class="content">
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['search_logs']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<div class="form-horizontal">
<div class="form-group">
<label for="location" class="control-label col-sm-4">
<?php echo $hesklang['custom_place']; ?>
</label>
<div class="col-sm-8">
<input type="text" name="location" class="form-control" placeholder="<?php echo hesk_htmlspecialchars($hesklang['custom_place']); ?>">
</div>
</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label for="location" class="control-label col-sm-4">
<?php echo $hesklang['custom_place']; ?>
</label>
<div class="col-sm-8">
<input type="text" name="location" class="form-control" placeholder="<?php echo hesk_htmlspecialchars($hesklang['custom_place']); ?>">
</div>
</div>
<div class="form-group">
<label for="date" class="control-label col-sm-4">
<?php echo $hesklang['date_logged']; ?>
</label>
<div class="col-sm-8">
<input type="text" name="from-date" class="datepicker form-control white-readonly no-bottom-round-corners no-bottom-border" placeholder="<?php echo hesk_htmlspecialchars($hesklang['from_date']); ?>" readonly>
<input type="text" name="to-date" class="datepicker form-control white-readonly no-top-round-corners" placeholder="<?php echo hesk_htmlspecialchars($hesklang['to_date']); ?>" readonly>
</div>
</div>
<div class="form-group">
<label for="severity" class="control-label col-sm-4"><?php echo $hesklang['severity']; ?></label>
<div class="col-sm-8">
<select name="severity" class="form-control">
<option value="-1" selected><?php echo $hesklang['all']; ?></option>
<option value="0"><?php echo $hesklang['debug']; ?></option>
<option value="1"><?php echo $hesklang['info']; ?></option>
<option value="2"><?php echo $hesklang['warning_title_case']; ?></option>
<option value="3"><?php echo $hesklang['sm_error']; ?></option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-8 col-sm-offset-4">
<button class="btn btn-default" id="search-button"><?php echo $hesklang['search']; ?></button>
</div>
</div>
<div class="form-group">
<label for="date" class="control-label col-sm-4">
<?php echo $hesklang['date_logged']; ?>
</label>
<div class="col-sm-8">
<input type="text" name="from-date" class="datepicker form-control white-readonly no-bottom-round-corners no-bottom-border" placeholder="<?php echo hesk_htmlspecialchars($hesklang['from_date']); ?>" readonly>
<input type="text" name="to-date" class="datepicker form-control white-readonly no-top-round-corners" placeholder="<?php echo hesk_htmlspecialchars($hesklang['to_date']); ?>" readonly>
</div>
</div>
</div>
</div>
<div class="col-sm-8">
<div class="panel panel-default">
<div class="panel-heading">
<?php echo $hesklang['logs']; ?>
<div class="form-group">
<label for="severity" class="control-label col-sm-4"><?php echo $hesklang['severity']; ?></label>
<div class="col-sm-8">
<select name="severity" class="form-control">
<option value="-1" selected><?php echo $hesklang['all']; ?></option>
<option value="0"><?php echo $hesklang['debug']; ?></option>
<option value="1"><?php echo $hesklang['info']; ?></option>
<option value="2"><?php echo $hesklang['warning_title_case']; ?></option>
<option value="3"><?php echo $hesklang['sm_error']; ?></option>
</select>
</div>
</div>
<div class="panel-body">
<table class="table table-striped" id="results-table">
<thead>
<tr>
<th><?php echo $hesklang['date']; ?></th>
<th><?php echo $hesklang['user']; ?></th>
<th><?php echo $hesklang['custom_place']; ?></th>
<th><?php echo $hesklang['message']; ?></th>
</tr>
</thead>
<tbody></tbody>
</table>
<div class="form-group">
<div class="col-sm-8 col-sm-offset-4">
<button class="btn btn-default" id="search-button"><?php echo $hesklang['search']; ?></button>
</div>
</div>
</div>
</div>
</div>
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['logs']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<table class="table table-striped" id="results-table">
<thead>
<tr>
<th><?php echo $hesklang['date']; ?></th>
<th><?php echo $hesklang['user']; ?></th>
<th><?php echo $hesklang['custom_place']; ?></th>
<th><?php echo $hesklang['message']; ?></th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</section>
<?php
require_once(HESK_PATH . 'inc/footer.inc.php');
exit();

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,153 @@
.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;
}

@ -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

@ -1885,4 +1885,27 @@ function mfh_bytesToUnits($size) {
$quotient = $size / $bytes_in_megabyte;
return intval($quotient);
}
/**
* Returns the star markup based on the rating provided. Filled in stars are orange, empty stars are gray.
*/
function mfh_get_stars($rating) {
$int_value = intval($rating);
$has_half = $int_value === $rating;
$markup = '';
for ($i = 0; $i < $int_value; $i++) {
$markup .= '<i class="fa fa-star orange"></i>';
}
if ($has_half) {
$markup .= '<i class="fa fa-star-half-o orange"></i>';
}
for ($i = 0; $i < 5 - $int_value; $i++) {
$markup .= '<i class="fa fa-star-o gray"></i>';
}
return $markup;
}

@ -37,42 +37,17 @@ if (!defined('IN_SCRIPT')) {
$modsForHesk_settings = mfh_getSettings();
?>
<!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" xml:lang="en" lang="en">
<!DOCTYPE html>
<html>
<head>
<title><?php echo(isset($hesk_settings['tmp_title']) ? $hesk_settings['tmp_title'] : $hesk_settings['hesk_title']); ?></title>
<meta http-equiv="Content-Type" content="text/html;charset=<?php echo $hesklang['ENCODING']; ?>"/>
<meta name="viewport" content="width=device-width, user-scalable=no">
<meta name="theme-color" content="<?php echo '#414a5c'; ?>">
<?php if ($modsForHesk_settings['rtl']) { ?>
<link href="<?php echo HESK_PATH; ?>hesk_style_RTL.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>" type="text/css"
rel="stylesheet"/>
<?php } else { ?>
<link href="<?php echo HESK_PATH; ?>hesk_style.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>" type="text/css"
rel="stylesheet"/>
<?php } ?>
<link href="<?php echo HESK_PATH; ?>css/datepicker.css" type="text/css" rel="stylesheet"/>
<link href="<?php echo HESK_PATH; ?>css/bootstrap.css?v=21" type="text/css" rel="stylesheet"/>
<link href="<?php echo HESK_PATH; ?>css/bootstrap-theme.css?v=21" type="text/css"
rel="stylesheet" <?php if ($modsForHesk_settings['use_bootstrap_theme'] == 0) {
echo 'disabled';
} ?>>
<?php if ($modsForHesk_settings['rtl']) { ?>
<link href="<?php echo HESK_PATH; ?>css/bootstrap-rtl.min.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>"
type="text/css" rel="stylesheet"/>
<link href="<?php echo HESK_PATH; ?>css/mods-for-hesk.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>" type="text/css"
rel="stylesheet"/>
<link href="<?php echo HESK_PATH; ?>css/hesk_newStyleRTL.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>"
type="text/css" rel="stylesheet"/>
<?php } else { ?>
<link href="<?php echo HESK_PATH; ?>css/mods-for-hesk.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>" type="text/css"
rel="stylesheet"/>
<link href="<?php echo HESK_PATH; ?>css/hesk_newStyle.css?v=<?php echo MODS_FOR_HESK_BUILD; ?>" type="text/css"
rel="stylesheet"/>
<?php } ?>
<link href="<?php echo HESK_PATH; ?>css/bootstrap-iconpicker.min.css" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/octicons.css" type="text/css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css">
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/dropzone.min.css">
@ -81,7 +56,14 @@ $modsForHesk_settings = mfh_getSettings();
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/bootstrap-clockpicker.min.css">
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/jquery.jgrowl.min.css">
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/bootstrap-colorpicker.min.css">
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/AdminLTE.min.css">
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/skins/_all-skins.min.css">
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/mods-for-hesk-new.css">
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/colors.css">
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/positions.css">
<link rel="stylesheet" href="<?php echo HESK_PATH; ?>css/displays.css">
<script src="<?php echo HESK_PATH; ?>js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/adminlte.min.js"></script>
<script language="Javascript" type="text/javascript" src="<?php echo HESK_PATH; ?>hesk_javascript.js"></script>
<script language="Javascript" type="text/javascript" src="<?php echo HESK_PATH; ?>js/bootstrap.min.js"></script>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/dropzone.min.js"></script>
@ -158,6 +140,12 @@ $modsForHesk_settings = mfh_getSettings();
.h3questionmark {
color: <?php echo $modsForHesk_settings['questionMarkColor']; ?>;
}
<?php if (defined('PAGE_TITLE') && PAGE_TITLE == 'LOGIN'): ?>
body {
background: #d2d6de;
}
<?php endif; ?>
</style>
<?php
@ -236,7 +224,7 @@ $modsForHesk_settings = mfh_getSettings();
</head>
<body onload="<?php echo $onload;
unset($onload); ?>">
unset($onload); ?>" class="hold-transition skin-blue sidebar-mini">
<?php
include(HESK_PATH . 'header.txt');

@ -0,0 +1,22 @@
<?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`,
COALESCE(`users`.`name`, '{$deleted_user_text}') AS `from`, `mail`.`dt` AS `date`
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)) {
$mails[] = $row;
}
return $mails;
}

@ -38,7 +38,7 @@ function hesk_profile_tab($session_array = 'new', $is_profile_page = true, $acti
{
global $hesk_settings, $hesklang, $can_reply_tickets, $can_view_tickets, $can_view_unassigned;
?>
<div role="tabpanel">
<div role="tabpanel" class="nav-tabs-custom">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">

@ -33,254 +33,426 @@ 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>
<span class="label label-warning"><?php echo $number_of_maintenance_warnings; ?></span>
</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="#">
<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="#">
<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']; ?>">
<!-- TODO User avatars -->
<!--<div class="pull-left">
<img src="dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
</div>-->
<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&amp;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>&nbsp;<?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>&nbsp;' . $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>&nbsp;' . $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>&nbsp;' . $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>&nbsp;' . $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>&nbsp;' . $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>&nbsp;' . $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>&nbsp;' . $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"';
}
if (hesk_checkPermission('can_man_kb', 0)) {
echo '<li'.$active.'><a href="manage_knowledgebase.php"><i class="fa fa-book" ' . $iconDisplay . '></i>&nbsp;' . $hesklang['menu_kb'] . '</a></li>';
} else {
echo '<li'.$active.'><a href="knowledgebase_private.php"><i class="fa fa-book" ' . $iconDisplay . '></i>&nbsp;' . $hesklang['menu_kb'] . '</a></li>';
$active = 'active';
}
}
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>&nbsp;' . $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>&nbsp;' . $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>&nbsp;' . $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_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>&nbsp;' . $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>&nbsp;' . $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>&nbsp;' . $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>&nbsp;' . $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>&nbsp;' . $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>&nbsp;' . $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>&nbsp;' . $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>&nbsp;' . $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>&nbsp;<?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>&nbsp;<?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&amp;token=<?php echo hesk_token_echo(); ?>"><span
class="octicon octicon-sign-out" <?php echo $iconDisplay; ?>></span>&nbsp;<?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;
}

@ -58,7 +58,6 @@ $result = hesk_dbQuery($sql_count);
$total = hesk_dbResult($result);
//-- Precondition: The panel has already been created, and there is NO open <div class="panel-body"> tag yet.
echo '<div class="panel-body">';
if ($total > 0) {
/* This query string will be used to browse pages */
@ -244,13 +243,13 @@ if ($total > 0) {
$owner = '';
$first_line = '(' . $hesklang['unas'] . ')' . " \n\n";
if ($ticket['owner'] == $_SESSION['id']) {
$owner = '<span class="assignedyou" title="' . $hesklang['tasy2'] . '"><span class="glyphicon glyphicon-user" data-toggle="tooltip" data-placement="top" title="' . $hesklang['tasy2'] . '"></span></span> ';
$owner = '<span class="red" title="' . $hesklang['tasy2'] . '"><span class="glyphicon glyphicon-user" data-toggle="tooltip" data-placement="top" title="' . $hesklang['tasy2'] . '"></span></span> ';
$first_line = $hesklang['tasy2'] . " \n\n";
} elseif ($ticket['owner']) {
if (!isset($admins[$ticket['owner']])) {
$admins[$ticket['owner']] = $hesklang['e_udel'];
}
$owner = '<span class="assignedother" title="' . $hesklang['taso3'] . ' ' . $admins[$ticket['owner']] . '"><span class="glyphicon glyphicon-user" data-toggle="tooltip" data-placement="top" title="' . $hesklang['taso3'] . ' ' . $admins[$ticket['owner']] . '"></span></span> ';
$owner = '<span class="green" title="' . $hesklang['taso3'] . ' ' . $admins[$ticket['owner']] . '"><span class="glyphicon glyphicon-user" data-toggle="tooltip" data-placement="top" title="' . $hesklang['taso3'] . ' ' . $admins[$ticket['owner']] . '"></span></span> ';
$first_line = $hesklang['taso3'] . ' ' . $admins[$ticket['owner']] . " \n\n";
}
@ -422,11 +421,15 @@ if ($total > 0) {
} // End while
?>
</table>
</div>
&nbsp;<br/>
<hr>
<table border="0" width="100%">
<tr>
<td>
<a href="new_ticket.php" class="btn btn-success pull-left">
<span class="glyphicon glyphicon-plus-sign"></span>
<?php echo $hesklang['nti']; ?>
</a>
</td>
<td width="50%" class="text-right" style="vertical-align:top">
<select class="form-control" name="a">
<option value="low"
@ -494,8 +497,7 @@ else {
echo '</div></div>';
}
echo '</div>
</div>';
echo '</div>';
function hesk_print_list_head()

@ -14,7 +14,6 @@ function mfh_listAttachments($attachments = '', $reply = 0, $is_staff)
}
/* List attachments */
echo '<p><b>' . $hesklang['attachments'] . ':</b></p><br />';
$att = explode(',', substr($attachments, 0, -1));
echo '<div class="table-responsive">';
echo '<table class="table table-striped attachment-table">';

@ -1,8 +1,7 @@
$(document).ready(function() {
var $readonlyDueDateContainer = $('#readonly-due-date');
var $editableDueDateContainer = $('#editable-due-date');
var $dueDateButton = $('#due-date-button');
$dueDateButton.click(function() {
$readonlyDueDateContainer.click(function() {
$readonlyDueDateContainer.hide();
$editableDueDateContainer.show();
if ($readonlyDueDateContainer.find('span#due-date').text().trim() == 'None') {
@ -37,4 +36,9 @@ $(document).ready(function() {
}
});
});
$('#related-tickets-link').click(function() {
$(this).hide();
$('.related-ticket').show();
})
});

13
js/adminlte.min.js vendored

File diff suppressed because one or more lines are too long

@ -21,6 +21,52 @@ $hesklang['_COLLATE']='utf8_unicode_ci';
// This is the email break line that will be used in email piping
$hesklang['EMAIL_HR']='------ Reply above this line ------';
// ADDED OR MODIFIED IN Mods for HESK 2.7.0
$hesklang['you_have_x_messages'] = 'You have %s new %s'; // %s: Number of new messages, "message" or "messages", depending on #
$hesklang['message_lower_case'] = 'message';
$hesklang['messages_lower_case'] = 'messages';
$hesklang['deleted_user_title_case'] = 'Deleted User';
$hesklang['main_navigation_uppercase'] = 'MAIN NAVIGATION';
$hesklang['x_system_warnings'] = '%s System %s'; // %s: Number of warnings, $s: "Warning" or "Warnings", depending on #
$hesklang['warnings_title_case'] = 'Warnings';
$hesklang['articles_in_category_x'] = 'Articles in Category %s'; // %s: category name
$hesklang['private_category_star'] = 'Private categories indicated by *';
$hesklang['private_article_star'] = 'Private articles indicated by *';
$hesklang['ticket_details'] = 'Ticket Details';
$hesklang['more'] = 'More';
$hesklang['language_colon'] = 'Language:';
$hesklang['created_colon'] = 'Created:';
$hesklang['updated_colon'] = 'Updated:';
$hesklang['last_replier_colon'] = 'Last replier:';
$hesklang['click_to_edit'] = 'Click to edit';
$hesklang['no_device_information'] = 'No device information';
$hesklang['message_colon'] = 'Message:';
$hesklang['original_message'] = 'Original message';
$hesklang['reply_by_customer'] = 'Reply by customer';
$hesklang['reply_by_staff'] = 'Reply by staff';
$hesklang['timeline_today'] = 'Today';
$hesklang['no_notes_for_this_ticket'] = 'No notes for this ticket';
$hesklang['private_message_header'] = 'Private Message';
$hesklang['date_colon'] = 'Date:';
$hesklang['api_information'] = 'API Information';
$hesklang['api_version'] = 'API Version';
$hesklang['external_api'] = 'External API';
$hesklang['external_api_help'] = 'Enable or Disable the external REST API';
$hesklang['disabled_title_case'] = 'Disabled';
$hesklang['enabled_title_case'] = 'Enabled';
$hesklang['api_settings'] = 'API Settings';
$hesklang['user_security'] = 'User Security';
$hesklang['api_documentation'] = 'API Documentation';
$hesklang['changes_saved'] = 'Changes saved!';
$hesklang['save_failed_check_logs'] = 'Saving changes failed. Check the logs for more information.';
$hesklang['number_of_tokens'] = 'Number of Tokens';
$hesklang['generate_new_token'] = 'Generate New Token';
$hesklang['revoke_all_tokens'] = 'Revoke All Tokens';
$hesklang['generated_token_colon'] = 'Generated Token:';
$hesklang['record_this_token_warning'] = 'Please record this token, as this is the only time you will be able to view it!';
$hesklang['all_tokens_revoked'] = 'All tokens for this user have been revoked';
$hesklang['staff_login_title'] = 'Staff Login';
// ADDED OR MODIFIED IN Mods for HESK 2.6.0
$hesklang['search_logs'] = 'Search Logs';
$hesklang['date_logged'] = 'Date Logged';
@ -1809,7 +1855,7 @@ $hesklang['ekb_y']='<b>YES</b>, enable Knowledgebase';
$hesklang['ekb_o']='<b>YES</b>, use HESK as a Knowledgebase only (<i>disable help desk</i>)';
$hesklang['kb_set']='Knowledgebase settings';
$hesklang['kbo1']='Knowledgebase-only mode';
$hesklang['kbo2']='<br /><br />Visitors cannot submit new support tickets and are taken directly to the knowledgebase.';
$hesklang['kbo2']='Visitors cannot submit new support tickets and are taken directly to the knowledgebase.';
$hesklang['fpass']='Forgot your password?';
$hesklang['passr']='Password reset';
$hesklang['passa']='Allow users to reset a forgot password over email';

Loading…
Cancel
Save