From f6a6412d25f869e90bff9010eaedb442a03d0cb8 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 27 Jun 2018 20:22:04 +0200 Subject: [PATCH] also show external organiser in textual replies and remove him from participants --- calendar/inc/class.calendar_boupdate.inc.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_boupdate.inc.php b/calendar/inc/class.calendar_boupdate.inc.php index 8ec4779195..789c0421e4 100644 --- a/calendar/inc/class.calendar_boupdate.inc.php +++ b/calendar/inc/class.calendar_boupdate.inc.php @@ -79,7 +79,7 @@ class calendar_boupdate extends calendar_bo * @var array id => data */ protected static $tz_cache = array(); - + /** * The resources storage object * @var resources_so $resources_so @@ -94,7 +94,7 @@ class calendar_boupdate extends calendar_bo if ($this->debug > 0) $this->debug_message('calendar_boupdate::__construct() started',True); parent::__construct(); // calling the parent constructor - + $this->resources_so = new resources_so(); if ($this->debug > 0) $this->debug_message('calendar_boupdate::__construct() finished',True); @@ -1941,7 +1941,21 @@ class calendar_boupdate extends calendar_bo if (isset($event['participants']) && is_array($event['participants']) && !empty($event['participants'])) { $participants = $this->participants($event,true); + + // fix external organiser to not be included as participant and shown as organiser + foreach($event['participants'] as $uid => $status) + { + $role = $quantity = null; + calendar_so::split_status($status, $quantity, $role); + if ($role == 'CHAIR' && $status == 'D' && !is_numeric($uid)) + { + $var['owner']['data'] = $this->participant_name($uid); + unset($participants[$uid]); + break; + } + } } + $var['participants'] = Array( 'field' => lang('Participants'), 'data' => $participants