Browse Source

Some improvments

merge-requests/3/head
Mike Koch 6 years ago
parent
commit
26e750959a
  1. 11
      admin/view_message_log.php
  2. 4
      build.php
  3. 14
      css/mods-for-hesk.css
  4. 25
      inc/common.inc.php
  5. 5
      inc/header.inc.php
  6. 4
      inc/headerAdmin.inc.php
  7. 10
      inc/show_admin_nav.inc.php
  8. 2
      language/en/text.php

11
admin/view_message_log.php

@ -14,6 +14,7 @@ hesk_session_start();
hesk_dbConnect();
hesk_isLoggedIn();
hesk_checkPermission('can_view_logs');
define('EXTRA_JS', '<script src="'.HESK_PATH.'internal-api/js/view-message-log.js"></script>');
@ -45,8 +46,8 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<?php echo $hesklang['date_logged']; ?>
</label>
<div class="col-sm-8">
<input type="text" name="from-date" class="datepicker form-control white-readonly" placeholder="<?php echo hesk_htmlspecialchars($hesklang['from_date']); ?>" readonly>
<input type="text" name="to-date" class="datepicker form-control white-readonly" placeholder="<?php echo hesk_htmlspecialchars($hesklang['to_date']); ?>" readonly>
<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">
@ -61,8 +62,12 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
</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>
<button class="btn btn-default" id="search-button"><?php echo $hesklang['search']; ?></button>
</div>
</div>
</div>

4
build.php

@ -0,0 +1,4 @@
<?php
// Define the current build
define('MODS_FOR_HESK_BUILD', 23);

14
css/mods-for-hesk.css

@ -301,4 +301,18 @@ div.setupButtons {
.pad-20 {
padding: 20px;
}
.no-bottom-round-corners {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.no-top-round-corners {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.no-bottom-border {
border-bottom: none;
}

25
inc/common.inc.php

@ -1761,6 +1761,7 @@ function hesk_getFeatureArray()
'can_man_permission_tpl', /* User can manage permission templates */
'can_man_settings', /* User can manage helpdesk settings */
'can_change_notification_settings', /* User can change notification settings */
'can_view_logs', /* User can view the message logs */
);
}
@ -1811,4 +1812,28 @@ function mfh_getSettings()
$settings[$row['Key']] = $row['Value'];
}
return $settings;
}
function mfh_log($location, $message, $severity, $user) {
global $hesk_settings;
$sql = "INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "logging` (`username`, `message`, `severity`, `location`, `timestamp`)
VALUES ('" . hesk_dbEscape($user) . "',
'" . hesk_dbEscape($message) . "', " . intval($severity) . ", '" . hesk_dbEscape($location) . "', NOW())";
}
function mfh_log_debug($location, $message, $user) {
mfh_log($location, $message, 0, $user);
}
function mfh_log_info($location, $message, $user) {
mfh_log($location, $message, 1, $user);
}
function mfh_log_warning($location, $message, $user) {
mfh_log($location, $message, 2, $user);
}
function mfh_log_error($location, $message, $user) {
mfh_log($location, $message, 3, $user);
}

5
inc/header.inc.php

@ -28,8 +28,7 @@
* https://www.hesk.com/buy.php
*******************************************************************************/
// Define the current build
define('MODS_FOR_HESK_BUILD', 23);
require_once(HESK_PATH . 'build.php');
/* Check if this is a valid include */
if (!defined('IN_SCRIPT')) {
@ -41,7 +40,7 @@ if (!function_exists('mfh_getSettings')) {
$modsForHesk_settings = array();
if (is_dir(HESK_PATH . 'install')) {
$modsForHesk_settings['navbar_title_url'] = '#';
$modsForHesk_settings['navbar_title_url'] = 'javascript:;';
$modsForHesk_settings['rtl'] = 0;
$modsForHesk_settings['use_bootstrap_theme'] = 1;
$modsForHesk_settings['show_icons'] = 1;

4
inc/headerAdmin.inc.php

@ -28,8 +28,7 @@
* https://www.hesk.com/buy.php
*******************************************************************************/
// Define the current build
define('MODS_FOR_HESK_BUILD', 23);
require_once(HESK_PATH . 'build.php');
/* Check if this is a valid include */
if (!defined('IN_SCRIPT')) {
@ -90,7 +89,6 @@ $modsForHesk_settings = mfh_getSettings();
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/platform.js"></script>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>js/bootstrap-validator.min.js"></script>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>internal-api/js/core.php"></script>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>internal-api/js/common.js"></script>
<?php
if (defined('EXTRA_JS')) {
echo EXTRA_JS;

10
inc/show_admin_nav.inc.php

@ -180,6 +180,10 @@ if (hesk_check_kb_only(false)) {
$tools_count++;
$dropdown_items .= '<li><a href="manage_statuses.php">' . $hesklang['manage_statuses'] . '</a></li>';
}
if (hesk_checkPermission('can_view_logs', 0)) {
$tools_count++;
$dropdown_items .= '<li><a href="view_message_log.php">' . $hesklang['view_message_log'] . '</a></li>';
}
$dropdown_items .= '</ul>';
if ($tools_count > 1) {
@ -224,6 +228,12 @@ if (hesk_check_kb_only(false)) {
$active = ' class="active"';
}
echo '<li'.$active.'><a href="manage_statuses.php"><i class="fa fa-wrench" ' . $iconDisplay . '></i>&nbsp;' . $hesklang['tools'] . '</a></li>';
} elseif (hesk_checkPermission('can_view_logs', 0)) {
$active = '';
if (defined('PAGE_TITLE') && PAGE_TITLE == 'ADMIN_TOOLS') {
$active = ' class="active"';
}
echo '<li'.$active.'><a href="view_message_log.php"><i class="fa fa-wrench" ' . $iconDisplay . '></i>&nbsp;' . $hesklang['tools'] . '</a></li>';
}
}
if (hesk_checkPermission('can_man_settings', 0)) {

2
language/en/text.php

@ -30,6 +30,8 @@ $hesklang['severity'] = 'Severity';
$hesklang['debug'] = 'Debug';
$hesklang['warning_title_case'] = 'Warning';
$hesklang['logs'] = 'Logs';
$hesklang['view_message_log'] = 'View Message Log';
$hesklang['can_view_logs'] = 'Can view message logs';
// ADDED OR MODIFIED IN Mods for HESK 2.5.2
$hesklang['manage_statuses'] = 'Manage Statuses';

Loading…
Cancel
Save