From 9ab9397af74aa403dceb438a6f438508ae4f3a1c Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 4 Nov 2010 17:27:08 +0000 Subject: [PATCH] Format CSV export data from internal/numeric format into something a little more friendly for normal people --- calendar/inc/class.calendar_egw_record.inc.php | 4 ++-- calendar/inc/class.calendar_export_csv.inc.php | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_egw_record.inc.php b/calendar/inc/class.calendar_egw_record.inc.php index f52c96f65f..757255a623 100644 --- a/calendar/inc/class.calendar_egw_record.inc.php +++ b/calendar/inc/class.calendar_egw_record.inc.php @@ -44,7 +44,7 @@ class calendar_egw_record implements importexport_iface_egw_record * @param string $_attribute_name */ public function __get($_attribute_name) { - + return $this->record[$_attribute_name]; } /** @@ -54,7 +54,7 @@ class calendar_egw_record implements importexport_iface_egw_record * @param data $data */ public function __set($_attribute_name, $data) { - + $this->record[$_attribute_name] = $data; } /** diff --git a/calendar/inc/class.calendar_export_csv.inc.php b/calendar/inc/class.calendar_export_csv.inc.php index 9ad98d4a1e..85d9b46c0d 100644 --- a/calendar/inc/class.calendar_export_csv.inc.php +++ b/calendar/inc/class.calendar_export_csv.inc.php @@ -36,12 +36,23 @@ class calendar_export_csv implements importexport_iface_export_plugin { $export_object = new importexport_export_csv($_stream, (array)$options); $export_object->set_mapping($options['mapping']); + $convert_fields = importexport_export_csv::$types; + $convert_fields['date-time'][] = 'start'; + $convert_fields['date-time'][] = 'end'; + // $options['selection'] is array of identifiers as this plugin doesn't // support other selectors atm. $record = new calendar_egw_record(); foreach ($events as $event) { + // Add in participants + if($options['mapping']['participants']) { + $event['participants'] = implode(", ",$this->bo->participants($event,true)); + } + $record->set_record($event); + // Standard stuff + importexport_export_csv::convert($record, $convert_fields, 'calendar'); $export_object->export_record($record); } unset($record);