diff --git a/apps/common/locale.js b/apps/common/locale.js
index d954165fc8..7990b2c8df 100644
--- a/apps/common/locale.js
+++ b/apps/common/locale.js
@@ -74,6 +74,9 @@ Common.Locale = new(function() {
var res = '';
if (l10n && scope && scope.name) {
res = l10n[scope.name + '.' + prop];
+
+ if ( !res && scope.default )
+ res = scope.default;
}
return res || (scope ? eval(scope.name).prototype[prop] : '');
diff --git a/apps/common/main/lib/controller/Desktop.js b/apps/common/main/lib/controller/Desktop.js
index 6d3e41a401..a5cd5bae35 100644
--- a/apps/common/main/lib/controller/Desktop.js
+++ b/apps/common/main/lib/controller/Desktop.js
@@ -201,9 +201,11 @@ define([
});
Common.NotificationCenter.on('document:ready', function () {
- var maincontroller = webapp.getController('Main');
- if ( maincontroller.api.asc_isReadOnly && maincontroller.api.asc_isReadOnly() ) {
- maincontroller.warningDocumentIsLocked();
+ if ( config.isEdit ) {
+ var maincontroller = webapp.getController('Main');
+ if (maincontroller.api.asc_isReadOnly && maincontroller.api.asc_isReadOnly()) {
+ maincontroller.warningDocumentIsLocked();
+ }
}
});
diff --git a/apps/common/main/lib/util/utils.js b/apps/common/main/lib/util/utils.js
index 57e933da4b..39bbf45a95 100644
--- a/apps/common/main/lib/util/utils.js
+++ b/apps/common/main/lib/util/utils.js
@@ -853,6 +853,30 @@ Common.Utils.injectComponent = function ($slot, cmp) {
}
};
+Common.Utils.warningDocumentIsLocked = function (opts) {
+ if ( opts.disablefunc )
+ opts.disablefunc(true);
+
+ var app = window.DE || window.PE || window.SSE;
+ var tip = new Common.UI.SynchronizeTip({
+ extCls : 'simple',
+ text : Common.Locale.get("warnFileLocked",{name:"Common.Translation", default:'Document is in use by another application. You can continue editing and save it as a copy.'}),
+ textLink : Common.Locale.get("txtContinueEditing",{name:app.nameSpace + ".Views.SignatureSettings", default:'Edit anyway'}),
+ placement : 'document'
+ });
+ tip.on({
+ 'dontshowclick': function() {
+ if ( opts.disablefunc ) opts.disablefunc(false);
+ app.getController('Main').api.asc_setIsReadOnly(false);
+ this.close();
+ },
+ 'closeclick': function() {
+ this.close();
+ }
+ });
+ tip.show();
+};
+
jQuery.fn.extend({
elementById: function (id, parent) {
/**
diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js
index 1cdc0ff1a5..bf8dc0e8ea 100644
--- a/apps/documenteditor/main/app/controller/Main.js
+++ b/apps/documenteditor/main/app/controller/Main.js
@@ -2222,36 +2222,15 @@ define([
warningDocumentIsLocked: function() {
var me = this;
var _disable_ui = function (disable) {
- DE.getController('RightMenu').SetDisabled(disable, false, true);
- DE.getController('Toolbar').DisableToolbar(disable, disable);
- DE.getController('Statusbar').getView('Statusbar').SetDisabled(disable);
- DE.getController('Common.Controllers.ReviewChanges').SetDisabled(disable);
+ me.disableEditing(disable);
DE.getController('DocumentHolder').getView().SetDisabled(disable, true);
DE.getController('Navigation') && DE.getController('Navigation').SetDisabled(disable);
DE.getController('LeftMenu').setPreviewMode(disable);
var comments = DE.getController('Common.Controllers.Comments');
if (comments) comments.setPreviewMode(disable);
- }
+ };
- _disable_ui(true);
-
- var tip = new Common.UI.SynchronizeTip({
- extCls : 'simple',
- text : Common.Locale.get("warnFileLocked",{name:"DE.Controllers.Main"}),
- textLink : Common.Locale.get("txtContinueEditing",{name:"DE.Views.SignatureSettings"}),
- placement : 'document'
- });
- tip.on({
- 'dontshowclick': function() {
- _disable_ui(false);
- me.api.asc_setIsReadOnly(false);
- this.close();
- },
- 'closeclick': function() {
- this.close();
- }
- });
- tip.show();
+ Common.Utils.warningDocumentIsLocked({disablefunc: _disable_ui});
},
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.',
diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json
index 7cc96cf00e..6a2e1ee461 100644
--- a/apps/documenteditor/main/locale/en.json
+++ b/apps/documenteditor/main/locale/en.json
@@ -71,6 +71,7 @@
"Common.Controllers.ReviewChanges.textUnderline": "Underline",
"Common.Controllers.ReviewChanges.textUrl": "Paste a document URL",
"Common.Controllers.ReviewChanges.textWidow": "Widow control",
+ "Common.Translation.warnFileLocked": "Document is in use by another application. You can continue editing and save it as a copy.",
"Common.define.chartData.textArea": "Area",
"Common.define.chartData.textBar": "Bar",
"Common.define.chartData.textCharts": "Charts",
@@ -743,7 +744,6 @@
"DE.Controllers.Main.warnNoLicense": "This version of %1 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 %1 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.warnFileLocked": "Document is in use by another application. You can continue editing and save it as a copy.",
"DE.Controllers.Main.textConvertEquation": "This equation was created with an old version of equation editor which is no longer supported. Converting this equation to Office Math ML format will make it editable.
Do you want to convert this equation?",
"DE.Controllers.Main.textApplyAll": "Apply to all equations",
"DE.Controllers.Main.textLearnMore": "Learn More",
diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js
index b32a87ac0d..bcbc8026b9 100644
--- a/apps/presentationeditor/main/app/controller/Main.js
+++ b/apps/presentationeditor/main/app/controller/Main.js
@@ -1866,6 +1866,20 @@ define([
}
},
+ warningDocumentIsLocked: function() {
+ var me = this;
+ Common.Utils.warningDocumentIsLocked({
+ disablefunc: function (disable) {
+ me.disableEditing(disable);
+ PE.getController('RightMenu').SetDisabled(disable, true);
+ PE.getController('Common.Controllers.ReviewChanges').SetDisabled(disable);
+ PE.getController('DocumentHolder').getView('DocumentHolder').SetDisabled(disable);
+ PE.getController('LeftMenu').setPreviewMode(disable);
+ var comments = PE.getController('Common.Controllers.Comments');
+ if (comments) comments.setPreviewMode(disable);
+ }});
+ },
+
// Translation
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.',
criticalErrorTitle: 'Error',
diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json
index bf5cd807c7..c7f9fc9ce9 100644
--- a/apps/presentationeditor/main/locale/en.json
+++ b/apps/presentationeditor/main/locale/en.json
@@ -1,4 +1,5 @@
{
+ "Common.Translation.warnFileLocked": "Document is in use by another application. You can continue editing and save it as a copy.",
"Common.Controllers.Chat.notcriticalErrorTitle": "Warning",
"Common.Controllers.Chat.textEnterMessage": "Enter your message here",
"Common.Controllers.ExternalDiagramEditor.textAnonymous": "Anonymous",
diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js
index 7dee9bd7c2..ed18c256ee 100644
--- a/apps/spreadsheeteditor/main/app/controller/Main.js
+++ b/apps/spreadsheeteditor/main/app/controller/Main.js
@@ -2164,6 +2164,22 @@ define([
if (url) this.iframePrint.src = url;
},
+ warningDocumentIsLocked: function() {
+ var me = this;
+ Common.Utils.warningDocumentIsLocked({
+ disablefunc: function (disable) {
+ me.disableEditing(disable);
+
+ SSE.getController('RightMenu').SetDisabled(disable, true);
+ SSE.getController('Statusbar').SetDisabled(disable);
+ SSE.getController('Common.Controllers.ReviewChanges').SetDisabled(disable);
+ SSE.getController('DocumentHolder').SetDisabled(disable, true);
+ SSE.getController('LeftMenu').setPreviewMode(disable);
+ var comments = SSE.getController('Common.Controllers.Comments');
+ if (comments) comments.setPreviewMode(disable);
+ }});
+ },
+
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.',
criticalErrorTitle: 'Error',
notcriticalErrorTitle: 'Warning',
diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json
index 13fa749b05..9808366fdf 100644
--- a/apps/spreadsheeteditor/main/locale/en.json
+++ b/apps/spreadsheeteditor/main/locale/en.json
@@ -1,5 +1,6 @@
{
"cancelButtonText": "Cancel",
+ "Common.Translation.warnFileLocked": "Document is in use by another application. You can continue editing and save it as a copy.",
"Common.Controllers.Chat.notcriticalErrorTitle": "Warning",
"Common.Controllers.Chat.textEnterMessage": "Enter your message here",
"Common.define.chartData.textArea": "Area",