- Remove html entities from statuses

- Add project ID / name, when set
This commit is contained in:
Nathan Gray 2011-03-29 23:38:22 +00:00
parent ff1b3d3345
commit 83b1f7f39e
2 changed files with 14 additions and 1 deletions

View File

@ -33,7 +33,7 @@ class timesheet_egw_record implements importexport_iface_egw_record
public function __construct( $_identifier='' ){ public function __construct( $_identifier='' ){
$this->identifier = $_identifier; $this->identifier = $_identifier;
$this->botimesheet = new timesheet_bo(); $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){ public function set_record(array $_record){
$this->timesheetentry = $_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;
}
}
} }
/** /**

View File

@ -53,6 +53,9 @@ class timesheet_export_csv implements importexport_iface_export_plugin {
$lookups = array( $lookups = array(
'ts_status' => $uitimesheet->status_labels+array(lang('No status')) '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 // $options['selection'] is array of identifiers as this plugin doesn't
// support other selectors atm. // support other selectors atm.
@ -60,6 +63,8 @@ class timesheet_export_csv implements importexport_iface_export_plugin {
$record = new timesheet_egw_record($identifier); $record = new timesheet_egw_record($identifier);
if($options['convert']) { if($options['convert']) {
importexport_export_csv::convert($record, self::$types, 'timesheet', $lookups); 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 { } else {
// Implode arrays, so they don't say 'Array' // Implode arrays, so they don't say 'Array'
foreach($record->get_record_array() as $key => $value) { foreach($record->get_record_array() as $key => $value) {