From 895dfe26c68a283c448c54538e8d1bcbad3ccf45 Mon Sep 17 00:00:00 2001 From: Christian Binder Date: Thu, 29 Nov 2007 18:31:24 +0000 Subject: [PATCH] make calendar aware of possibly missing notification app. if notification app is missing, print an error to php log. --- calendar/inc/class.bocalupdate.inc.php | 32 +++++++++++++++----------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/calendar/inc/class.bocalupdate.inc.php b/calendar/inc/class.bocalupdate.inc.php index 9f9d1156c3..d5fef65197 100644 --- a/calendar/inc/class.bocalupdate.inc.php +++ b/calendar/inc/class.bocalupdate.inc.php @@ -594,20 +594,24 @@ class bocalupdate extends bocal break; } // send via notification_app - require_once(EGW_INCLUDE_ROOT. '/notifications/inc/class.notification.inc.php'); - try { - $notification = new notification(); - $notification->set_receivers(array($userid)); - $notification->set_message($body); - $notification->set_sender($senderid); - $notification->set_subject($subject); - $notification->set_links(array($details['link_arr'])); - if(is_array($attachment)) { $notification->set_attachments(array($attachment)); } - $notification->send(); - } - catch (Exception $exception) { - error_log('error while notifying user '.$userid.':'.$exception->getMessage()); - continue; + if($GLOBALS['egw_info']['apps']['notifications']['enabled']) { + require_once(EGW_INCLUDE_ROOT. '/notifications/inc/class.notification.inc.php'); + try { + $notification = new notification(); + $notification->set_receivers(array($userid)); + $notification->set_message($body); + $notification->set_sender($senderid); + $notification->set_subject($subject); + $notification->set_links(array($details['link_arr'])); + if(is_array($attachment)) { $notification->set_attachments(array($attachment)); } + $notification->send(); + } + catch (Exception $exception) { + error_log('error while notifying user '.$userid.':'.$exception->getMessage()); + continue; + } + } else { + error_log('calendar: cannot send any notifications because notification-app is not installed'); } } }