[DE forms] Disable edit buttons when no license (Bug 54910)

This commit is contained in:
Julia Radzhabova 2022-01-17 18:09:45 +03:00
parent 415d9651df
commit 0f7cd84acf

View file

@ -670,6 +670,10 @@ define([
primary = 'buynow';
}
if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && this.appOptions.canFillForms) {
this.disableEditing(true);
}
var value = Common.localStorage.getItem("de-license-warning");
value = (value!==null) ? parseInt(value) : 0;
var now = (new Date).getTime();
@ -998,6 +1002,8 @@ define([
},
onShowContentControlsActions: function(obj, x, y) {
if (this._isDisabled) return;
var me = this;
switch (obj.type) {
case Asc.c_oAscContentControlSpecificType.DateTime:
@ -1730,12 +1736,12 @@ define([
if (this.textMenu && !noobject) {
var cancopy = this.api.can_CopyCut(),
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[1].setDisabled(disabled || !this.api.asc_getCanRedo()); // redo
this.textMenu.items[3].setDisabled(!cancopy); // copy
this.textMenu.items[4].setDisabled(disabled || !cancopy); // cut
this.textMenu.items[3].setDisabled(disabled || !cancopy); // cut
this.textMenu.items[4].setDisabled(!cancopy); // copy
this.textMenu.items[5].setDisabled(disabled) // paste;
this.showPopupMenu(this.textMenu, {}, event);
@ -1769,6 +1775,11 @@ define([
}
},
disableEditing: function(state) {
this.view && this.view.btnClear && this.view.btnClear.setDisabled(state);
this._isDisabled = state;
},
errorDefaultMessage : 'Error code: %1',
unknownErrorText : 'Unknown error.',
convertationTimeoutText : 'Conversion timeout exceeded.',