From 4d0977f8f92119f9b8f59a673a2e83be050acc09 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 5 Jan 2016 22:54:33 +0000 Subject: [PATCH] - Fix inconsistency in participant / owner between planner & weekview - Change default participant default to selected users --- calendar/inc/class.calendar_hooks.inc.php | 2 +- calendar/inc/class.calendar_uiforms.inc.php | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/calendar/inc/class.calendar_hooks.inc.php b/calendar/inc/class.calendar_hooks.inc.php index 0137f9b777..64f05366db 100644 --- a/calendar/inc/class.calendar_hooks.inc.php +++ b/calendar/inc/class.calendar_hooks.inc.php @@ -393,7 +393,7 @@ class calendar_hooks 'name' => 'default_participant', 'values'=> $default_participants, 'help' => 'Participants automatically added to new events', - 'default' => 0, + 'default' => 'selected', 'xmlrpc' => False, 'admin' => False ), diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index c54705a9ef..fa8ad0275e 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -84,6 +84,15 @@ class calendar_uiforms extends calendar_ui if (isset($_GET['owner'])) { $owner = $_GET['owner']; + if(is_array($owner)) + { + $extra_participants += $owner; + $owner = count($owner) > 1 ? $this->user : $owner[0]; + } + else + { + $extra_participants[] = $owner; + } } else { @@ -165,8 +174,8 @@ class calendar_uiforms extends calendar_ui } if (!$participants) // if all participants got removed, include current user { - $participants[$this->user] = $participant_types['u'][$this->user] = calendar_so::combine_status('A',1,'CHAIR'); - } + $participants[$this->user] = $participant_types['u'][$this->user] = calendar_so::combine_status('A',1,'CHAIR'); + } if(isset($_GET['cat_id'])) { $cat_id = explode(',',$_GET['cat_id']);