From f3536a72bfd2b6e44a44249460c950e884c7965a Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 15 Mar 2011 16:18:13 +0000 Subject: [PATCH] Improve error message for import errors. Just because there was an error doesn't mean the record wasn't imported using default info --- importexport/inc/class.importexport_import_ui.inc.php | 9 ++++++--- importexport/lang/egw_en.lang | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/importexport/inc/class.importexport_import_ui.inc.php b/importexport/inc/class.importexport_import_ui.inc.php index 3c40ab4f94..dcafb19a1c 100644 --- a/importexport/inc/class.importexport_import_ui.inc.php +++ b/importexport/inc/class.importexport_import_ui.inc.php @@ -57,14 +57,17 @@ $count = $plugin->import($file, $definition_obj); $this->message = lang('%1 records processed', $count); - foreach($plugin->get_results() as $action => $count) { - $this->message .= "\n" . lang($action) . ": $count"; + $total_processed = 0; + foreach($plugin->get_results() as $action => $a_count) { + $this->message .= "\n" . lang($action) . ": $a_count"; + $total_processed += $a_count; } if(count($plugin->get_errors())) { - $this->message .= "\n".lang('Unable to import:'); + $this->message .= "\n".lang('Problems during import:'); foreach($plugin->get_errors() as $record => $message) { $this->message .= "\n$record: $message"; } + if($count != $total_processed) $this->message .= "\n".lang('Some records may not have been imported'); } } catch (Exception $e) { $this->message = $e->getMessage(); diff --git a/importexport/lang/egw_en.lang b/importexport/lang/egw_en.lang index 1a12957fac..b52fe04a42 100644 --- a/importexport/lang/egw_en.lang +++ b/importexport/lang/egw_en.lang @@ -55,6 +55,7 @@ please select file to import importexport en Please select file to import plugin importexport en Plugin preview importexport en Preview previous importexport en previous +problems during import: importexport en Problems during import: save as definition importexport en Save as definition schedule common en Schedule schedule import / export common en Schedule import / export @@ -63,6 +64,7 @@ select definition importexport en Select definition select plugin importexport en Select plugin select... importexport en Select... some nice text importexport en some nice text +some records may not have been imported importexport en Some records may not have been imported stop importexport en Stop target importexport en Target target examples: vfs://default/home/user/export.csv or http://server.net/prices.csv importexport en Target examples: vfs://default/home/user/export.csv or http://server.net/prices.csv @@ -70,7 +72,6 @@ target field importexport en Target Field test only importexport en Test only translation importexport en Translation true importexport en True -unable to import: importexport en Unable to import: unable to schedule importexport en Unable to schedule update categories importexport en Update categories users allowed to create their own definitions importexport en Users allowed to create their own definitions