Hello All,

I want to give credit for this MOD to daz123. He posted it as a reply to a feature request of mine and another OS Ticket enthusiast. Please see the code and instructions below. I have also included a screen shot of what it looks like post implementation. The goal of this from my perspective is to use this as a means of notifying customers of outages or system wide issues to avoid the need for a flood of tickets.

Instructions:

In the file 'include/staff/preference.inc.php' find:

<tr><th>Helpdesk Name/Title:</th>

<td><input type="text" size="40" name="helpdesk_title" value="<?=$config?>"> </td>

</tr>

Add this code underneath:

<tr><th>Helpdesk Index Message:</th>

<td><textarea rows="6" cols="35" name="helpdesk_message"><?=$config?></textarea><br>

Enter the message above to be shown on the index page</td>

</tr>

Now in index.php find:

<p class="big">In order to streamline support requests and better serve you, we utilize a support ticket system. Every support request is assigned a unique ticket number which you can use to track the progress and responses online. For your reference we provide complete archives and history of all your support requests. A valid email address is required.</p>

**Note** My text was slightly different but it was still easy to find

and replace it with this:

<p class="big"><?php echo $cfg->HelpDeskMessage(); ?></p>

Now in 'include/class.config.php' after the following

function getBaseUrl(){ //Same as above with no trailing slash.

return rtrim($this->getUrl(),'/');

}

Add this code:

function HelpDeskMessage(){

return $this->config;

}

In the same file 'include/class.config.php' after:

',helpdesk_title='.db_input($var).

Add the following code:

Add this code:

',helpdesk_message='.db_input(htmlspecialchars($var)).

Now run the following query on your database:

ALTER TABLE ost_config

ADD helpdesk_message text;

ScreenCaps:

Admin: blank

Main Page: blank

This is a great start to getting banner messages out to people. Hopefully others will take the code, mod it themselves and re-post improvements.

Rich

osticket-bannermainpage.JPG

osticket-banneradmin.JPG

a year later

Thanks to Rich_C for posting this. I implemented it in our 1.7 version, and found the following changes are appropriate:

In the file 'include/staff/preference.inc.php' find:

I decided to put this in the Admin Control Panel under Alerts & Notices. I created a new table section to separate it from the ticket alerts. In the 'include/staff/settings-alerts.inc.php' find:

<table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2">

Add this code underneath:

<thead>

<tr>

<th>

<h4>HelpDesk Status</h4>

</th>

</tr>

</thead>

<tbody>

<tr><th><em><b>Helpdesk Message:</b> Banner message for all clients</em></th></tr>

<tr>

<td><textarea rows="6" cols="114" name="helpdesk_message"><?=$config?></textarea>

</td>

</tr>

</tbody>

Next, we want to add the section of code that will display the message. Rich_C put it in index.php:

Now in index.php find:

However, instead of on the main page, I wanted it on all pages. So I edited 'include/client/header.inc.php'. In that file, find:

<?php

}elseif($nav){ ?>

Guest User - login.php">Log In

<?php

} ?>

and add the following after:

Current HelpDesk Status

<?php echo $cfg->HelpDeskMessage(); ?>

The next bit is the same:

Now in 'include/class.config.php' after the following

function getBaseUrl(){ //Same as above with no trailing slash.

return rtrim($this->getUrl(),'/');

}

Add this code:

function HelpDeskMessage(){

return $this->config;

}

Now we need to update the Config class:

In the same file 'include/class.config.php' after:

We're still tracking with Rich_C, but this one is a little different as well. In the same file 'include/class.config.php', look for the function:

function updateAlertsSettings($vars, &$errors) {

Scroll down until you find:

$sql= 'UPDATE '.CONFIG_TABLE.' SET updated=NOW() '

After that, add this code:

.',helpdesk_message='.db_input($vars)

The MySQL commands are the same:

Now run the following query on your database:

ALTER TABLE ost_config

ADD helpdesk_message text;

Now you can go into the Admin Control Panel => Settings => Alerts & Notices, and update your banner message. My screen shots are attached.

CotterPin

Banner1.JPG

Banner2.JPG

please ignore.
Since this wasn't needed, I've cleaned up my post as to not confuse anyone.

Thanks for jumping on this so quickly. I looked, checked and re-checked everything, but I'll look at it again.

I'm sure I missed something.

As I suspected, I did something wrong. What, I'm not certain, but I *DO* appreciate the hand-holding.

awesome update, and thank you for helping to make this work!

:

--Jeff

10 years later

I don't see this particular menu item on 1.17.3, has it Mover or been deprecated?

    satcomjimmy

    As the title states this was a mod; an old one at that. A “mod” (modification) means it was never added to the core codebase so someone modified the codebase to add this functionality. This post is from 2012 (11 years old!) so it’s old, dead, and will likely no longer work in the latest supported versions.

    Cheers.

    Write a Reply...