diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 4613100f14..2bda81aa1c 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -252,6 +252,10 @@ mobile: { forceView: true/false (default: true) // turn on/off the 'reader' mode on launch. for mobile document editor only standardView: true/false (default: false) // open editor in 'Standard view' instead of 'Mobile view' + }, + submitForm: { + visible: true/false (default: true) + resultMessage: 'text'/''/null/undefined // if '' - don't show a message after submitting form, null/undefined - show the default message } }, coEditing: { diff --git a/apps/documenteditor/forms/app/controller/ApplicationController.js b/apps/documenteditor/forms/app/controller/ApplicationController.js index d8e21aabed..c39f283802 100644 --- a/apps/documenteditor/forms/app/controller/ApplicationController.js +++ b/apps/documenteditor/forms/app/controller/ApplicationController.js @@ -634,7 +634,8 @@ define([ this.appOptions.trialMode = params.asc_getLicenseMode(); this.appOptions.isBeta = params.asc_getIsBeta(); this.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit); - this.appOptions.canSubmitForms = this.appOptions.canLicense && (typeof (this.editorConfig.customization) == 'object') && !!this.editorConfig.customization.submitForm && !this.appOptions.isOffline; + this.appOptions.canSubmitForms = this.appOptions.canLicense && (typeof (this.editorConfig.customization) == 'object') && !this.appOptions.isOffline && + !!this.editorConfig.customization.submitForm && (typeof this.editorConfig.customization.submitForm !== 'object' || this.editorConfig.customization.submitForm.visible!==false); var type = /^(?:(pdf))$/.exec(this.document.fileType); // can fill forms only in pdf format this.appOptions.isOFORM = !!(type && typeof type[1] === 'string'); @@ -931,20 +932,23 @@ define([ Common.Gateway.submitForm(); this.view.btnSubmit.setCaption(this.textFilled); this.view.btnSubmit.cmpEl.removeClass('yellow').removeClass('back-color').addClass('gray'); - if (!this.submitedTooltip) { - this.submitedTooltip = new Common.UI.SynchronizeTip({ - text: this.textSubmitOk, - extCls: 'no-arrow colored', - style: 'max-width: 400px', - showLink: false, - target: $('.toolbar'), - placement: 'bottom' - }); - this.submitedTooltip.on('closeclick', function () { - this.submitedTooltip.hide(); - }, this); + var text = (typeof this.appOptions.customization.submitForm==='object') ? this.appOptions.customization.submitForm.resultMessage : this.textSubmitOk; + if (text!=='') { + if (!this.submitedTooltip) { + this.submitedTooltip = new Common.UI.SynchronizeTip({ + text: text || this.textSubmitOk, + extCls: 'no-arrow colored', + style: 'max-width: 400px', + showLink: false, + target: $('.toolbar'), + placement: 'bottom' + }); + this.submitedTooltip.on('closeclick', function () { + this.submitedTooltip.hide(); + }, this); + } + this.submitedTooltip.show(); } - this.submitedTooltip.show(); this.api.asc_setRestriction(Asc.c_oAscRestrictionType.View); this.onApiServerDisconnect(true); } else diff --git a/apps/documenteditor/main/app/controller/FormsTab.js b/apps/documenteditor/main/app/controller/FormsTab.js index 01e143ad75..cf25536f2c 100644 --- a/apps/documenteditor/main/app/controller/FormsTab.js +++ b/apps/documenteditor/main/app/controller/FormsTab.js @@ -467,13 +467,15 @@ define([ onLongActionEnd: function(type, id) { if (id==Asc.c_oAscAsyncAction['Submit'] && this.view.btnSubmit) { - Common.Utils.lockControls(Common.enumLock.submit, !this._submitFail, {array: [this.view.btnSubmit]}) + Common.Utils.lockControls(Common.enumLock.submit, !this._submitFail, {array: [this.view.btnSubmit]}); if (!this._submitFail) { Common.Gateway.submitForm(); this.view.btnSubmit.setCaption(this.view.textFilled); + var text = (typeof this.appConfig.customization.submitForm==='object') ? this.appConfig.customization.submitForm.resultMessage : this.view.textSubmitOk; + if (text==='') return; if (!this.submitedTooltip) { this.submitedTooltip = new Common.UI.SynchronizeTip({ - text: this.view.textSubmitOk, + text: text || this.view.textSubmitOk, extCls: 'no-arrow colored', showLink: false, target: $('.toolbar'), diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 147192fd98..10bcc68065 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1733,7 +1733,8 @@ define([ if (this.appOptions.isRestrictedEdit && this.appOptions.canComments && this.appOptions.canFillForms) // must be one restricted mode, priority for filling forms this.appOptions.canComments = false; this.appOptions.canSwitchMode = this.appOptions.isEdit; - this.appOptions.canSubmitForms = this.appOptions.isRestrictedEdit && this.appOptions.canFillForms && this.appOptions.canLicense && (typeof (this.editorConfig.customization) == 'object') && !!this.editorConfig.customization.submitForm && !this.appOptions.isOffline; + this.appOptions.canSubmitForms = this.appOptions.isRestrictedEdit && this.appOptions.canFillForms && this.appOptions.canLicense && !this.appOptions.isOffline && (typeof (this.editorConfig.customization) == 'object') && + !!this.editorConfig.customization.submitForm && (typeof this.editorConfig.customization.submitForm !== 'object' || this.editorConfig.customization.submitForm.visible!==false); this.appOptions.canStartFilling = this.editorConfig.canStartFilling && this.appOptions.isEdit && this.appOptions.isPDFForm; // show Start Filling button in the header this.appOptions.compactHeader = this.appOptions.customization && (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compactHeader; diff --git a/apps/documenteditor/mobile/src/store/appOptions.js b/apps/documenteditor/mobile/src/store/appOptions.js index ee26d13539..db29f48eea 100644 --- a/apps/documenteditor/mobile/src/store/appOptions.js +++ b/apps/documenteditor/mobile/src/store/appOptions.js @@ -209,7 +209,8 @@ export class storeAppOptions { this.canFillForms = this.canLicense && this.typeForm && ((permissions.fillForms === undefined) ? this.isEdit : permissions.fillForms) && (this.config.mode !== 'view'); this.isForm = !this.isXpsViewer && !!window.isPDFForm; this.canProtect = permissions.protect !== false; - this.canSubmitForms = this.canLicense && (typeof (this.customization) == 'object') && !!this.customization.submitForm && !this.isOffline; + this.canSubmitForms = this.canLicense && !this.isOffline && (typeof (this.customization) == 'object') && !!this.customization.submitForm && + (typeof this.customization.submitForm !== 'object' || this.customization.submitForm.visible!==false); this.isEditableForms = this.isForm && this.canSubmitForms; this.isRestrictedEdit = !this.isEdit && (this.canComments || this.canFillForms) && isSupportEditFeature; if (this.isRestrictedEdit && this.canComments && this.canFillForms) // must be one restricted mode, priority for filling forms