diff --git a/calendar/inc/class.bocalupdate.inc.php b/calendar/inc/class.bocalupdate.inc.php index da486d9747..9f9d1156c3 100644 --- a/calendar/inc/class.bocalupdate.inc.php +++ b/calendar/inc/class.bocalupdate.inc.php @@ -410,7 +410,7 @@ class bocalupdate extends bocal * @param array $old_event Event before the change * @param array $new_event=null Event after the change * @param int $user=0 User who started the notify, default current user - * @return mixed returncode from send-class or false on error + * @return bool true/false */ function send_update($msg_type,$to_notify,$old_event,$new_event=null,$user=0) { @@ -443,9 +443,7 @@ class bocalupdate extends bocal $GLOBALS['egw']->preferences->preferences($user); $GLOBALS['egw_info']['user']['preferences'] = $GLOBALS['egw']->preferences->read_repository(); } - $sender = $GLOBALS['egw_info']['user']['email']; - $sender_fullname = $GLOBALS['egw_info']['user']['fullname']; - + $senderid = $GLOBALS['egw_info']['user']['account_id']; $event = $msg_type == MSG_ADDED || $msg_type == MSG_MODIFIED ? $new_event : $old_event; switch($msg_type) @@ -507,13 +505,7 @@ class bocalupdate extends bocal $notify_msg = $this->cal_prefs['notifyAdded']; // use a default } $details = $this->_get_event_details($event,$action,$event_arr,$disinvited); - - if(!is_object($GLOBALS['egw']->send)) - { - $GLOBALS['egw']->send =& CreateObject('phpgwapi.send'); - } - $send = &$GLOBALS['egw']->send; - + // add all group-members to the notification, unless they are already participants foreach($to_notify as $userid => $statusid) { @@ -554,14 +546,7 @@ class bocalupdate extends bocal } $GLOBALS['egw']->accounts->get_account_name($userid,$lid,$details['to-firstname'],$details['to-lastname']); $details['to-fullname'] = $GLOBALS['egw']->common->display_fullname('',$details['to-firstname'],$details['to-lastname']); - - $to = $GLOBALS['egw']->accounts->id2name($userid,'account_email'); - if (!$to || strpos($to,'@') === false) - { - // ToDo: give an error-message - echo '
'.lang('Invalid email-address "%1" for user %2',$to,$GLOBALS['egw']->common->grab_owner_name($userid))."
\n"; - continue; - } + $GLOBALS['egw_info']['user']['preferences']['common']['tz_offset'] = $part_prefs['common']['tz_offset']; $GLOBALS['egw_info']['user']['preferences']['common']['timeformat'] = $part_prefs['common']['timeformat']; $GLOBALS['egw_info']['user']['preferences']['common']['dateformat'] = $part_prefs['common']['dateformat']; @@ -576,21 +561,22 @@ class bocalupdate extends bocal list($subject,$body) = explode("\n",$GLOBALS['egw']->preferences->parse_notify($notify_msg,$details),2); - $send->ClearAddresses(); - $send->ClearAttachments(); - $send->IsHTML(False); - $send->AddAddress($to); - $send->AddCustomHeader('X-eGroupWare-type: calendarupdate'); - switch($part_prefs['calendar']['update_format']) { case 'extended': $body .= "\n\n".lang('Event Details follow').":\n"; foreach($event_arr as $key => $val) { - if ($key != 'access' && $key != 'priority' && strlen($details[$key])) - { - $body .= sprintf("%-20s %s\n",$val['field'].':',$details[$key]); + if(strlen($details[$key])) { + switch($key){ + case 'access': + case 'priority': + case 'link': + break; + default: + $body .= sprintf("%-20s %s\n",$val['field'].':',$details[$key]); + break; + } } } break; @@ -599,35 +585,37 @@ class bocalupdate extends bocal $ics = ExecMethod2('calendar.boical.exportVCal',$event['id'],'2.0',$method); if ($method == 'REQUEST') { - $send->AddStringAttachment($ics, "cal.ics", "8bit", "text/calendar; method=$method"); + $attachment = array( 'string' => $ics, + 'filename' => 'cal.ics', + 'encoding' => '8bit', + 'type' => 'text/calendar; method='.$method, + ); } break; } - $send->From = $sender; - $send->FromName = $sender_fullname; - $send->Subject = $send->encode_subject($subject); - $send->Body = $body; - if ($this->debug) - { - echo "to: $to
from: $sender_fullname <$sender>
Subject: $subject
".nl2br($body)."
bo_trackering::send_notification(): sending
".print_r($send,true)."\n"; + $notification_sent = $send->Send(); + if(!$notification_sent) { + $this->errors[] = lang('Error while notifying %1: %2',$email,$send->ErrorInfo); + return false; } } - - //echo "
bo_trackering::send_notification(): sending
".print_r($send,true)."\n"; - if (!$send->Send()) - { - $this->errors[] = lang('Error while notifying %1: %2',$email,$send->ErrorInfo); - return false; - } + return true; } @@ -579,28 +580,45 @@ class bo_tracking } /** - * Get the body of the notification message, can be reimplemented + * Get a link for notifications to view the entry + * + * @param array $data + * @param array $old + * @return array with link + */ + function get_notification_link($data,$old) + { + if (!is_object($GLOBALS['egw']->link)) + { + require_once(EGW_API_INC.'/class.bolink.inc.php'); + $GLOBALS['egw']->link =& new bolink(); + } + if($view = $GLOBALS['egw']->link->view($this->app,$data[$this->id_field])) { + return array( 'menuaction' => $view['menuaction'], + 'params' => array ( 'action' => $view['action'], + 'action_id' => $view['action_id'], + ), + 'text' => $data['info_subject'], + ); + } else { + return false; + } + } + + /** + * Get the body of the notification message for notification-app * - * @param boolean $html_email * @param array $data * @param array $old * @return string */ - function get_body($html_email,$data,$old) + function get_notification_body($data,$old) { $body = ''; - if ($html_email) - { - $body = "\n\n".'
'. nl2br($notification['message']). '
.
- * NOTE: There is no XSS prevention in notifications framework!
- * You have to filter userinputs yourseve (e.g. htmlspechialchars() )
- *
- * @param string &$message
+ * array with objects of links
+ * @var array
*/
- public function set_message($_message) {
- $this->message = $_message;
+ private $links = array();
+
+ /**
+ * array with objects of attachments
+ * @var array
+ */
+ private $attachments = array();
+
+ /**
+ * holds html object to render elements
+ *
+ * @var object
+ */
+ private $html;
+
+ /**
+ * holds config object (sitewide configuration of app)
+ *
+ * @var object
+ */
+ private $config;
+
+ /**
+ * constructor of notification
+ *
+ */
+ public function __construct() {
+ $this->html = & html::singleton();
+ $config = new config(self::_appname);
+ $this->config = (object) $config->read_repository();
+ }
+
+ /**
+ * Set sender for the current notification
+ *
+ * @param $_sender object of account
+ * as long as the accounts class isn't a nice object, it's an int with the account id :-(
+ */
+ public function set_sender($_sender) {
+ $this->sender = is_object($_sender) ? $_sender : (object) $GLOBALS['egw']->accounts->get_account_data($_sender);
return true;
}
@@ -66,6 +140,100 @@ final class notification {
$receiver[$receiver_id]['id'] = $receiver_id;
$this->receivers[$receiver_id] = (object)$receiver[$receiver_id];
}
+ return true;
+ }
+
+ /**
+ * sets notification subject
+ *
+ * @param string $_subject
+ */
+ public function set_subject($_subject) {
+ $this->subject = $_subject;
+ return true;
+ }
+
+ /**
+ * sets notification message
+ * @abstract $message accepts html tags:
.
+ * NOTE: There is no XSS prevention in notifications framework!
+ * You have to filter userinputs yourseve (e.g. htmlspechialchars() )
+ *
+ * @param string $_message
+ */
+ public function set_message($_message) {
+ $this->message = $_message;
+ return true;
+ }
+
+ /**
+ * sets the notification links
+ *
+ * @param array $links link array (like defined in $this->add_link)
+ */
+ public function set_links(array $_links) {
+ $this->links = array(); // clear array if set
+ foreach($_links as $link) {
+ if(is_array($link)) {
+ $this->add_link($link['menuaction'], $link['params'], $link['text']);
+ }
+ }
+ return true;
+ }
+
+ /**
+ * adds a notification link
+ *
+ * @param string $menuaction egw menuaction (appname.classname.functionname)
+ * @param array $params params to append (name => value pairs)
+ * @param string $text a descriptive text for the link
+ */
+ public function add_link($_menuaction, $_params, $_text) {
+ if(!$_menuaction || !$_params || !$_text) { return false; }
+ $this->links[] = (object)array( 'menuaction' => $_menuaction,
+ 'params' => $_params,
+ 'text' => $_text,
+ );
+ return true;
+ }
+
+ /**
+ * sets the notification attachments
+ *
+ * @param array $attachments attachment array (like defined in $this->add_attachment
+ */
+ public function set_attachments(array $_attachments) {
+ $this->attachments = array(); // clear array if set
+ foreach($_attachments as $attachment) {
+ if(is_array($attachment)) {
+ $this->add_attachment( $attachment['string'],
+ $attachment['filename'],
+ $attachment['encoding'],
+ $attachment['type']
+ );
+ }
+ }
+ return true;
+ }
+
+ /**
+ * adds a notification attachment
+ * This method can be used to attach ascii or binary data,
+ * such as a BLOB record from a database.
+ *
+ * @param string $string Attachment data.
+ * @param string $filename Name of the attachment.
+ * @param string $encoding File encoding (see $Encoding).
+ * @param string $type File extension (MIME) type.
+ */
+ public function add_attachment($_string, $_filename, $_encoding = "base64", $_type = "application/octet-stream") {
+ if(!$_string || !$_filename) { return false; }
+ $this->attachments[] = (object)array( 'string' => $_string,
+ 'filename' => $_filename,
+ 'encoding' => $_encoding,
+ 'type' => $_type,
+ );
+ return true;
}
/**
@@ -73,42 +241,66 @@ final class notification {
*/
public function send() {
if (empty($this->receivers) || !$this->message) {
- throw new Exception('Error: Coud not send notification. No receiver or no message where supplied');
+ throw new Exception('Error: Could not send notification. No receiver or no message where supplied');
}
-
+ // create all message styles
+ $messages = $this->create_messages($this->message, $this->links);
foreach ($this->receivers as $receiver) {
- $prefs = new preferences($receiver->id);
- $preferences = $prefs->read();
- $preferences = (object)$preferences[self::_appname ];
-
- if (!$preferences->disable_ajaxpopup) {
- $notification_backends[] = 'notification_popup';
+ try {
+ // check if the receiver has rights to run the notifcation app
+ $ids = $GLOBALS['egw']->accounts->memberships($receiver->id,true);
+ $ids[] = $receiver->id;
+ if (!$GLOBALS['egw']->acl->get_specific_rights_for_account($ids,'run','notifications')) {
+ throw new Exception('Error: Could not send notification to user '.$receiver->lid.' because of missing execute rights on notification-app.');
+ }
+
+ $prefs = new preferences($receiver->id);
+ $preferences = $prefs->read();
+ $preferences = (object)$preferences[self::_appname];
+ $notification_chain = $this->notification_chains[$preferences->notification_chain];
+ if(!is_array($notification_chain)) {
+ throw new Exception('Error: Could not send notification to user '.$receiver->lid.' because of missing notification settings.');
+ }
}
-
- $send_succseed = 0;
- foreach ((array)$notification_backends as $notification_backend) {
+ catch (Exception $exception) {
+ error_log('notification of receiver'.$receiver->lid.' failed: '.$exception->getMessage());
+ }
+
+ $user_notified = false;
+ $backend_errors = array();
+ foreach($notification_chain as $notification_backend => $action) {
try {
+ $notification_backend = 'notification_'.$notification_backend;
require_once(EGW_INCLUDE_ROOT. SEP. self::_appname. SEP. 'inc'. SEP. 'class.'. $notification_backend. '.inc.php');
-
- $obj = @new $notification_backend( $receiver, $preferences );
+ $obj = @new $notification_backend( $this->sender, $receiver, $this->config, $preferences );
if ( !is_a( $obj, iface_notification )) {
unset ( $obj );
- throw new Exception('Error: '.$notification_backend. ' is no implementation of iface_notification');
+ throw new Exception('Error: '.$notification_backend. ' is no implementation of iface_notification');
}
-
- $obj->send( $this->message );
- $send_succseed++;
+
+ $obj->send($this->subject, $messages, $this->attachments);
}
catch (Exception $exception) {
- $send_succseed--;
- //echo $exception->getMessage(), "\n";
+ $backend_errors[] = $notification_backend.' failed: '.$exception->getMessage();
+ // try next backend
+ if($action == 'fail' || $action == 'continue') {
+ continue;
+ }
+ // all backends failed - give error message
+ if(!$user_notified) {
+ error_log('Error: notification of receiver '.$receiver->lid.' failed');
+ foreach($backend_errors as $id=>$backend_error) {
+ error_log($backend_error);
+ }
+ }
+ break; // stop running through chain
}
- }
-
- if ($send_succseed == 0) {
- throw new Exception('Error: Was not able to send Notification to user!');
+ // backend sucseeded
+ $user_notified = true;
+ if($action == 'stop' || $action == 'fail') { break; } // stop running through chain
}
}
+ return true;
}
/**
@@ -128,27 +320,54 @@ final class notification {
public function get_receivers() {
return $this->receivers;
}
-
+
/**
- * Small helper function to just send a message
+ * this function creates an array with the message as plaintext and html
*
- * @abstract To stay php4 compatible for the 1.4 release we don't
- * throw exeptions here. This behaviour will change after 1.4!
- * @param array $receivers
* @param string $message
- * @return string
+ * @param array $links
+ * @return array $messages
*/
- public static function notify( array $_receivers, $_message ) {
- $notification = new notification();
- $notification->set_receivers( $_receivers );
- $notification->set_message( $_message );
- try{
- $notification->send();
+ private function create_messages($_message, $_links = false) {
+ $messages = array();
+ $messages['plain'] = array();
+ $messages['html'] = array();
+
+ $messages['plain']['text'] = $_message;
+ $messages['html']['text'] = nl2br($_message);
+ if(is_array($_links)) {
+ foreach($_links as $link) {
+ $params = '';
+ foreach($link->params as $param => $value) {
+ $params.='&'.$param.'='.$value;
+ }
+ $url = $GLOBALS['egw_info']['server']['webserver_url'].'/index.php?menuaction='.$link->menuaction.$params;
+ $menuaction_arr = explode('.',$link->menuaction);
+ $application = $menuaction_arr[0];
+ $image = $application ? $this->html->image($application,'navbar',$link->text,'align="middle"').' ' : '';
+ $messages['plain']['link_internal'] .= "\n".$url;
+ $messages['plain']['link_external'] .= "\n".$url.'&no_popup=1';
+ $messages['html']['link_internal'] .= '
'.$image.$link->text.'';
+ $messages['html']['link_external'] .= '
'.$link->text.'';
+ $messages['html']['link_jspopup'] .= '
'
+ .'low: just display the notification bell in the topmenu - topmenu must be enabled !
'
+ .'medium: bring notification window to front
'
+ .'high: bring notification window to front and let the browser do something to announce itself',
+ 'xmlrpc' => True,
+ 'admin' => False
+ ),
+ 'external_mailclient' => array(
+ 'type' => 'check',
+ 'label' => 'Optimize E-Mails for external mail client',
+ 'name' => 'external_mailclient',
+ 'help' => 'If set, embedded links get rendered special for external clients',
+ 'xmlrpc' => True,
+ 'admin' => False
+ ),
+);
+?>
\ No newline at end of file
diff --git a/notifications/js/notificationajaxpopup.js b/notifications/js/notificationajaxpopup.js
index aeb51dabf5..012850cd22 100644
--- a/notifications/js/notificationajaxpopup.js
+++ b/notifications/js/notificationajaxpopup.js
@@ -8,6 +8,8 @@
* @version $Id$
*/
+var notifymessages = new Array();
+
function notificationwindow_init() {
window.setTimeout("notificationwindow_refresh();", 1000);
}
@@ -22,13 +24,32 @@ function notificationwindow_refresh() {
function notificationwindow_display() {
var notificationwindow;
+ var notificationwindow_message;
notificationwindow = document.getElementById("notificationwindow");
+ notificationwindow_message = document.getElementById("notificationwindow_message");
+ notificationwindow_ok_button = document.getElementById("notificationwindow_ok_button");
notificationwindow.style.display = "inline";
notificationwindow.style.position = "absolute";
notificationwindow.style.width = "500px";
notificationwindow.style.left = screen.availWidth/2 - 250 + "px";
notificationwindow.style.top = screen.availHeight/4 + "px";
notificationwindow.style.height = "100%";
+ notificationwindow_message.innerHTML = notifymessages[0];
+ if(notifymessages.length-1 > 0 ) {
+ notificationwindow_ok_button.value = "OK (" + (notifymessages.length-1) + ")";
+ } else {
+ notificationwindow_ok_button.value = "OK";
+ }
+}
+
+function notificationbell_switch(mode) {
+ var notificationbell;
+ notificationbell = document.getElementById("notificationbell");
+ if(mode == "active") {
+ notificationbell.style.display = "inline";
+ } else {
+ notificationbell.style.display = "none";
+ }
}
function notificationwindow_button_ok() {
@@ -36,6 +57,16 @@ function notificationwindow_button_ok() {
var notificationwindow_message;
notificationwindow = document.getElementById("notificationwindow");
notificationwindow_message = document.getElementById("notificationwindow_message");
- notificationwindow.style.display = "none";
- notificationwindow_message.innerHTML = "";
+ notifymessages.shift();
+ if(notifymessages.length > 0) {
+ notificationwindow_display();
+ } else {
+ notificationwindow.style.display = "none";
+ notificationwindow_message.innerHTML = "";
+ notificationbell_switch("inactive");
+ }
+}
+
+function append_notification_message(_message) {
+ notifymessages.push(_message);
}
\ No newline at end of file
diff --git a/notifications/setup/setup.inc.php b/notifications/setup/setup.inc.php
index b1525dda97..6047b95ab2 100644
--- a/notifications/setup/setup.inc.php
+++ b/notifications/setup/setup.inc.php
@@ -32,6 +32,8 @@ $setup_info[NOTIFICATION_APP]['description'] =
/* The hooks this app includes, needed for hooks registration */
$setup_info[NOTIFICATION_APP]['hooks'][] = 'after_navbar';
$setup_info[NOTIFICATION_APP]['hooks'][] = 'preferences';
+$setup_info[NOTIFICATION_APP]['hooks'][] = 'settings';
+$setup_info[NOTIFICATION_APP]['hooks'][] = 'admin';
//$setup_info[NOTIFICATION_APP]['hooks']['settings'] = NOTIFICATION_APP.'.ts_admin_prefs_sidebox_hooks.settings';
//$setup_info[NOTIFICATION_APP]['hooks']['admin'] = NOTIFICATION_APP.'.ts_admin_prefs_sidebox_hooks.all_hooks';
//$setup_info[NOTIFICATION_APP]['hooks']['sidebox_menu'] = NOTIFICATION_APP.'.ts_admin_prefs_sidebox_hooks.all_hooks';
diff --git a/notifications/templates/default/config.tpl b/notifications/templates/default/config.tpl
new file mode 100644
index 0000000000..396d9cc3dc
--- /dev/null
+++ b/notifications/templates/default/config.tpl
@@ -0,0 +1,43 @@
+
+
+
diff --git a/notifications/templates/default/images/notificationbell.gif b/notifications/templates/default/images/notificationbell.gif
new file mode 100644
index 0000000000..b8cd941a39
Binary files /dev/null and b/notifications/templates/default/images/notificationbell.gif differ
diff --git a/phpgwapi/inc/class.egw_framework.inc.php b/phpgwapi/inc/class.egw_framework.inc.php
index ce2aa6e4c9..592fafdc03 100644
--- a/phpgwapi/inc/class.egw_framework.inc.php
+++ b/phpgwapi/inc/class.egw_framework.inc.php
@@ -400,6 +400,21 @@ class egw_framework
return $GLOBALS['egw']->html->select('quick_add','',$options,true,$options=' onchange="eval(this.value); this.value=0; return false;"');
}
+ function _get_notification_bell() {
+ if (!is_object($GLOBALS['egw']->html))
+ {
+ require_once(EGW_API_INC.'/class.html.inc.php');
+ $GLOBALS['egw']->html =& new html();
+ }
+ return $GLOBALS['egw']->html->div( $GLOBALS['egw']->html->a_href( $GLOBALS['egw']->html->image('notifications','notificationbell',lang('notifications')),
+ 'javascript: notificationwindow_display();'
+ ),
+ 'id="notificationbell"', // options
+ '', // class
+ 'display: none' //style
+ );
+ }
+
/**
* Prepare an array with apps used to render the navbar
diff --git a/phpgwapi/templates/idots/class.idots_framework.inc.php b/phpgwapi/templates/idots/class.idots_framework.inc.php
index 3093593b0a..94a8ef1b1b 100644
--- a/phpgwapi/templates/idots/class.idots_framework.inc.php
+++ b/phpgwapi/templates/idots/class.idots_framework.inc.php
@@ -606,33 +606,37 @@
*/
function topmenu()
{
- $this->tplsav2->menuitems = array();
- $this->tplsav2->menuinfoitems = array();
+ $this->tplsav2->menuitems = array();
+ $this->tplsav2->menuinfoitems = array();
- $this->apps = $this->_get_navbar_apps();
+ $this->apps = $this->_get_navbar_apps();
- $this->_add_topmenu_item('home');
+ $this->_add_topmenu_item('home');
- if($GLOBALS['egw_info']['user']['apps']['preferences'])
- {
+ if($GLOBALS['egw_info']['user']['apps']['preferences'])
+ {
$this->_add_topmenu_item('preferences');
- }
+ }
- if($GLOBALS['egw_info']['user']['apps']['manual'] && $this->apps['manual'])
- {
- $this->_add_topmenu_item('manual');
- }
+ if($GLOBALS['egw_info']['user']['apps']['manual'] && $this->apps['manual'])
+ {
+ $this->_add_topmenu_item('manual');
+ }
- //$this->_add_topmenu_item('about',lang('About %1',$GLOBALS['egw_info']['apps'][$GLOBALS['egw_info']['flags']['currentapp']]['title']));
- $this->_add_topmenu_item('logout');
+ //$this->_add_topmenu_item('about',lang('About %1',$GLOBALS['egw_info']['apps'][$GLOBALS['egw_info']['flags']['currentapp']]['title']));
+ $this->_add_topmenu_item('logout');
- $this->tplsav2->assign('info_icons',$this->topmenu_icon_arr);
+ $this->tplsav2->assign('info_icons',$this->topmenu_icon_arr);
- $this->_add_topmenu_info_item($this->_user_time_info());
- $this->_add_topmenu_info_item($this->_current_users());
- $this->_add_topmenu_info_item($this->_get_quick_add());
+ if($GLOBALS['egw_info']['user']['apps']['notifications'])
+ {
+ $this->_add_topmenu_info_item($this->_get_notification_bell());
+ }
+ $this->_add_topmenu_info_item($this->_user_time_info());
+ $this->_add_topmenu_info_item($this->_current_users());
+ $this->_add_topmenu_info_item($this->_get_quick_add());
- return $this->tplsav2->fetch('topmenu.tpl.php');
+ return $this->tplsav2->fetch('topmenu.tpl.php');
}
/**
diff --git a/phpgwapi/templates/jerryr/class.jerryr_framework.inc.php b/phpgwapi/templates/jerryr/class.jerryr_framework.inc.php
index 2605560831..65024cc7bd 100644
--- a/phpgwapi/templates/jerryr/class.jerryr_framework.inc.php
+++ b/phpgwapi/templates/jerryr/class.jerryr_framework.inc.php
@@ -31,39 +31,40 @@ class jerryr_framework extends idots_framework
}
function topmenu()
-
{
- $this->tplsav2->menuitems = array();
- $this->tplsav2->menuinfoitems = array();
+ $this->tplsav2->menuitems = array();
+ $this->tplsav2->menuinfoitems = array();
- $this->apps = $this->_get_navbar_apps();
+ $this->apps = $this->_get_navbar_apps();
- $this->_add_topmenu_item('home');
+ $this->_add_topmenu_item('home');
- /*if($GLOBALS['egw_info']['user']['apps']['manual'])
- {
- $this->_add_topmenu_item('manual');
- }
- */
- if($GLOBALS['egw_info']['user']['apps']['preferences'])
- {
- $this->_add_topmenu_item('preferences');
- }
+ /*if($GLOBALS['egw_info']['user']['apps']['manual'])
+ {
+ $this->_add_topmenu_item('manual');
+ }
+ */
+ if($GLOBALS['egw_info']['user']['apps']['preferences'])
+ {
+ $this->_add_topmenu_item('preferences');
+ }
if($GLOBALS['egw_info']['user']['apps']['manual'] && $this->apps['manual'])
{
$this->_add_topmenu_item('manual');
}
- //$this->_add_topmenu_item('about',lang('About %1',$GLOBALS['egw_info']['apps'][$GLOBALS['egw_info']['flags']['currentapp']]['title']));
- $this->_add_topmenu_item('logout');
+ //$this->_add_topmenu_item('about',lang('About %1',$GLOBALS['egw_info']['apps'][$GLOBALS['egw_info']['flags']['currentapp']]['title']));
+ $this->_add_topmenu_item('logout');
- $this->tplsav2->assign('info_icons',$this->topmenu_icon_arr);
+ $this->tplsav2->assign('info_icons',$this->topmenu_icon_arr);
- $this->_add_topmenu_info_item($this->_user_time_info());
- $this->_add_topmenu_info_item($this->_current_users());
- $this->_add_topmenu_info_item($this->_get_quick_add());
+ if($GLOBALS['egw_info']['user']['apps']['notifications'])
+ {
+ $this->_add_topmenu_info_item($this->_get_notification_bell());
+ }
+ $this->_add_topmenu_info_item($this->_user_time_info());
+ $this->_add_topmenu_info_item($this->_current_users());
+ $this->_add_topmenu_info_item($this->_get_quick_add());
- $this->tplsav2->display('topmenu.tpl.php');
- }
-
-
+ $this->tplsav2->display('topmenu.tpl.php');
+ }
}