From e38dca3436c4a4dd3f2895c22215295b04f0ec65 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Fri, 10 Dec 2010 22:51:53 +0000 Subject: [PATCH] -Implode arrays when not exporting human-friendly values so they don't say 'Array' - Add standard conversion for human-friendly values --- timesheet/inc/class.timesheet_export_csv.inc.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/timesheet/inc/class.timesheet_export_csv.inc.php b/timesheet/inc/class.timesheet_export_csv.inc.php index edce3d97a4..a35baf0906 100644 --- a/timesheet/inc/class.timesheet_export_csv.inc.php +++ b/timesheet/inc/class.timesheet_export_csv.inc.php @@ -38,9 +38,17 @@ class timesheet_export_csv implements importexport_iface_export_plugin { // $options['selection'] is array of identifiers as this plugin doesn't // support other selectors atm. foreach ($selection as $identifier) { - $timesheetentry = new timesheet_egw_record($identifier); - $export_object->export_record($timesheetentry); - unset($timesheetentry); + $record = new timesheet_egw_record($identifier); + if($options['convert']) { + importexport_export_csv::convert($record, self::$types, 'timesheet'); + } else { + // Implode arrays, so they don't say 'Array' + foreach($record->get_record_array() as $key => $value) { + if(is_array($value)) $record->$key = implode(',', $value); + } + } + $export_object->export_record($record); + unset($record); } }