query new notifications right after login and therefore also show up as "active" in session-status

This commit is contained in:
Ralf Becker 2014-10-09 08:21:40 +00:00
parent 4e89ed6520
commit 659ca5eb4f
2 changed files with 45 additions and 34 deletions

View File

@ -108,11 +108,14 @@ class notifications_email implements notifications_iface {
$this->mail->AltExtended = $_attachments[0]->string; $this->mail->AltExtended = $_attachments[0]->string;
$this->mail->AltExtendedContentType = $_attachments[0]->type; $this->mail->AltExtendedContentType = $_attachments[0]->type;
unset($_attachments[0]); unset($_attachments[0]);
$this->mail->Body = $body_plain;
}
else
{
$this->mail->IsHTML();
$this->mail->Body = $body_html;
$this->mail->AltBody = $body_plain;
} }
$this->mail->IsHTML(($isMeetingRequestNotif?false:true));
$this->mail->Body = $body_html;
$this->mail->AltBody = $body_plain;
if(is_array($_attachments) && count($_attachments) > 0) if(is_array($_attachments) && count($_attachments) > 0)
{ {
foreach($_attachments as $attachment) foreach($_attachments as $attachment)

View File

@ -24,10 +24,22 @@
var notification_script = document.getElementById('notifications_script_id'); var notification_script = document.getElementById('notifications_script_id');
var popup_poll_interval = notification_script && notification_script.getAttribute('data-poll-interval'); var popup_poll_interval = notification_script && notification_script.getAttribute('data-poll-interval');
this.setTimeout(popup_poll_interval || 60); this.setTimeout(popup_poll_interval || 60);
var self = this; jQuery('#egwpopup_ok_button').click(jQuery.proxy(this.button_ok, this));
jQuery('#egwpopup_ok_button').click(function() { self.button_ok.apply(self); }); jQuery('#egwpopup_close_button').click(jQuery.proxy(this.button_close, this));
jQuery('#egwpopup_close_button').click(function() { self.button_close.apply(self); }); jQuery('#notificationbell').click(jQuery.proxy(this.display, this));
jQuery('#notificationbell').click(function() { self.display.apply(self); }); // query notifictions now
this.get_notifications();
};
/**
* Poll server for new notifications
*/
notifications.prototype.get_notifications = function()
{
egw.json(
"notifications.notifications_ajax.get_notifications",
this.check_browser_notify()
).sendRequest();
}; };
/** /**
@ -37,11 +49,7 @@
notifications.prototype.setTimeout = function(_i) { notifications.prototype.setTimeout = function(_i) {
var self = this; var self = this;
window.setTimeout(function(){ window.setTimeout(function(){
var request = egw.json( self.get_notifications();
"notifications.notifications_ajax.get_notifications",
self.check_browser_notify()
);
request.sendRequest();
self.setTimeout(_i); self.setTimeout(_i);
}, _i*1000); }, _i*1000);
}; };
@ -101,7 +109,7 @@
/** /**
* Display or hide notifcation-bell * Display or hide notifcation-bell
* *
* @param String mode "active" * @param {string} mode "active"
*/ */
notifications.prototype.bell = function(mode) { notifications.prototype.bell = function(mode) {
var notificationbell; var notificationbell;