Merge pull request #684 from ONLYOFFICE/fix/hide-forms

[DE] Hide forms
This commit is contained in:
Julia Radzhabova 2021-01-29 20:05:58 +03:00 committed by GitHub
commit f32e6cd74c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 8 deletions

View file

@ -159,7 +159,7 @@ define([
}, },
onControlsSelect: function(type) { 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, var oPr,
oFormPr = new AscCommon.CSdtFormPr(); oFormPr = new AscCommon.CSdtFormPr();

View file

@ -371,6 +371,7 @@ define([
this.appOptions.compatibleFeatures = (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compatibleFeatures; this.appOptions.compatibleFeatures = (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compatibleFeatures;
this.appOptions.canFeatureComparison = !!this.api.asc_isSupportFeature("comparison"); this.appOptions.canFeatureComparison = !!this.api.asc_isSupportFeature("comparison");
this.appOptions.canFeatureContentControl = !!this.api.asc_isSupportFeature("content-controls"); this.appOptions.canFeatureContentControl = !!this.api.asc_isSupportFeature("content-controls");
this.appOptions.canFeatureForms = false; // hide in 6.2
this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false)); this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false));
appHeader = this.getApplication().getController('Viewport').getView('Common.Views.Header'); appHeader = this.getApplication().getController('Viewport').getView('Common.Views.Header');

View file

@ -3095,12 +3095,14 @@ define([
Array.prototype.push.apply(me.toolbar.toolbarControls, links.getView('Links').getButtons()); Array.prototype.push.apply(me.toolbar.toolbarControls, links.getView('Links').getButtons());
if (config.canFeatureContentControl) { if (config.canFeatureContentControl) {
tab = {caption: me.textTabForms, action: 'forms'}; if (config.canFeatureForms) {
var forms = me.getApplication().getController('FormsTab'); tab = {caption: me.textTabForms, action: 'forms'};
forms.setApi(me.api).setConfig({toolbar: me}); var forms = me.getApplication().getController('FormsTab');
me.toolbar.addTab(tab, $panel, 4); forms.setApi(me.api).setConfig({toolbar: me});
me.toolbar.setVisible('forms', true); me.toolbar.addTab(tab, $panel, 4);
Array.prototype.push.apply(me.toolbar.toolbarControls, forms.getView('FormsTab').getButtons()); me.toolbar.setVisible('forms', true);
Array.prototype.push.apply(me.toolbar.toolbarControls, forms.getView('FormsTab').getButtons());
}
me.onChangeSdtGlobalSettings(); me.onChangeSdtGlobalSettings();
} }
} }

View file

@ -211,7 +211,7 @@ define([
this.signatureSettings = new DE.Views.SignatureSettings(); 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({ this.btnForm = new Common.UI.Button({
hint: this.txtFormSettings, hint: this.txtFormSettings,
asctype: Common.Utils.documentSettingsType.Form, asctype: Common.Utils.documentSettingsType.Form,