diff --git a/calendar/inc/class.calendar_merge.inc.php b/calendar/inc/class.calendar_merge.inc.php index b48b2ed84e..452f66f1fb 100644 --- a/calendar/inc/class.calendar_merge.inc.php +++ b/calendar/inc/class.calendar_merge.inc.php @@ -185,6 +185,28 @@ class calendar_merge extends bo_merge if (substr($name,-4) == 'date') $name = substr($name,0,-4); $replacements['$$' . ($prefix ? $prefix . '/' : '') . 'calendar_'.$name . '$$'] = is_array($data['data']) ? implode(', ',$data['data']) : $data['data']; } + // Add seperate lists of participants by type + if(strpos($content, 'calendar_participants/')!== false) + { + $types = array(); + foreach($this->bo->resources as $resource) + { + $types[$resource['app']] = array(); + } + foreach($event['participants'] as $uid => $status) + { + $type = $this->bo->resources[$uid[0]]['app']; + if($type == 'home-accounts') + { + $type = ($GLOBALS['egw']->accounts->get_type($uid) == 'g' ? 'group' : 'account'); + } + $types[$type][] = $this->bo->participant_name($uid); + } + foreach($types as $t_id => $type) + { + $replacements['$$'.($prefix ? $prefix . '/' : '') . "calendar_participants/{$t_id}$$"] = implode(', ',$type); + } + } if(!$replacements['$$'.($prefix ? $prefix . '/' : '') . 'calendar_recur_type$$']) { // Need to set it to '' if not set or previous record may be used @@ -567,6 +589,18 @@ class calendar_merge extends bo_merge echo '