Updated tools to new UI, starting on admin_settings
This commit is contained in:
parent
bd15f925bc
commit
baf90b7a5d
@ -46,6 +46,7 @@ $hesk_settings['language_default'] = $hesk_settings['language'];
|
||||
require(HESK_PATH . 'inc/common.inc.php');
|
||||
$hesk_settings['language'] = $hesk_settings['language_default'];
|
||||
require(HESK_PATH . 'inc/admin_functions.inc.php');
|
||||
require(HESK_PATH . 'inc/mail_functions.inc.php');
|
||||
hesk_load_database_functions();
|
||||
|
||||
hesk_session_start();
|
||||
|
@ -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>
|
||||
</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 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>
|
||||
<?php
|
||||
if ($can_unban) {
|
||||
?>
|
||||
<th><?php echo $hesklang['opt']; ?></th>
|
||||
?>
|
||||
</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
|
||||
}
|
||||
?>
|
||||
</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']);
|
||||
}
|
||||
/* 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>
|
||||
|
||||
echo '
|
||||
<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 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">
|
||||
<div class="col-sm-12">
|
||||
<?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>
|
||||
<?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&id=' . $ban['id'] . '&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
|
||||
|
||||
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
echo '</tr>';
|
||||
} // End while
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div align="center">
|
||||
<table border="0" cellspacing="1" cellpadding="3" class="white" width="100%">
|
||||
<?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>
|
||||
</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 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>
|
||||
<?php
|
||||
if ($can_unban) {
|
||||
?>
|
||||
<th><?php echo $hesklang['opt']; ?></th>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
while ($ban = hesk_dbFetchAssoc($res)) {
|
||||
echo '
|
||||
//-->
|
||||
</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 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">
|
||||
<div class="col-sm-12">
|
||||
<?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>
|
||||
<?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&ip=' . urlencode($ban['ip']) . '&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&id=' . $ban['id'] . '&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');
|
||||
|
@ -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>
|
||||
<?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']);
|
||||
}
|
||||
|
||||
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>
|
||||
</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();
|
||||
|
||||
// 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'));
|
||||
|
||||
?>
|
||||
<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>
|
||||
</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
|
||||
echo getTemplateMarkup($template, $languageCode);
|
||||
echo ' ';
|
||||
if ($modsForHesk_settings['html_emails']) {
|
||||
echo getTemplateMarkup($template, $languageCode, true);
|
||||
$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
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<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']);
|
||||
}
|
||||
|
||||
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>
|
||||
</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();
|
||||
|
||||
// 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'));
|
||||
|
||||
?>
|
||||
<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 ' ';
|
||||
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');
|
||||
|
@ -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'];
|
||||
<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):
|
||||
?>
|
||||
</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>';
|
||||
}
|
||||
?>
|
||||
</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>
|
||||
</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">
|
||||
<?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="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>
|
||||
</form>
|
||||
</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">
|
||||
<?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="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>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
foreach ($statuses as $status) {
|
||||
|
@ -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> <?php echo $hesklang['opt']; ?> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
//-->
|
||||
</script>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<?php
|
||||
$j = 1;
|
||||
$k = 1;
|
||||
/* This will handle error, success and notice messages */
|
||||
hesk_handle_messages();
|
||||
|
||||
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";
|
||||
}
|
||||
if (isset($_SESSION['new_sm']) && !isset($_SESSION['edit_sm'])) {
|
||||
$_SESSION['new_sm'] = hesk_stripArray($_SESSION['new_sm']);
|
||||
}
|
||||
|
||||
$type = $sm['type'] ? $hesklang['sm_draft'] : $hesklang['sm_published'];
|
||||
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&id=<?php echo $sm['id']; ?>&move=15&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&id=<?php echo $sm['id']; ?>&move=-15&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&id=<?php echo $sm['id']; ?>&move=-15&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&id=<?php echo $sm['id']; ?>&move=15&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&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&id=<?php echo $sm['id']; ?>&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>
|
||||
</td>
|
||||
</tr>
|
||||
<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
|
||||
$j++;
|
||||
$k++;
|
||||
} // End while
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
</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 panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4><?php echo $hesklang['ex_sm']; ?></h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php
|
||||
|
||||
<p style="display:none" id="search-icon"><?php echo $hesklang['sm_search_icon']; ?></p>
|
||||
// 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);
|
||||
|
||||
<p style="display:none"
|
||||
id="footer-icon"><?php echo $hesklang['sm_iconpicker_footer_label']; ?></p>
|
||||
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'];
|
||||
}
|
||||
}
|
||||
|
||||
<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>
|
||||
?>
|
||||
<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> <?php echo $hesklang['opt']; ?> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$j = 1;
|
||||
$k = 1;
|
||||
|
||||
<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>
|
||||
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'];
|
||||
|
||||
?>
|
||||
<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&id=<?php echo $sm['id']; ?>&move=15&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&id=<?php echo $sm['id']; ?>&move=-15&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&id=<?php echo $sm['id']; ?>&move=-15&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&id=<?php echo $sm['id']; ?>&move=15&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&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&id=<?php echo $sm['id']; ?>&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>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$j++;
|
||||
$k++;
|
||||
} // End while
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</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 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>
|
||||
</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="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>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php
|
||||
|
||||
|
@ -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 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>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<?php echo $hesklang['logs']; ?>
|
||||
</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>
|
||||
</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();
|
Loading…
x
Reference in New Issue
Block a user