diff --git a/apps/documenteditor/forms/app/controller/ApplicationController.js b/apps/documenteditor/forms/app/controller/ApplicationController.js
index befcce86f5..99f0736681 100644
--- a/apps/documenteditor/forms/app/controller/ApplicationController.js
+++ b/apps/documenteditor/forms/app/controller/ApplicationController.js
@@ -83,7 +83,7 @@ define([
weakCompare : function(obj1, obj2){return obj1.type === obj2.type;}
});
- this._state = {isDisconnected: false, licenseType: false, isDocModified: false};
+ this._state = {isDisconnected: false, licenseType: false, isDocModified: false, isFormDisconnected: false};
this.view = this.createView('ApplicationView').render();
@@ -142,6 +142,7 @@ define([
this.api.asc_registerCallback('asc_onCurrentPage', this.onCurrentPage.bind(this));
this.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(this.onDocumentModifiedChanged, this));
this.api.asc_registerCallback('asc_onZoomChange', this.onApiZoomChange.bind(this));
+ this.api.asc_registerCallback('asc_onDisconnectEveryone', _.bind(this.onDisconnectEveryone, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiServerDisconnect, this));
@@ -662,7 +663,8 @@ define([
var type = /^(?:(pdf))$/.exec(this.document.fileType); // can fill forms only in pdf format
this.appOptions.isOFORM = !!(type && typeof type[1] === 'string');
- this.appOptions.canFillForms = this.appOptions.canLicense && this.appOptions.isOFORM && ((this.permissions.fillForms===undefined) ? (this.permissions.edit !== false) : this.permissions.fillForms) && (this.editorConfig.mode !== 'view');
+ this.appOptions.canFillForms = this.appOptions.canLicense && this.appOptions.isOFORM && ((this.permissions.fillForms===undefined) ? (this.permissions.edit !== false) : this.permissions.fillForms) &&
+ (this.editorConfig.mode !== 'view') && !this._state.isFormDisconnected;
this.api.asc_setViewMode(!this.appOptions.canFillForms);
this.appOptions.canBranding = params.asc_getCustomization();
@@ -2235,6 +2237,16 @@ define([
}
},
+ onDisconnectEveryone: function() {
+ this._state.isFormDisconnected = true;
+ if (this.appOptions) this.appOptions.canFillForms = false;
+ this.showFillingForms(false); // hide filling forms
+ Common.UI.warning({
+ msg : this.warnStartFilling,
+ buttons: ['ok']
+ });
+ },
+
onEditComplete: function() {
var me = this;
me.boxSdk && _.defer(function(){ me.boxSdk.focus(); }, 50);
diff --git a/apps/documenteditor/forms/locale/en.json b/apps/documenteditor/forms/locale/en.json
index 1f32caa599..af390d5395 100644
--- a/apps/documenteditor/forms/locale/en.json
+++ b/apps/documenteditor/forms/locale/en.json
@@ -173,6 +173,7 @@
"DE.Controllers.ApplicationController.warnLicenseUsersExceeded": "You've reached the user limit for %1 editors. Contact your administrator to learn more.",
"DE.Controllers.ApplicationController.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.ApplicationController.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
+ "DE.Controllers.ApplicationController.warnStartFilling": "Form filling is in progress.
File editing is not currently available.",
"DE.Views.ApplicationView.textClear": "Clear all fields",
"DE.Views.ApplicationView.textClearField": "Clear field",
"DE.Views.ApplicationView.textClose": "Close file",