From 24c06d710ab6fa4f8daa705ad7b0ae190dec25d9 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 30 Aug 2019 19:39:20 +0000 Subject: [PATCH] B2019-121 Pagination was breaking on the last bulleted substep of a note, then mistakenly putting the bottom continue message on top of the note box. Logic now does a better job in keeping substeps within notes and caution together and thus placing the continue message in the correct location. --- PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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)