Fix license mode
This commit is contained in:
parent
ee25374d11
commit
2eee79844d
|
@ -1087,7 +1087,7 @@ define([
|
|||
} else {
|
||||
documentHolderController.getView().createDelayedElementsViewer();
|
||||
Common.NotificationCenter.trigger('document:ready', 'main');
|
||||
if (me.appOptions.canEdit && me.editorConfig.mode !== 'view') // if want to open editor, but viewer is loaded
|
||||
if (me.editorConfig.mode !== 'view') // if want to open editor, but viewer is loaded
|
||||
me.applyLicense();
|
||||
}
|
||||
|
||||
|
@ -1119,7 +1119,7 @@ define([
|
|||
var licType = params.asc_getLicenseType();
|
||||
if (licType !== undefined && this.appOptions.canEdit && 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.ExpiredLimited))
|
||||
|| (licType===Asc.c_oLicenseResult.SuccessLimit || licType===Asc.c_oLicenseResult.ExpiredLimited) && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
|
||||
this._state.licenseType = licType;
|
||||
|
||||
if (this._isDocReady)
|
||||
|
@ -1127,7 +1127,7 @@ define([
|
|||
},
|
||||
|
||||
applyLicense: function() {
|
||||
if (this._state.licenseType || (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0) {
|
||||
if (this._state.licenseType) {
|
||||
var license = this._state.licenseType,
|
||||
buttons = ['ok'],
|
||||
primary = 'ok';
|
||||
|
@ -1142,7 +1142,7 @@ define([
|
|||
primary = 'buynow';
|
||||
}
|
||||
|
||||
if (this._state.licenseType && this.appOptions.isEdit) {
|
||||
if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && this.appOptions.isEdit) {
|
||||
this.disableEditing(true);
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
}
|
||||
|
|
|
@ -659,7 +659,7 @@ define([
|
|||
var licType = params.asc_getLicenseType();
|
||||
if (licType !== undefined && this.appOptions.canEdit && 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.ExpiredLimited))
|
||||
|| (licType===Asc.c_oLicenseResult.SuccessLimit || licType===Asc.c_oLicenseResult.ExpiredLimited) && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
|
||||
this._state.licenseType = licType;
|
||||
|
||||
if (this._isDocReady && this._state.licenseType)
|
||||
|
@ -684,7 +684,7 @@ define([
|
|||
return;
|
||||
}
|
||||
|
||||
if (this._state.licenseType || (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0) {
|
||||
if (this._state.licenseType) {
|
||||
var license = this._state.licenseType,
|
||||
buttons = [{text: 'OK'}];
|
||||
if ((this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0) {
|
||||
|
@ -707,9 +707,13 @@ define([
|
|||
}
|
||||
}];
|
||||
}
|
||||
DE.getController('Toolbar').activateViewControls();
|
||||
DE.getController('Toolbar').deactivateEditControls();
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
if (this._state.licenseType===Asc.c_oLicenseResult.SuccessLimit) {
|
||||
DE.getController('Toolbar').activateControls();
|
||||
} else {
|
||||
DE.getController('Toolbar').activateViewControls();
|
||||
DE.getController('Toolbar').deactivateEditControls();
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
}
|
||||
|
||||
var value = Common.localStorage.getItem("de-license-warning");
|
||||
value = (value!==null) ? parseInt(value) : 0;
|
||||
|
|
|
@ -815,7 +815,7 @@ define([
|
|||
} else {
|
||||
documentHolderController.getView('DocumentHolder').createDelayedElementsViewer();
|
||||
Common.NotificationCenter.trigger('document:ready', 'main');
|
||||
if (me.appOptions.canEdit && me.editorConfig.mode !== 'view') // if want to open editor, but viewer is loaded
|
||||
if (me.editorConfig.mode !== 'view') // if want to open editor, but viewer is loaded
|
||||
me.applyLicense();
|
||||
}
|
||||
|
||||
|
@ -845,7 +845,7 @@ define([
|
|||
var licType = params.asc_getLicenseType();
|
||||
if (licType !== undefined && this.appOptions.canEdit && 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.ExpiredLimited))
|
||||
|| (licType===Asc.c_oLicenseResult.SuccessLimit || licType===Asc.c_oLicenseResult.ExpiredLimited) && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
|
||||
this._state.licenseType = licType;
|
||||
|
||||
if (this._isDocReady)
|
||||
|
@ -853,7 +853,7 @@ define([
|
|||
},
|
||||
|
||||
applyLicense: function() {
|
||||
if (this._state.licenseType || (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0) {
|
||||
if (this._state.licenseType) {
|
||||
var license = this._state.licenseType,
|
||||
buttons = ['ok'],
|
||||
primary = 'ok';
|
||||
|
@ -868,7 +868,7 @@ define([
|
|||
primary = 'buynow';
|
||||
}
|
||||
|
||||
if (this._state.licenseType && this.appOptions.isEdit) {
|
||||
if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && this.appOptions.isEdit) {
|
||||
this.disableEditing(true);
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
}
|
||||
|
|
|
@ -589,7 +589,7 @@ define([
|
|||
var licType = params.asc_getLicenseType();
|
||||
if (licType !== undefined && this.appOptions.canEdit && 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.ExpiredLimited))
|
||||
|| (licType===Asc.c_oLicenseResult.SuccessLimit || licType===Asc.c_oLicenseResult.ExpiredLimited) && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
|
||||
this._state.licenseType = licType;
|
||||
|
||||
if (this._isDocReady && this._state.licenseType)
|
||||
|
@ -614,7 +614,7 @@ define([
|
|||
return;
|
||||
}
|
||||
|
||||
if (this._state.licenseType || (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0) {
|
||||
if (this._state.licenseType) {
|
||||
var license = this._state.licenseType,
|
||||
buttons = [{text: 'OK'}];
|
||||
if ((this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0) {
|
||||
|
@ -637,9 +637,13 @@ define([
|
|||
}
|
||||
}];
|
||||
}
|
||||
PE.getController('Toolbar').activateViewControls();
|
||||
PE.getController('Toolbar').deactivateEditControls();
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
if (this._state.licenseType===Asc.c_oLicenseResult.SuccessLimit) {
|
||||
PE.getController('Toolbar').activateControls();
|
||||
} else {
|
||||
PE.getController('Toolbar').activateViewControls();
|
||||
PE.getController('Toolbar').deactivateEditControls();
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
}
|
||||
|
||||
var value = Common.localStorage.getItem("pe-license-warning");
|
||||
value = (value!==null) ? parseInt(value) : 0;
|
||||
|
@ -685,7 +689,6 @@ define([
|
|||
onEditorPermissions: function(params) {
|
||||
var me = this,
|
||||
licType = params.asc_getLicenseType();
|
||||
|
||||
if (Asc.c_oLicenseResult.Expired === licType ||
|
||||
Asc.c_oLicenseResult.Error === licType ||
|
||||
Asc.c_oLicenseResult.ExpiredTrial === licType) {
|
||||
|
|
|
@ -866,7 +866,7 @@ define([
|
|||
} else {
|
||||
documentHolderView.createDelayedElementsViewer();
|
||||
Common.NotificationCenter.trigger('document:ready', 'main');
|
||||
if (me.appOptions.canEdit && me.editorConfig.mode !== 'view') // if want to open editor, but viewer is loaded
|
||||
if (me.editorConfig.mode !== 'view') // if want to open editor, but viewer is loaded
|
||||
me.applyLicense();
|
||||
}
|
||||
// TODO bug 43960
|
||||
|
@ -912,7 +912,7 @@ define([
|
|||
var licType = params.asc_getLicenseType();
|
||||
if (licType !== undefined && this.appOptions.canEdit && 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.ExpiredLimited))
|
||||
|| (licType===Asc.c_oLicenseResult.SuccessLimit || licType===Asc.c_oLicenseResult.ExpiredLimited) && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
|
||||
this._state.licenseType = licType;
|
||||
|
||||
if (this._isDocReady)
|
||||
|
@ -920,7 +920,7 @@ define([
|
|||
},
|
||||
|
||||
applyLicense: function() {
|
||||
if (this._state.licenseType || (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0) {
|
||||
if (this._state.licenseType) {
|
||||
var license = this._state.licenseType,
|
||||
buttons = ['ok'],
|
||||
primary = 'ok';
|
||||
|
@ -935,7 +935,7 @@ define([
|
|||
primary = 'buynow';
|
||||
}
|
||||
|
||||
if (this._state.licenseType && this.appOptions.isEdit) {
|
||||
if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && this.appOptions.isEdit) {
|
||||
this.disableEditing(true);
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
}
|
||||
|
|
|
@ -615,7 +615,7 @@ define([
|
|||
var licType = params.asc_getLicenseType();
|
||||
if (licType !== undefined && this.appOptions.canEdit && 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.ExpiredLimited))
|
||||
|| (licType===Asc.c_oLicenseResult.SuccessLimit || licType===Asc.c_oLicenseResult.ExpiredLimited) && (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0))
|
||||
this._state.licenseType = licType;
|
||||
|
||||
if (this._isDocReady && this._state.licenseType)
|
||||
|
@ -639,7 +639,7 @@ define([
|
|||
SSE.getController('Toolbar').activateControls();
|
||||
return;
|
||||
}
|
||||
if (this._state.licenseType || (this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0) {
|
||||
if (this._state.licenseType) {
|
||||
var license = this._state.licenseType,
|
||||
buttons = [{text: 'OK'}];
|
||||
if ((this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0) {
|
||||
|
@ -662,9 +662,13 @@ define([
|
|||
}
|
||||
}];
|
||||
}
|
||||
SSE.getController('Toolbar').activateViewControls();
|
||||
SSE.getController('Toolbar').deactivateEditControls();
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
if (this._state.licenseType===Asc.c_oLicenseResult.SuccessLimit) {
|
||||
SSE.getController('Toolbar').activateControls();
|
||||
} else {
|
||||
SSE.getController('Toolbar').activateViewControls();
|
||||
SSE.getController('Toolbar').deactivateEditControls();
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
}
|
||||
|
||||
var value = Common.localStorage.getItem("sse-license-warning");
|
||||
value = (value!==null) ? parseInt(value) : 0;
|
||||
|
|
Loading…
Reference in a new issue