diff --git a/timesheet/inc/class.timesheet_egw_record.inc.php b/timesheet/inc/class.timesheet_egw_record.inc.php index cf74b86fdc..dd1603b823 100644 --- a/timesheet/inc/class.timesheet_egw_record.inc.php +++ b/timesheet/inc/class.timesheet_egw_record.inc.php @@ -33,7 +33,7 @@ class timesheet_egw_record implements importexport_iface_egw_record public function __construct( $_identifier='' ){ $this->identifier = $_identifier; $this->botimesheet = new timesheet_bo(); - $this->timesheetentry = $this->botimesheet->read($this->identifier); + $this->set_record($this->botimesheet->read($this->identifier)); } /** @@ -88,6 +88,14 @@ class timesheet_egw_record implements importexport_iface_egw_record */ public function set_record(array $_record){ $this->timesheetentry = $_record; + // Check for linked project ID + if($this->timesheetentry['ts_project']) { + $links = egw_link::get_links('timesheet', $_record['ts_id'], 'projectmanager'); + foreach($links as $link_id => $app_id) { + $this->timesheetentry['pm_id'] = $app_id; + break; + } + } } /** diff --git a/timesheet/inc/class.timesheet_export_csv.inc.php b/timesheet/inc/class.timesheet_export_csv.inc.php index b886b2bedd..1584ee08d8 100644 --- a/timesheet/inc/class.timesheet_export_csv.inc.php +++ b/timesheet/inc/class.timesheet_export_csv.inc.php @@ -53,6 +53,9 @@ class timesheet_export_csv implements importexport_iface_export_plugin { $lookups = array( 'ts_status' => $uitimesheet->status_labels+array(lang('No status')) ); + foreach($lookups['ts_status'] as &$status) { + $status = html_entity_decode($status); // Remove   + } // $options['selection'] is array of identifiers as this plugin doesn't // support other selectors atm. @@ -60,6 +63,8 @@ class timesheet_export_csv implements importexport_iface_export_plugin { $record = new timesheet_egw_record($identifier); if($options['convert']) { importexport_export_csv::convert($record, self::$types, 'timesheet', $lookups); + // Special handling because it's added, not a custom field + if($record->pm_id) $record->pm_id = egw_link::title('projectmanager', $record->pm_id); } else { // Implode arrays, so they don't say 'Array' foreach($record->get_record_array() as $key => $value) {