[DE] Hide Forms

This commit is contained in:
Julia Radzhabova 2021-04-30 12:36:34 +03:00
parent 774b4befdc
commit 7099648bb1
5 changed files with 22 additions and 19 deletions

View file

@ -170,7 +170,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

@ -390,6 +390,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.3
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));
this.appOptions.user.guest && this.appOptions.canRenameAnonymous && Common.NotificationCenter.on('user:rename', _.bind(this.showRenameUserDialog, this)); this.appOptions.user.guest && this.appOptions.canRenameAnonymous && Common.NotificationCenter.on('user:rename', _.bind(this.showRenameUserDialog, this));

View file

@ -3092,8 +3092,8 @@ define([
onAppShowed: function (config) { onAppShowed: function (config) {
var me = this; var me = this;
var compactview = !(config.isEdit || config.isRestrictedEdit && config.canFillForms); var compactview = !(config.isEdit || config.isRestrictedEdit && config.canFillForms && config.canFeatureForms);
if ( config.isEdit || config.isRestrictedEdit && config.canFillForms) { if ( config.isEdit || config.isRestrictedEdit && config.canFillForms && config.canFeatureForms) {
if ( Common.localStorage.itemExists("de-compact-toolbar") ) { if ( Common.localStorage.itemExists("de-compact-toolbar") ) {
compactview = Common.localStorage.getBool("de-compact-toolbar"); compactview = Common.localStorage.getBool("de-compact-toolbar");
} else } else
@ -3141,21 +3141,23 @@ 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.isEdit && config.canFeatureContentControl || config.isRestrictedEdit && config.canFillForms ) { if ( config.isEdit && config.canFeatureContentControl || config.isRestrictedEdit && config.canFillForms ) {
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, config: config}); var forms = me.getApplication().getController('FormsTab');
$panel = forms.createToolbarPanel(); forms.setApi(me.api).setConfig({toolbar: me, config: config});
if ($panel) { $panel = forms.createToolbarPanel();
me.toolbar.addTab(tab, $panel, 4); if ($panel) {
me.toolbar.setVisible('forms', true); me.toolbar.addTab(tab, $panel, 4);
if (config.isEdit && config.canFeatureContentControl) { me.toolbar.setVisible('forms', true);
Array.prototype.push.apply(me.toolbar.toolbarControls, forms.getView('FormsTab').getButtons()); if (config.isEdit && config.canFeatureContentControl) {
me.onChangeSdtGlobalSettings(); Array.prototype.push.apply(me.toolbar.toolbarControls, forms.getView('FormsTab').getButtons());
} else if (!compactview) { } else if (!compactview) {
me.toolbar.setTab('forms'); me.toolbar.setTab('forms');
}
} }
} }
} }
config.isEdit && config.canFeatureContentControl && me.onChangeSdtGlobalSettings();
}, },
onAppReady: function (config) { onAppReady: function (config) {

View file

@ -165,7 +165,7 @@ define([
me.viewport.$el.attr('applang', me.appConfig.lang.split(/[\-_]/)[0]); 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") && ( !Common.localStorage.itemExists("de-compact-toolbar") &&
config.customization && config.customization.compactToolbar )) { config.customization && config.customization.compactToolbar )) {
@ -205,8 +205,8 @@ define([
onAppReady: function (config) { onAppReady: function (config) {
var me = this; var me = this;
if ( me.header.btnOptions ) { if ( me.header.btnOptions ) {
var compactview = !(config.isEdit || config.isRestrictedEdit && config.canFillForms); var compactview = !(config.isEdit || config.isRestrictedEdit && config.canFillForms && config.canFeatureForms);
if ( config.isEdit || config.isRestrictedEdit && config.canFillForms) { if ( config.isEdit || config.isRestrictedEdit && config.canFillForms && config.canFeatureForms) {
if ( Common.localStorage.itemExists("de-compact-toolbar") ) { if ( Common.localStorage.itemExists("de-compact-toolbar") ) {
compactview = Common.localStorage.getBool("de-compact-toolbar"); compactview = Common.localStorage.getBool("de-compact-toolbar");
} else } else

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,