[oform] Add ability to set NoRole as a current role

This commit is contained in:
Ilya Kirillov
2025-02-19 17:07:24 +03:00
parent 482774c219
commit 1f344b6991
2 changed files with 19 additions and 5 deletions

View File

@ -40,8 +40,9 @@
*/
function CRestrictionSettings()
{
this.OFormRole = undefined;
this.ResetNone = false;
this.OFormRole = undefined;
this.OFormNoRole = false;
this.ResetNone = false;
}
CRestrictionSettings.prototype.GetOFormRole = function()
{
@ -51,12 +52,22 @@
{
this.OFormRole = roleName;
};
CRestrictionSettings.prototype.IsOFormNoRole = function()
{
return this.OFormNoRole;
};
CRestrictionSettings.prototype.SetOFormNoRole = function(noRole)
{
this.OFormNoRole = noRole;
};
//--------------------------------------------------------export----------------------------------------------------
window['AscCommon'] = window['AscCommon'] || {};
window['AscCommon'].CRestrictionSettings = CRestrictionSettings;
window['AscCommon']["CRestrictionSettings"] = CRestrictionSettings;
CRestrictionSettings.prototype['get_OFormRole'] = CRestrictionSettings.prototype.GetOFormRole;
CRestrictionSettings.prototype['put_OFormRole'] = CRestrictionSettings.prototype.SetOFormRole;
CRestrictionSettings.prototype['get_OFormRole'] = CRestrictionSettings.prototype.GetOFormRole;
CRestrictionSettings.prototype['put_OFormRole'] = CRestrictionSettings.prototype.SetOFormRole;
CRestrictionSettings.prototype['get_OFormNoRole'] = CRestrictionSettings.prototype.IsOFormNoRole;
CRestrictionSettings.prototype['put_OFormNoRole'] = CRestrictionSettings.prototype.SetOFormNoRole;
})(window);

View File

@ -13709,7 +13709,10 @@ background-repeat: no-repeat;\
if (oform)
{
let roleName = restrictionSettings ? restrictionSettings.GetOFormRole() : null;
if (oLogicDocument.IsFillingFormMode() && roleName)
if (oLogicDocument.IsFillingFormMode() && restrictionSettings && restrictionSettings.IsOFormNoRole())
oform.setCurrentNoRole();
else if (oLogicDocument.IsFillingFormMode() && roleName)
oform.setCurrentRole(roleName);
else
oform.clearCurrentRole();