From 3b88b78b347d9b6b903420884c50e478e542945b Mon Sep 17 00:00:00 2001 From: Kathy Ruffing Date: Thu, 12 Oct 2023 08:29:21 -0400 Subject: [PATCH 1/4] B2023-101 & 102: Incoming Transition & Copy/Paste Replace with Incoming Transitionis crashes --- .../Extension/ItemInsertExt.cs | 23 ++++++++++++++++--- .../Volian.Controls.Library/DisplaySearch.cs | 3 +++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index 6b469f29..34b307ee 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -2508,11 +2508,28 @@ namespace VEPROMS.CSLA.Library firstTrans = false; if (!CanDeleteObject()) throw new System.Security.SecurityException("User not authorized to remove a Item"); + // B2016-009 check source and desintation types and display message box if needed + // C2022-017 moved the CheckSourceDestinationType call to btnPasteReplace_Click in StepTabRibbon + // B2023-101 Handle Paste Replace when procedure to be replaced has Incoming Transitions, i.e. do a separate try/catch for this case + ItemInfo newItemInfo = null; + try + { + newItemInfo = ItemInfo.CopyPasteReplaceItemInfoFetch(copyStartID, itemInfo); //itemInfo.ItemID, itemInfo.MyContent.Type, itemInfo.MyContent.Type); + if (newItemInfo == null) return null; + } + catch (Exception ex1) + { + if (ex1.Message.Contains("has External Transitions and has no next step") + || ex1.Message.Contains("has External Transitions to Procedure") + || ex1.Message.Contains("has External Transitions to it's children")) + + { + FlexibleMessageBox.Show("This procedure has external transition references to it that must be resolved before doing the Paste/Replace.\r\nRight Click on the procedure and select the Incoming Transitions menu option to find these references and resolve them.", "Paste Replace Failed", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); + return null; + } + } try { - // B2016-009 check source and desintation types and display message box if needed - // C2022-017 moved the CheckSourceDestinationType call to btnPasteReplace_Click in StepTabRibbon - ItemInfo newItemInfo = ItemInfo.CopyPasteReplaceItemInfoFetch(copyStartID, itemInfo); //itemInfo.ItemID, itemInfo.MyContent.Type, itemInfo.MyContent.Type); // Delete business objects, including remove from tree ItemInfo.DeleteItemInfoAndChildren(itemInfo.ItemID); // Dispose ItemInfo and Children using (Item item = Get(newItemInfo.ItemID)) ItemInfo.Refresh(item); diff --git a/PROMS/Volian.Controls.Library/DisplaySearch.cs b/PROMS/Volian.Controls.Library/DisplaySearch.cs index 9f0d5402..b41df472 100644 --- a/PROMS/Volian.Controls.Library/DisplaySearch.cs +++ b/PROMS/Volian.Controls.Library/DisplaySearch.cs @@ -1134,6 +1134,9 @@ namespace Volian.Controls.Library // C2020-033: Before allowing conversion of Incoming Transitions to text, get list of results that the user has permission edit. private List TranCvtCheckPermission(bool all) { + // B2023-102 Don't crash on converting incoming transitions to text if there are none (can happen if 2nd pass occurs) + if (_SearchResults == null) return null; + // check if a non-reader can convert transitions to text even if a reader - this is set by an administrator on the top // folder properties dialog bool allowNonAdmin = IncTranCvtPerm(); -- 2.47.2 From fedbb698ab58477947ba62ba8b2c2882d7796944 Mon Sep 17 00:00:00 2001 From: John Jenko Date: Fri, 13 Oct 2023 14:03:39 -0400 Subject: [PATCH 2/4] C2023-019 Added a message box to install the latest PROMSFixes for when PROMS opens a database that does not have the needed Stored Procedures that allow for displaying only the formats related to that plant. --- PROMS/VEPROMS.CSLA.Library/Generated/FormatInfoList.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/FormatInfoList.cs b/PROMS/VEPROMS.CSLA.Library/Generated/FormatInfoList.cs index cfe55f2f..459f7407 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/FormatInfoList.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/FormatInfoList.cs @@ -160,6 +160,14 @@ namespace VEPROMS.CSLA.Library catch (Exception ex) { if (_MyLog.IsErrorEnabled) _MyLog.Error("FormatInfoList.DataPortal_Fetch", ex); + System.Text.StringBuilder sbMsg = new System.Text.StringBuilder(); + sbMsg.Append("The SQL Stored Procedures may need updating."); + sbMsg.Append("\n\nPlease have your DBA update the database with the PROMSFixes.sql script file that was delivered with this PROMS executable."); + sbMsg.Append("\n\nThe PROMSFixes.sql file is included with the PROMS installation download."); + sbMsg.Append("\n\nIt can also be found in your PROMS executable folder:"); + sbMsg.AppendFormat("\n\t{0}", Volian.Base.Library.ExeInfo.PROMSExecutableFolderPath()); + + System.Windows.Forms.MessageBox.Show(sbMsg.ToString(), "Update Stored Procedures", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation); throw new DbCslaException("FormatInfoList.DataPortal_Fetch", ex); } this.RaiseListChangedEvents = true; -- 2.47.2 From a79819bb6563f0eebb56711f1a06b53c3c2e48ec Mon Sep 17 00:00:00 2001 From: John Jenko Date: Mon, 16 Oct 2023 15:33:45 -0400 Subject: [PATCH 3/4] B2023-104 Import procedure and Go To RO Added a check for a bad RO link when trying to do a Go To RO. A message box pops up telling the user to re-link that RO. Fixed the Import logic so that an old RO link reference can be replaced with the new one that is generated when a procedure is processed during the Import function. The Import caused the Bad RO link reported in this bug. This bug was introduced when the ROID was standardized in length and formatting (new RO logic in 2022). --- PROMS/VEPROMS User Interface/dlgExportImport.cs | 8 +++++++- PROMS/Volian.Controls.Library/StepTabRibbon.cs | 13 +++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/PROMS/VEPROMS User Interface/dlgExportImport.cs b/PROMS/VEPROMS User Interface/dlgExportImport.cs index ddf946f6..139a5b5a 100644 --- a/PROMS/VEPROMS User Interface/dlgExportImport.cs +++ b/PROMS/VEPROMS User Interface/dlgExportImport.cs @@ -4116,6 +4116,11 @@ namespace VEPROMS ROFSTLookup lookup = MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(MyDocVersion); + // B2023-104 use this to replace RO Link information in the imported text + // FormatRoidKey() was creating the roid with the new formatting introduce with B2022-088 & B2022-098 + // We need to save the ROID from the imported text in order to update it with the new RO link information + string contentROID = roid; + // B2022-088: [JPR] Find Doc Ro button not working in Word Sections // B2022-098: [JPR] ROs not being resolved in Word Sections roid = ROFSTLookup.FormatRoidKey(roid, true); @@ -4135,7 +4140,8 @@ namespace VEPROMS rou.Save(); RoUsageInfo roui = RoUsageInfo.Get(rou.ROUsageID); - string lookFor = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rousageid, roid, oldRODbID.ToString()); + //B2023-104 use the ROID from the imported text (contentROID) to create the lookFor string + string lookFor = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rousageid, contentROID, oldRODbID.ToString()); string replaceWith = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rou.ROUsageID.ToString(), roid, newRODbID.ToString()); _DidProcessROs = content.Text.Contains(lookFor); // B2017-076 RO link in the text so we will be processing it diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index d67dd9e1..fc242db9 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -3112,8 +3112,17 @@ namespace Volian.Controls.Library else { LinkText lt = new LinkText(_MyStepRTB.MyLinkText); - myROID = lt.MyRoUsageInfo.ROID.ToLower(); - myRODB = lt.MyRoUsageInfo.MyRODb; + //B2023-104 If we could not get the MyRoUsageInfo then we have a bad RO Link. Tell user to re-link the RO + if (lt.MyRoUsageInfo != null) + { + myROID = lt.MyRoUsageInfo.ROID.ToLower(); + myRODB = lt.MyRoUsageInfo.MyRODb; + } + else + { + FlexibleMessageBox.Show("Invalid RO link information.\n\n Please re-link this RO value.", "Invalid RO Reference", MessageBoxButtons.OK, MessageBoxIcon.Information); + return; + } } if (myROID == null) return; if (myROID.StartsWith("ffff")) -- 2.47.2 From f320c8a865d84a8881ec3cd1b8b0c7d9669934ff Mon Sep 17 00:00:00 2001 From: Chris Glavan Date: Wed, 18 Oct 2023 09:06:08 -0400 Subject: [PATCH 4/4] ~Fixed ALTER TABLE statement that adds the ApplicablePlant column to the Formats table so that it checks if the column exists --- PROMS/VEPROMS User Interface/PROMSFixes.Sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PROMS/VEPROMS User Interface/PROMSFixes.Sql b/PROMS/VEPROMS User Interface/PROMSFixes.Sql index fddfb39c..58b265fa 100644 --- a/PROMS/VEPROMS User Interface/PROMSFixes.Sql +++ b/PROMS/VEPROMS User Interface/PROMSFixes.Sql @@ -21942,7 +21942,11 @@ GO */ /****** Add the ApplicablePlant field to the Formats table ******/ -ALTER TABLE Formats ADD ApplicablePlant int NULL; +/****** Add the ApplicablePlant field to the Formats table ******/ +IF COL_LENGTH('Formats', 'ApplicablePlant') IS NULL +BEGIN + ALTER TABLE Formats ADD ApplicablePlant int NULL; +END GO /****** Update the Formats table with the appropriate ApplicablePlant value ******/ -- 2.47.2