diff --git a/application/Espo/Resources/i18n/en_US/Import.json b/application/Espo/Resources/i18n/en_US/Import.json new file mode 100644 index 0000000000..0eb8be2a83 --- /dev/null +++ b/application/Espo/Resources/i18n/en_US/Import.json @@ -0,0 +1,15 @@ +{ + "labels": { + "Revert": "Revert", + "Return to Import": "Return to Import", + "Run Import": "Run Import", + "Back": "Back", + "Field Mapping": "Field Mapping", + "Default Values": "Default Values", + "Add Field": "Add Field", + "Created": "Created", + "Updated": "Updated", + "Result": "Result", + "Show records": "Show records" + } +} diff --git a/application/Espo/Services/Import.php b/application/Espo/Services/Import.php index d30a82d862..31b9908e99 100644 --- a/application/Espo/Services/Import.php +++ b/application/Espo/Services/Import.php @@ -329,14 +329,17 @@ class Import extends \Espo\Core\Services\Base $a = $entity->toArray(); - if ($this->getEntityManager()->saveEntity($entity)) { - $result['id'] = $entity->id; - if (empty($id)) { - $result['imported'] = true; - } else { - $result['updated'] = true; + try { + if ($this->getEntityManager()->saveEntity($entity)) { + $result['id'] = $entity->id; + if (empty($id)) { + $result['imported'] = true; + } else { + $result['updated'] = true; + } } - } + } catch (\Exception $e) {} + return $result; } diff --git a/frontend/client/res/templates/import/step-2.tpl b/frontend/client/res/templates/import/step-2.tpl index 9e8c12f840..71e05e7d77 100644 --- a/frontend/client/res/templates/import/step-2.tpl +++ b/frontend/client/res/templates/import/step-2.tpl @@ -14,7 +14,7 @@
- - + +
diff --git a/frontend/client/res/templates/import/step-3.tpl b/frontend/client/res/templates/import/step-3.tpl index 45ee31a39e..68e261e7d4 100644 --- a/frontend/client/res/templates/import/step-3.tpl +++ b/frontend/client/res/templates/import/step-3.tpl @@ -9,6 +9,8 @@
+ {{translate 'Return to Import' scope='Import'}} + {{translate 'Show records' scope='Import'}} {{#if result.countCreated}} {{/if}} @@ -16,5 +18,3 @@
- - diff --git a/frontend/client/src/views/import/step3.js b/frontend/client/src/views/import/step3.js index 40a11ec6a8..b494b6fc58 100644 --- a/frontend/client/src/views/import/step3.js +++ b/frontend/client/src/views/import/step3.js @@ -37,6 +37,10 @@ Espo.define('Views.Import.Step3', 'View', function (Dep) { }, }, + afterRender: function () { + this.getRouter().navigate('#Import/results'); + }, + setup: function () { this.formData = this.options.formData; this.scope = this.formData.entityType;