From 2f7af7fa258571fe17aa64abe984e5fc44a70f39 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 4 Apr 2013 16:47:39 +0000 Subject: [PATCH] Load applications translations for header check, add field name to invalid user warning --- importexport/inc/class.importexport_import_csv.inc.php | 2 +- importexport/inc/class.importexport_import_ui.inc.php | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/importexport/inc/class.importexport_import_csv.inc.php b/importexport/inc/class.importexport_import_csv.inc.php index 66340ed54e..1f6a569595 100755 --- a/importexport/inc/class.importexport_import_csv.inc.php +++ b/importexport/inc/class.importexport_import_csv.inc.php @@ -368,7 +368,7 @@ class importexport_import_csv implements importexport_iface_import_record { //, if(count($new_owner) != count(explode(',',$record[$name]))) { // Unable to parse value into account - $warnings[] = lang('%1 is not a known user or group', $record[$name]); + $warnings[] = $name . ': ' .lang('%1 is not a known user or group', $record[$name]); } if($new_owner != '') { $record[$name] = $new_owner; diff --git a/importexport/inc/class.importexport_import_ui.inc.php b/importexport/inc/class.importexport_import_ui.inc.php index 983d101ac4..04a7399003 100644 --- a/importexport/inc/class.importexport_import_ui.inc.php +++ b/importexport/inc/class.importexport_import_ui.inc.php @@ -43,6 +43,11 @@ $appname = $_GET['appname'] ? $_GET['appname'] : $content['appname']; $definition = $_GET['definition'] ? $_GET['definition'] : $content['definition']; + // Load application's translations + if($appname) + { + translation::add_app($appname); + } if($content['import'] && $definition) { try { $definition_obj = new importexport_definition($content['definition']); @@ -356,7 +361,8 @@ // Skipped column in definition continue; } - elseif($index < count($options['csv_fields']) && strtoupper($options['csv_fields'][$index]) != strtoupper($header) && strtoupper(lang($options['csv_fields'][$index])) != strtoupper($header)) + // Check column headers, taking into account different translations + elseif($index < count($options['csv_fields']) && strtoupper($options['csv_fields'][$index]) != strtoupper($header) && strtoupper(lang($options['csv_fields'][$index])) != strtoupper($header) && strtoupper($options['csv_fields'][$index]) != strtoupper(lang($header))) { // Problem $message[] = lang("Column mismatch: %1 should be %2, not %3",