diff --git a/apps/documenteditor/main/app/controller/FormsTab.js b/apps/documenteditor/main/app/controller/FormsTab.js index dddf680f1..9ef385626 100644 --- a/apps/documenteditor/main/app/controller/FormsTab.js +++ b/apps/documenteditor/main/app/controller/FormsTab.js @@ -170,7 +170,7 @@ define([ }, onControlsSelect: function(type) { - if (!(this.toolbar.mode && this.toolbar.mode.canFeatureContentControl)) return; + if (!(this.toolbar.mode && this.toolbar.mode.canFeatureContentControl && this.toolbar.mode.canFeatureForms)) return; var oPr, oFormPr = new AscCommon.CSdtFormPr(); diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 44d97a700..183a3194a 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -390,6 +390,7 @@ define([ this.appOptions.compatibleFeatures = (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compatibleFeatures; this.appOptions.canFeatureComparison = !!this.api.asc_isSupportFeature("comparison"); this.appOptions.canFeatureContentControl = !!this.api.asc_isSupportFeature("content-controls"); + this.appOptions.canFeatureForms = false; // hide in 6.3 this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false)); this.appOptions.user.guest && this.appOptions.canRenameAnonymous && Common.NotificationCenter.on('user:rename', _.bind(this.showRenameUserDialog, this)); diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 11ede557c..78ca39386 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -3092,8 +3092,8 @@ define([ onAppShowed: function (config) { var me = this; - var compactview = !(config.isEdit || config.isRestrictedEdit && config.canFillForms); - if ( config.isEdit || config.isRestrictedEdit && config.canFillForms) { + var compactview = !(config.isEdit || config.isRestrictedEdit && config.canFillForms && config.canFeatureForms); + if ( config.isEdit || config.isRestrictedEdit && config.canFillForms && config.canFeatureForms) { if ( Common.localStorage.itemExists("de-compact-toolbar") ) { compactview = Common.localStorage.getBool("de-compact-toolbar"); } else @@ -3141,21 +3141,23 @@ define([ Array.prototype.push.apply(me.toolbar.toolbarControls, links.getView('Links').getButtons()); } if ( config.isEdit && config.canFeatureContentControl || config.isRestrictedEdit && config.canFillForms ) { - tab = {caption: me.textTabForms, action: 'forms'}; - var forms = me.getApplication().getController('FormsTab'); - forms.setApi(me.api).setConfig({toolbar: me, config: config}); - $panel = forms.createToolbarPanel(); - if ($panel) { - me.toolbar.addTab(tab, $panel, 4); - me.toolbar.setVisible('forms', true); - if (config.isEdit && config.canFeatureContentControl) { - Array.prototype.push.apply(me.toolbar.toolbarControls, forms.getView('FormsTab').getButtons()); - me.onChangeSdtGlobalSettings(); - } else if (!compactview) { - me.toolbar.setTab('forms'); + if (config.canFeatureForms) { + tab = {caption: me.textTabForms, action: 'forms'}; + var forms = me.getApplication().getController('FormsTab'); + forms.setApi(me.api).setConfig({toolbar: me, config: config}); + $panel = forms.createToolbarPanel(); + if ($panel) { + me.toolbar.addTab(tab, $panel, 4); + me.toolbar.setVisible('forms', true); + if (config.isEdit && config.canFeatureContentControl) { + Array.prototype.push.apply(me.toolbar.toolbarControls, forms.getView('FormsTab').getButtons()); + } else if (!compactview) { + me.toolbar.setTab('forms'); + } } } } + config.isEdit && config.canFeatureContentControl && me.onChangeSdtGlobalSettings(); }, onAppReady: function (config) { diff --git a/apps/documenteditor/main/app/controller/Viewport.js b/apps/documenteditor/main/app/controller/Viewport.js index 3b234b489..80e01e5c5 100644 --- a/apps/documenteditor/main/app/controller/Viewport.js +++ b/apps/documenteditor/main/app/controller/Viewport.js @@ -165,7 +165,7 @@ define([ me.viewport.$el.attr('applang', me.appConfig.lang.split(/[\-_]/)[0]); - if ( !(config.isEdit || config.isRestrictedEdit && config.canFillForms) || + if ( !(config.isEdit || config.isRestrictedEdit && config.canFillForms && config.canFeatureForms) || ( !Common.localStorage.itemExists("de-compact-toolbar") && config.customization && config.customization.compactToolbar )) { @@ -205,8 +205,8 @@ define([ onAppReady: function (config) { var me = this; if ( me.header.btnOptions ) { - var compactview = !(config.isEdit || config.isRestrictedEdit && config.canFillForms); - if ( config.isEdit || config.isRestrictedEdit && config.canFillForms) { + var compactview = !(config.isEdit || config.isRestrictedEdit && config.canFillForms && config.canFeatureForms); + if ( config.isEdit || config.isRestrictedEdit && config.canFillForms && config.canFeatureForms) { if ( Common.localStorage.itemExists("de-compact-toolbar") ) { compactview = Common.localStorage.getBool("de-compact-toolbar"); } else diff --git a/apps/documenteditor/main/app/view/FormSettings.js b/apps/documenteditor/main/app/view/FormSettings.js index 443f84bf2..d89876c7d 100644 --- a/apps/documenteditor/main/app/view/FormSettings.js +++ b/apps/documenteditor/main/app/view/FormSettings.js @@ -323,6 +323,7 @@ define([ if (this.api) { // this.api.asc_registerCallback('asc_onParaSpacingLine', _.bind(this._onLineSpacing, this)); } + Common.NotificationCenter.on('storage:image-insert', _.bind(this.insertImageFromStorage, this)); return this; }, diff --git a/apps/documenteditor/main/app/view/RightMenu.js b/apps/documenteditor/main/app/view/RightMenu.js index dfadc2c5c..974fc87e1 100644 --- a/apps/documenteditor/main/app/view/RightMenu.js +++ b/apps/documenteditor/main/app/view/RightMenu.js @@ -211,7 +211,7 @@ define([ this.signatureSettings = new DE.Views.SignatureSettings(); } - if (mode && mode.canFeatureContentControl && mode.canEditContentControl) { + if (mode && mode.canFeatureContentControl && mode.canEditContentControl && mode.canFeatureForms) { this.btnForm = new Common.UI.Button({ hint: this.txtFormSettings, asctype: Common.Utils.documentSettingsType.Form,