mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-02-10 18:05:32 +08:00
Change warning when license limit reached
This commit is contained in:
@ -302,8 +302,6 @@ define([
|
||||
me.warnNoLicense = (me.warnNoLicense || '').replace(/%1/g, '{{COMPANY_NAME}}');
|
||||
me.warnNoLicenseUsers = (me.warnNoLicenseUsers || '').replace(/%1/g, '{{COMPANY_NAME}}');
|
||||
me.textNoLicenseTitle = (me.textNoLicenseTitle || '').replace(/%1/g, '{{COMPANY_NAME}}');
|
||||
me.warnLicenseExceeded = (me.warnLicenseExceeded || '').replace(/%1/g, '{{COMPANY_NAME}}');
|
||||
me.warnLicenseUsersExceeded = (me.warnLicenseUsersExceeded || '').replace(/%1/g, '{{COMPANY_NAME}}');
|
||||
},
|
||||
|
||||
loadConfig: function(data) {
|
||||
@ -1048,17 +1046,21 @@ define([
|
||||
});
|
||||
} else if (this._state.licenseType) {
|
||||
var license = this._state.licenseType,
|
||||
title = this.textNoLicenseTitle,
|
||||
buttons = ['ok'],
|
||||
primary = 'ok';
|
||||
primary = 'ok',
|
||||
modal = false;
|
||||
if ((this.appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0 &&
|
||||
(license===Asc.c_oLicenseResult.SuccessLimit || this.appOptions.permissionsLicense===Asc.c_oLicenseResult.SuccessLimit)) {
|
||||
license = this.warnLicenseLimitedRenewed;
|
||||
} else if (license===Asc.c_oLicenseResult.Connections || license===Asc.c_oLicenseResult.UsersCount) {
|
||||
license = (license===Asc.c_oLicenseResult.Connections) ? this.warnLicenseExceeded : this.warnLicenseUsersExceeded;
|
||||
title = this.titleReadOnly;
|
||||
license = (license===Asc.c_oLicenseResult.Connections) ? this.tipLicenseExceeded : this.tipLicenseUsersExceeded;
|
||||
} else {
|
||||
license = (license===Asc.c_oLicenseResult.ConnectionsOS) ? this.warnNoLicense : this.warnNoLicenseUsers;
|
||||
buttons = [{value: 'buynow', caption: this.textBuyNow}, {value: 'contact', caption: this.textContactUs}];
|
||||
primary = 'buynow';
|
||||
modal = true;
|
||||
}
|
||||
|
||||
if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && (this.appOptions.isEdit || this.appOptions.isRestrictedEdit)) {
|
||||
@ -1067,25 +1069,19 @@ define([
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
}
|
||||
|
||||
var value = Common.localStorage.getItem("ve-license-warning");
|
||||
value = (value!==null) ? parseInt(value) : 0;
|
||||
var now = (new Date).getTime();
|
||||
if (now - value > 86400000) {
|
||||
Common.UI.info({
|
||||
maxwidth: 500,
|
||||
title: this.textNoLicenseTitle,
|
||||
msg : license,
|
||||
buttons: buttons,
|
||||
primary: primary,
|
||||
callback: function(btn) {
|
||||
Common.localStorage.setItem("ve-license-warning", now);
|
||||
if (btn == 'buynow')
|
||||
window.open('{{PUBLISHER_URL}}', "_blank");
|
||||
else if (btn == 'contact')
|
||||
window.open('mailto:{{SALES_EMAIL}}', "_blank");
|
||||
}
|
||||
});
|
||||
}
|
||||
Common.UI.info({
|
||||
maxwidth: 500,
|
||||
title: title,
|
||||
msg : license,
|
||||
buttons: buttons,
|
||||
primary: primary,
|
||||
callback: function(btn) {
|
||||
if (btn == 'buynow')
|
||||
window.open('{{PUBLISHER_URL}}', "_blank");
|
||||
else if (btn == 'contact')
|
||||
window.open('mailto:{{SALES_EMAIL}}', "_blank");
|
||||
}
|
||||
});
|
||||
} else if (!this.appOptions.isDesktopApp && !this.appOptions.canBrandingExt &&
|
||||
this.editorConfig && this.editorConfig.customization && (this.editorConfig.customization.loaderName || this.editorConfig.customization.loaderLogo ||
|
||||
this.editorConfig.customization.font && (this.editorConfig.customization.font.size || this.editorConfig.customization.font.name))) {
|
||||
|
||||
@ -294,14 +294,17 @@
|
||||
"VE.Controllers.Main.warnBrowserZoom": "Your browser current zoom setting is not fully supported. Please reset to the default zoom by pressing Ctrl+0.",
|
||||
"VE.Controllers.Main.warnLicenseAnonymous": "Access denied for anonymous users.<br>This document will be opened for viewing only.",
|
||||
"VE.Controllers.Main.warnLicenseBefore": "License not active.<br>Please contact your administrator.",
|
||||
"VE.Controllers.Main.warnLicenseExceeded": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.<br>Contact your administrator to learn more.",
|
||||
"del_VE.Controllers.Main.warnLicenseExceeded": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.<br>Contact your administrator to learn more.",
|
||||
"VE.Controllers.Main.warnLicenseExp": "Your license has expired.<br>Please update your license and refresh the page.",
|
||||
"VE.Controllers.Main.warnLicenseLimitedNoAccess": "License expired.<br>You have no access to document editing functionality.<br>Please contact your administrator.",
|
||||
"VE.Controllers.Main.warnLicenseLimitedRenewed": "License needs to be renewed.<br>You have a limited access to document editing functionality.<br>Please contact your administrator to get full access",
|
||||
"VE.Controllers.Main.warnLicenseUsersExceeded": "You've reached the user limit for %1 editors. Contact your administrator to learn more.",
|
||||
"del_VE.Controllers.Main.warnLicenseUsersExceeded": "You've reached the user limit for %1 editors. Contact your administrator to learn more.",
|
||||
"VE.Controllers.Main.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.<br>Contact %1 sales team for personal upgrade terms.",
|
||||
"VE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
|
||||
"VE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
|
||||
"VE.Controllers.Main.tipLicenseExceeded": "The document is open in read-only mode as the maximum number of simultaneous connections allowed by license has been reached.<br><br>Please try again later or contact the document owner if you need editing access.",
|
||||
"VE.Controllers.Main.tipLicenseUsersExceeded": "The document is open in read-only mode as the maximum number of users allowed to edit documents by license has been reached.<br><br>Please try again later or contact the document owner if you need editing access.",
|
||||
"VE.Controllers.Main.titleReadOnly": "Read-Only Mode",
|
||||
"VE.Controllers.Search.notcriticalErrorTitle": "Warning",
|
||||
"VE.Controllers.Search.textNoTextFound": "The data you have been searching for could not be found. Please adjust your search options.",
|
||||
"VE.Controllers.Search.textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.",
|
||||
|
||||
@ -64,14 +64,17 @@
|
||||
"txtIncorrectPwd": "Password is incorrect",
|
||||
"warnLicenseAnonymous": "Access denied for anonymous users.<br>This document will be opened for viewing only.",
|
||||
"warnLicenseBefore": "License not active.<br>Please contact your administrator.",
|
||||
"warnLicenseExceeded": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only. Contact your administrator to learn more.",
|
||||
"del_warnLicenseExceeded": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only. Contact your administrator to learn more.",
|
||||
"warnLicenseExp": "Your license has expired. Please, update your license and refresh the page.",
|
||||
"warnLicenseLimitedNoAccess": "License expired. You have no access to document editing functionality. Please, contact your administrator.",
|
||||
"warnLicenseLimitedRenewed": "License needs to be renewed. You have limited access to document editing functionality.<br>Please contact your administrator to get full access",
|
||||
"warnLicenseUsersExceeded": "You've reached the user limit for %1 editors. Contact your administrator to learn more.",
|
||||
"del_warnLicenseUsersExceeded": "You've reached the user limit for %1 editors. Contact your administrator to learn more.",
|
||||
"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.",
|
||||
"warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
|
||||
"warnProcessRightsChange": "You don't have permission to edit the file."
|
||||
"warnProcessRightsChange": "You don't have permission to edit the file.",
|
||||
"titleReadOnly": "Read-Only Mode",
|
||||
"tipLicenseExceeded": "The document is open in read-only mode as the maximum number of simultaneous connections allowed by license has been reached.<br><br>Please try again later or contact the document owner if you need editing access.",
|
||||
"tipLicenseUsersExceeded": "The document is open in read-only mode as the maximum number of users allowed to edit documents by license has been reached.<br><br>Please try again later or contact the document owner if you need editing access."
|
||||
}
|
||||
},
|
||||
"Error": {
|
||||
|
||||
@ -420,8 +420,6 @@ class MainController extends Component {
|
||||
const warnNoLicense = _t.warnNoLicense.replace(/%1/g, __COMPANY_NAME__);
|
||||
const warnNoLicenseUsers = _t.warnNoLicenseUsers.replace(/%1/g, __COMPANY_NAME__);
|
||||
const textNoLicenseTitle = _t.textNoLicenseTitle.replace(/%1/g, __COMPANY_NAME__);
|
||||
const warnLicenseExceeded = _t.warnLicenseExceeded.replace(/%1/g, __COMPANY_NAME__);
|
||||
const warnLicenseUsersExceeded = _t.warnLicenseUsersExceeded.replace(/%1/g, __COMPANY_NAME__);
|
||||
|
||||
const appOptions = this.props.storeAppOptions;
|
||||
if (appOptions.config.mode !== 'view' && !EditorUIController.isSupportEditFeature()) {
|
||||
@ -460,13 +458,15 @@ class MainController extends Component {
|
||||
} else if (this._state.licenseType) {
|
||||
let license = this._state.licenseType;
|
||||
let buttons = [{ text: _t.textOk }];
|
||||
let title = textNoLicenseTitle;
|
||||
if ((appOptions.trialMode & Asc.c_oLicenseMode.Limited) !== 0 &&
|
||||
(license === Asc.c_oLicenseResult.SuccessLimit ||
|
||||
appOptions.permissionsLicense === Asc.c_oLicenseResult.SuccessLimit)
|
||||
) {
|
||||
license = _t.warnLicenseLimitedRenewed;
|
||||
} else if (license === Asc.c_oLicenseResult.Connections || license === Asc.c_oLicenseResult.UsersCount) {
|
||||
license = (license===Asc.c_oLicenseResult.Connections) ? warnLicenseExceeded : warnLicenseUsersExceeded;
|
||||
title = _t.titleReadOnly;
|
||||
license = (license===Asc.c_oLicenseResult.Connections) ? _t.tipLicenseExceeded : _t.tipLicenseUsersExceeded;
|
||||
} else {
|
||||
license = (license === Asc.c_oLicenseResult.ConnectionsOS) ? warnNoLicense : warnNoLicenseUsers;
|
||||
buttons = [{
|
||||
@ -491,18 +491,11 @@ class MainController extends Component {
|
||||
Common.Notifications.trigger('api:disconnect');
|
||||
}
|
||||
|
||||
let value = LocalStorage.getItem("ve-license-warning");
|
||||
value = (value !== null) ? parseInt(value) : 0;
|
||||
const now = (new Date).getTime();
|
||||
|
||||
if (now - value > 86400000) {
|
||||
LocalStorage.setItem("ve-license-warning", now);
|
||||
f7.dialog.create({
|
||||
title: textNoLicenseTitle,
|
||||
text : license,
|
||||
buttons: buttons
|
||||
}).open();
|
||||
}
|
||||
f7.dialog.create({
|
||||
title: title,
|
||||
text : license,
|
||||
buttons: buttons
|
||||
}).open();
|
||||
} else {
|
||||
if (!appOptions.isDesktopApp && !appOptions.canBrandingExt &&
|
||||
appOptions.config && appOptions.config.customization && (appOptions.config.customization.loaderName || appOptions.config.customization.loaderLogo)) {
|
||||
|
||||
Reference in New Issue
Block a user