added configureable poll interval for egwpopup - default is 60 seconds

This commit is contained in:
Christian Binder 2009-04-06 21:46:11 +00:00
parent fcb8f3497c
commit 6f7c9611ea
3 changed files with 25 additions and 14 deletions

View File

@ -15,9 +15,10 @@
$notification_config = config::read('notifications'); $notification_config = config::read('notifications');
if ($notification_config['popup_enable']) { if ($notification_config['popup_enable']) {
$GLOBALS['egw']->translation->add_app('notifications'); $GLOBALS['egw']->translation->add_app('notifications');
$popup_poll_interval = empty($notification_config['popup_poll_interval']) ? 60 : $notification_config['popup_poll_interval'];
echo '<script src="'. $GLOBALS['egw_info']['server']['webserver_url']. '/notifications/js/notificationajaxpopup.js?'. echo '<script src="'. $GLOBALS['egw_info']['server']['webserver_url']. '/notifications/js/notificationajaxpopup.js?'.
filemtime(EGW_SERVER_ROOT.'/notifications/js/notificationajaxpopup.js'). '" type="text/javascript"></script>'; filemtime(EGW_SERVER_ROOT.'/notifications/js/notificationajaxpopup.js'). '" type="text/javascript"></script>';
echo '<script type="text/javascript">egwpopup_init();</script>'; echo '<script type="text/javascript">egwpopup_init("'.$popup_poll_interval.'");</script>';
echo ' echo '
<div id="egwpopup" style="display: none; z-index: 999;"> <div id="egwpopup" style="display: none; z-index: 999;">
<div id="egwpopup_header">'.lang('Notification').'</div> <div id="egwpopup_header">'.lang('Notification').'</div>

View File

@ -10,16 +10,16 @@
var notifymessages = new Array(); var notifymessages = new Array();
function egwpopup_init() { function egwpopup_init(_i) {
window.setTimeout("egwpopup_refresh();", 1000); window.setTimeout("egwpopup_refresh(" + _i + ");", 1000);
} }
function egwpopup_setTimeout() { function egwpopup_setTimeout(_i) {
window.setTimeout("egwpopup_refresh();", 60000); window.setTimeout("egwpopup_refresh(" + _i + ");", _i*1000);
} }
function egwpopup_refresh() { function egwpopup_refresh(_i) {
xajax_doXMLHTTP("notifications.notifications_ajax.get_notifications"); xajax_doXMLHTTP("notifications.notifications_ajax.get_notifications");
egwpopup_setTimeout(); egwpopup_setTimeout(_i);
} }
function egwpopup_display() { function egwpopup_display() {

View File

@ -13,7 +13,7 @@
<tr class="th"> <tr class="th">
<td colspan="2">&nbsp;<b>{lang_eGroupWare-Popup_backend}</b></td> <td colspan="2">&nbsp;<b>{lang_eGroupWare-Popup_backend}</b></td>
</tr> </tr>
<tr bgcolor="{row_on}"> <tr class="row_on">
<td>{lang_Enable_eGroupWare-Popup_backend}</td> <td>{lang_Enable_eGroupWare-Popup_backend}</td>
<td> <td>
<select name="newsettings[popup_enable]"> <select name="newsettings[popup_enable]">
@ -22,10 +22,20 @@
</select> </select>
</td> </td>
</tr> </tr>
<tr class="row_off">
<td>{lang_Poll_interval}</td>
<td>
<select name="newsettings[popup_poll_interval]">
<option value="60"{selected_popup_poll_interval_60}>1 {lang_minute}</option>
<option value="120"{selected_popup_poll_interval_120}>2 {lang_minutes}</option>
<option value="300"{selected_popup_poll_interval_300}>5 {lang_minutes}</option>
</select>
</td>
</tr>
<tr class="th"> <tr class="th">
<td colspan="2">&nbsp;<b>{lang_Windows-Popup_backend}</b></td> <td colspan="2">&nbsp;<b>{lang_Windows-Popup_backend}</b></td>
</tr> </tr>
<tr bgcolor="{row_on}"> <tr class="row_on">
<td>{lang_Enable_Windows-Popup_backend}</td> <td>{lang_Enable_Windows-Popup_backend}</td>
<td> <td>
<select name="newsettings[winpopup_enable]"> <select name="newsettings[winpopup_enable]">
@ -37,7 +47,7 @@
<tr class="th"> <tr class="th">
<td colspan="2">&nbsp;<b>{lang_SMS_backend}</b></td> <td colspan="2">&nbsp;<b>{lang_SMS_backend}</b></td>
</tr> </tr>
<tr bgcolor="{row_on}"> <tr class="row_on">
<td>{lang_Enable_SMS_backend}</td> <td>{lang_Enable_SMS_backend}</td>
<td> <td>
<select name="newsettings[sms_enable]"> <select name="newsettings[sms_enable]">
@ -46,13 +56,13 @@
</select> </select>
</td> </td>
</tr> </tr>
<tr bgcolor="{row_off}"> <tr class="row_off">
<td>{lang_Maximum_SMS_messages_per_notification}</td> <td>{lang_Maximum_SMS_messages_per_notification}</td>
<td> <td>
<select name="newsettings[sms_maxmessages]"> <select name="newsettings[sms_maxmessages]">
<option value="1">1</option> <option value="1"{selected_sms_maxmessages_1}>1</option>
<option value="2">2</option> <option value="2"{selected_sms_maxmessages_2}>2</option>
<option value="3">3</option> <option value="3"{selected_sms_maxmessages_3}>3</option>
</select> </select>
</td> </td>
</tr> </tr>