From d067d3572c32dba5ae12e648a0299144cc8fd1bb Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 14 Dec 2020 14:47:48 +0300 Subject: [PATCH] Show custom message for protected files --- apps/common/main/lib/view/OpenDialog.js | 3 ++- apps/documenteditor/main/app/controller/Main.js | 1 + apps/documenteditor/mobile/app/controller/Main.js | 2 +- apps/presentationeditor/main/app/controller/Main.js | 1 + apps/presentationeditor/mobile/app/controller/Main.js | 2 +- apps/spreadsheeteditor/main/app/controller/Main.js | 1 + apps/spreadsheeteditor/mobile/app/controller/Main.js | 2 +- 7 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/common/main/lib/view/OpenDialog.js b/apps/common/main/lib/view/OpenDialog.js index 659d4b7df..6123d15f5 100644 --- a/apps/common/main/lib/view/OpenDialog.js +++ b/apps/common/main/lib/view/OpenDialog.js @@ -68,6 +68,7 @@ define([ preview : options.preview, warning : options.warning, codepages : options.codepages, + warningMsg : options.warningMsg, width : width, height : height, header : true, @@ -85,7 +86,7 @@ define([ '<% if (warning) { %>', '
', '
', - '
' + t.txtProtected+ '
', + '
' + (typeof _options.warningMsg=='string' ? _options.warningMsg : t.txtProtected) + '
', '', '
', '
', diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 0aafc7a84..987df7258 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -2088,6 +2088,7 @@ define([ closeFile: me.appOptions.canRequestClose, type: Common.Utils.importTextType.DRM, warning: !(me.appOptions.isDesktopApp && me.appOptions.isOffline), + warningMsg: advOptions, validatePwd: !!me._state.isDRM, handler: function (result, value) { me.isShowOpenDialog = false; diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index 51cb46f04..2f988bb44 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -1329,7 +1329,7 @@ define([ me._state.openDlg = uiApp.modal({ title: me.advDRMOptions, - text: me.txtProtected, + text: (typeof advOptions=='string' ? advOptions : me.txtProtected), afterText: '
', buttons: buttons }); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index d8c228a71..27390ccb0 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -1884,6 +1884,7 @@ define([ closeFile: me.appOptions.canRequestClose, type: Common.Utils.importTextType.DRM, warning: !(me.appOptions.isDesktopApp && me.appOptions.isOffline), + warningMsg: advOptions, validatePwd: !!me._state.isDRM, handler: function (result, value) { me.isShowOpenDialog = false; diff --git a/apps/presentationeditor/mobile/app/controller/Main.js b/apps/presentationeditor/mobile/app/controller/Main.js index 54dd18f5c..4e37dc86a 100644 --- a/apps/presentationeditor/mobile/app/controller/Main.js +++ b/apps/presentationeditor/mobile/app/controller/Main.js @@ -1218,7 +1218,7 @@ define([ me._state.openDlg = uiApp.modal({ title: me.advDRMOptions, - text: me.txtProtected, + text: (typeof advOptions=='string' ? advOptions : me.txtProtected), afterText: '
', buttons: buttons }); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 860646e1e..9ba061b0c 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1826,6 +1826,7 @@ define([ closeFile: me.appOptions.canRequestClose, type: Common.Utils.importTextType.DRM, warning: !(me.appOptions.isDesktopApp && me.appOptions.isOffline), + warningMsg: advOptions, validatePwd: !!me._state.isDRM, handler: function (result, value) { me.isShowOpenDialog = false; diff --git a/apps/spreadsheeteditor/mobile/app/controller/Main.js b/apps/spreadsheeteditor/mobile/app/controller/Main.js index d57e09c86..476818674 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Main.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Main.js @@ -1425,7 +1425,7 @@ define([ me._state.openDlg = uiApp.modal({ title: me.advDRMOptions, - text: me.txtProtected, + text: (typeof advOptions=='string' ? advOptions : me.txtProtected), afterText: '
', buttons: buttons });