C2019-045: Fix length of procedure number for CCR to work

C2019-045: For enhanced procedures, allow modification of number & title
This commit is contained in:
2019-12-13 11:51:15 +00:00
parent 5109fbbddb
commit beed3319ca
7 changed files with 618 additions and 31 deletions

View File

@@ -363,6 +363,16 @@ namespace VEPROMS.CSLA.Library
return _EnhType;
}
}
public bool EnhAllowMod()
{
// C2019-045: For enhanced procedures, allow modifications of number & text. This method checks whether the
// user selected to allow for modifications, i.e. the value in the docversion config, 'Enhanced_AllowMods' is true.
// Note that the flag is set on the enhanced doc versions, not the source, so that each enhanced can have its own setting.
if (!IsProcedure) return false;
if (MyDocVersion.DocVersionConfig.Enhanced_AllowMods) return true;
return false;
}
public bool InList(params int[] IDs)
{
foreach (int id in IDs)
@@ -7148,14 +7158,18 @@ namespace VEPROMS.CSLA.Library
// the text in the enhanced item based on the displaytext of the source item.
foreach (ItemInfo ii in iil)
{
EnhancedDocuments seds = ii.GetMyEnhancedDocuments();
if (seds != null && seds.Count != 0)
// C2019-045: if allowing mods for procedure num/text we don't want to update the enhanced text so only do if not allowing mods:
if (!ii.EnhAllowMod())
{
ItemInfo srcItem = ItemInfo.Get(seds[0].ItemID);
using (Item enhItem = Item.Get(ii.ItemID))
EnhancedDocuments seds = ii.GetMyEnhancedDocuments();
if (seds != null && seds.Count != 0)
{
enhItem.MyContent.Text = srcItem.DisplayTextKeepSpecialChars;
enhItem.Save();
ItemInfo srcItem = ItemInfo.Get(seds[0].ItemID);
using (Item enhItem = Item.Get(ii.ItemID))
{
enhItem.MyContent.Text = srcItem.DisplayTextKeepSpecialChars;
enhItem.Save();
}
}
}
}