Merge pull request #1486 from ONLYOFFICE/fix/bug-54910

Fix/bug 54910
This commit is contained in:
Julia Radzhabova 2022-01-17 19:11:36 +03:00 committed by GitHub
commit 04d67d5612
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 9 deletions

View file

@ -673,6 +673,10 @@ define([
primary = 'buynow'; primary = 'buynow';
} }
if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && this.appOptions.canFillForms) {
this.disableEditing(true);
}
var value = Common.localStorage.getItem("de-license-warning"); var value = Common.localStorage.getItem("de-license-warning");
value = (value!==null) ? parseInt(value) : 0; value = (value!==null) ? parseInt(value) : 0;
var now = (new Date).getTime(); var now = (new Date).getTime();
@ -1001,6 +1005,8 @@ define([
}, },
onShowContentControlsActions: function(obj, x, y) { onShowContentControlsActions: function(obj, x, y) {
if (this._isDisabled) return;
var me = this; var me = this;
switch (obj.type) { switch (obj.type) {
case Asc.c_oAscContentControlSpecificType.DateTime: case Asc.c_oAscContentControlSpecificType.DateTime:
@ -1761,12 +1767,12 @@ define([
if (this.textMenu && !noobject) { if (this.textMenu && !noobject) {
var cancopy = this.api.can_CopyCut(), var cancopy = this.api.can_CopyCut(),
disabled = menu_props.paraProps && menu_props.paraProps.locked || menu_props.headerProps && menu_props.headerProps.locked || disabled = menu_props.paraProps && menu_props.paraProps.locked || menu_props.headerProps && menu_props.headerProps.locked ||
menu_props.imgProps && (menu_props.imgProps.locked || menu_props.imgProps.content_locked); menu_props.imgProps && (menu_props.imgProps.locked || menu_props.imgProps.content_locked) || this._isDisabled;
this.textMenu.items[0].setDisabled(disabled || !this.api.asc_getCanUndo()); // undo this.textMenu.items[0].setDisabled(disabled || !this.api.asc_getCanUndo()); // undo
this.textMenu.items[1].setDisabled(disabled || !this.api.asc_getCanRedo()); // redo this.textMenu.items[1].setDisabled(disabled || !this.api.asc_getCanRedo()); // redo
this.textMenu.items[3].setDisabled(!cancopy); // copy this.textMenu.items[3].setDisabled(disabled || !cancopy); // cut
this.textMenu.items[4].setDisabled(disabled || !cancopy); // cut this.textMenu.items[4].setDisabled(!cancopy); // copy
this.textMenu.items[5].setDisabled(disabled) // paste; this.textMenu.items[5].setDisabled(disabled) // paste;
this.showPopupMenu(this.textMenu, {}, event); this.showPopupMenu(this.textMenu, {}, event);
@ -1800,6 +1806,11 @@ define([
} }
}, },
disableEditing: function(state) {
this.view && this.view.btnClear && this.view.btnClear.setDisabled(state);
this._isDisabled = state;
},
errorDefaultMessage : 'Error code: %1', errorDefaultMessage : 'Error code: %1',
unknownErrorText : 'Unknown error.', unknownErrorText : 'Unknown error.',
convertationTimeoutText : 'Conversion timeout exceeded.', convertationTimeoutText : 'Conversion timeout exceeded.',

View file

@ -1293,7 +1293,7 @@ define([
onLicenseChanged: function(params) { onLicenseChanged: function(params) {
var licType = params.asc_getLicenseType(); var licType = params.asc_getLicenseType();
if (licType !== undefined && this.appOptions.canEdit && this.editorConfig.mode !== 'view' && if (licType !== undefined && (this.appOptions.canEdit || this.appOptions.isRestrictedEdit) && this.editorConfig.mode !== 'view' &&
(licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS (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)) || licType===Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
this._state.licenseType = licType; this._state.licenseType = licType;
@ -1319,7 +1319,7 @@ define([
primary = 'buynow'; primary = 'buynow';
} }
if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && this.appOptions.isEdit) { if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.isEdit || this.appOptions.isRestrictedEdit)) {
this.disableEditing(true); this.disableEditing(true);
Common.NotificationCenter.trigger('api:disconnect'); Common.NotificationCenter.trigger('api:disconnect');
} }

View file

@ -935,7 +935,7 @@ define([
onLicenseChanged: function(params) { onLicenseChanged: function(params) {
var licType = params.asc_getLicenseType(); var licType = params.asc_getLicenseType();
if (licType !== undefined && this.appOptions.canEdit && this.editorConfig.mode !== 'view' && if (licType !== undefined && (this.appOptions.canEdit || this.appOptions.isRestrictedEdit) && this.editorConfig.mode !== 'view' &&
(licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS (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)) || licType===Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
this._state.licenseType = licType; this._state.licenseType = licType;
@ -961,7 +961,7 @@ define([
primary = 'buynow'; primary = 'buynow';
} }
if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && this.appOptions.isEdit) { if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.isEdit || this.appOptions.isRestrictedEdit)) {
this.disableEditing(true); this.disableEditing(true);
Common.NotificationCenter.trigger('api:disconnect'); Common.NotificationCenter.trigger('api:disconnect');
} }

View file

@ -1031,7 +1031,7 @@ define([
if (this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) return; if (this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) return;
var licType = params.asc_getLicenseType(); var licType = params.asc_getLicenseType();
if (licType !== undefined && this.appOptions.canEdit && this.editorConfig.mode !== 'view' && if (licType !== undefined && (this.appOptions.canEdit || this.appOptions.isRestrictedEdit) && this.editorConfig.mode !== 'view' &&
(licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount || licType===Asc.c_oLicenseResult.ConnectionsOS || licType===Asc.c_oLicenseResult.UsersCountOS (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)) || licType===Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
this._state.licenseType = licType; this._state.licenseType = licType;
@ -1057,7 +1057,7 @@ define([
primary = 'buynow'; primary = 'buynow';
} }
if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && this.appOptions.isEdit) { if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.isEdit || this.appOptions.isRestrictedEdit)) {
this.disableEditing(true); this.disableEditing(true);
Common.NotificationCenter.trigger('api:disconnect'); Common.NotificationCenter.trigger('api:disconnect');
} }