From d6358a2a6a31e2776e3074071547692b6d3aedd4 Mon Sep 17 00:00:00 2001 From: e107steved Date: Mon, 28 Dec 2009 22:16:54 +0000 Subject: [PATCH] more notice removal --- e107_admin/notify.php | 15 ++++++++++--- e107_handlers/notify_class.php | 28 ++++++++++++++++++++----- e107_plugins/calendar_menu/e_notify.php | 8 +++---- 3 files changed, 39 insertions(+), 12 deletions(-) diff --git a/e107_admin/notify.php b/e107_admin/notify.php index df9a020b3..87daf5916 100644 --- a/e107_admin/notify.php +++ b/e107_admin/notify.php @@ -9,11 +9,19 @@ * * * $Source: /cvs_backup/e107_0.8/e107_admin/notify.php,v $ - * $Revision: 1.12 $ - * $Date: 2009-11-27 21:42:46 $ + * $Revision: 1.13 $ + * $Date: 2009-12-28 22:16:54 $ * $Author: e107steved $ */ +/** + * @package e107 + * @subpackage admin + * @version $Id: notify.php,v 1.13 2009-12-28 22:16:54 e107steved Exp $; + * + * 'Notify' admin page - selects action on various events + */ + require_once('../class2.php'); if (!getperms('O')) { @@ -70,6 +78,7 @@ class notify_config $this -> notify_prefs = $sysprefs -> get('notify_prefs'); $this -> notify_prefs = $eArrayStorage -> ReadArray($this -> notify_prefs); + $recalibrate = FALSE; // load every e_notify.php file. if($pref['e_notify_list']) { @@ -209,7 +218,7 @@ class notify_config function render_event($id, $description) { global $rs, $tp, $uc; - $text .= " + $text = " ".$description.": diff --git a/e107_handlers/notify_class.php b/e107_handlers/notify_class.php index 23e6bf971..c48fc9b35 100644 --- a/e107_handlers/notify_class.php +++ b/e107_handlers/notify_class.php @@ -9,12 +9,20 @@ * Forum plugin notify configuration * * $Source: /cvs_backup/e107_0.8/e107_handlers/notify_class.php,v $ -* $Revision: 1.10 $ -* $Date: 2009-11-27 21:42:46 $ +* $Revision: 1.11 $ +* $Date: 2009-12-28 22:16:54 $ * $Author: e107steved $ * */ +/** + * @package e107 + * @subpackage e107_handlers + * @version $Id: notify_class.php,v 1.11 2009-12-28 22:16:54 e107steved Exp $; + * + * Handler for 'notify' events - sends email notifications to the appropriate user groups + */ + if (!defined('e107_INIT')) { exit; } class notify @@ -52,8 +60,10 @@ class notify * @param string $subject - subject for email * @param string $message - email message body * @return none + * + * @todo handle 'everyone except' clauses (email address filter done) + * @todo set up pref to not notify originator of event which caused notify (see $blockOriginator) */ - // TODO: handle 'everyone except' clauses (email address filter done) function send($id, $subject, $message) { $e107 = e107::getInstance(); @@ -66,6 +76,7 @@ class notify { $emailFilter = $this->notify_prefs['event'][$id]['email']; } + $blockOriginator = FALSE; // TODO: set this using a pref if (is_numeric($this -> notify_prefs['event'][$id]['class'])) { switch ($notifyTarget) @@ -84,6 +95,10 @@ class notify break; } $qry = 'SELECT user_id,user_name,user_email FROM `#user` WHERE '.$qry; + if ($blockOriginator) + { + $qry .= ' AND `user_id` != '.USERID; + } if (FALSE !== ($count = $e107->sql->db_Select_gen($qry))) { if ($count <= 5) @@ -155,8 +170,11 @@ class notify } elseif ($notifyTarget == 'email') { // Single email address - that can always go immediately - e107_require_once(e_HANDLER.'mail.php'); - sendemail($this->notify_prefs['event'][$id]['email'], $subject, $message); + if (!$blockOriginator || ($this->notify_prefs['event'][$id]['email'] != USEREMAIL)) + { + e107_require_once(e_HANDLER.'mail.php'); + sendemail($this->notify_prefs['event'][$id]['email'], $subject, $message); + } } } } diff --git a/e107_plugins/calendar_menu/e_notify.php b/e107_plugins/calendar_menu/e_notify.php index fb0789947..33f595d67 100644 --- a/e107_plugins/calendar_menu/e_notify.php +++ b/e107_plugins/calendar_menu/e_notify.php @@ -9,8 +9,8 @@ * * * $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/e_notify.php,v $ - * $Revision: 1.5 $ - * $Date: 2009-12-20 22:47:28 $ + * $Revision: 1.6 $ + * $Date: 2009-12-28 22:16:54 $ * $Author: e107steved $ */ @@ -19,14 +19,14 @@ * * @package e107_plugins * @subpackage event_calendar - * @version $Id: e_notify.php,v 1.5 2009-12-20 22:47:28 e107steved Exp $; + * @version $Id: e_notify.php,v 1.6 2009-12-28 22:16:54 e107steved Exp $; */ if (!defined('e107_INIT')) { exit; } if(defined('ADMIN_PAGE') && ADMIN_PAGE === true) { - include_lan(e_PLUGIN.'calendar_menu/languages/'.e_LANGUAGE.'.php'); + include_lan(e_PLUGIN.'calendar_menu/languages/'.e_LANGUAGE.'_class.php'); $config_category = NT_LAN_EC_1; $config_events = array('ecalnew' => NT_LAN_EC_7, 'ecaledit' => NT_LAN_EC_2); }