From 1a168696515e5a011b49ddae0fef6052964628c0 Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 16 May 2016 17:26:15 -0600 Subject: [PATCH] Add missing conversion to human values --- calendar/inc/class.calendar_merge.inc.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/calendar/inc/class.calendar_merge.inc.php b/calendar/inc/class.calendar_merge.inc.php index 9c32d12a5f..bbe9a27769 100644 --- a/calendar/inc/class.calendar_merge.inc.php +++ b/calendar/inc/class.calendar_merge.inc.php @@ -245,6 +245,19 @@ class calendar_merge extends Api\Storage\Merge } else { $event = $id; } + + $record = new calendar_egw_record($event['id']); + + // Convert to human friendly values + $types = calendar_egw_record::$types; + importexport_export_csv::convert($record, $types, 'calendar'); + + $array = $record->get_record_array(); + foreach($array as $key => $value) + { + $replacements['$$'.($prefix?$prefix.'/':'').$key.'$$'] = $value; + } + $replacements['$$' . ($prefix ? $prefix . '/' : '') . 'calendar_id'. '$$'] = $event['id']; foreach($this->bo->event2array($event) as $name => $data) { @@ -306,12 +319,6 @@ class calendar_merge extends Api\Storage\Merge $this->cf_link_to_expand($event, $content, $replacements); } - $custom = Api\Storage\Customfields::get('calendar'); - foreach(array_keys($custom) as $name) - { - $replacements['$$'.($prefix?$prefix.'/':'').'#'.$name.'$$'] = $event['#'.$name]; - } - // Links $replacements += $this->get_all_links('calendar', $event['id'], $prefix, $content);