diff --git a/PROMS/Formats/fmtall/CAL1all.xml b/PROMS/Formats/fmtall/CAL1all.xml index a2b5b562..b584e1ab 100644 Binary files a/PROMS/Formats/fmtall/CAL1all.xml and b/PROMS/Formats/fmtall/CAL1all.xml differ diff --git a/PROMS/Formats/fmtall/CAL2_00all.xml b/PROMS/Formats/fmtall/CAL2_00all.xml index 34af6e72..2cceeba1 100644 Binary files a/PROMS/Formats/fmtall/CAL2_00all.xml and b/PROMS/Formats/fmtall/CAL2_00all.xml differ diff --git a/PROMS/Formats/fmtall/CAL2all.xml b/PROMS/Formats/fmtall/CAL2all.xml index ea57f1ad..53fc979c 100644 Binary files a/PROMS/Formats/fmtall/CAL2all.xml and b/PROMS/Formats/fmtall/CAL2all.xml differ diff --git a/PROMS/Formats/fmtall/CALBCKall.xml b/PROMS/Formats/fmtall/CALBCKall.xml index 33bbe321..b77bfad2 100644 Binary files a/PROMS/Formats/fmtall/CALBCKall.xml and b/PROMS/Formats/fmtall/CALBCKall.xml differ diff --git a/PROMS/Formats/fmtall/CALFSGBCKall.xml b/PROMS/Formats/fmtall/CALFSGBCKall.xml index c01338b5..f8324ab1 100644 Binary files a/PROMS/Formats/fmtall/CALFSGBCKall.xml and b/PROMS/Formats/fmtall/CALFSGBCKall.xml differ diff --git a/PROMS/Formats/fmtall/CALOTOall.xml b/PROMS/Formats/fmtall/CALOTOall.xml index 805628f0..16b95356 100644 Binary files a/PROMS/Formats/fmtall/CALOTOall.xml and b/PROMS/Formats/fmtall/CALOTOall.xml differ diff --git a/PROMS/Formats/fmtall/CALSAMall.xml b/PROMS/Formats/fmtall/CALSAMall.xml index babc8e32..443c285c 100644 Binary files a/PROMS/Formats/fmtall/CALSAMall.xml and b/PROMS/Formats/fmtall/CALSAMall.xml differ diff --git a/PROMS/Formats/fmtall/GENall.xml b/PROMS/Formats/fmtall/GENall.xml index 432f0ac3..05f8bbaf 100644 Binary files a/PROMS/Formats/fmtall/GENall.xml and b/PROMS/Formats/fmtall/GENall.xml differ diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs index 32b18364..e43bafcf 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs @@ -468,10 +468,12 @@ namespace VEPROMS.CSLA.Library return text; } // B2022-035: resolve unit specific designators - moved code to here so that other objects can use it + // B2024-025 added to the replace list public static string ResolveUnitSpecific(DocVersionInfo mydocversion, string text) { if (mydocversion == null) return text; text = Regex.Replace(text, @"\", mydocversion.DocVersionConfig.Unit_Number, RegexOptions.IgnoreCase); + text = Regex.Replace(text, @"\", mydocversion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase); text = Regex.Replace(text, @"\<(U(-|\\u8209\?)ID)\>", mydocversion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase); text = Regex.Replace(text, @"\<(U(-|\\u8209\?)NAME)\>", mydocversion.DocVersionConfig.Unit_Name, RegexOptions.IgnoreCase); text = Regex.Replace(text, @"\<(U(-|\\u8209\?)TEXT)\>", mydocversion.DocVersionConfig.Unit_Text, RegexOptions.IgnoreCase); diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index e1634696..ca204abb 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -2934,7 +2934,8 @@ namespace VEPROMS.CSLA.Library { string str = MyContent.Text; // B2022-035: resolve unit specific designators - if (str.ToUpper().Contains(@", , ) + str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(this.MyDocVersion, str); return ConvertToDisplayText(str, false, " "); // B2024-013 added " " to replace hard returns with a space instead of semi-colon } } @@ -2946,7 +2947,8 @@ namespace VEPROMS.CSLA.Library { string str = MyContent.Text; // B2022-035: resolve unit specific designators - if (str.ToUpper().Contains(@", , ) + str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(this.MyDocVersion, str); return ConvertToDisplayText(str, false, ""); // pass in empty string for hard retun char will keep hard return } } @@ -2960,7 +2962,8 @@ namespace VEPROMS.CSLA.Library string str = MyContent.Text; if (MyDocVersion != null) { - str = Regex.Replace(str, @"\<[uU]\>", MyDocVersion.DocVersionConfig.Unit_Number); + // B2024-025 - process all of the applicability token (, , ) + str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(MyDocVersion, str); } else { @@ -2979,16 +2982,13 @@ namespace VEPROMS.CSLA.Library if (MyDocVersion != null) { // B2022-035: resolve unit specific designators - if (str.ToUpper().Contains(", , ) + str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(MyDocVersion, str); } else { _MyLog.WarnFormat("Disconnected Data - ItemID = {0}", ItemID); } - //if (str.Contains("")) - // str = str.Replace("", MyDocVersion.DocVersionConfig.Unit_Number); - //if (str.Contains("")) - // str = str.Replace("", MyDocVersion.DocVersionConfig.Unit_Number); return ConvertToDisplayText(str); } } @@ -3047,7 +3047,8 @@ namespace VEPROMS.CSLA.Library string str = MyContent.Text; if (MyDocVersion != null) { - str = Regex.Replace(str, @"\<[uU]\>", MyDocVersion.DocVersionConfig.Unit_Number); + // B2024-025 - process all of the applicability token (, , ) + str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(MyDocVersion, str); } else { @@ -3080,8 +3081,8 @@ namespace VEPROMS.CSLA.Library } else str = MyContent.Number; - str = Regex.Replace(str, @"\", MyDocVersion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase); - str = Regex.Replace(str, @"\", MyDocVersion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase); + // B2024-025 - process all of the applicability token (, , ) + str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(MyDocVersion, str); } else { @@ -3094,7 +3095,9 @@ namespace VEPROMS.CSLA.Library // str = str.Replace(@"", MyDocVersion.DocVersionConfig.Unit_ID); str = ConvertToDisplayText(str); if (MyDocVersion != null) // B2020-086 check for null doc version - happens if item we are trying to open is no longer there (disconnected) - str = Regex.Replace(str, @"\<[uU]\>", MyDocVersion.DocVersionConfig.Unit_Number); // B2017-019 - process "" in section number + // B2017-019 - process "" in section number + // B2024-025 - process all of the applicability token (, , ) + str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(MyDocVersion, str); return str; } //get { return ConvertToDisplayText(MyContent.Number); } diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs index 627f335b..f8f12d94 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs @@ -1540,8 +1540,8 @@ namespace VEPROMS.CSLA.Library ItemInfo tmpitm = TranGetSectionItem(itminfo); if (!tmpitm.IsSection) return ""; string str = tmpitm.MyContent.Number; - str = Regex.Replace(str, @"\", itminfo.MyDocVersion.DocVersionConfig.Unit_Number, RegexOptions.IgnoreCase ); - str = Regex.Replace(str, @"\", itminfo.MyDocVersion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase); + // B2024-025 - process all of the applicability token (, , ) + str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(itminfo.MyDocVersion, str); return (str); } private static string TranGetSectionNumber(TransitionBuilder tb, bool allLevels) @@ -1566,8 +1566,8 @@ namespace VEPROMS.CSLA.Library } //string str = tmpitm.MyContent.Number; string str = BuildSectionPath(ToSections); - str = Regex.Replace(str, @"\", tb._ToItem.MyDocVersion.DocVersionConfig.Unit_Number, RegexOptions.IgnoreCase); - str = Regex.Replace(str, @"\", tb._ToItem.MyDocVersion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase); + // B2024-025 - process all of the applicability token (, , ) + str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(tb._ToItem.MyDocVersion, str); //if (!str.EndsWith(".") && tb._ToItem.ItemID != tb._ToItem.ActiveSection.ItemID) tb.StepPrefix = "."; tb.SectionNumberLength = str.Length; diff --git a/PROMS/Volian.Controls.Library/EditItem.cs b/PROMS/Volian.Controls.Library/EditItem.cs index 2c4bab67..8bb85288 100644 --- a/PROMS/Volian.Controls.Library/EditItem.cs +++ b/PROMS/Volian.Controls.Library/EditItem.cs @@ -3583,6 +3583,9 @@ namespace Volian.Controls.Library private string ResolveUnitApp(DocVersionInfo dvi, string str) { if (dvi == null) return str; + // B2024-025 - process all of the applicability token (, , ) + str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(dvi, str); + // look for un-resolved tokens and replace less/greater than chars with "*?" and "?*" respectively string tmp = str.ToUpper(); int sindx = tmp.IndexOf("", sindx + 1); @@ -3591,21 +3594,34 @@ namespace Volian.Controls.Library { reptmp = str.Substring(sindx, eindx - sindx + 1); tmp = reptmp.ToUpper(); - if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number); - else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Text); - else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number); - else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Name); - else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_ID); - // B2021-145: For applicability, the tree view & pdf file name are not getting resolved when using any of the ‘OTHER’ tokens - else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Text); - else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Number); - else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Name); - else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_ID); - else str = str.Replace(reptmp, tmp.Replace("<", "*?").Replace(">", "?*")); + str = str.Replace(reptmp, tmp.Replace("<", "*?").Replace(">", "?*")); // unresolved token tmp = str.ToUpper(); sindx = tmp.IndexOf("", sindx + 1); } + //string tmp = str.ToUpper(); + //int sindx = tmp.IndexOf("", sindx + 1); + //string reptmp; + //while (sindx > -1 && eindx > -1) // B2022-007 added while loop to process more than one ") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number); + // else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Text); + // else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number); + // else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Name); + // else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_ID); + // // B2021-145: For applicability, the tree view & pdf file name are not getting resolved when using any of the ‘OTHER’ tokens + // else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Text); + // else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Number); + // else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Name); + // else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_ID); + // else str = str.Replace(reptmp, tmp.Replace("<", "*?").Replace(">", "?*")); + // tmp = str.ToUpper(); + // sindx = tmp.IndexOf("", sindx + 1); + //} return str; } // C2021-018 used to display Alarm Point Table RO values in the editor diff --git a/PROMS/Volian.Controls.Library/vlnTreeView.cs b/PROMS/Volian.Controls.Library/vlnTreeView.cs index cddd4d47..28b2c6a6 100644 --- a/PROMS/Volian.Controls.Library/vlnTreeView.cs +++ b/PROMS/Volian.Controls.Library/vlnTreeView.cs @@ -1322,7 +1322,7 @@ namespace Volian.Controls.Library { MenuItem miri = mir.MenuItems.Add("Create Procedure to Import"); miri.Tag = ri.RevisionID; - miri.Click += new EventHandler(ImportProcedure_Click); + miri.Click += new EventHandler(MultiUnitImportProcedure_Click); //B2024-024 Parent Child Create Approved Import file } //end added jcb 20111031 @@ -1420,8 +1420,8 @@ namespace Volian.Controls.Library void ImportProcedure_Click(object sender, EventArgs e) { - //RevisionInfo ri = (sender as MenuItem).Tag as RevisionInfo; - RevisionInfo ri = RevisionInfo.Get(int.Parse((sender as MenuItem).Tag.ToString())); + //B2024-024 restored the line below from prior change - didn't work for non parent/childs sets - created a new click event method (below) for parent/child sets. + RevisionInfo ri = (sender as MenuItem).Tag as RevisionInfo; RevisionConfig rc = ri.MyConfig as RevisionConfig; // bug fix: B2016-183 - add the child's name (ex Unit 1) to the export file name for Parent/Child procedures. int applIdx = rc.Applicability_Index; @@ -1440,6 +1440,30 @@ namespace Volian.Controls.Library FlexibleMessageBox.Show("Approved procedure saved to import file " + fileName, "Creating Export of Approved Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information); } + //B2024-024 create import file for parent/child procedure set + void MultiUnitImportProcedure_Click(object sender, EventArgs e) + { + //RevisionInfo ri = (sender as MenuItem).Tag as RevisionInfo; + RevisionInfo ri = RevisionInfo.Get(int.Parse((sender as MenuItem).Tag.ToString())); + RevisionConfig rc = ri.MyConfig as RevisionConfig; + // bug fix: B2016-183 - add the child's name (ex Unit 1) to the export file name for Parent/Child procedures. + int applIdx = rc.Applicability_Index; + string str = (applIdx > 0) ? _currentPri.MyDocVersion.UnitNames[applIdx - 1] + "_" : ""; // if parent/child get the defined child name to inlcude the export filename + System.Xml.XmlDocument xd = new System.Xml.XmlDocument(); + xd.LoadXml(ri.LatestVersion.ApprovedXML); + string PEIPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\PEI_" + Database.VEPROMS_SqlConnection.Database; + DirectoryInfo di = new DirectoryInfo(PEIPath); + if (!di.Exists) di.Create(); + // B2022-048: Crash when creating Procedure to Import from versions. Couldn't handle '/' in proc number. + string fNametmp = xd.SelectSingleNode("procedure/content/@number").InnerText.Replace(" ", "_").Replace(@"\u8209?", "-").Replace(@"\u9586?", "_").Replace("/", "-") + ".pxml"; + // B2022-112: If applicability, need to resolve the '<' and '>' characters. Just use the UnitNames, i.e. str, from above. + if (applIdx > 0) fNametmp = Regex.Replace(fNametmp, @"\", str, RegexOptions.IgnoreCase); + string fileName = PEIPath + "\\" + str + "Approved_Rev_" + ri.RevisionNumber.Replace(" ", "_").Replace("\\", "-").Replace("/", "-") + "_" + fNametmp; + xd.Save(fileName); + FlexibleMessageBox.Show("Approved procedure saved to import file " + fileName, "Creating Export of Approved Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + + void ApprovedRevision_Click(object sender, EventArgs e) { bool superceded = false; diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs index 32661ab0..f15899c6 100644 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs +++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs @@ -1834,7 +1834,8 @@ i = 0; { if (section.ActiveFormat.PlantFormat.FormatData.ProcData.CapitalizeTitle) title = title.ToUpper(); // B2022-035: resolve unit specific designators - if (title.ToUpper().Contains(@", , ) + title = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(section.MyDocVersion, title); plstr = SplitTitle(svgGroup, pageItem, title, (int)linelen, token, plstr, null); //,rowAdj); } break; @@ -1847,7 +1848,8 @@ i = 0; string title1 = section.MyProcedure.MyContent.Text; if (section.ActiveFormat.PlantFormat.FormatData.ProcData.CapitalizeTitle) title1 = title1.ToUpper(); // F2024-012 copied this line from above (processing COVERPROCTITLE) to resolve unit designators in the procedure title - if (title1.ToUpper().Contains(@", , ) + title1 = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(section.MyDocVersion, title1); plstr = SplitCoverTitle(svgGroup, pageItem, title1, (int)coverlinelen, token, plstr);//, rowAdj); break; case "{TITLE&UNIT}": @@ -2471,6 +2473,9 @@ i = 0; private string ResolveUnitApp(DocVersionInfo dvi, string str) { if (dvi == null) return str; + // B2024-025 - process all of the applicability token (, , ) + str = VEPROMS.CSLA.Library.DisplayText.ResolveUnitSpecific(dvi, str); + // look for un-resolved tokens and replace less/greater than chars with "*?" and "?*" respectively string tmp = str.ToUpper(); int sindx = tmp.IndexOf("", sindx + 1); @@ -2479,21 +2484,34 @@ i = 0; { reptmp = str.Substring(sindx, eindx - sindx + 1); tmp = reptmp.ToUpper(); - if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number); - else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Text); - else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number); - else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Name); - else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_ID); - // B2021-145: For applicability, the tree view & pdf file name are not getting resolved when using any of the ‘OTHER’ tokens - else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Text); - else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Number); - else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Name); - else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_ID); - else str = str.Replace(reptmp, tmp.Replace("<", "*?").Replace(">", "?*")); + str = str.Replace(reptmp, tmp.Replace("<", "*?").Replace(">", "?*")); tmp = str.ToUpper(); sindx = tmp.IndexOf("", sindx + 1); } + //string tmp = str.ToUpper(); + //int sindx = tmp.IndexOf("", sindx + 1); + //string reptmp; + //while (sindx > -1 && eindx > -1) // B2022-007 added while loop to process more than one ") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number); + // else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Text); + // else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Number); + // else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_Name); + // else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Unit_ID); + // // B2021-145: For applicability, the tree view & pdf file name are not getting resolved when using any of the ‘OTHER’ tokens + // else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Text); + // else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Number); + // else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_Name); + // else if (tmp == "") str = str.Replace(reptmp, dvi.DocVersionConfig.Other_Unit_ID); + // else str = str.Replace(reptmp, tmp.Replace("<", "*?").Replace(">", "?*")); + // tmp = str.ToUpper(); + // sindx = tmp.IndexOf("", sindx + 1); + //} return str; } // B2019-076: moved the following to DocVersionExt.cs to make it available to transitionext.cs code.