[DE] Fix hiding buttons

This commit is contained in:
Julia Radzhabova
2025-02-19 19:26:24 +03:00
parent 0bb0d2011c
commit 03e1e4a674
2 changed files with 7 additions and 5 deletions

View File

@ -513,11 +513,12 @@ define([
config.isEdit && config.canFeatureContentControl && config.isFormCreator && !config.isOForm && me.showHelpTip('create'); // show tip only when create form in docxf
if (config.isRestrictedEdit && config.canFillForms && config.isPDFForm && me.api) {
var oform = me.api.asc_GetOForm();
if (!oform || !config.user.roles || config.user.roles.length<1 || !oform.asc_canFillRole(config.user.roles[0])) {
me.view && me.view.showFillingForms(false);
if (oform && config.user.roles && config.user.roles.length>0 && oform.asc_canFillRole(config.user.roles[0])) {
me.view && me.view.showFillingForms(true);
} else {
var role = new AscCommon.CRestrictionSettings();
role.put_OFormNoRole(true);
this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyForms, role);
me.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyForms, role);
}
}
if (config.isRestrictedEdit && me.view && me.view.btnSubmit && me.api) {

View File

@ -750,6 +750,7 @@ define([
this.btnSaveForm && this.btnSaveForm.render($host.find('#slot-btn-form-save'));
(this.btnSubmit && !(this.appConfig.isRestrictedEdit && this.appConfig.canFillForms) || this.btnSaveForm) && $host.find('.save-separator').show();
this.appConfig.isRestrictedEdit && this.appConfig.canFillForms && this.appConfig.isPDFForm && this.showFillingForms(false);
return this.$el;
},
@ -816,8 +817,8 @@ define([
this.btnClear.setVisible(visible);
this.btnPrevForm.setVisible(visible);
this.btnNextForm.setVisible(visible);
this.view.btnRedo.$el.next().hide();
this.btnPrevForm.cmpEl.parents('.group').hide().prev('.separator').hide();
visible ? this.btnPrevForm.$el.parents('.group').show().prev('.separator').show() :
this.btnPrevForm.$el.parents('.group').hide().prev('.separator').hide();
this.btnSubmit && this.btnSubmit.setVisible(visible);
},