From 9139c11dc5fa665d5fe74a8ed87bead3c9be1d83 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 12 Sep 2012 17:55:13 +0000 Subject: [PATCH] - Better messages if import file has a problem - Reload opening window when definition wizard is done --- .../inc/class.importexport_definitions_ui.inc.php | 2 +- importexport/inc/class.importexport_import_ui.inc.php | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/importexport/inc/class.importexport_definitions_ui.inc.php b/importexport/inc/class.importexport_definitions_ui.inc.php index 4124faeb02..a9c4b7bd6a 100644 --- a/importexport/inc/class.importexport_definitions_ui.inc.php +++ b/importexport/inc/class.importexport_definitions_ui.inc.php @@ -607,8 +607,8 @@ class importexport_definitions_ui if ($content['closewindow']) { + $this->response->addScript("opener.location.reload();"); $this->response->addScript("window.close();"); - //$this->response->addScript("opener.location = '" . egw::link('/index.php', array('menuaction' => 'importexport.importexport_definitions_ui.index')) . "';"); // If Browser can't close window we display a "close" buuton and // need to disable normal buttons $this->response->addAssign('exec[button][previous]','style.display', 'none'); diff --git a/importexport/inc/class.importexport_import_ui.inc.php b/importexport/inc/class.importexport_import_ui.inc.php index abb0a274f4..78ef3f8d1e 100644 --- a/importexport/inc/class.importexport_import_ui.inc.php +++ b/importexport/inc/class.importexport_import_ui.inc.php @@ -72,7 +72,7 @@ } $file = fopen($content['file']['tmp_name'], 'r'); - + $count = 0; // Some of the translation, conversion, etc look here $GLOBALS['egw_info']['flags']['currentapp'] = $appname; @@ -97,6 +97,7 @@ { // Set this so plugin doesn't do any data changes $content['dry-run'] = true; + $this->message .= '' . lang('Import aborted').":
\n"; $definition_obj->plugin_options = (array)$definition_obj->plugin_options + array('dry_run' => true); } $this->message .= implode($check_message, "
\n") . "
\n"; @@ -106,7 +107,15 @@ } $count = $plugin->import($file, $definition_obj); } + else + { + $this->message .= lang('please select file to import'."
\n"); + } + if($content['dry-run']) + { + $this->message .= '' . lang('test only').":
\n"; + } $this->message .= lang('%1 records processed', $count); // Refresh opening window