From 472adc39d61a27b0fbd24737636a80f42af64e6d Mon Sep 17 00:00:00 2001 From: nathangray Date: Fri, 2 Mar 2018 11:13:18 -0700 Subject: [PATCH] * Calendar - Fix exporting CSV from search results exported owner as participants --- calendar/inc/class.calendar_export_csv.inc.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/calendar/inc/class.calendar_export_csv.inc.php b/calendar/inc/class.calendar_export_csv.inc.php index 3e353a7ec2..bb78f26d8c 100644 --- a/calendar/inc/class.calendar_export_csv.inc.php +++ b/calendar/inc/class.calendar_export_csv.inc.php @@ -84,7 +84,7 @@ class calendar_export_csv implements importexport_iface_export_plugin { if($states['view'] == 'listview') { $ui->get_rows($query, $events, $unused); - } + } else { $query['filter'] = 'custom'; @@ -147,7 +147,15 @@ class calendar_export_csv implements importexport_iface_export_plugin { // Add in participants if($options['mapping']['participants']) { - $event['participants'] = implode(", ",$this->bo->participants($event,true)); + if(is_array($event['participants'])) + { + $event['participants'] = implode(", ",$this->bo->participants($event,true)); + } + else + { + // Getting results from list already has participants formatted + $event['participants'] = str_replace("\n", ' ', $event['participants']); + } } if (is_array($event)) { @@ -229,10 +237,10 @@ class calendar_export_csv implements importexport_iface_export_plugin { { $states = $this->bo->cal_prefs['saved_states']; $list = Api\Cache::getSession('calendar', 'calendar_list'); - + $start= new Api\DateTime($list['startdate']); $end = new Api\DateTime($list['enddate']); - + if ($states['view'] == 'listview') { $list = Api\Cache::getSession('calendar', 'calendar_list');