From 163ca54a1e54e85f4df16b86687ff0f6f71b6722 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 9 Nov 2010 19:27:13 +0000 Subject: [PATCH] Convert recurrence type and interval to human friendly values --- calendar/inc/class.calendar_export_csv.inc.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/calendar/inc/class.calendar_export_csv.inc.php b/calendar/inc/class.calendar_export_csv.inc.php index 85d9b46c0d..d02f639cc4 100644 --- a/calendar/inc/class.calendar_export_csv.inc.php +++ b/calendar/inc/class.calendar_export_csv.inc.php @@ -31,15 +31,16 @@ class calendar_export_csv implements importexport_iface_export_plugin { 'enum_recuring' => false, 'daywise' => false, 'owner' => $options['owner'], - 'date_format' => $options['date_format'], )); $export_object = new importexport_export_csv($_stream, (array)$options); $export_object->set_mapping($options['mapping']); $convert_fields = importexport_export_csv::$types; + $convert_fields['select-account'][] = 'owner'; $convert_fields['date-time'][] = 'start'; $convert_fields['date-time'][] = 'end'; + $recurrence = $this->bo->recur_types; // $options['selection'] is array of identifiers as this plugin doesn't // support other selectors atm. @@ -51,8 +52,14 @@ class calendar_export_csv implements importexport_iface_export_plugin { } $record->set_record($event); + if($options['mapping']['recurrence']) { + $record->recurrence = $recurrence[$record->recur_type]; + if($record->recur_type != MCAL_RECUR_NONE) $record->recurrence .= ' / '. $record->recur_interval; + } + // Standard stuff importexport_export_csv::convert($record, $convert_fields, 'calendar'); + $export_object->export_record($record); } unset($record);