Service messages now appear in their proper locations

master
Mike Koch 6 years ago
parent 2faac6be1a
commit 3e8085110f
No known key found for this signature in database
GPG Key ID: 9BA5D7F8391455ED

@ -54,7 +54,15 @@ else {
?> ?>
<div class="content-wrapper"> <div class="content-wrapper">
<section class="content"> <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">
<div class="box-header with-border"> <div class="box-header with-border">
<h1 class="box-title"> <h1 class="box-title">

@ -939,6 +939,11 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
/* This will handle error, success and notice messages */ /* This will handle error, success and notice messages */
hesk_handle_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 // Prepare special custom fields
foreach ($hesk_settings['custom_fields'] as $k=>$v) { foreach ($hesk_settings['custom_fields'] as $k=>$v) {
if ($v['use'] && hesk_is_custom_field_in_category($k, $ticket['category']) ) { if ($v['use'] && hesk_is_custom_field_in_category($k, $ticket['category']) ) {

@ -278,6 +278,12 @@ function print_login()
<?php <?php
/* This will handle error, success and notice messages */ /* This will handle error, success and notice messages */
hesk_handle_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>
<div class="login-logo"> <div class="login-logo">

@ -121,7 +121,9 @@ function hesk_kb_header($kb_link, $catid=1)
</ol> </ol>
<?php <?php
show_subnav('view', $catid); show_subnav('view', $catid);
echo '<div style="margin-left:40px;margin-right:40px">';
hesk_kbSearchLarge(1); hesk_kbSearchLarge(1);
echo '</div>';
} // END hesk_kb_header() } // END hesk_kb_header()
@ -214,7 +216,15 @@ function hesk_show_kb_article($artid)
?> ?>
<div class="content-wrapper"> <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"> <section class="content">
<div class="box"> <div class="box">
<div class="box-header with-border"> <div class="box-header with-border">
@ -397,6 +407,13 @@ function hesk_show_kb_category($catid, $is_search = 0) {
{ {
/* Print header */ /* Print header */
hesk_kb_header($hesk_settings['kb_link'], $catid); 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"> <section class="content">
<?php if ($thiscat['parent']): ?> <?php if ($thiscat['parent']): ?>

@ -270,6 +270,12 @@ if (!isset($_SESSION['hide']['treemenu']))
<?php <?php
show_subnav(); 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 // Show a notice if total public articles is less than 5
if ($total_articles < 5) if ($total_articles < 5)
{ {

@ -157,6 +157,11 @@ $show_quick_help = $show['show'];
/* This will handle error, success and notice messages */ /* This will handle error, success and notice messages */
hesk_handle_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): ?> if ($show_quick_help): ?>
<div class="box"> <div class="box">
<div class="box-header with-border"> <div class="box-header with-border">

@ -192,6 +192,27 @@ function hesk_service_message($sm)
<?php <?php
} // END hesk_service_message() } // 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) function hesk_isBannedIP($ip)
{ {

@ -79,7 +79,6 @@ function print_select_category($number_of_categories)
?> ?>
<div style="text-align: center"> <div style="text-align: center">
<h3><?php echo $hesklang['select_category_text']; ?></h3> <h3><?php echo $hesklang['select_category_text']; ?></h3>
<div class="select_category"> <div class="select_category">
@ -322,6 +321,13 @@ function print_add_ticket()
<h2><?php hesk_showTopBar($hesklang['submit_ticket']); ?></h2> <h2><?php hesk_showTopBar($hesklang['submit_ticket']); ?></h2>
<small><?php echo $hesklang['use_form_below']; ?></small> <small><?php echo $hesklang['use_form_below']; ?></small>
<div class="blankSpace"></div> <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 align="left" class="h3"><?php echo $hesklang['add_ticket_general_information']; ?></div>
<div class="footerWithBorder"></div> <div class="footerWithBorder"></div>
@ -1315,20 +1321,13 @@ function print_start()
</ol> </ol>
<?php <?php
// Service messages // Service messages
$res = hesk_dbQuery('SELECT `title`, `message`, `style`, `icon` FROM `'.hesk_dbEscape($hesk_settings['db_pfix'])."service_messages` AS `sm` $service_messages = mfh_get_service_messages('CUSTOMER_HOME');
INNER JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mfh_service_message_to_location` AS `location` if (count($service_messages) > 0) {
ON `sm`.`id` = `location`.`service_message_id`
AND `location`.`location` = 'CUSTOMER_HOME'
WHERE `type`='0'
ORDER BY `order` ASC");
if (hesk_dbNumRows($res) > 0)
{
?> ?>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<?php <?php
while ($sm=hesk_dbFetchAssoc($res)) foreach ($service_messages as $sm) {
{
hesk_service_message($sm); hesk_service_message($sm);
} }
?> ?>

@ -254,6 +254,13 @@ if (!$show['show']) {
require_once(HESK_PATH . 'inc/header.inc.php'); require_once(HESK_PATH . 'inc/header.inc.php');
hesk_kb_header($hesk_settings['kb_link']); 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 // Update views by 1 - exclude known bots and reloads because of ratings
if (!isset($_GET['rated']) && !hesk_detect_bots()) { 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}"); 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']); hesk_kb_header($hesk_settings['kb_link']);
} }
// If we are in "Knowledgebase only" mode show system messages // Display service messages on the default category
if ($catid == 1 && hesk_check_kb_only(false)) { if ($catid == 1) {
// Service messages // 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"); $service_messages = mfh_get_service_messages('CUSTOMER_KB_HOME');
while ($sm = hesk_dbFetchAssoc($res)) { foreach ($service_messages as $sm) {
hesk_service_message($sm); hesk_service_message($sm);
} }
} }

@ -215,6 +215,13 @@ if (!$show['show']) {
<?php endif; ?> <?php endif; ?>
<div class="<?php echo $columnWidth; ?>"> <div class="<?php echo $columnWidth; ?>">
<?php <?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 */ /* This will handle error, success and notice messages */
hesk_handle_messages(); hesk_handle_messages();
@ -478,6 +485,12 @@ function print_form()
<?php endif; ?> <?php endif; ?>
<div class="<?php echo $columnWidth; ?>"> <div class="<?php echo $columnWidth; ?>">
<?php <?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 */ /* This will handle error, success and notice messages */
hesk_handle_messages(); hesk_handle_messages();
?> ?>

Loading…
Cancel
Save