diff --git a/importexport/inc/class.importexport_basic_import_csv.inc.php b/importexport/inc/class.importexport_basic_import_csv.inc.php
index 53a4ffbc10..e068c4aee2 100644
--- a/importexport/inc/class.importexport_basic_import_csv.inc.php
+++ b/importexport/inc/class.importexport_basic_import_csv.inc.php
@@ -296,6 +296,7 @@ abstract class importexport_basic_import_csv implements importexport_iface_impor
// Get labels from wizard, if possible
$labels = array_combine($definition->plugin_options['field_mapping'], $definition->plugin_options['field_mapping']);
+
$plugin = get_called_class();
$wizard_name = $definition->application . '_wizard_' . str_replace($definition->application . '_', '', $plugin);
try {
diff --git a/importexport/inc/class.importexport_definitions_ui.inc.php b/importexport/inc/class.importexport_definitions_ui.inc.php
index a2e62ed757..074a0a5b2a 100644
--- a/importexport/inc/class.importexport_definitions_ui.inc.php
+++ b/importexport/inc/class.importexport_definitions_ui.inc.php
@@ -219,6 +219,7 @@ class importexport_definitions_ui
'icon' => 'importexport/navbar',
'allowOnMultiple' => false,
'group' => $group,
+ 'onExecute' => 'javaScript:app.importexport.run_definition'
),
'schedule' => array(
'caption' => 'Schedule',
diff --git a/importexport/inc/class.importexport_import_ui.inc.php b/importexport/inc/class.importexport_import_ui.inc.php
index 4011bbc7d4..701bb9612d 100644
--- a/importexport/inc/class.importexport_import_ui.inc.php
+++ b/importexport/inc/class.importexport_import_ui.inc.php
@@ -126,6 +126,8 @@
$preview = $this->preview($plugin, $file, $definition_obj);
if(trim($this->message) == '')
{
+ // Clear first, to prevent request from being collected if the result is the same
+ $template->setElementAttribute('preview', 'value', '');
$template->setElementAttribute('preview', 'value', $preview);
return;
}
@@ -205,7 +207,7 @@
$sel_options = self::get_select_options($data);
- $data['msg'] = $this->message;
+ $data['message'] = $this->message;
$GLOBALS['egw']->js->validate_file('.','importexport','importexport');
if($_GET['appname']) $readonlys['appname'] = true;
diff --git a/importexport/js/app.js b/importexport/js/app.js
index c944bd76a8..600bd23418 100644
--- a/importexport/js/app.js
+++ b/importexport/js/app.js
@@ -93,5 +93,26 @@ app.classes.importexport = AppJS.extend(
.removeClass('loading');
},this));
return false;
+ },
+
+ /**
+ * Open a popup to run a given definition
+ *
+ * @param {egwAction} action
+ * @param {egwActionObject[]} selected
+ */
+ run_definition: function(action, selected)
+ {
+ if(!selected || selected.length != 1) return;
+
+ var id = selected[0].id||null;
+ var data = egw.dataGetUIDdata(id).data;
+ if(!data || !data.type) return;
+
+ egw.open_link(egw.link('/index.php',{
+ menuaction: 'importexport.importexport_' + data.type + '_ui.' + data.type + '_dialog',
+ appname: data.application,
+ definition: data.definition_id
+ }), false, '850x440', app);
}
});
\ No newline at end of file
diff --git a/importexport/templates/default/import_dialog.xet b/importexport/templates/default/import_dialog.xet
index 7c9b64cb2b..12a5eb6a3f 100644
--- a/importexport/templates/default/import_dialog.xet
+++ b/importexport/templates/default/import_dialog.xet
@@ -8,8 +8,8 @@
-
-
+
+
@@ -38,8 +38,8 @@
-
-
+
+