Added proper cleanup/success message after import
authorAlexander Ebert <ebert@woltlab.com>
Sat, 20 Jul 2013 12:21:13 +0000 (14:21 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 20 Jul 2013 12:21:13 +0000 (14:21 +0200)
wcfsetup/install/files/acp/js/WCF.ACP.js
wcfsetup/install/files/acp/templates/dataImport.tpl
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index f0e08fcd87ae330a7db69582f9ea7a165b56a51d..12fa84b11ab70435fbf50fc865fa23976d072025 100644 (file)
@@ -2232,12 +2232,19 @@ WCF.ACP.Import.Manager = Class.extend({
         */
        _proxy: null,
        
+       /**
+        * redirect URL
+        * @var string
+        */
+       _redirectURL: '',
+       
        /**
         * Initializes the WCF.ACP.Importer object.
         * 
         * @param       array<string>   objectTypes
+        * @param       string          redirectURL
         */
-       init: function(objectTypes) {
+       init: function(objectTypes, redirectURL) {
                this._currentAction = '';
                this._index = -1;
                this._objectTypes = objectTypes;
@@ -2246,6 +2253,7 @@ WCF.ACP.Import.Manager = Class.extend({
                        success: $.proxy(this._success, this),
                        url: 'index.php/WorkerProxy/?t=' + SECURITY_TOKEN + SID_ARG_2ND
                });
+               this._redirectURL = redirectURL;
                
                this._invoke();
        },
@@ -2256,9 +2264,26 @@ WCF.ACP.Import.Manager = Class.extend({
        _invoke: function() {
                this._index++;
                if (this._index >= this._objectTypes.length) {
-                       this._dialog.find('.icon-spinner').removeClass('icon-spinner').addClass('icon-ok');
-                       
-                       // TODO: invoke cleanup here
+                       // cleanup
+                       new WCF.Action.Proxy({
+                               autoSend: true,
+                               data: {
+                                       actionName: 'resetMapping',
+                                       className: 'wcf\\system\\importer\\ImportHandler'
+                               },
+                               success: $.proxy(function() {
+                                       this._dialog.find('.icon-spinner').removeClass('icon-spinner').addClass('icon-ok');
+                                       this._dialog.find('h1').text(WCF.Language.get('wcf.acp.dataImport.completed'));
+                                       
+                                       var $form = $('<div class="formSubmit" />').appendTo(this._dialog.find('#workerContainer'));
+                                       $('<button>' + WCF.Language.get('wcf.global.button.next') + '</button>').click($.proxy(function() {
+                                               window.location = this._redirectURL;
+                                       }, this)).appendTo($form);
+                                       
+                                       this._dialog.wcfDialog('render');
+                               }, this),
+                               url: 'index.php/AJAXInvokeAction/?t=' + SECURITY_TOKEN + SID_ARG_2ND
+                       });
                }
                else {
                        this._run(
index 7d8c212b3190802fceafbae2a82aeb56a1f04c77..5539de9122d65167d44180065d929ad4490c05a0 100644 (file)
@@ -6,11 +6,12 @@
                {if $queue|isset}
                        WCF.Language.addObject({
                                'wcf.acp.dataImport': '{lang}wcf.acp.dataImport{/lang}',
+                               'wcf.acp.dataImport.completed': '{lang}wcf.acp.dataImport.completed{/lang}',
                                {implode from=$importers item=importer}'wcf.acp.dataImport.data.{@$importer}': '{lang}wcf.acp.dataImport.data.{@$importer}{/lang}'{/implode}
                        });
                        
                        var $queues = [ {implode from=$queue item=item}'{@$item}'{/implode} ];
-                       new WCF.ACP.Import.Manager($queues);
+                       new WCF.ACP.Import.Manager($queues, '{link controller='RebuildData'}{/link}');
                {/if}
                
                $('.jsImportSection').change(function(event) {
index 9f3d21d699dde5127c43489d7748edf295ad464f..3aa803895253e68eb6226150d04ac43070b03e57 100644 (file)
                <item name="wcf.acp.dataImport.data.com.woltlab.wcf.user.comment.response"><![CDATA[Pinnwand-Kommentar-Antworten]]></item>
                <item name="wcf.acp.dataImport.data.com.woltlab.wcf.label"><![CDATA[Labels]]></item>
                <item name="wcf.acp.dataImport.data.com.woltlab.wcf.smiley"><![CDATA[Smileys]]></item>
+               <item name="wcf.acp.dataImport.completed"><![CDATA[Import abgeschlossen.]]></item>
                <item name="wcf.acp.dataImport.configure.database"><![CDATA[Datenbank-Zugang]]></item>
                <item name="wcf.acp.dataImport.configure.database.host"><![CDATA[Hostname]]></item>
                <item name="wcf.acp.dataImport.configure.database.user"><![CDATA[Benutzername]]></item>
index 934773db4e894a6978029f29c0283b99b0d5df16..033172078123a97a7b99e90387e33137c0540cb5 100644 (file)
@@ -177,6 +177,7 @@ Examples for medium ID detection:
                <item name="wcf.acp.dataImport.data.com.woltlab.wcf.user.comment.response"><![CDATA[TODO: Pinwand-Kommentar-Antworten]]></item>
                <item name="wcf.acp.dataImport.data.com.woltlab.wcf.label"><![CDATA[TODO: Labels]]></item>
                <item name="wcf.acp.dataImport.data.com.woltlab.wcf.smiley"><![CDATA[Smilies]]></item>
+               <item name="wcf.acp.dataImport.completed"><![CDATA[Import completed.]]></item>
                <item name="wcf.acp.dataImport.configure.database"><![CDATA[TODO: Datenbank-Zugang]]></item>
                <item name="wcf.acp.dataImport.configure.database.host"><![CDATA[TODO: Hostname]]></item>
                <item name="wcf.acp.dataImport.configure.database.user"><![CDATA[TODO: Benutzername]]></item>