Closes #141 Show correct icon for each service message
This commit is contained in:
parent
f4c6588e41
commit
33dc2c3a9c
@ -196,24 +196,20 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
||||
|
||||
while ($sm=hesk_dbFetchAssoc($res))
|
||||
{
|
||||
$faIcon = "";
|
||||
$faIcon = $sm['icon'];
|
||||
switch ($sm['style'])
|
||||
{
|
||||
case 1:
|
||||
$sm_style = "alert alert-success";
|
||||
$faIcon = "fa fa-check-circle";
|
||||
break;
|
||||
case 2:
|
||||
$sm_style = "alert alert-info";
|
||||
$faIcon = "fa fa-comment";
|
||||
break;
|
||||
case 3:
|
||||
$sm_style = "alert alert-warning";
|
||||
$faIcon = "fa fa-exclamation-triangle";
|
||||
break;
|
||||
case 4:
|
||||
$sm_style = "alert alert-danger";
|
||||
$faIcon = "fa fa-times-circle";
|
||||
break;
|
||||
default:
|
||||
$sm_style = "none";
|
||||
@ -434,6 +430,7 @@ function save_sm()
|
||||
}
|
||||
|
||||
$type = empty($_POST['type']) ? 0 : 1;
|
||||
$icon = hesk_POST('icon');
|
||||
$title = hesk_input( hesk_POST('title') ) or $hesk_error_buffer[] = $hesklang['sm_e_title'];
|
||||
$message = hesk_getHTML( hesk_POST('message') );
|
||||
|
||||
@ -448,6 +445,7 @@ function save_sm()
|
||||
'style' => $style,
|
||||
'type' => $type,
|
||||
'title' => $title,
|
||||
'icon' => $icon,
|
||||
'message' => hesk_input( hesk_POST('message') ),
|
||||
);
|
||||
|
||||
@ -475,6 +473,7 @@ function save_sm()
|
||||
'type' => $type,
|
||||
'title' => $title,
|
||||
'message' => $message,
|
||||
'icon' => $icon,
|
||||
);
|
||||
|
||||
header('Location: service_messages.php');
|
||||
@ -487,7 +486,8 @@ function save_sm()
|
||||
`title` = '".hesk_dbEscape($title)."',
|
||||
`message` = '".hesk_dbEscape($message)."',
|
||||
`style` = '{$style}',
|
||||
`type` = '{$type}'
|
||||
`type` = '{$type}',
|
||||
`icon` = '{$icon}'
|
||||
WHERE `id`={$id} LIMIT 1");
|
||||
|
||||
$_SESSION['smord'] = $id;
|
||||
|
@ -65,24 +65,20 @@ hesk_getLanguage();
|
||||
|
||||
function hesk_service_message($sm)
|
||||
{
|
||||
$faIcon = "";
|
||||
$faIcon = $sm['icon'];
|
||||
switch ($sm['style'])
|
||||
{
|
||||
case 1:
|
||||
$style = "alert alert-success";
|
||||
$faIcon = "fa fa-check-circle";
|
||||
break;
|
||||
case 2:
|
||||
$style = "alert alert-info";
|
||||
$faIcon = "fa fa-comment";
|
||||
break;
|
||||
case 3:
|
||||
$style = "alert alert-warning";
|
||||
$faIcon = "fa fa-exclamation-triangle";
|
||||
break;
|
||||
case 4:
|
||||
$style = "alert alert-danger";
|
||||
$faIcon = "fa fa-times-circle";
|
||||
break;
|
||||
default:
|
||||
$style = "none";
|
||||
@ -90,7 +86,7 @@ function hesk_service_message($sm)
|
||||
|
||||
?>
|
||||
<div class="<?php echo $style; ?>">
|
||||
<?php echo $style == 'none' ? '' : '<i class="'.$faIcon.'"></i> '; ?>
|
||||
<?php echo $faIcon == '' ? '' : '<i class="'.$faIcon.'"></i> '; ?>
|
||||
<b><?php echo $sm['title']; ?></b><?php echo $sm['message']; ?>
|
||||
</div>
|
||||
<br />
|
||||
|
@ -1054,7 +1054,7 @@ function print_start()
|
||||
</ol>
|
||||
<?php
|
||||
// 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");
|
||||
$res = hesk_dbQuery('SELECT `title`, `message`, `style`, `icon` FROM `'.hesk_dbEscape($hesk_settings['db_pfix'])."service_messages` WHERE `type`='0' ORDER BY `order` ASC");
|
||||
if (hesk_dbNumRows($res) > 0)
|
||||
{
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user