diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 66389e26..b7295ae6 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -1306,6 +1306,21 @@ namespace VEPROMS.CSLA.Library return retval.ToString(); } } + // B2019-121 tell us if the step item in part of a caution or note type + public bool HasAncestorCautionOrNote + { + get + { + ItemInfo item = this.ActiveParent as ItemInfo; + while (item is ItemInfo && !item.IsHigh) + { + if (item.IsInCautionOrNote) + return true; + item = item.ActiveParent as ItemInfo; + } + return false; + } + } private static int CalcStepLevel(ItemInfo item) { if (item == null) return 0; @@ -1344,6 +1359,8 @@ namespace VEPROMS.CSLA.Library { if (item.Cautions != null || item.Notes != null) level += 2; + else if (item.HasAncestorCautionOrNote) // B2019-121 step part is in a caution or note + level += 3; } // Paginate before first caution, not between cautions. else if (item.IsCautionPart)