diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js index 1aa6ea402a..6f90ad3504 100644 --- a/apps/common/main/lib/controller/ReviewChanges.js +++ b/apps/common/main/lib/controller/ReviewChanges.js @@ -670,13 +670,13 @@ define([ } }); } else if (config.canViewReview) { - config.canViewReview = me.api.asc_HaveRevisionsChanges(true); // check revisions from all users + config.canViewReview = (config.isEdit || me.api.asc_HaveRevisionsChanges(true)); // check revisions from all users if (config.canViewReview) { var val = Common.localStorage.getItem(me.view.appPrefix + "review-mode"); if (val===null) val = me.appConfig.customization && /^(original|final|markup)$/i.test(me.appConfig.customization.reviewDisplay) ? me.appConfig.customization.reviewDisplay.toLocaleLowerCase() : 'original'; - me.turnDisplayMode(config.isRestrictedEdit ? 'markup' : val); // load display mode only in viewer - me.view.turnDisplayMode(config.isRestrictedEdit ? 'markup' : val); + me.turnDisplayMode((config.isEdit || config.isRestrictedEdit) ? 'markup' : val); // load display mode only in viewer + me.view.turnDisplayMode((config.isEdit || config.isRestrictedEdit) ? 'markup' : val); } } diff --git a/apps/common/mobile/lib/controller/Collaboration.js b/apps/common/mobile/lib/controller/Collaboration.js index 673092e464..63d5296a4e 100644 --- a/apps/common/mobile/lib/controller/Collaboration.js +++ b/apps/common/mobile/lib/controller/Collaboration.js @@ -209,7 +209,10 @@ define([ Common.Utils.addScrollIfNeed('.page[data-page=comments-view]', '.page[data-page=comments-view] .page-content'); } else { if(editor === 'DE' && !this.appConfig.canReview) { - $('#reviewing-settings').hide(); + this.canViewReview = me.api.asc_HaveRevisionsChanges(true); + if (!this.canViewReview) { + $('#reviewing-settings').hide(); + } } } }, @@ -282,6 +285,11 @@ define([ $('#settings-reject-all').removeClass('disabled'); $('#settings-review').removeClass('disabled'); } + if (!this.appConfig.canReview) { + $('#settings-review').hide(); + $('#settings-accept-all').hide(); + $('#settings-reject-all').hide(); + } }, onTrackChanges: function(e) { @@ -384,6 +392,10 @@ define([ $('#btn-prev-change').addClass('disabled'); $('#btn-next-change').addClass('disabled'); } + if (!this.appConfig.canReview) { + $('#btn-accept-change').addClass('disabled'); + $('#btn-reject-change').addClass('disabled'); + } }, onPrevChange: function() { diff --git a/apps/documenteditor/main/app/controller/DocumentHolder.js b/apps/documenteditor/main/app/controller/DocumentHolder.js index 18f1a82d51..55f341fbac 100644 --- a/apps/documenteditor/main/app/controller/DocumentHolder.js +++ b/apps/documenteditor/main/app/controller/DocumentHolder.js @@ -134,11 +134,14 @@ define([ } }, this)); diagramEditor.on('hide', _.bind(function(cmp, message) { - this.documentHolder.fireEvent('editcomplete', this.documentHolder); if (this.api) { this.api.asc_onCloseChartFrame(); this.api.asc_enableKeyEvents(true); } + var me = this; + setTimeout(function(){ + me.documentHolder.fireEvent('editcomplete', me.documentHolder); + }, 10); }, this)); } @@ -151,10 +154,13 @@ define([ this.api.asc_setMailMergeData(data); }, this)); mergeEditor.on('hide', _.bind(function(cmp, message) { - this.documentHolder.fireEvent('editcomplete', this.documentHolder); if (this.api) { this.api.asc_enableKeyEvents(true); } + var me = this; + setTimeout(function(){ + me.documentHolder.fireEvent('editcomplete', me.documentHolder); + }, 10); }, this)); } }, diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index b3058d6259..640e0b1046 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -2115,6 +2115,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 9c345baa7b..0a10d18f3e 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -2616,7 +2616,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; @@ -2624,6 +2624,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) { diff --git a/apps/documenteditor/main/app/view/StyleTitleDialog.js b/apps/documenteditor/main/app/view/StyleTitleDialog.js index 9a0deabee5..238efe6895 100644 --- a/apps/documenteditor/main/app/view/StyleTitleDialog.js +++ b/apps/documenteditor/main/app/view/StyleTitleDialog.js @@ -71,6 +71,7 @@ define([ ].join(''); this.options.tpl = _.template(this.template)(this.options); + this.options.formats = this.options.formats || []; Common.UI.Window.prototype.initialize.call(this, this.options); }, @@ -100,6 +101,7 @@ define([ $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); + this.options.formats.unshift({value: -1, displayValue: this.txtSameAs}); this.cmbNextStyle = new Common.UI.ComboBox({ el : $('#id-dlg-style-next-par'), style : 'width: 100%;', @@ -109,8 +111,7 @@ define([ data : this.options.formats, disabled : (this.options.formats.length==0) }); - if (this.options.formats.length>0) - this.cmbNextStyle.setValue(this.options.formats[0].value); + this.cmbNextStyle.setValue(-1); }, show: function() { @@ -128,8 +129,8 @@ define([ }, getNextStyle: function () { - var me = this; - return (me.options.formats.length>0) ? me.cmbNextStyle.getValue() : null; + var val = this.cmbNextStyle.getValue(); + return (val!=-1) ? val : null; }, onBtnClick: function(event) { @@ -161,7 +162,8 @@ define([ textHeader: 'Create New Style', txtEmpty: 'This field is required', txtNotEmpty: 'Field must not be empty', - textNextStyle: 'Next paragraph style' + textNextStyle: 'Next paragraph style', + txtSameAs: 'Same as created new style' }, DE.Views.StyleTitleDialog || {})) diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 81107c5033..fe28eb861d 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -1873,6 +1873,7 @@ "DE.Views.StyleTitleDialog.textTitle": "Title", "DE.Views.StyleTitleDialog.txtEmpty": "This field is required", "DE.Views.StyleTitleDialog.txtNotEmpty": "Field must not be empty", + "DE.Views.StyleTitleDialog.txtSameAs": "Same as created new style", "DE.Views.TableFormulaDialog.cancelButtonText": "Cancel", "DE.Views.TableFormulaDialog.okButtonText": "OK", "DE.Views.TableFormulaDialog.textBookmark": "Paste Bookmark", diff --git a/apps/documenteditor/main/locale/ru.json b/apps/documenteditor/main/locale/ru.json index 3d8d69c365..57a23f1b80 100644 --- a/apps/documenteditor/main/locale/ru.json +++ b/apps/documenteditor/main/locale/ru.json @@ -1873,6 +1873,7 @@ "DE.Views.StyleTitleDialog.textTitle": "Название", "DE.Views.StyleTitleDialog.txtEmpty": "Это поле необходимо заполнить", "DE.Views.StyleTitleDialog.txtNotEmpty": "Поле не может быть пустым", + "DE.Views.StyleTitleDialog.txtSameAs": "Такой же, как создаваемый стиль", "DE.Views.TableFormulaDialog.cancelButtonText": "Отмена", "DE.Views.TableFormulaDialog.okButtonText": "ОК", "DE.Views.TableFormulaDialog.textBookmark": "Вставить закладку", diff --git a/apps/documenteditor/mobile/app.js b/apps/documenteditor/mobile/app.js index 465d67e692..cfd2b1b40f 100644 --- a/apps/documenteditor/mobile/app.js +++ b/apps/documenteditor/mobile/app.js @@ -183,7 +183,7 @@ require([ //Store Framework7 initialized instance for easy access window.uiApp = new Framework7({ // Default title for modals - modalTitle: '{{MOBILE_MODAL_TITLE}}', + modalTitle: '{{APP_TITLE_TEXT}}', // Enable tap hold events tapHold: true, diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index d122f1bf69..8269cbea5d 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -553,7 +553,18 @@ define([ }, onShowHelp: function () { - window.open('{{SUPPORT_URL}}', "_blank"); + var url = '{{HELP_URL}}'; + if (url.charAt(url.length-1) !== '/') { + url += '/'; + } + if (Common.SharedSettings.get('sailfish')) { + url+='mobile-applications/documents/sailfish/index.aspx'; + } else if (Common.SharedSettings.get('android')) { + url+='mobile-applications/documents/android/index.aspx'; + } else { + url+='mobile-applications/documents/index.aspx'; + } + window.open(url, "_blank"); this.hideModal(); }, diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index a3e6bc4b63..cde8bf0fd1 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -633,21 +633,21 @@
<% print(/^(?:https?:\/{2})?(\S+)/.exec('{{PUBLISHER_URL}}')[1]); %>
+<% print(/^(?:https?:\/{2})?(\S+)/.exec('{{PUBLISHER_URL}}')[1]); %>
+<% print(/^(?:https?:\/{2})?(\S+)/.exec('{{PUBLISHER_URL}}')[1]); %>
+