From 3d865efa389ac7cd665541fb2e5eba5809a6ce89 Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 28 Oct 2019 15:29:36 -0600 Subject: [PATCH] * Calendar: New preference for notifications about events you created, but are not a participant in --- calendar/inc/class.calendar_boupdate.inc.php | 5 +++++ calendar/inc/class.calendar_hooks.inc.php | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/calendar/inc/class.calendar_boupdate.inc.php b/calendar/inc/class.calendar_boupdate.inc.php index e0ae8057e8..4031e45bb6 100644 --- a/calendar/inc/class.calendar_boupdate.inc.php +++ b/calendar/inc/class.calendar_boupdate.inc.php @@ -632,6 +632,11 @@ class calendar_boupdate extends calendar_bo } else { + // Check if user is not participating, and does not want notifications + if(!$part_prefs['calendar']['receive_not_participating'] && !array_key_exists($userid, $old_event['participants'])) + { + return false; + } switch($ru = $part_prefs['calendar']['receive_updates']) { case 'responses': diff --git a/calendar/inc/class.calendar_hooks.inc.php b/calendar/inc/class.calendar_hooks.inc.php index 9c84924a55..c0d5c8b8d0 100644 --- a/calendar/inc/class.calendar_hooks.inc.php +++ b/calendar/inc/class.calendar_hooks.inc.php @@ -526,6 +526,14 @@ class calendar_hooks 'admin' => False, 'default'=> 'false', ), + 'receive_not_participating' => array( + 'type' => 'select', + 'label' => 'Receive notifications about events you are not a participant in', + 'name' => 'receive_not_participating', + 'values' => $yesno, + 'help' => 'Do you want to be notified about events you created, but are not participating in?', + 'default'=> '1' + ), 'notify_externals' => array( 'type' => 'select', 'label' => 'Notify non-EGroupware users about event updates',