diff --git a/calendar/inc/class.calendar_hooks.inc.php b/calendar/inc/class.calendar_hooks.inc.php index 924ab2931c..28e46436ad 100644 --- a/calendar/inc/class.calendar_hooks.inc.php +++ b/calendar/inc/class.calendar_hooks.inc.php @@ -184,6 +184,10 @@ class calendar_hooks 45 => '45', 60 => '60' ); + $default_participants = array( + 0 => lang('Just me'), + 'selected' => lang('Selected users/groups') + ); $defaultresource_sel = array( 'resources_conflict' => lang('resources with conflict detection'), 'resources_without_conflict' => lang('resources except conflicting ones'), @@ -383,6 +387,16 @@ class calendar_hooks 'admin' => False, 'default'=> 60, ), + 'default_participant' => array( + 'type' => 'select', + 'label' => 'New event participants', + 'name' => 'default_participant', + 'values'=> $default_participants, + 'help' => 'Participants automatically added to new events', + 'default' => 0, + 'xmlrpc' => False, + 'admin' => False + ), 'default-alarm' => array( 'type' => 'date-duration',//'select', 'label' => lang('Default alarm for regular events').' ('.lang('empty = no alarm').')', diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index 572bb3edf7..c54705a9ef 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -87,7 +87,7 @@ class calendar_uiforms extends calendar_ui } else { - $owner = $this->owner; + $owner = !$this->cal_prefs['default_participant'] ? $this->user : $this->owner; } if (!$owner || !is_numeric($owner) || $GLOBALS['egw']->accounts->get_type($owner) != 'u' || @@ -116,9 +116,6 @@ class calendar_uiforms extends calendar_ui } //error_log("this->owner=$this->owner, _GET[owner]=$_GET[owner], user=$this->user => owner=$owner, extra_participants=".implode(',',$extra_participants).")"); - // by default include the owner as participant (the user can remove him) - $extra_participants[] = $owner; - if(isset($_GET['start'])) { $start = egw_time::to($_GET['start'], 'ts'); @@ -168,8 +165,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']);