Don't overwrite numeric owner IDs from successful conversion

This commit is contained in:
Nathan Gray 2011-04-04 21:24:06 +00:00
parent 7962433e27
commit a8e8d82f64

View File

@ -219,7 +219,8 @@ class timesheet_import_csv implements importexport_iface_import_plugin {
}
// Set creator, unless it's supposed to come from CSV file
if($_definition->plugin_options['owner_from_csv'] && $record['ts_owner'] && !is_numeric($record['ts_owner'])) {
if($_definition->plugin_options['owner_from_csv'] && $record['ts_owner']) {
if(!is_numeric($record['ts_owner'])) {
// Automatically handle text owner without explicit translation
$new_owner = importexport_helper_functions::account_name2id($record['ts_owner']);
if($new_owner == '') {
@ -233,6 +234,7 @@ class timesheet_import_csv implements importexport_iface_import_plugin {
} else {
$record['ts_owner'] = $new_owner;
}
}
} elseif ($_definition->plugin_options['creator']) {
$record['ts_owner'] = $_definition->plugin_options['creator'];
}