From 245275c571377260ffe4fc72ff798e9d4436aa10 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 17 Jan 2022 12:01:35 +0300 Subject: [PATCH] [DE forms] Fix Bug 54910 --- .../forms/app/controller/ApplicationController.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/documenteditor/forms/app/controller/ApplicationController.js b/apps/documenteditor/forms/app/controller/ApplicationController.js index 5aed32a9c..1e6a01a15 100644 --- a/apps/documenteditor/forms/app/controller/ApplicationController.js +++ b/apps/documenteditor/forms/app/controller/ApplicationController.js @@ -508,6 +508,7 @@ define([ this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this)); this.api.asc_registerCallback('asc_onRunAutostartMacroses', _.bind(this.onRunAutostartMacroses, this)); + this.api.asc_registerCallback('asc_onLicenseChanged', _.bind(this.onLicenseChanged, this)); this.api.asc_setDocInfo(docInfo); this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId); this.api.asc_enableKeyEvents(true); @@ -645,6 +646,17 @@ define([ }); }, + onLicenseChanged: function(params) { + var licType = params.asc_getLicenseType(); + if (licType !== undefined && this.appOptions.canFillForms && + (licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS + || licType===Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0)) + this._state.licenseType = licType; + + if (this._isDocReady) + this.applyLicense(); + }, + applyLicense: function() { if (this._state.licenseType) { var license = this._state.licenseType,