From c59c0fe22f8be9daf84288d8d0a676ba6883ed3f Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 17 Apr 2012 16:37:38 +0000 Subject: [PATCH] Human value lookups for priority, type & status --- infolog/inc/class.infolog_egw_record.inc.php | 1 + infolog/inc/class.infolog_export_csv.inc.php | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/infolog/inc/class.infolog_egw_record.inc.php b/infolog/inc/class.infolog_egw_record.inc.php index 85e961075d..428d0539b3 100644 --- a/infolog/inc/class.infolog_egw_record.inc.php +++ b/infolog/inc/class.infolog_egw_record.inc.php @@ -25,6 +25,7 @@ class infolog_egw_record implements importexport_iface_egw_record // Used in conversions static $types = array( 'select-account' => array('info_owner','info_responsible','modifier'), + 'select' => array('info_priority', 'info_type', 'info_status'), 'date-time' => array('info_startdate', 'info_enddate','info_datecompleted', 'info_datemodified','created','last_event','next_event'), 'select-cat' => array('info_cat', 'cat_id'), 'links' => array('info_link_id'), diff --git a/infolog/inc/class.infolog_export_csv.inc.php b/infolog/inc/class.infolog_export_csv.inc.php index 71a7ba98b8..ebc032c382 100644 --- a/infolog/inc/class.infolog_export_csv.inc.php +++ b/infolog/inc/class.infolog_export_csv.inc.php @@ -30,6 +30,12 @@ class infolog_export_csv implements importexport_iface_export_plugin { $query = array(); $cf_links = array(); + if(!$this->selects) + { + $this->selects['info_type'] = $bo->enums['type']; + $this->selects['info_priority'] = $bo->enums['priority']; + } + $export_object = new importexport_export_csv($_stream, (array)$options); $export_object->set_mapping($options['mapping']); @@ -123,8 +129,15 @@ class infolog_export_csv implements importexport_iface_export_plugin { } // Some conversion if($options['convert']) { - importexport_export_csv::convert($record, infolog_egw_record::$types, 'infolog'); + $this->selects['info_status'] = $bo->status[$record->info_type]; + importexport_export_csv::convert($record, infolog_egw_record::$types, 'infolog', $this->selects); $this->convert($record); + + // Force 0 times to '' + foreach(array('info_planned_time', 'info_used_time', 'info_replanned_time') as $field) + { + if($record->$field == 0) $record->$field = ''; + } } else { // Implode arrays, so they don't say 'Array' foreach($record->get_record_array() as $key => $value) {