From 9f3f96e502c16f8978e8b46373467a44c97c6b43 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 23 Feb 2011 20:48:57 +0000 Subject: [PATCH] Fix missing custom fields --- calendar/inc/class.calendar_export_csv.inc.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_export_csv.inc.php b/calendar/inc/class.calendar_export_csv.inc.php index 300801a80e..694d7c28b2 100644 --- a/calendar/inc/class.calendar_export_csv.inc.php +++ b/calendar/inc/class.calendar_export_csv.inc.php @@ -24,14 +24,27 @@ class calendar_export_csv implements importexport_iface_export_plugin { public function export( $_stream, importexport_definition $_definition) { $options = $_definition->plugin_options; $this->bo = new calendar_bo(); - $events =& $this->bo->search(array( + + // Custom fields need to be specifically requested + $cfs = array(); + foreach($options['mapping'] as $key => $label) { + if($key[0] == '#') $cfs[] = substr($key,1); + } + $query = array( 'start' => $options['selection']['start'], 'end' => $options['selection']['end'], 'categories' => $options['categories'] ? $options['categories'] : $options['selection']['categories'], 'enum_recuring' => false, 'daywise' => false, 'owner' => $options['owner'], - )); + 'cfs' => $cfs // Otherwise we shouldn't get any custom fields + ); + $config = config::read('phpgwapi'); + if($config['export_limit']) { + $query['offset'] = 0; + $query['num_rows'] = (int)$config['export_limit']; + } + $events =& $this->bo->search($query); $export_object = new importexport_export_csv($_stream, (array)$options); $export_object->set_mapping($options['mapping']);