This modification is for people that always want
"auto-refresh" operating on their main
helpdesk page.
Currently you select
"never, 1 minute, 3 minutes, etc." from the 'Auto-refresh' pull down menu. It remembers your settings for the session but next time you log in, you have to choose the refresh rate again. You could embed the refresh rate in the URL so next time you log in, it's already selected. However, if you always want that particular refresh rate, the pull down menu might now seem pointless to you. This mod is not for everyone, for example, different operators may want different refresh settings.
But if you are the only operator, this mod will clean up your interface and permanently give you the auto-refresh feature.
ALL changes are made on the
"helpdesk.html" template.
This is the Javascript function already in the Javascript section of the template. No changes to this.<script language=Javascript> <!--
function update()
{
document.forms['hd'].submit();
return false;
}
var htimeout = null;
function setrefreshrate(tmout) {
if (htimeout != null) {
clearTimeout(htimeout);
htimeout = null;
}
if (tmout > 0) {
htimeout = setTimeout(update, tmout * 1000);
}
}
//-->
</script>
Remove this...[%Autorefresh rate%] <select name=autorefresh onchange="setrefreshrate(this.options[this.selectedIndex].value)">
<option value="0">[%never%]</option>
<option value="60">[%1 min%]</option>
<option value="180">[%3 min%]</option>
<option value="300">[%5 min%]</option>
<option value="600">[%10 min%]</option>
</select>
<script type="text/javascript"><!--
var i;
var inauto = '(%INPUT_autorefresh%)';
if (inauto == '') {
inauto = '(%CONFIG_AUTOREFRESH%)';
}
for (i = 0; i < document.forms['hd'].autorefresh.options.length; i++) {
if (document.forms['hd'].autorefresh.options.value == inauto) {
document.forms['hd'].autorefresh.options.selected = true;
setrefreshrate(document.forms['hd'].autorefresh.options.value);
}
}
//--></script>
Add this to bottom of template...<script type="text/javascript"><!--
setrefreshrate(180); // refreshes every 3 minutes
//-->
</script>
Notes:1. I chose "180" for every 3 minutes. You can insert any number representing the number of seconds.
2.
This mod can be applied to versions of TTX prior to 2.23. Just add the
purple Javascript code above if any of it's missing from your "helpdesk.html" template.
3. Adding the
original and unmodified "Auto-refresh" feature including pull-down menu to older versions of TTX would required additional modifications to PM modules so that the "auto-refresh" setting is remembered for the entire session. This is not discussed here.