From f65057491cde692861fb6da16e701bd262525696 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 22 Aug 2019 17:16:07 +0300 Subject: [PATCH] [DE] Add methods to disable mail merge and version history (use in desktop app) --- apps/documenteditor/main/app/controller/Main.js | 11 +++++++++++ apps/documenteditor/main/app/controller/Toolbar.js | 7 ++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 61f8dee9d..25986829a 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -2124,6 +2124,17 @@ define([ this.beforeShowDummyComment = true; }, + DisableMailMerge: function() { + this.appOptions.mergeFolderUrl = ""; + var toolbarController = this.getApplication().getController('Toolbar'); + toolbarController && toolbarController.DisableMailMerge(); + }, + + DisableVersionHistory: function() { + this.editorConfig.canUseHistory = false; + this.appOptions.canUseHistory = false; + }, + 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/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index c8bdca3d9..7bbd02381 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -2615,7 +2615,7 @@ define([ this.toolbar.btnRedo.setDisabled(this._state.can_redo!==true); this.toolbar.btnCopy.setDisabled(this._state.can_copycut!==true); this.toolbar.btnPrint.setDisabled(!this.toolbar.mode.canPrint); - if (this.toolbar.mode.fileChoiceUrl || this.toolbar.mode.canRequestMailMergeRecipients) + if (!this._state.mmdisable && (this.toolbar.mode.fileChoiceUrl || this.toolbar.mode.canRequestMailMergeRecipients)) this.toolbar.btnMailRecepients.setDisabled(false); this._state.activated = true; @@ -2623,6 +2623,11 @@ define([ this.onApiPageSize(props.get_W(), props.get_H()); }, + DisableMailMerge: function() { + this._state.mmdisable = true; + this.toolbar && this.toolbar.btnMailRecepients && this.toolbar.btnMailRecepients.setDisabled(true); + }, + updateThemeColors: function() { var updateColors = function(picker, defaultColorIndex) { if (picker) {