*/
_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;
success: $.proxy(this._success, this),
url: 'index.php/WorkerProxy/?t=' + SECURITY_TOKEN + SID_ARG_2ND
});
+ this._redirectURL = redirectURL;
this._invoke();
},
_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(
{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) {
<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>
<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>