diff --git a/notifications/inc/class.notifications_ajax.inc.php b/notifications/inc/class.notifications_ajax.inc.php index 9a24c21998..2ce4591f4b 100644 --- a/notifications/inc/class.notifications_ajax.inc.php +++ b/notifications/inc/class.notifications_ajax.inc.php @@ -269,20 +269,20 @@ class notifications_ajax { $message = 'data:text/html;charset=' . translation::charset() .';base64,'.base64_encode($message); } - $this->response->addScriptCall('app.notifications.append',$notification['notify_id'],$notification['notify_message'],$message); + $this->response->apply('app.notifications.append',array($notification['notify_id'],$notification['notify_message'],$message)); } switch($this->preferences[self::_appname]['egwpopup_verbosity']) { case 'low': - $this->response->addScriptCall('app.notifications.bell', 'active'); + $this->response->apply('app.notifications.bell', array('active')); break; case 'high': - $this->response->addAlert(lang('EGroupware has notifications for you')); - $this->response->addScriptCall('app.notifications.display'); + $this->response->alert(lang('EGroupware has notifications for you')); + $this->response->apply('app.notifications.display'); break; case 'medium': default: - $this->response->addScriptCall('app.notifications.display'); + $this->response->apply('app.notifications.display'); break; } } diff --git a/notifications/js/notificationajaxpopup.js b/notifications/js/notificationajaxpopup.js index 20cbbbea13..fd0b426b21 100644 --- a/notifications/js/notificationajaxpopup.js +++ b/notifications/js/notificationajaxpopup.js @@ -37,13 +37,11 @@ notifications.prototype.setTimeout = function(_i) { var self = this; window.setTimeout(function(){ - var request = xajax_doXMLHTTP("notifications.notifications_ajax.get_notifications", self.check_browser_notify()); - request.request.error = function(_xmlhttp,_err){ - if(console) { - console.log(request); - console.log(_err); - } - }; + var request = egw.json( + "notifications.notifications_ajax.get_notifications", + self.check_browser_notify() + ); + request.sendRequest(); self.setTimeout(_i); }, _i*1000); }; @@ -126,7 +124,8 @@ egwpopup_message.scrollTop = 0; for(var confirmed in notifymessages) break; - xajax_doXMLHTTP("notifications.notifications_ajax.confirm_message", confirmed); + var request = egw.json("notifications.notifications_ajax.confirm_message", confirmed); + request.sendRequest(); delete notifymessages[confirmed]; for(var id in notifymessages) break; @@ -147,8 +146,8 @@ for(var id in notifymessages) { ids.push(id); } - xajax_doXMLHTTP("notifications.notifications_ajax.confirm_message", ids); - + var request = egw.json("notifications.notifications_ajax.confirm_message", ids); + request.sendRequest(); notifymessages = {}; var egwpopup = document.getElementById("egwpopup"); var egwpopup_message = document.getElementById("egwpopup_message"); @@ -208,7 +207,8 @@ // Confirm when user gets to see it - no close needed // Wait a bit to let it load first, or it might not be there when requested. window.setTimeout( function() { - xajax_doXMLHTTP("notifications.notifications_ajax.confirm_message", _id); + var request = egw.json("notifications.notifications_ajax.confirm_message", _id); + request.sendRequest(); }, 2000); }; notice.show();