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:
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