diff --git a/apps/documenteditor/main/app/controller/FormsTab.js b/apps/documenteditor/main/app/controller/FormsTab.js index f2288075b..f8eaad23f 100644 --- a/apps/documenteditor/main/app/controller/FormsTab.js +++ b/apps/documenteditor/main/app/controller/FormsTab.js @@ -70,8 +70,9 @@ define([ Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); this.api.asc_registerCallback('asc_onChangeSpecialFormsGlobalSettings', _.bind(this.onChangeSpecialFormsGlobalSettings, this)); Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); - this.api.asc_registerCallback('asc_onStartAction', _.bind(this.onLongActionBegin, this)); - this.api.asc_registerCallback('asc_onEndAction', _.bind(this.onLongActionEnd, this)); + this.api.asc_registerCallback('asc_onStartAction', _.bind(this.onLongActionBegin, this)); + this.api.asc_registerCallback('asc_onEndAction', _.bind(this.onLongActionEnd, this)); + this.api.asc_registerCallback('asc_onError', _.bind(this.onError, this)); // this.api.asc_registerCallback('asc_onShowContentControlsActions',_.bind(this.onShowContentControlsActions, this)); // this.api.asc_registerCallback('asc_onHideContentControlsActions',_.bind(this.onHideContentControlsActions, this)); @@ -232,7 +233,7 @@ define([ }, onSubmitClick: function() { - // this.api.asc_SubmitForm(); + this.api.asc_SendForm(); Common.NotificationCenter.trigger('edit:complete', this.toolbar); }, @@ -260,6 +261,8 @@ define([ onLongActionBegin: function(type, id) { if (id==Asc.c_oAscAsyncAction['Submit'] && this.view.btnSubmit) { + this._submitFail = false; + this.submitedTooltip && this.submitedTooltip.hide(); this.view.btnSubmit.setDisabled(true); } }, @@ -279,7 +282,14 @@ define([ this.submitedTooltip.hide(); }, this); } - this.submitedTooltip.show(); + !this._submitFail && this.submitedTooltip.show(); + } + }, + + onError: function(id, level, errData) { + if (id==Asc.c_oAscError.ID.Submit) { + this._submitFail = true; + this.submitedTooltip && this.submitedTooltip.hide(); } }, diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index f5e99aedc..8c4cee411 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1662,6 +1662,10 @@ define([ config.msg = this.errorSetPassword; break; + case Asc.c_oAscError.ID.Submit: + config.msg = this.errorSubmit; + break; + default: config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id); break; @@ -2833,7 +2837,8 @@ define([ textRenameLabel: 'Enter a name to be used for collaboration', textRenameError: 'User name must not be empty.', textLongName: 'Enter a name that is less than 128 characters.', - textGuest: 'Guest' + textGuest: 'Guest', + errorSubmit: 'Submit failed.' } })(), DE.Controllers.Main || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index e5e8955cd..d5e0db48f 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -818,6 +818,7 @@ "DE.Controllers.Main.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.
Contact %1 sales team for personal upgrade terms.", "DE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.", "DE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.", + "DE.Controllers.Main.errorSubmit": "Submit failed.", "DE.Controllers.Navigation.txtBeginning": "Beginning of document", "DE.Controllers.Navigation.txtGotoBeginning": "Go to the beginning of the document", "DE.Controllers.Statusbar.textHasChanges": "New changes have been tracked", @@ -1749,6 +1750,7 @@ "DE.Views.FormsTab.tipPrevForm": "Go to the previous field", "DE.Views.FormsTab.tipNextForm": "Go to the next field", "DE.Views.FormsTab.tipSubmit": "Submit form", + "DE.Views.FormsTab.textSubmited": "Form submitted successfully", "DE.Views.HeaderFooterSettings.textBottomCenter": "Bottom center", "DE.Views.HeaderFooterSettings.textBottomLeft": "Bottom left", "DE.Views.HeaderFooterSettings.textBottomPage": "Bottom of Page",