Browse Source

Service messages now appear in their proper locations

master
Mike Koch 2 years ago
parent
commit
3e8085110f
No account linked to committer's email address

+ 9
- 1
admin/admin_main.php View File

@@ -54,7 +54,15 @@ else {
?>
<div class="content-wrapper">
<section class="content">
<?php hesk_handle_messages(); ?>
<?php
// Service messages
$service_messages = mfh_get_service_messages('STAFF_HOME');
foreach ($service_messages as $sm) {
hesk_service_message($sm);
}

hesk_handle_messages();
?>
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">

+ 5
- 0
admin/admin_ticket.php View File

@@ -939,6 +939,11 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
/* This will handle error, success and notice messages */
hesk_handle_messages();

$service_messages = mfh_get_service_messages('STAFF_VIEW_TICKET');
foreach ($service_messages as $sm) {
hesk_service_message($sm);
}

// Prepare special custom fields
foreach ($hesk_settings['custom_fields'] as $k=>$v) {
if ($v['use'] && hesk_is_custom_field_in_category($k, $ticket['category']) ) {

+ 6
- 0
admin/index.php View File

@@ -278,6 +278,12 @@ function print_login()
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();

// Service messages
$service_messages = mfh_get_service_messages('STAFF_LOGIN');
foreach ($service_messages as $sm) {
hesk_service_message($sm);
}
?>
</div>
<div class="login-logo">

+ 18
- 1
admin/knowledgebase_private.php View File

@@ -121,7 +121,9 @@ function hesk_kb_header($kb_link, $catid=1)
</ol>
<?php
show_subnav('view', $catid);
echo '<div style="margin-left:40px;margin-right:40px">';
hesk_kbSearchLarge(1);
echo '</div>';
} // END hesk_kb_header()


@@ -214,7 +216,15 @@ function hesk_show_kb_article($artid)

?>
<div class="content-wrapper">
<?php hesk_kb_header($hesk_settings['kb_link'], $article['catid']); ?>
<?php
hesk_kb_header($hesk_settings['kb_link'], $article['catid']);
echo '<div style="margin-left:40px;margin-right:40px">';
$service_messages = mfh_get_service_messages('STAFF_VIEW_KB_ARTICLE');
foreach ($service_messages as $sm) {
hesk_service_message($sm);
}
echo '</div>';
?>
<section class="content">
<div class="box">
<div class="box-header with-border">
@@ -397,6 +407,13 @@ function hesk_show_kb_category($catid, $is_search = 0) {
{
/* Print header */
hesk_kb_header($hesk_settings['kb_link'], $catid);

echo '<div style="margin-left:40px;margin-right:40px">';
$service_messages = mfh_get_service_messages('STAFF_KB_HOME');
foreach ($service_messages as $sm) {
hesk_service_message($sm);
}
echo '</div>';
} ?>
<section class="content">
<?php if ($thiscat['parent']): ?>

+ 6
- 0
admin/manage_knowledgebase.php View File

@@ -270,6 +270,12 @@ if (!isset($_SESSION['hide']['treemenu']))
<?php
show_subnav();

// Service messages
$service_messages = mfh_get_service_messages('STAFF_KB_HOME');
foreach ($service_messages as $sm) {
hesk_service_message($sm);
}

// Show a notice if total public articles is less than 5
if ($total_articles < 5)
{

+ 5
- 0
admin/new_ticket.php View File

@@ -157,6 +157,11 @@ $show_quick_help = $show['show'];
/* This will handle error, success and notice messages */
hesk_handle_messages();

$service_messages = mfh_get_service_messages('STAFF_SUBMIT_TICKET');
foreach ($service_messages as $sm) {
hesk_service_message($sm);
}

if ($show_quick_help): ?>
<div class="box">
<div class="box-header with-border">

+ 21
- 0
inc/common.inc.php View File

@@ -192,6 +192,27 @@ function hesk_service_message($sm)
<?php
} // END hesk_service_message()

function mfh_get_service_messages($location) {
global $hesk_settings;

$language = $hesk_settings['languages'][$hesk_settings['language']]['folder'];

$res = hesk_dbQuery('SELECT `title`, `message`, `style`, `icon` FROM `'.hesk_dbEscape($hesk_settings['db_pfix'])."service_messages` AS `sm`
INNER JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mfh_service_message_to_location` AS `location`
ON `sm`.`id` = `location`.`service_message_id`
AND `location`.`location` = '" . hesk_dbEscape($location) . "'
AND `sm`.`mfh_language` IN ('ALL', '" . hesk_dbEscape($language) . "')
WHERE `type`='0'
ORDER BY `order` ASC");

$sm = array();
while ($row = hesk_dbFetchAssoc($res)) {
$sm[] = $row;
}

return $sm;
}


function hesk_isBannedIP($ip)
{

+ 10
- 11
index.php View File

@@ -79,7 +79,6 @@ function print_select_category($number_of_categories)
?>

<div style="text-align: center">

<h3><?php echo $hesklang['select_category_text']; ?></h3>

<div class="select_category">
@@ -322,6 +321,13 @@ function print_add_ticket()
<h2><?php hesk_showTopBar($hesklang['submit_ticket']); ?></h2>
<small><?php echo $hesklang['use_form_below']; ?></small>
<div class="blankSpace"></div>
<?php
// Service messages
$service_messages = mfh_get_service_messages('CUSTOMER_SUBMIT_TICKET');
foreach ($service_messages as $sm) {
hesk_service_message($sm);
}
?>

<div align="left" class="h3"><?php echo $hesklang['add_ticket_general_information']; ?></div>
<div class="footerWithBorder"></div>
@@ -1315,20 +1321,13 @@ function print_start()
</ol>
<?php
// Service messages
$res = hesk_dbQuery('SELECT `title`, `message`, `style`, `icon` FROM `'.hesk_dbEscape($hesk_settings['db_pfix'])."service_messages` AS `sm`
INNER JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mfh_service_message_to_location` AS `location`
ON `sm`.`id` = `location`.`service_message_id`
AND `location`.`location` = 'CUSTOMER_HOME'
WHERE `type`='0'
ORDER BY `order` ASC");
if (hesk_dbNumRows($res) > 0)
{
$service_messages = mfh_get_service_messages('CUSTOMER_HOME');
if (count($service_messages) > 0) {
?>
<div class="row">
<div class="col-md-12">
<?php
while ($sm=hesk_dbFetchAssoc($res))
{
foreach ($service_messages as $sm) {
hesk_service_message($sm);
}
?>

+ 11
- 4
knowledgebase.php View File

@@ -254,6 +254,13 @@ if (!$show['show']) {
require_once(HESK_PATH . 'inc/header.inc.php');
hesk_kb_header($hesk_settings['kb_link']);


// Service messages
$service_messages = mfh_get_service_messages('CUSTOMER_VIEW_KB_ARTICLE');
foreach ($service_messages as $sm) {
hesk_service_message($sm);
}

// Update views by 1 - exclude known bots and reloads because of ratings
if (!isset($_GET['rated']) && !hesk_detect_bots()) {
hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "kb_articles` SET `views`=`views`+1 WHERE `id`={$artid}");
@@ -406,11 +413,11 @@ if (!$show['show']) {
hesk_kb_header($hesk_settings['kb_link']);
}

// If we are in "Knowledgebase only" mode show system messages
if ($catid == 1 && hesk_check_kb_only(false)) {
// Display service messages on the default category
if ($catid == 1) {
// Service messages
$res = hesk_dbQuery('SELECT `title`, `message`, `style` FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . "service_messages` WHERE `type`='0' ORDER BY `order` ASC");
while ($sm = hesk_dbFetchAssoc($res)) {
$service_messages = mfh_get_service_messages('CUSTOMER_KB_HOME');
foreach ($service_messages as $sm) {
hesk_service_message($sm);
}
}

+ 13
- 0
ticket.php View File

@@ -215,6 +215,13 @@ if (!$show['show']) {
<?php endif; ?>
<div class="<?php echo $columnWidth; ?>">
<?php
// Service messages
$service_messages = mfh_get_service_messages('CUSTOMER_VIEW_TICKET');
foreach ($service_messages as $sm) {
hesk_service_message($sm);
}


/* This will handle error, success and notice messages */
hesk_handle_messages();

@@ -478,6 +485,12 @@ function print_form()
<?php endif; ?>
<div class="<?php echo $columnWidth; ?>">
<?php
// Service messages
$service_messages = mfh_get_service_messages('CUSTOMER_VIEW_TICKET');
foreach ($service_messages as $sm) {
hesk_service_message($sm);
}

/* This will handle error, success and notice messages */
hesk_handle_messages();
?>

Loading…
Cancel
Save