From 26643799c5aeca048aa7ce48e5dda8c6073f8e44 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 14 Oct 2021 17:58:26 +0000 Subject: [PATCH] F2021-068 Added logic to support the conditional Folder Specific (SI) pagelist items --- .../Volian.Print.Library/VlnSvgPageHelper.cs | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs index 5ebb7366..95d9989b 100644 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs +++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs @@ -1465,6 +1465,62 @@ i = 0; } } } + else if (token.Contains(@"SI=")) // F2021-068 needed duplicate conditional logic from PSI (above) but make of folder (set) specific info + { + DocVersionConfig dvConfig = new DocVersionConfig(section.MyProcedure.MyDocVersion.Config); + FolderConfig folderConfig = new FolderConfig(section.MyProcedure.MyDocVersion.MyFolder.Config); + if (dvConfig != null || folderConfig != null) + { + int indx = token.IndexOf("="); + int qindx = token.IndexOf("?", indx); + string pstok = token.Substring(indx + 1, qindx - indx - 1); + string val = DocVersionInfo.GetInheritedSIValue(section.MyProcedure, pstok); + + int bindx = token.IndexOf("|", indx); + if (val == "Y") + { + val = token.Substring(qindx + 1, bindx - qindx - 1); + // see if there is a RelatedItem in this page item. RelatedItem allows for repositioning + // this current item if both items are set to be printed from the Procedure Specific Information. If both are printed + // the location of this item is defined in the RelatedItem xml. + if (pageItem.RelatedItem.Token != null) + { + // see if the related item is on this page also, if so, use the new row/col/justify: + string reltoken = pageItem.RelatedItem.Token; + string relval = DocVersionInfo.GetInheritedSIValue(section.MyProcedure, reltoken); + if (relval == "Y") + { + svgGroup.Add(PageItemToSvgText(pltok, (float)pageItem.RelatedItem.Row, (float)pageItem.RelatedItem.Col, pageItem.RelatedItem.Justify ?? VEPROMS.CSLA.Library.E_Justify.PSLeft, pageItem.Font, val, MySection)); + plstr = ""; // Clear it so it isn't put out twice (used below) + } + } + } + else + { + int eindx = token.IndexOf("}", bindx); + val = token.Substring(bindx + 1, eindx - bindx - 1); + } + if (val != null && val != "" && !PgLogicals.ContainsKey(pstok)) PgLogicals.Add(pstok, val != null); + //if (val == null || val == "") + //val = " "; + if (val == null) + val = ""; + plstr = plstr.Replace(token, val); + // Get a list of Pagelist token that are inside the SI= conditional result + // Paglist tokens inside a PS= conditional are surrounded by square brackets instead of curley + // ex. [BOX3] instead of {BOX3} + MatchCollection subMatches = regexFindSubToken.Matches(plstr); + if (subMatches.Count > 0) + { + foreach (Match subMatch in subMatches) + { + string subToken = subMatch.Value; + ProcessPaglistToken(section, svgGroup, pageItem, ref useFontForCheckOffHeader, ref plstr, subToken); + } + } + } + } + else { if (!ProcessPaglistToken(section, svgGroup, pageItem, ref useFontForCheckOffHeader, ref plstr, token)) break;