From 3e79a1900240c24d65484b48f88d8f8be5e399c7 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 7 Sep 2018 13:22:03 +0300 Subject: [PATCH] Add license error --- .../main/app/controller/Main.js | 28 +++++++++++++++++-- apps/documenteditor/main/locale/en.json | 3 ++ .../main/app/controller/Main.js | 26 ++++++++++++++++- apps/presentationeditor/main/locale/en.json | 3 ++ .../main/app/controller/Main.js | 26 ++++++++++++++++- apps/spreadsheeteditor/main/locale/en.json | 3 ++ 6 files changed, 85 insertions(+), 4 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 94063ac4d..95b312e3f 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -181,6 +181,7 @@ define([ this.api.asc_registerCallback('asc_onPrintUrl', _.bind(this.onPrintUrl, this)); this.api.asc_registerCallback('asc_onMeta', _.bind(this.onMeta, this)); this.api.asc_registerCallback('asc_onSpellCheckInit', _.bind(this.loadLanguages, this)); + this.api.asc_registerCallback('asc_onLicenseError', _.bind(this.onPaidFeatureError, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); Common.NotificationCenter.on('goback', _.bind(this.goBack, this)); @@ -1041,6 +1042,26 @@ define([ } }, + onPaidFeatureError: function() { + var buttons = [], primary, + mail = (this.appOptions.canBranding) ? ((this.editorConfig && this.editorConfig.customization && this.editorConfig.customization.customer) ? this.editorConfig.customization.customer.mail : '') : 'sales@onlyoffice.com'; + if (mail.length>0) { + buttons.push({value: 'contact', caption: this.textContactUs}); + primary = 'contact'; + } + buttons.push({value: 'close', caption: this.textClose}); + Common.UI.info({ + title: this.textPaidFeature, + msg : this.textLicencePaidFeature, + buttons: buttons, + primary: primary, + callback: function(btn) { + if (btn == 'contact') + window.open('mailto:'+mail, "_blank"); + } + }); + }, + onOpenDocument: function(progress) { var elem = document.getElementById('loadmask-text'); var proc = (progress.asc_getCurrentFont() + progress.asc_getCurrentImage())/(progress.asc_getFontsCount() + progress.asc_getImagesCount()); @@ -2218,7 +2239,7 @@ define([ textStrict: 'Strict mode', txtErrorLoadHistory: 'Loading history failed', textBuyNow: 'Visit website', - textNoLicenseTitle: 'ONLYOFFICE open source version', + textNoLicenseTitle: 'ONLYOFFICE connection limitation', 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.', @@ -2273,7 +2294,10 @@ define([ 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.', - errorDataEncrypted: 'Encrypted changes have been received, they cannot be deciphered.' + errorDataEncrypted: 'Encrypted changes have been received, they cannot be deciphered.', + textClose: 'Close', + textPaidFeature: 'Paid feature', + textLicencePaidFeature: 'The feature you are trying to use is available for additional payment.
If you need it, please contact Sales Department' } })(), 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 8fcdf023b..5dd6ee46b 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -462,6 +462,9 @@ "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.warnProcessRightsChange": "You have been denied the right to edit the file.", + "DE.Controllers.Main.textClose": "Close", + "DE.Controllers.Main.textPaidFeature": "Paid feature", + "DE.Controllers.Main.textLicencePaidFeature": "The feature you are trying to use is available for additional payment.
If you need it, please contact Sales Department", "DE.Controllers.Navigation.txtBeginning": "Beginning of document", "DE.Controllers.Navigation.txtGotoBeginning": "Go to the beginning of the document", "DE.Controllers.Statusbar.textHasChanges": "New changes have been tracked", diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 0d07207b8..cc33295dc 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -174,6 +174,7 @@ define([ this.api.asc_registerCallback('asc_onMeta', _.bind(this.onMeta, this)); this.api.asc_registerCallback('asc_onAdvancedOptions', _.bind(this.onAdvancedOptions, this)); this.api.asc_registerCallback('asc_onSpellCheckInit', _.bind(this.loadLanguages, this)); + this.api.asc_registerCallback('asc_onLicenseError', _.bind(this.onPaidFeatureError, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); Common.NotificationCenter.on('goback', _.bind(this.goBack, this)); @@ -805,6 +806,26 @@ define([ } }, + onPaidFeatureError: function() { + var buttons = [], primary, + mail = (this.appOptions.canBranding) ? ((this.editorConfig && this.editorConfig.customization && this.editorConfig.customization.customer) ? this.editorConfig.customization.customer.mail : '') : 'sales@onlyoffice.com'; + if (mail.length>0) { + buttons.push({value: 'contact', caption: this.textContactUs}); + primary = 'contact'; + } + buttons.push({value: 'close', caption: this.textClose}); + Common.UI.info({ + title: this.textPaidFeature, + msg : this.textLicencePaidFeature, + buttons: buttons, + primary: primary, + callback: function(btn) { + if (btn == 'contact') + window.open('mailto:'+mail, "_blank"); + } + }); + }, + disableEditing: function(disable) { var app = this.getApplication(); if (this.appOptions.canEdit && this.editorConfig.mode !== 'view') { @@ -2045,7 +2066,10 @@ define([ 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.', - errorDataEncrypted: 'Encrypted changes have been received, they cannot be deciphered.' + errorDataEncrypted: 'Encrypted changes have been received, they cannot be deciphered.', + textClose: 'Close', + textPaidFeature: 'Paid feature', + textLicencePaidFeature: 'The feature you are trying to use is available for additional payment.
If you need it, please contact Sales Department' } })(), PE.Controllers.Main || {})) }); diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index a9609ceca..3184a325a 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -400,6 +400,9 @@ "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.warnProcessRightsChange": "You have been denied the right to edit the file.", + "PE.Controllers.Main.textClose": "Close", + "PE.Controllers.Main.textPaidFeature": "Paid feature", + "PE.Controllers.Main.textLicencePaidFeature": "The feature you are trying to use is available for additional payment.
If you need it, please contact Sales Department", "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?", "PE.Controllers.Toolbar.textAccent": "Accents", diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 1d7158447..e8b0728da 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -164,6 +164,7 @@ define([ this.api.asc_registerCallback('asc_onDocumentName', _.bind(this.onDocumentName, this)); this.api.asc_registerCallback('asc_onPrintUrl', _.bind(this.onPrintUrl, this)); this.api.asc_registerCallback('asc_onMeta', _.bind(this.onMeta, this)); + this.api.asc_registerCallback('asc_onLicenseError', _.bind(this.onPaidFeatureError, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); Common.NotificationCenter.on('goback', _.bind(this.goBack, this)); Common.NotificationCenter.on('namedrange:locked', _.bind(this.onNamedRangeLocked, this)); @@ -831,6 +832,26 @@ define([ } }, + onPaidFeatureError: function() { + var buttons = [], primary, + mail = (this.appOptions.canBranding) ? ((this.editorConfig && this.editorConfig.customization && this.editorConfig.customization.customer) ? this.editorConfig.customization.customer.mail : '') : 'sales@onlyoffice.com'; + if (mail.length>0) { + buttons.push({value: 'contact', caption: this.textContactUs}); + primary = 'contact'; + } + buttons.push({value: 'close', caption: this.textClose}); + Common.UI.info({ + title: this.textPaidFeature, + msg : this.textLicencePaidFeature, + buttons: buttons, + primary: primary, + callback: function(btn) { + if (btn == 'contact') + window.open('mailto:'+mail, "_blank"); + } + }); + }, + disableEditing: function(disable) { var app = this.getApplication(); if (this.appOptions.canEdit && this.editorConfig.mode !== 'view') { @@ -2224,7 +2245,10 @@ define([ 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.', - errorDataEncrypted: 'Encrypted changes have been received, they cannot be deciphered.' + errorDataEncrypted: 'Encrypted changes have been received, they cannot be deciphered.', + textClose: 'Close', + textPaidFeature: 'Paid feature', + textLicencePaidFeature: 'The feature you are trying to use is available for additional payment.
If you need it, please contact Sales Department' } })(), SSE.Controllers.Main || {})) }); diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 344cf2aaa..01e0679da 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -534,6 +534,9 @@ "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.warnProcessRightsChange": "You have been denied the right to edit the file.", + "SSE.Controllers.Main.textClose": "Close", + "SSE.Controllers.Main.textPaidFeature": "Paid feature", + "SSE.Controllers.Main.textLicencePaidFeature": "The feature you are trying to use is available for additional payment.
If you need it, please contact Sales Department", "SSE.Controllers.Print.strAllSheets": "All Sheets", "SSE.Controllers.Print.textWarning": "Warning", "SSE.Controllers.Print.warnCheckMargings": "Margins are incorrect",