B2016-122: from Document Version Properties form: click OK crashes if remove enhanced links done first.
B2016-122: Added a DocVersion.GetFromDB to get data directly from db (not from cache) Support subsections when setting context menu items for enhanced links
This commit is contained in:
@@ -235,21 +235,27 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
else if (MyItemInfo.IsHigh || MyItemInfo.IsCaution || MyItemInfo.IsNote)
|
||||
{
|
||||
EnhancedDocuments seds = MyItemInfo.ActiveSection.GetMyEnhancedDocuments();
|
||||
// for HLS there could be multiple level of sections, so need to walk up tree until a procedure to see if one exists on section/subsections.
|
||||
ItemInfo sect = MyItemInfo.ActiveSection;
|
||||
bool didMenuItem = false;
|
||||
foreach (EnhancedDocument sed in seds)
|
||||
while (!didMenuItem && sect.IsSection)
|
||||
{
|
||||
if (sed.Type == edtypebtn)
|
||||
EnhancedDocuments seds = sect.GetMyEnhancedDocuments();
|
||||
foreach (EnhancedDocument sed in seds)
|
||||
{
|
||||
if (MyItemInfo.IsHigh || ((MyItemInfo.IsCaution || MyItemInfo.IsNote) && MyItemInfo.MyHLS.GetMyEnhancedDocuments().Count > 0))
|
||||
if (sed.Type == edtypebtn)
|
||||
{
|
||||
biEnhanced.Visible = true;
|
||||
biEnhanced.Text = string.Format("Create Missing Enhanced {0} Document Step", dveds.GetByType(edtypebtn).Name);
|
||||
biEnhanced.Tag = MyItemInfo.ItemID;
|
||||
didMenuItem = true;
|
||||
break;
|
||||
if (MyItemInfo.IsHigh || ((MyItemInfo.IsCaution || MyItemInfo.IsNote) && MyItemInfo.MyHLS.GetMyEnhancedDocuments().Count > 0))
|
||||
{
|
||||
biEnhanced.Visible = true;
|
||||
biEnhanced.Text = string.Format("Create Missing Enhanced {0} Document Step", dveds.GetByType(edtypebtn).Name);
|
||||
biEnhanced.Tag = MyItemInfo.ItemID;
|
||||
didMenuItem = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sect = sect.MyParent;
|
||||
}
|
||||
if (!didMenuItem) biEnhanced.Visible = false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user