From 0d49651ea7501d87e26424124baec74bb79d42dc Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 28 May 2018 13:00:03 +0300 Subject: [PATCH] Add license type ConnectionsOS, UsersCountOS --- .../main/app/controller/Main.js | 38 +++++++----- apps/documenteditor/main/locale/en.json | 6 +- .../mobile/app/controller/Main.js | 58 +++++++++++-------- apps/documenteditor/mobile/locale/en.json | 6 +- .../main/app/controller/Main.js | 38 +++++++----- apps/presentationeditor/main/locale/en.json | 6 +- .../mobile/app/controller/Main.js | 58 +++++++++++-------- apps/presentationeditor/mobile/locale/en.json | 6 +- .../main/app/controller/Main.js | 39 ++++++++----- apps/spreadsheeteditor/main/locale/en.json | 6 +- .../mobile/app/controller/Main.js | 58 +++++++++++-------- apps/spreadsheeteditor/mobile/locale/en.json | 6 +- 12 files changed, 196 insertions(+), 129 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 3658c8c8d..2790b549b 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -108,7 +108,7 @@ define([ weakCompare : function(obj1, obj2){return obj1.type === obj2.type;} }); - this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseWarning: false}; + this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseType: false}; this.languages = null; this.translationTable = []; // Initialize viewport @@ -994,16 +994,27 @@ define([ onLicenseChanged: function(params) { var licType = params.asc_getLicenseType(); - if (licType !== undefined && (licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount) && this.appOptions.canEdit && this.editorConfig.mode !== 'view') { - this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) ? this.warnNoLicense : this.warnNoLicenseUsers; - } + 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)) + this._state.licenseType = licType; if (this._isDocReady) this.applyLicense(); }, applyLicense: function() { - if (this._state.licenseWarning) { + if (this._state.licenseType) { + var license = this._state.licenseType, + buttons = ['ok'], + primary = 'ok'; + if (license===Asc.c_oLicenseResult.Connections || license===Asc.c_oLicenseResult.UsersCount) { + license = (license===Asc.c_oLicenseResult.Connections) ? this.warnLicenseExceeded : this.warnLicenseUsersExceeded; + } else { + license = (license===Asc.c_oLicenseResult.ConnectionsOS) ? this.warnNoLicense : this.warnNoLicenseUsers; + buttons = [{value: 'buynow', caption: this.textBuyNow}, {value: 'contact', caption: this.textContactUs}]; + primary = 'buynow'; + } + this.disableEditing(true); Common.NotificationCenter.trigger('api:disconnect'); @@ -1015,12 +1026,9 @@ define([ Common.UI.info({ width: 500, title: this.textNoLicenseTitle, - msg : this._state.licenseWarning, - buttons: [ - {value: 'buynow', caption: this.textBuyNow}, - {value: 'contact', caption: this.textContactUs} - ], - primary: 'buynow', + msg : license, + buttons: buttons, + primary: primary, callback: function(btn) { if (btn == 'buynow') window.open('https://www.onlyoffice.com', "_blank"); @@ -2192,7 +2200,6 @@ define([ txtErrorLoadHistory: 'Loading history failed', textBuyNow: 'Visit website', textNoLicenseTitle: 'ONLYOFFICE open source version', - warnNoLicense: 'This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.', textContactUs: 'Contact sales', errorViewerDisconnect: 'Connection is lost. You can still view the document,
but will not be able to download or print until the connection is restored.', warnLicenseExp: 'Your license has expired.
Please update your license and refresh the page.', @@ -2240,10 +2247,13 @@ define([ txtOddPage: "Odd Page ", txtSameAsPrev: "Same as Previous", txtCurrentDocument: "Current Document", - warnNoLicenseUsers: 'This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.', txtNoTableOfContents: "No table of contents entries found.", txtTableOfContents: "Table of Contents", - errorForceSave: "An error occurred while saving the file. Please use the 'Download as' option to save the file to your computer hard drive or try again later." + errorForceSave: "An error occurred while saving the file. Please use the 'Download as' option to save the file to your computer hard drive or try again later.", + warnNoLicense: 'This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider purchasing a commercial license.', + warnNoLicenseUsers: 'This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider purchasing a commercial license.', + warnLicenseExceeded: 'The number of concurrent connections to the document server has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.', + warnLicenseUsersExceeded: 'The number of concurrent users has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.' } })(), DE.Controllers.Main || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 92f0f2cfc..47a849348 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -447,8 +447,10 @@ "DE.Controllers.Main.warnBrowserIE9": "The application has low capabilities on IE9. Use IE10 or higher", "DE.Controllers.Main.warnBrowserZoom": "Your browser current zoom setting is not fully supported. Please reset to the default zoom by pressing Ctrl+0.", "DE.Controllers.Main.warnLicenseExp": "Your license has expired.
Please update your license and refresh the page.", - "DE.Controllers.Main.warnNoLicense": "This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.", - "DE.Controllers.Main.warnNoLicenseUsers": "This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.", + "DE.Controllers.Main.warnNoLicense": "This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider purchasing a commercial license.", + "DE.Controllers.Main.warnNoLicenseUsers": "This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider purchasing a commercial license.", + "DE.Controllers.Main.warnLicenseExceeded": "The number of concurrent connections to the document server has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.", + "DE.Controllers.Main.warnLicenseUsersExceeded": "The number of concurrent users has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.", "DE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.", "DE.Controllers.Navigation.txtBeginning": "Beginning of document", "DE.Controllers.Navigation.txtGotoBeginning": "Go to the beginning of the document", diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index bf1613b60..eaf50a6ce 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -80,7 +80,7 @@ define([ usersCount : 1, fastCoauth : true, lostEditingRights : false, - licenseWarning : false + licenseType : false }; // Initialize viewport @@ -568,17 +568,37 @@ define([ onLicenseChanged: function(params) { var licType = params.asc_getLicenseType(); - if (licType !== undefined && (licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount) && this.appOptions.canEdit && this.editorConfig.mode !== 'view') { - this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) ? this.warnNoLicense : this.warnNoLicenseUsers; - } + 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)) + this._state.licenseType = licType; - if (this._isDocReady && this._state.licenseWarning) + if (this._isDocReady && this._state.licenseType) this.applyLicense(); }, applyLicense: function() { var me = this; - if (me._state.licenseWarning) { + if (this._state.licenseType) { + var license = this._state.licenseType, + buttons = [{text: 'OK'}]; + if (license===Asc.c_oLicenseResult.Connections || license===Asc.c_oLicenseResult.UsersCount) { + license = (license===Asc.c_oLicenseResult.Connections) ? this.warnLicenseExceeded : this.warnLicenseUsersExceeded; + } else { + license = (license===Asc.c_oLicenseResult.ConnectionsOS) ? this.warnNoLicense : this.warnNoLicenseUsers; + buttons = [{ + text: me.textBuyNow, + bold: true, + onClick: function() { + window.open('https://www.onlyoffice.com', "_blank"); + } + }, + { + text: me.textContactUs, + onClick: function() { + window.open('mailto:sales@onlyoffice.com', "_blank"); + } + }]; + } DE.getController('Toolbar').activateViewControls(); DE.getController('Toolbar').deactivateEditControls(); Common.NotificationCenter.trigger('api:disconnect'); @@ -591,22 +611,8 @@ define([ Common.localStorage.setItem("de-license-warning", now); uiApp.modal({ title: me.textNoLicenseTitle, - text : me._state.licenseWarning, - buttons: [ - { - text: me.textBuyNow, - bold: true, - onClick: function() { - window.open('https://www.onlyoffice.com', "_blank"); - } - }, - { - text: me.textContactUs, - onClick: function() { - window.open('mailto:sales@onlyoffice.com', "_blank"); - } - } - ] + text : license, + buttons: buttons }); } } else @@ -1251,7 +1257,6 @@ define([ textTryUndoRedo: 'The Undo/Redo functions are disabled for the Fast co-editing mode.', textBuyNow: 'Visit website', textNoLicenseTitle: 'ONLYOFFICE open source version', - warnNoLicense: 'This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.', textContactUs: 'Contact sales', errorViewerDisconnect: 'Connection is lost. You can still view the document,
but will not be able to download until the connection is restored.', warnLicenseExp: 'Your license has expired.
Please update your license and refresh the page.', @@ -1292,8 +1297,11 @@ define([ txtStyle_footnote_text: 'Footnote Text', txtHeader: "Header", txtFooter: "Footer", - warnNoLicenseUsers: 'This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.', - txtProtected: 'Once you enter the password and open the file, the current password to the file will be reset' + txtProtected: 'Once you enter the password and open the file, the current password to the file will be reset', + warnNoLicense: 'This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider purchasing a commercial license.', + warnNoLicenseUsers: 'This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider purchasing a commercial license.', + warnLicenseExceeded: 'The number of concurrent connections to the document server has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.', + warnLicenseUsersExceeded: 'The number of concurrent users has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.' } })(), DE.Controllers.Main || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index 01490ed44..b27cff114 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -150,8 +150,10 @@ "DE.Controllers.Main.uploadImageTextText": "Uploading image...", "DE.Controllers.Main.uploadImageTitleText": "Uploading Image", "DE.Controllers.Main.warnLicenseExp": "Your license has expired.
Please update your license and refresh the page.", - "DE.Controllers.Main.warnNoLicense": "This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.", - "DE.Controllers.Main.warnNoLicenseUsers": "This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.", + "DE.Controllers.Main.warnNoLicense": "This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider purchasing a commercial license.", + "DE.Controllers.Main.warnNoLicenseUsers": "This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider purchasing a commercial license.", + "DE.Controllers.Main.warnLicenseExceeded": "The number of concurrent connections to the document server has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.", + "DE.Controllers.Main.warnLicenseUsersExceeded": "The number of concurrent users has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.", "DE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.", "DE.Controllers.Search.textNoTextFound": "Text not Found", "DE.Controllers.Search.textReplaceAll": "Replace All", diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index cf238b519..fb808a0ae 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -102,7 +102,7 @@ define([ onLaunch: function() { var me = this; - this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseWarning: false}; + this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseType: false}; this.languages = null; this.translationTable = []; @@ -759,16 +759,27 @@ define([ onLicenseChanged: function(params) { var licType = params.asc_getLicenseType(); - if (licType !== undefined && (licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount) && this.appOptions.canEdit && this.editorConfig.mode !== 'view') { - this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) ? this.warnNoLicense : this.warnNoLicenseUsers; - } + 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)) + this._state.licenseType = licType; if (this._isDocReady) this.applyLicense(); }, applyLicense: function() { - if (this._state.licenseWarning) { + if (this._state.licenseType) { + var license = this._state.licenseType, + buttons = ['ok'], + primary = 'ok'; + if (license===Asc.c_oLicenseResult.Connections || license===Asc.c_oLicenseResult.UsersCount) { + license = (license===Asc.c_oLicenseResult.Connections) ? this.warnLicenseExceeded : this.warnLicenseUsersExceeded; + } else { + license = (license===Asc.c_oLicenseResult.ConnectionsOS) ? this.warnNoLicense : this.warnNoLicenseUsers; + buttons = [{value: 'buynow', caption: this.textBuyNow}, {value: 'contact', caption: this.textContactUs}]; + primary = 'buynow'; + } + this.disableEditing(true); Common.NotificationCenter.trigger('api:disconnect'); @@ -780,12 +791,9 @@ define([ Common.UI.info({ width: 500, title: this.textNoLicenseTitle, - msg : this._state.licenseWarning, - buttons: [ - {value: 'buynow', caption: this.textBuyNow}, - {value: 'contact', caption: this.textContactUs} - ], - primary: 'buynow', + msg : license, + buttons: buttons, + primary: primary, callback: function(btn) { if (btn == 'buynow') window.open('https://www.onlyoffice.com', "_blank"); @@ -1977,7 +1985,6 @@ define([ textStrict: 'Strict mode', textBuyNow: 'Visit website', textNoLicenseTitle: 'ONLYOFFICE open source version', - warnNoLicense: 'This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.', textContactUs: 'Contact sales', errorViewerDisconnect: 'Connection is lost. You can still view the document,
but will not be able to download or print until the connection is restored.', warnLicenseExp: 'Your license has expired.
Please update your license and refresh the page.', @@ -2010,7 +2017,6 @@ define([ saveTextText: 'Saving document...', txtLoading: 'Loading...', txtAddNotes: 'Click to add notes', - warnNoLicenseUsers: 'This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.', errorForceSave: "An error occurred while saving the file. Please use the 'Download as' option to save the file to your computer hard drive or try again later.", txtAddFirstSlide: 'Click to add first slide', txtTheme_blank: 'Blank', @@ -2023,7 +2029,11 @@ define([ txtTheme_safari: 'Safari', txtTheme_dotted: 'Dotted', txtTheme_corner: 'Corner', - txtTheme_turtle: 'Turtle' + txtTheme_turtle: 'Turtle', + warnNoLicense: 'This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider purchasing a commercial license.', + warnNoLicenseUsers: 'This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider purchasing a commercial license.', + warnLicenseExceeded: 'The number of concurrent connections to the document server has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.', + warnLicenseUsersExceeded: 'The number of concurrent users has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.' } })(), PE.Controllers.Main || {})) }); diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 35972d0f1..998919986 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -386,8 +386,10 @@ "PE.Controllers.Main.warnBrowserIE9": "The application has low capabilities on IE9. Use IE10 or higher", "PE.Controllers.Main.warnBrowserZoom": "Your browser current zoom setting is not fully supported. Please reset to the default zoom by pressing Ctrl+0.", "PE.Controllers.Main.warnLicenseExp": "Your license has expired.
Please update your license and refresh the page.", - "PE.Controllers.Main.warnNoLicense": "This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.", - "PE.Controllers.Main.warnNoLicenseUsers": "This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.", + "PE.Controllers.Main.warnNoLicense": "This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider purchasing a commercial license.", + "PE.Controllers.Main.warnNoLicenseUsers": "This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider purchasing a commercial license.", + "PE.Controllers.Main.warnLicenseExceeded": "The number of concurrent connections to the document server has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.", + "PE.Controllers.Main.warnLicenseUsersExceeded": "The number of concurrent users has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.", "PE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.", "PE.Controllers.Statusbar.zoomText": "Zoom {0}%", "PE.Controllers.Toolbar.confirmAddFontName": "The font you are going to save is not available on the current device.
The text style will be displayed using one of the system fonts, the saved font will be used when it is available.
Do you want to continue?", diff --git a/apps/presentationeditor/mobile/app/controller/Main.js b/apps/presentationeditor/mobile/app/controller/Main.js index fd1ac443b..5660cfcb7 100644 --- a/apps/presentationeditor/mobile/app/controller/Main.js +++ b/apps/presentationeditor/mobile/app/controller/Main.js @@ -80,7 +80,7 @@ define([ usersCount : 1, fastCoauth : true, lostEditingRights : false, - licenseWarning : false + licenseType : false }; // Initialize viewport @@ -523,17 +523,37 @@ define([ onLicenseChanged: function(params) { var licType = params.asc_getLicenseType(); - if (licType !== undefined && (licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount) && this.appOptions.canEdit && this.editorConfig.mode !== 'view') { - this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) ? this.warnNoLicense : this.warnNoLicenseUsers; - } + 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)) + this._state.licenseType = licType; - if (this._isDocReady && this._state.licenseWarning) + if (this._isDocReady && this._state.licenseType) this.applyLicense(); }, applyLicense: function() { var me = this; - if (me._state.licenseWarning) { + if (this._state.licenseType) { + var license = this._state.licenseType, + buttons = [{text: 'OK'}]; + if (license===Asc.c_oLicenseResult.Connections || license===Asc.c_oLicenseResult.UsersCount) { + license = (license===Asc.c_oLicenseResult.Connections) ? this.warnLicenseExceeded : this.warnLicenseUsersExceeded; + } else { + license = (license===Asc.c_oLicenseResult.ConnectionsOS) ? this.warnNoLicense : this.warnNoLicenseUsers; + buttons = [{ + text: me.textBuyNow, + bold: true, + onClick: function() { + window.open('https://www.onlyoffice.com', "_blank"); + } + }, + { + text: me.textContactUs, + onClick: function() { + window.open('mailto:sales@onlyoffice.com', "_blank"); + } + }]; + } PE.getController('Toolbar').activateViewControls(); PE.getController('Toolbar').deactivateEditControls(); Common.NotificationCenter.trigger('api:disconnect'); @@ -546,22 +566,8 @@ define([ Common.localStorage.setItem("pe-license-warning", now); uiApp.modal({ title: me.textNoLicenseTitle, - text : me._state.licenseWarning, - buttons: [ - { - text: me.textBuyNow, - bold: true, - onClick: function() { - window.open('https://www.onlyoffice.com', "_blank"); - } - }, - { - text: me.textContactUs, - onClick: function() { - window.open('mailto:sales@onlyoffice.com', "_blank"); - } - } - ] + text : license, + buttons: buttons }); } } else @@ -1252,7 +1258,6 @@ define([ textTryUndoRedo: 'The Undo/Redo functions are disabled for the Fast co-editing mode.', textBuyNow: 'Visit website', textNoLicenseTitle: 'ONLYOFFICE open source version', - warnNoLicense: 'This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.', textContactUs: 'Contact sales', errorViewerDisconnect: 'Connection is lost. You can still view the document,
but will not be able to download or print until the connection is restored.', warnLicenseExp: 'Your license has expired.
Please update your license and refresh the page.', @@ -1285,8 +1290,11 @@ define([ txtSlideNumber: 'Slide number', txtSlideSubtitle: 'Slide subtitle', txtSlideTitle: 'Slide title', - warnNoLicenseUsers: 'This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.', - txtProtected: 'Once you enter the password and open the file, the current password to the file will be reset' + txtProtected: 'Once you enter the password and open the file, the current password to the file will be reset', + warnNoLicense: 'This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider purchasing a commercial license.', + warnNoLicenseUsers: 'This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider purchasing a commercial license.', + warnLicenseExceeded: 'The number of concurrent connections to the document server has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.', + warnLicenseUsersExceeded: 'The number of concurrent users has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.' } })(), PE.Controllers.Main || {})) }); \ No newline at end of file diff --git a/apps/presentationeditor/mobile/locale/en.json b/apps/presentationeditor/mobile/locale/en.json index 1b455190c..96af22b03 100644 --- a/apps/presentationeditor/mobile/locale/en.json +++ b/apps/presentationeditor/mobile/locale/en.json @@ -204,8 +204,10 @@ "PE.Controllers.Main.uploadImageTextText": "Uploading image...", "PE.Controllers.Main.uploadImageTitleText": "Uploading Image", "PE.Controllers.Main.warnLicenseExp": "Your license has expired.
Please update your license and refresh the page.", - "PE.Controllers.Main.warnNoLicense": "This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.", - "PE.Controllers.Main.warnNoLicenseUsers": "This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.", + "PE.Controllers.Main.warnNoLicense": "This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider purchasing a commercial license.", + "PE.Controllers.Main.warnNoLicenseUsers": "This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider purchasing a commercial license.", + "PE.Controllers.Main.warnLicenseExceeded": "The number of concurrent connections to the document server has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.", + "PE.Controllers.Main.warnLicenseUsersExceeded": "The number of concurrent users has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.", "PE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.", "PE.Controllers.Search.textNoTextFound": "Text not Found", "PE.Controllers.Settings.notcriticalErrorTitle": "Warning", diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index f97db87d0..45ebd4d0a 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -107,7 +107,7 @@ define([ // $(document.body).css('position', 'absolute'); var me = this; - this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseWarning: false}; + this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseType: false}; this.translationTable = []; if (!Common.Utils.isBrowserSupported()){ @@ -786,16 +786,27 @@ define([ if (this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) return; var licType = params.asc_getLicenseType(); - if (licType !== undefined && (licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount) && this.appOptions.canEdit && this.editorConfig.mode !== 'view') { - this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) ? this.warnNoLicense : this.warnNoLicenseUsers; - } + 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)) + this._state.licenseType = licType; if (this._isDocReady) this.applyLicense(); }, applyLicense: function() { - if (this._state.licenseWarning) { + if (this._state.licenseType) { + var license = this._state.licenseType, + buttons = ['ok'], + primary = 'ok'; + if (license===Asc.c_oLicenseResult.Connections || license===Asc.c_oLicenseResult.UsersCount) { + license = (license===Asc.c_oLicenseResult.Connections) ? this.warnLicenseExceeded : this.warnLicenseUsersExceeded; + } else { + license = (license===Asc.c_oLicenseResult.ConnectionsOS) ? this.warnNoLicense : this.warnNoLicenseUsers; + buttons = [{value: 'buynow', caption: this.textBuyNow}, {value: 'contact', caption: this.textContactUs}]; + primary = 'buynow'; + } + this.disableEditing(true); Common.NotificationCenter.trigger('api:disconnect'); @@ -807,12 +818,9 @@ define([ Common.UI.info({ width: 500, title: this.textNoLicenseTitle, - msg : this._state.licenseWarning, - buttons: [ - {value: 'buynow', caption: this.textBuyNow}, - {value: 'contact', caption: this.textContactUs} - ], - primary: 'buynow', + msg : license, + buttons: buttons, + primary: primary, callback: function(btn) { if (btn == 'buynow') window.open('https://www.onlyoffice.com', "_blank"); @@ -2159,7 +2167,6 @@ define([ errorFrmlWrongReferences: 'The function refers to a sheet that does not exist.
Please check the data and try again.', textBuyNow: 'Visit website', textNoLicenseTitle: 'ONLYOFFICE open source version', - warnNoLicense: 'This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.', textContactUs: 'Contact sales', confirmPutMergeRange: 'The source data contains merged cells.
They will be unmerged before they are pasted into the table.', errorViewerDisconnect: 'Connection is lost. You can still view the document,
but will not be able to download or print until the connection is restored.', @@ -2200,9 +2207,13 @@ define([ txtStyle_Currency: 'Currency', txtStyle_Percent: 'Percent', txtStyle_Comma: 'Comma', - warnNoLicenseUsers: 'This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.', errorForceSave: "An error occurred while saving the file. Please use the 'Download as' option to save the file to your computer hard drive or try again later.", - errorMaxPoints: "The maximum number of points in series per chart is 4096." + errorMaxPoints: "The maximum number of points in series per chart is 4096.", + warnNoLicense: 'This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider purchasing a commercial license.', + warnNoLicenseUsers: 'This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider purchasing a commercial license.', + warnLicenseExceeded: 'The number of concurrent connections to the document server has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.', + warnLicenseUsersExceeded: 'The number of concurrent users has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.' + } })(), SSE.Controllers.Main || {})) }); diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index d6e2cfd6f..172a8fadd 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -495,8 +495,10 @@ "SSE.Controllers.Main.warnBrowserIE9": "The application has low capabilities on IE9. Use IE10 or higher", "SSE.Controllers.Main.warnBrowserZoom": "Your browser current zoom setting is not fully supported. Please reset to the default zoom by pressing Ctrl+0.", "SSE.Controllers.Main.warnLicenseExp": "Your license has expired.
Please update your license and refresh the page.", - "SSE.Controllers.Main.warnNoLicense": "This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.", - "SSE.Controllers.Main.warnNoLicenseUsers": "This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.", + "SSE.Controllers.Main.warnNoLicense": "This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider purchasing a commercial license.", + "SSE.Controllers.Main.warnNoLicenseUsers": "This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider purchasing a commercial license.", + "SSE.Controllers.Main.warnLicenseExceeded": "The number of concurrent connections to the document server has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.", + "SSE.Controllers.Main.warnLicenseUsersExceeded": "The number of concurrent users has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.", "SSE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.", "SSE.Controllers.Print.strAllSheets": "All Sheets", "SSE.Controllers.Print.textWarning": "Warning", diff --git a/apps/spreadsheeteditor/mobile/app/controller/Main.js b/apps/spreadsheeteditor/mobile/app/controller/Main.js index 9ff1c3a98..2e3cde961 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Main.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Main.js @@ -81,7 +81,7 @@ define([ usersCount : 1, fastCoauth : true, lostEditingRights : false, - licenseWarning : false + licenseType : false }; // Initialize viewport @@ -552,17 +552,37 @@ define([ if (this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) return; var licType = params.asc_getLicenseType(); - if (licType !== undefined && (licType===Asc.c_oLicenseResult.Connections || licType===Asc.c_oLicenseResult.UsersCount) && this.appOptions.canEdit && this.editorConfig.mode !== 'view') { - this._state.licenseWarning = (licType===Asc.c_oLicenseResult.Connections) ? this.warnNoLicense : this.warnNoLicenseUsers; - } + 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)) + this._state.licenseType = licType; - if (this._isDocReady && this._state.licenseWarning) + if (this._isDocReady && this._state.licenseType) this.applyLicense(); }, applyLicense: function() { var me = this; - if (me._state.licenseWarning) { + if (this._state.licenseType) { + var license = this._state.licenseType, + buttons = [{text: 'OK'}]; + if (license===Asc.c_oLicenseResult.Connections || license===Asc.c_oLicenseResult.UsersCount) { + license = (license===Asc.c_oLicenseResult.Connections) ? this.warnLicenseExceeded : this.warnLicenseUsersExceeded; + } else { + license = (license===Asc.c_oLicenseResult.ConnectionsOS) ? this.warnNoLicense : this.warnNoLicenseUsers; + buttons = [{ + text: me.textBuyNow, + bold: true, + onClick: function() { + window.open('https://www.onlyoffice.com', "_blank"); + } + }, + { + text: me.textContactUs, + onClick: function() { + window.open('mailto:sales@onlyoffice.com', "_blank"); + } + }]; + } SSE.getController('Toolbar').activateViewControls(); SSE.getController('Toolbar').deactivateEditControls(); Common.NotificationCenter.trigger('api:disconnect'); @@ -575,22 +595,8 @@ define([ Common.localStorage.setItem("sse-license-warning", now); uiApp.modal({ title: me.textNoLicenseTitle, - text : me._state.licenseWarning, - buttons: [ - { - text: me.textBuyNow, - bold: true, - onClick: function() { - window.open('https://www.onlyoffice.com', "_blank"); - } - }, - { - text: me.textContactUs, - onClick: function() { - window.open('mailto:sales@onlyoffice.com', "_blank"); - } - } - ] + text : license, + buttons: buttons }); } } else @@ -1396,7 +1402,6 @@ define([ txtErrorLoadHistory: 'Loading history failed', textBuyNow: 'Visit website', textNoLicenseTitle: 'ONLYOFFICE open source version', - warnNoLicense: 'This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.', textContactUs: 'Contact sales', errorViewerDisconnect: 'Connection is lost. You can still view the document,
but will not be able to download until the connection is restored.', warnLicenseExp: 'Your license has expired.
Please update your license and refresh the page.', @@ -1449,9 +1454,12 @@ define([ txtStyle_Currency: 'Currency', txtStyle_Percent: 'Percent', txtStyle_Comma: 'Comma', - warnNoLicenseUsers: 'This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.', errorMaxPoints: 'The maximum number of points in series per chart is 4096.', - txtProtected: 'Once you enter the password and open the file, the current password to the file will be reset' + txtProtected: 'Once you enter the password and open the file, the current password to the file will be reset', + warnNoLicense: 'This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider purchasing a commercial license.', + warnNoLicenseUsers: 'This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider purchasing a commercial license.', + warnLicenseExceeded: 'The number of concurrent connections to the document server has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.', + warnLicenseUsersExceeded: 'The number of concurrent users has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.' } })(), SSE.Controllers.Main || {})) }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json index 6248bdd42..87f626b63 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -257,8 +257,10 @@ "SSE.Controllers.Main.uploadImageTextText": "Uploading image...", "SSE.Controllers.Main.uploadImageTitleText": "Uploading Image", "SSE.Controllers.Main.warnLicenseExp": "Your license has expired.
Please update your license and refresh the page.", - "SSE.Controllers.Main.warnNoLicense": "This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider upgrading your current license or purchasing a commercial one.", - "SSE.Controllers.Main.warnNoLicenseUsers": "This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider upgrading your current license or purchasing a commercial one.", + "SSE.Controllers.Main.warnNoLicense": "This version of ONLYOFFICE Editors has certain limitations for concurrent connections to the document server.
If you need more please consider purchasing a commercial license.", + "SSE.Controllers.Main.warnNoLicenseUsers": "This version of ONLYOFFICE Editors has certain limitations for concurrent users.
If you need more please consider purchasing a commercial license.", + "SSE.Controllers.Main.warnLicenseExceeded": "The number of concurrent connections to the document server has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.", + "SSE.Controllers.Main.warnLicenseUsersExceeded": "The number of concurrent users has been exceeded and the document will be opened for viewing only.
Please contact your administrator for more information.", "SSE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.", "SSE.Controllers.Search.textNoTextFound": "Text not found", "SSE.Controllers.Search.textReplaceAll": "Replace All",