From 7b649c4a629c7eae41d9f810b26e322f3c3e4dc8 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Tue, 10 Mar 2026 08:24:28 -0400 Subject: [PATCH 01/19] B2026-018_The_Disable_Initial_Line_check_box --- PROMS/Volian.Controls.Library/DisplayTags.Designer.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayTags.Designer.cs b/PROMS/Volian.Controls.Library/DisplayTags.Designer.cs index f9b2a032..c738e4c6 100644 --- a/PROMS/Volian.Controls.Library/DisplayTags.Designer.cs +++ b/PROMS/Volian.Controls.Library/DisplayTags.Designer.cs @@ -215,7 +215,8 @@ namespace Volian.Controls.Library this.groupPanelCheckoff.CanvasColor = System.Drawing.SystemColors.Control; this.groupPanelCheckoff.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; this.groupPanelCheckoff.Controls.Add(this.cmbCheckoff); - this.groupPanelCheckoff.DisabledBackColor = System.Drawing.Color.Empty; + this.groupPanelCheckoff.Controls.Add(this.cbInitialLine); + this.groupPanelCheckoff.DisabledBackColor = System.Drawing.Color.Empty; this.groupPanelCheckoff.Dock = System.Windows.Forms.DockStyle.Top; this.groupPanelCheckoff.Location = new System.Drawing.Point(0, 231); this.groupPanelCheckoff.Margin = new System.Windows.Forms.Padding(2); @@ -276,7 +277,7 @@ namespace Volian.Controls.Library // this.groupPanelcmbShwRplWds.CanvasColor = System.Drawing.SystemColors.Control; this.groupPanelcmbShwRplWds.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.groupPanelcmbShwRplWds.Controls.Add(this.cbInitialLine); + //this.groupPanelcmbShwRplWds.Controls.Add(this.cbInitialLine); this.groupPanelcmbShwRplWds.Controls.Add(this.cmbShwRplWds); this.groupPanelcmbShwRplWds.DisabledBackColor = System.Drawing.Color.Empty; this.groupPanelcmbShwRplWds.Dock = System.Windows.Forms.DockStyle.Top; -- 2.49.1 From 7636fe76867173b68d3b081e616798c1e835f028 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Wed, 11 Mar 2026 20:26:01 -0400 Subject: [PATCH 02/19] B2026-022-Adding-RO-Editor-symbols-to-RO-Tables --- .../Exe/RefObj/ROEditor/ROEditor.cs | 1 + .../LibSource/RODBInterface/RODBInterface.cs | 37 +++++++++++++++++-- PROMS/Volian.Controls.Library/VlnFlexGrid.cs | 16 ++++++++ 3 files changed, 50 insertions(+), 4 deletions(-) diff --git a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.cs b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.cs index 3c5a5e99..783ee109 100644 --- a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.cs +++ b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.cs @@ -419,6 +419,7 @@ namespace ROEditor System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US"); // The data path the was passed in. + PassedInPath = @"V:\Active Project Files\Farley PROMS Delivery\2022\RO"; DbConnectPath = PassedInPath; // Setup the context menu diff --git a/PROMS/ReferencedObjects/LibSource/RODBInterface/RODBInterface.cs b/PROMS/ReferencedObjects/LibSource/RODBInterface/RODBInterface.cs index f6ba23fe..2beac2bd 100644 --- a/PROMS/ReferencedObjects/LibSource/RODBInterface/RODBInterface.cs +++ b/PROMS/ReferencedObjects/LibSource/RODBInterface/RODBInterface.cs @@ -2142,7 +2142,21 @@ namespace RODBInterface wraccid = accid; string dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now); string xmlstr = GenerateXmlString(ro, false); - string strUpdate = "UPDATE " + ro.GetAttribute("Table") + " SET Info = '" + xmlstr + "'"; + StringBuilder xmlstrTmp = new StringBuilder(); // B2026-025 prep the info field data so it will be saved correctly. + char[] chrAry = xmlstr.ToCharArray(); + foreach (int chr in chrAry) + { + if (chr > 166) + + { + xmlstrTmp.Append($"\\u{(int)chr}?"); + } + else + { + xmlstrTmp.Append((char)chr); + } + } + string strUpdate = "UPDATE " + ro.GetAttribute("Table") + " SET Info = '" + xmlstrTmp.ToString() + "'"; if (movedRO) { VlnXmlElement parent = (VlnXmlElement)ro.ParentNode; @@ -2186,6 +2200,21 @@ namespace RODBInterface } string xmlstr = GenerateXmlString(ro, false); + StringBuilder xmlstrTmp = new StringBuilder(); // B2026-025 prep the info field data so it will be saved correctly. + char[] chrAry = xmlstr.ToCharArray(); + foreach (int chr in chrAry) + { + if (chr > 166) + + { + xmlstrTmp.Append($"\\u{(int)chr}?"); + } + else + { + xmlstrTmp.Append((char)chr); + } + } + string wraccid = null; if (ro.HasAttribute("AccPageID")) { @@ -2209,13 +2238,13 @@ namespace RODBInterface // strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, AccPageID, ModDateTime, Info ) "; strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, ModDateTime, AccPageID, Info ) "; strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.Group + ",'" + ro.GetAttribute("ParentID"); - strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstr + "');"; + strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstrTmp.ToString() + "');"; } else { strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, ModDateTime, Info ) "; strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.Group + ",'" + ro.GetAttribute("ParentID"); - strInsert = strInsert + "','" + dt + "','" + xmlstr + "');"; + strInsert = strInsert + "','" + dt + "','" + xmlstrTmp.ToString() + "');"; } } @@ -2223,7 +2252,7 @@ namespace RODBInterface { strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, AccPageId, ModDateTime, Info ) "; strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.RRO + ",'" + ro.GetAttribute("ParentID"); - strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstr + "');"; + strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstrTmp.ToString() + "');"; } try diff --git a/PROMS/Volian.Controls.Library/VlnFlexGrid.cs b/PROMS/Volian.Controls.Library/VlnFlexGrid.cs index ee6162dc..465d323a 100644 --- a/PROMS/Volian.Controls.Library/VlnFlexGrid.cs +++ b/PROMS/Volian.Controls.Library/VlnFlexGrid.cs @@ -2473,6 +2473,19 @@ namespace Volian.Controls.Library private string ConvertTableText(string str) { string rtn = str; + string pattern = @"\\u([0-9]{1,4})\?"; + + string mValue, mValue2 = ""; + foreach (Match match in Regex.Matches(rtn, pattern, RegexOptions.IgnoreCase)) + { + mValue = match.Value; + mValue2 = @"\f1 " + mValue + @"\f0"; + rtn = rtn.Replace(match.Value, mValue2); + // @"\f1\u9474 ?\f0") + // linkValue = linkValue.Replace(match.Value, "\\f1 " + match.Value + "\\f0"); + } + + //ShowRawString(str, "ConvertTableText IN"); rtn = rtn.Replace(@"START]\v0", @"START]\cf1\v0"); rtn = rtn.Replace(@"\v #Link:", @"\cf0\v #Link:"); @@ -3827,6 +3840,9 @@ namespace Volian.Controls.Library this.MergedRanges.Clear(); this.Clear(); this.IsRoTable = true; + //valtext = valtext.Replace(@"\u8209?", "-"); + //valtext = Regex.Replace(valtext, @"\\u([0-9]{1,4})\?", m => int.TryParse(m?.Groups[1]?.Value, out int result) ? Convert.ToChar(result).ToString() : ""); + //valtext = valtext.Replace("-", @"\u8209?"); this.ParseTableFromText(valtext, GridLinePattern.Single); this.AutoSizeCols(); this.AutoSizeRows(); -- 2.49.1 From ed615dbb31a4daa491d2b1b5fda5a8f264bed385 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Mon, 16 Mar 2026 13:30:36 -0400 Subject: [PATCH 03/19] B2026-022-Adding-RO-Editor-symbols-to-RO-Tables --- PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.cs b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.cs index 783ee109..fe7edb61 100644 --- a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.cs +++ b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.cs @@ -418,8 +418,7 @@ namespace ROEditor // NOTE: not doing the "Using System.Threading;" statement at beginning of file because it conflicts with the declaration of the "Timer" variable System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US"); - // The data path the was passed in. - PassedInPath = @"V:\Active Project Files\Farley PROMS Delivery\2022\RO"; + // The data path the was passed in. DbConnectPath = PassedInPath; // Setup the context menu -- 2.49.1 From 294d19e9d1809c46201bd05be8fdeb2a2a7ea2cb Mon Sep 17 00:00:00 2001 From: John Jenko Date: Mon, 16 Mar 2026 14:32:57 -0400 Subject: [PATCH 04/19] C2026-030 Barakah asked that the white space between the procedure number and procedure title be reduced when the KEPCO number is not printed --- PROMS/Formats/fmtall/BNPP1Newall.xml | Bin 243444 -> 243848 bytes PROMS/Formats/fmtall/BNPP1all.xml | Bin 184806 -> 185210 bytes PROMS/Formats/fmtall/BNPP2all.xml | Bin 199004 -> 199362 bytes PROMS/Formats/fmtall/BNPPalrall.xml | Bin 236928 -> 237646 bytes PROMS/Formats/fmtall/BNPPbckall.xml | Bin 163138 -> 163542 bytes 5 files changed, 0 insertions(+), 0 deletions(-) diff --git a/PROMS/Formats/fmtall/BNPP1Newall.xml b/PROMS/Formats/fmtall/BNPP1Newall.xml index 95276f4217c984caebcdebd59c33df3208539663..c58da4beead2cd33a138339f7530782688a0fb57 100644 GIT binary patch delta 170 zcmezJmapR@UqcIH3)2*4mFWgT%sSKk!kK4HuaaZdn110ulg;D=WuEB@!pwFcaVh2+ zhUn?F5zMl}u?)2gN(>4NK@9l}he g9+*lkrVIEoYi-{U$^49C`UQDrh3%WTnVnVx07)G)^Z)<= delta 46 zcmV+}0MY-5@ecIu4uFIKgaVWUB$u!^11Oi=0s|PA@aO_Kw=`J;_6nEqTLU7uNDTu( EtGs{_=Kufz diff --git a/PROMS/Formats/fmtall/BNPP1all.xml b/PROMS/Formats/fmtall/BNPP1all.xml index 8a25a67ff401e2e7e30ce89cd69df32d0405312d..1e852979510272e5696d8a6c97d147e1b5255cdf 100644 GIT binary patch delta 229 zcmaF1nETf1Th2vu|JR>!r%$SK0vWphFS(C1_hvaK0`T!Es$+A tU2qDM@U&@6EYtNunGEn6FHgYm>5k4!!qXMPu)ET)nMrHAS~$~zDge-@Iu-x` delta 94 zcmeyhjQiPQ?uHh|Ell%5rYpEGX-q#8!Zc&L!wW`^=@T58B&G{QFxgCRIKjj<{eUBr e!E}Q#CYk9D)l34@7lbo;;8LfzeL@7&t119oCLvV- diff --git a/PROMS/Formats/fmtall/BNPP2all.xml b/PROMS/Formats/fmtall/BNPP2all.xml index 44e5776885634668ca497557c74a0ceb46c4a554..f7193fd06bab7f9443c02a6111415adb9bf70535 100644 GIT binary patch delta 91 zcmcaJiRaK%o`x32Eldl7rVD5=u}zN)WRhU6VThhSKZr?IJeHxBL5V?uA&4QLp`5`M o$TngyWiXw7F^K8)^a&139ANc~5Y>#a(!mFLbRo`x32Eldl7rXLDol9^uT$|SJeD1>RkHUPA+3q=3` diff --git a/PROMS/Formats/fmtall/BNPPalrall.xml b/PROMS/Formats/fmtall/BNPPalrall.xml index f0c58c99d1c7222cab4959c585f5669f7b7ee825..58b11ba9d32e29e7dbed94e42cc9ce01b0ec172c 100644 GIT binary patch delta 198 zcmZqJ&3EnqUqcJy7ACU=(-$0IVw=81n^}OP(`BCGZr%KncmRPqz5*M8)i}s)GYB>hFS(C1_g#7hJ1!{23sK8h{24( rVtSxHbMEvB(#%Z=8&EVu?eJZ|6g@q_g?YtvJ~n2p?Rkrsgnk16Ql2^H delta 74 zcmX?ifUjXUUqcJy7ACU=(;vt&7ft_nkV#?sf%!~j(+xP7#ilz{F$qoo;Lhv?mnfP3 W!H~HG#8sN!;K{79{lZeFx?cc_+8>Po diff --git a/PROMS/Formats/fmtall/BNPPbckall.xml b/PROMS/Formats/fmtall/BNPPbckall.xml index 5c1811e0b91a3744e75ebffd2caaef34960139b2..073abde92f5c93e4c0abf61a33abd310f339a743 100644 GIT binary patch delta 208 zcmX@~i}TuF&W0AoEld>}(^s5i1IJpe5lGKm}?lKr=Qhik`<3-sAW)MP+$mR$Y&^Lum!S>7)%*Vryo>jawgI+Mu<_2 cvC|XnnS@!57%UhJh|qt;m&s|HHj`5j0RF#0Z~y=R delta 85 zcmccim-Ems&W0AoEld>}(;FO^G^QJ9Gf7O}r@_=P{htw&!t__#Og7UKG=O3OW=u-c oxwM#MrXP@H5@0oAuw*cveo&oh`*a6gph5#VCavvLbeNoi0P#Z_WB>pF -- 2.49.1 From bc3c14589ec34b2b162c13ab5f304abd1ee6099d Mon Sep 17 00:00:00 2001 From: mschill Date: Mon, 16 Mar 2026 14:45:04 -0400 Subject: [PATCH 05/19] C2026-007 Upgrade - Generate Missing Word Attachments/B2026-027 Update Refresh Tables For Search Tooltip --- PROMS/VEPROMS User Interface/PROMSFixes.Sql | 44 +++- .../frmBatchRefresh.Designer.cs | 53 ++++- .../VEPROMS User Interface/frmBatchRefresh.cs | 127 +++++++++++- .../frmBatchRefresh.resx | 191 +++++++++--------- .../Extension/DocumentExt.cs | 72 +++---- PROMS/VEPROMS.CSLA.Library/Generated/Pdf.cs | 21 +- .../Minimal/Maintenance.cs | 35 +++- 7 files changed, 388 insertions(+), 155 deletions(-) diff --git a/PROMS/VEPROMS User Interface/PROMSFixes.Sql b/PROMS/VEPROMS User Interface/PROMSFixes.Sql index 81fa98e6..0cbd1891 100644 --- a/PROMS/VEPROMS User Interface/PROMSFixes.Sql +++ b/PROMS/VEPROMS User Interface/PROMSFixes.Sql @@ -24736,6 +24736,46 @@ GO ========================================================================================================== */ +IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[GetMissingDocsByUnit]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1) + DROP PROCEDURE [GetMissingDocsByUnit]; + +GO + +-- ============================================= +-- Author: Matthew Schill +-- Create date: 02/27/2026 +-- Description: Get Missing Docs by Unit for Generating Pdf table +-- ============================================= +CREATE PROCEDURE [dbo].[GetMissingDocsByUnit] +AS +BEGIN + + select Docs.DocID, UnitID, SectionID = MIN(SectionID) + FROM + (SELECT DISTINCT [DocID] + FROM [VEPROMS_Barakah].[dbo].[tblDocuments]) Docs + INNER JOIN Entries on Docs.DocID = Entries.DocID + INNER JOIN Contents on Entries.ContentID = Contents.ContentID + inner join Items on Items.ContentID = Contents.ContentID + outer apply + (Select UnitID = ID FROM dbo.vefn_SplitInt([dbo].[ve_GetItemDerivedApplicability](Items.ItemID),',')) Unit + outer apply + (Select TOP 1 SectionID = ItemID FROM Contents SecC where SecC.ContentID = Contents.ContentID + AND (SecC.Type / 10000) = 1 + AND dbo.vefn_GetVersionIDByItemID(ItemID) IS NOT NULL + ) Section + left outer join Pdfs on Pdfs.DocID = Docs.DocID AND Pdfs.DebugStatus = CASE WHEN UNITID IS NULL THEN 0 ELSE UnitID * 10 END + WHERE Pdfs.DocID IS NULL + AND SectionID IS NOT NULL + Group by Docs.DocID, UnitID + order by Docs.DocID, UnitID + + RETURN +END + +IF (@@Error = 0) PRINT 'Procedure Creation: [GetMissingDocsByUnit] Succeeded' +ELSE PRINT 'Procedure Creation: [GetMissingDocsByUnit] Error on Creation' +GO /* --------------------------------------------------------------------------- @@ -24770,8 +24810,8 @@ BEGIN TRY -- Try Block DECLARE @RevDate varchar(255) DECLARE @RevDescription varchar(255) - set @RevDate = '03/12/2026 11:00 AM' - set @RevDescription = 'Update to Purge Change History Tool' + set @RevDate = '03/13/2026 7:00 AM' + set @RevDescription = 'Added Get Missing Docs by Unit for Generating Pdf table' Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs b/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs index 7cc148dd..41c381d5 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs @@ -113,6 +113,8 @@ this.lblAdmToolProgressType = new DevComponents.DotNetBar.LabelX(); this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip(); + this.swRegenWordAttmts = new DevComponents.DotNetBar.Controls.SwitchButton(); + this.labelX1 = new DevComponents.DotNetBar.LabelX(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit(); this.splitContainer3.Panel1.SuspendLayout(); this.splitContainer3.Panel2.SuspendLayout(); @@ -902,6 +904,8 @@ // // sideNavPanel2 // + this.sideNavPanel2.Controls.Add(this.swRegenWordAttmts); + this.sideNavPanel2.Controls.Add(this.labelX1); this.sideNavPanel2.Controls.Add(this.swRefreshTblsForSrch); this.sideNavPanel2.Controls.Add(this.lblRefreshTblForSrch); this.sideNavPanel2.Controls.Add(this.warningBox4); @@ -930,11 +934,11 @@ // // this.swRefreshTblsForSrch.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.swRefreshTblsForSrch.Location = new System.Drawing.Point(10, 153); + this.swRefreshTblsForSrch.Location = new System.Drawing.Point(10, 178); this.swRefreshTblsForSrch.Name = "swRefreshTblsForSrch"; this.swRefreshTblsForSrch.Size = new System.Drawing.Size(91, 22); this.swRefreshTblsForSrch.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.superTooltip1.SetSuperTooltip(this.swRefreshTblsForSrch, new DevComponents.DotNetBar.SuperTooltipInfo("Refresh Word Attachments", "", resources.GetString("swRefreshTblsForSrch.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(300, 200))); + this.superTooltip1.SetSuperTooltip(this.swRefreshTblsForSrch, new DevComponents.DotNetBar.SuperTooltipInfo("Refesh Tables For Search", "", resources.GetString("swRefreshTblsForSrch.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(300, 125))); this.swRefreshTblsForSrch.SwitchClickTogglesValue = true; this.swRefreshTblsForSrch.TabIndex = 32; this.swRefreshTblsForSrch.Value = true; @@ -949,10 +953,10 @@ // this.lblRefreshTblForSrch.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.lblRefreshTblForSrch.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblRefreshTblForSrch.Location = new System.Drawing.Point(107, 153); + this.lblRefreshTblForSrch.Location = new System.Drawing.Point(107, 178); this.lblRefreshTblForSrch.Name = "lblRefreshTblForSrch"; this.lblRefreshTblForSrch.Size = new System.Drawing.Size(186, 22); - this.superTooltip1.SetSuperTooltip(this.lblRefreshTblForSrch, new DevComponents.DotNetBar.SuperTooltipInfo("Refresh Word Attachments", "", resources.GetString("lblRefreshTblForSrch.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(300, 200))); + this.superTooltip1.SetSuperTooltip(this.lblRefreshTblForSrch, new DevComponents.DotNetBar.SuperTooltipInfo("Refresh Tables For Search", "", resources.GetString("lblRefreshTblForSrch.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(300, 125))); this.lblRefreshTblForSrch.TabIndex = 31; this.lblRefreshTblForSrch.Text = "Refresh Tables For Search"; // @@ -961,7 +965,7 @@ this.warningBox4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(219)))), ((int)(((byte)(249))))); this.warningBox4.CloseButtonVisible = false; this.warningBox4.Image = ((System.Drawing.Image)(resources.GetObject("warningBox4.Image"))); - this.warningBox4.Location = new System.Drawing.Point(12, 264); + this.warningBox4.Location = new System.Drawing.Point(12, 287); this.warningBox4.Margin = new System.Windows.Forms.Padding(4); this.warningBox4.Name = "warningBox4"; this.warningBox4.OptionsButtonVisible = false; @@ -974,7 +978,7 @@ this.warningBox2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(219)))), ((int)(((byte)(249))))); this.warningBox2.CloseButtonVisible = false; this.warningBox2.Image = ((System.Drawing.Image)(resources.GetObject("warningBox2.Image"))); - this.warningBox2.Location = new System.Drawing.Point(12, 302); + this.warningBox2.Location = new System.Drawing.Point(12, 325); this.warningBox2.Margin = new System.Windows.Forms.Padding(4); this.warningBox2.Name = "warningBox2"; this.warningBox2.OptionsButtonVisible = false; @@ -1128,7 +1132,7 @@ // line2 // this.line2.BackColor = System.Drawing.Color.Transparent; - this.line2.Location = new System.Drawing.Point(4, 237); + this.line2.Location = new System.Drawing.Point(4, 260); this.line2.Name = "line2"; this.line2.Size = new System.Drawing.Size(281, 12); this.line2.TabIndex = 20; @@ -1140,7 +1144,7 @@ this.btnRunRepair.Checked = true; this.btnRunRepair.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; this.btnRunRepair.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnRunRepair.Location = new System.Drawing.Point(5, 198); + this.btnRunRepair.Location = new System.Drawing.Point(5, 221); this.btnRunRepair.Name = "btnRunRepair"; this.btnRunRepair.Size = new System.Drawing.Size(280, 23); this.btnRunRepair.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; @@ -1303,6 +1307,37 @@ this.superTooltip1.DefaultTooltipSettings = new DevComponents.DotNetBar.SuperTooltipInfo("", "", "", null, null, DevComponents.DotNetBar.eTooltipColor.Gray); this.superTooltip1.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F"; // + // swRegenWordAttmts + // + // + // + // + this.swRegenWordAttmts.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.swRegenWordAttmts.Location = new System.Drawing.Point(10, 150); + this.swRegenWordAttmts.Name = "swRegenWordAttmts"; + this.swRegenWordAttmts.Size = new System.Drawing.Size(91, 22); + this.swRegenWordAttmts.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.superTooltip1.SetSuperTooltip(this.swRegenWordAttmts, new DevComponents.DotNetBar.SuperTooltipInfo("Generate Word Attachments", "", resources.GetString("swRegenWordAttmts.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(300, 200))); + this.swRegenWordAttmts.SwitchClickTogglesValue = true; + this.swRegenWordAttmts.TabIndex = 34; + this.swRegenWordAttmts.Value = true; + this.swRegenWordAttmts.ValueObject = "Y"; + // + // labelX1 + // + this.labelX1.BackColor = System.Drawing.Color.Transparent; + // + // + // + this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.labelX1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelX1.Location = new System.Drawing.Point(107, 150); + this.labelX1.Name = "labelX1"; + this.labelX1.Size = new System.Drawing.Size(186, 22); + this.superTooltip1.SetSuperTooltip(this.labelX1, new DevComponents.DotNetBar.SuperTooltipInfo("Generate Word Attachments", "", resources.GetString("labelX1.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(300, 200))); + this.labelX1.TabIndex = 33; + this.labelX1.Text = "Generate Missing Word Attachments"; + // // frmBatchRefresh // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1430,6 +1465,8 @@ private DevComponents.DotNetBar.PanelEx itemPanel2; private DevComponents.DotNetBar.PanelEx itemPanel3; private DevComponents.DotNetBar.ButtonX btnROsNotUsed; + private DevComponents.DotNetBar.Controls.SwitchButton swRegenWordAttmts; + private DevComponents.DotNetBar.LabelX labelX1; } } diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.cs b/PROMS/VEPROMS User Interface/frmBatchRefresh.cs index 249ddb19..0af71439 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.cs +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.cs @@ -62,6 +62,8 @@ namespace VEPROMS swRmObsoleteROData.Enabled = false; swRmOrphanDataRecs.Enabled = false; swRefreshWordAttmts.Enabled = false; + swRegenWordAttmts.Enabled = false; + swRefreshTblsForSrch.Enabled = false; swStandardHypenChars.Enabled = false; //if not full admin, disable Purge Change History @@ -648,11 +650,111 @@ namespace VEPROMS this.Cursor = Cursors.Default; } - // B2022-047 - refresh the Content/Text field for table, i.e. Grid, Data so that search will find text in the Grid - // NOTE that an out of memeory error occurs when having to process alot of tables. A config flag is used on the - // grid record to flag that this operation has been run. And a message is placed in the result window stating to - // rerun until all tables/text fields are completed. - private void RefreshTablesForSearch() + private int RegenCounter = 0; + private int RegenTotal = 0; + private const int TicksToupdate = 300000; //5 minutes(300 seconds). + + // C2026-007 - Generate Missing PDFs + // regenerates the saved attachment PDFs from the database + // so that this is not needed the next time the procedures are printed. This also forces ROs to be refreshed in the attachments + private void RegenPDFs() + { + this.Cursor = Cursors.WaitCursor; + DateTime pStart = DateTime.Now; + txtProcess.AppendText("Generating missing Word Attachments"); + txtProcess.AppendText(Environment.NewLine); + txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm"))); + txtProcess.AppendText(Environment.NewLine); + txtProcess.AppendText("Gathering data for Word Attachments that need generated."); + txtProcess.AppendText(Environment.NewLine); + Application.DoEvents(); + + //get data of missing Docs by Unit that will need regenerated + DataTable dt = Maintenance.GetMissingDocsByUnit(); + RegenCounter = 0; + RegenTotal = dt.Rows.Count; + txtProcess.AppendText($"Word Attachments to be generated: {RegenTotal}"); + txtProcess.AppendText(Environment.NewLine); + txtProcess.AppendText(Environment.NewLine); + txtProcess.AppendText($"Note that this will provide updates approximately every {TicksToupdate/60000} minutes. Some attachments may take longer than others due to size/number of pages/number of ROs. If PROMS is in the middle of generating a large attachment, it may delay the update message until generation of that attachment completes (in that case taking more than 5 minutes between updates)."); + txtProcess.AppendText(Environment.NewLine); + txtProcess.AppendText(Environment.NewLine); + txtResults.AppendText($"{RegenTotal} Word Attachments to be generated."); + txtResults.AppendText(Environment.NewLine); + txtResults.AppendText(Environment.NewLine); + + //generate as if not debug + int debugstatus = MSWordToPDF.DebugStatus; + MSWordToPDF.DebugStatus = 0; + MSWordToPDF.OverrideColor = Color.Transparent; + + Timer timer1 = new Timer(); + timer1.Tick += new EventHandler(UpdateRegenProgress); + timer1.Interval = TicksToupdate; + timer1.Start(); + + foreach (DataRow dr in dt.Rows) + { + //Do Generation + using (Section sect = Section.Get((int)dr["SectionID"])) + { + using (DocumentInfo docInfo = DocumentInfo.Get((int)dr["DocID"])) + { + if (!dr.IsNull("UnitID")) sect.MyItemInfo.MyDocVersion.DocVersionConfig.SelectedSlave = (int)dr["UnitID"]; + MSWordToPDF.SetDocPdf(docInfo, sect.MyItemInfo); + } + } + + //Increment - message every _ minutes + RegenCounter++; + } + + //done with loop - stop timer and destroy it + timer1.Stop(); + timer1.Dispose(); + + //Change DebugStatus Back to what it was + if (debugstatus == 1) + { + MSWordToPDF.DebugStatus = 1; + MSWordToPDF.OverrideColor = Color.Red; + } + else + { + MSWordToPDF.DebugStatus = 0; + MSWordToPDF.OverrideColor = Color.Transparent; + } + + //end messaging + txtProcess.AppendText(Environment.NewLine); + txtProcess.AppendText($"Word Attachments Generated: {RegenTotal}"); + txtProcess.AppendText(Environment.NewLine); + txtResults.AppendText(Environment.NewLine); + txtResults.AppendText($"{RegenTotal} Word Attachments generated."); + txtResults.AppendText(Environment.NewLine); + txtResults.AppendText(Environment.NewLine); + txtProcess.AppendText($"Completed: {DateTime.Now:G}"); + txtProcess.AppendText(Environment.NewLine); + txtProcess.AppendText(Environment.NewLine); + Application.DoEvents(); + this.Cursor = Cursors.Default; + } + + //Outputs the Progress of Regenerating the PDFs every __ minutes + private void UpdateRegenProgress(Object myObject, EventArgs myEventArgs) + { + string progress_str = $"Generated {RegenCounter} of {RegenTotal} ({(decimal)RegenCounter / RegenTotal * 100M:F2}%): {DateTime.Now:G}"; + txtProcess.AppendText(progress_str); + txtProcess.AppendText(Environment.NewLine); + txtResults.AppendText(progress_str); + txtResults.AppendText(Environment.NewLine); + } + + // B2022-047 - refresh the Content/Text field for table, i.e. Grid, Data so that search will find text in the Grid + // NOTE that an out of memeory error occurs when having to process alot of tables. A config flag is used on the + // grid record to flag that this operation has been run. And a message is placed in the result window stating to + // rerun until all tables/text fields are completed. + private void RefreshTablesForSearch() { this.Cursor = Cursors.WaitCursor; DateTime pStart = DateTime.Now; @@ -1305,7 +1407,8 @@ namespace VEPROMS DevComponents.DotNetBar.StepItem siObsoleteROData = new DevComponents.DotNetBar.StepItem("siObsoleteROData", "Obsolete RO Data"); DevComponents.DotNetBar.StepItem siStandardHyphens = new DevComponents.DotNetBar.StepItem("siStandardHyphens", "Standardize Hyphens"); DevComponents.DotNetBar.StepItem siRefreshAttmts = new DevComponents.DotNetBar.StepItem("siRefreshAttmts", "Refresh Word Attachments"); - DevComponents.DotNetBar.StepItem siRefreshTblsSrchTxt = new DevComponents.DotNetBar.StepItem("siRefreshTblsSrchTxt", "Refresh Tables For Search"); + DevComponents.DotNetBar.StepItem siRegenAttmts = new DevComponents.DotNetBar.StepItem("siRegenAttmts", "Regenerate Word Attachments"); + DevComponents.DotNetBar.StepItem siRefreshTblsSrchTxt = new DevComponents.DotNetBar.StepItem("siRefreshTblsSrchTxt", "Refresh Tables For Search"); // this will update/rebuild the progress bar in the bottom panel of Admin Tools private void setupProgessSteps1() { @@ -1323,7 +1426,9 @@ namespace VEPROMS progressSteps1.Items.Add(siStandardHyphens); if (swRefreshWordAttmts.Value) progressSteps1.Items.Add(siRefreshAttmts); - if (swRefreshTblsForSrch.Value) + if (swRegenWordAttmts.Value) + progressSteps1.Items.Add(siRegenAttmts); + if (swRefreshTblsForSrch.Value) progressSteps1.Items.Add(siRefreshTblsSrchTxt); splitContainer3.Panel2Collapsed = false; progressSteps1.Visible = true; @@ -1487,7 +1592,13 @@ namespace VEPROMS DeletePDFs(); // refresh word attachments StepProgress(prgStpIdx, 100); } - if (swRefreshTblsForSrch.Value) + if (swRegenWordAttmts.Value) + { + StepProgress(++prgStpIdx, 50); + RegenPDFs(); // generate missing pdfs + StepProgress(prgStpIdx, 100); + } + if (swRefreshTblsForSrch.Value) { StepProgress(++prgStpIdx, 50); RefreshTablesForSearch(); diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.resx b/PROMS/VEPROMS User Interface/frmBatchRefresh.resx index 7e66d1f3..15533721 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.resx +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.resx @@ -117,108 +117,30 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Purges all audit information and change history older than the above date. -It is recommended that you perform a database backup before performing this action. -Note after purging the information, this will automatically perform the Index -Maintenance function to realign indexes with the cut down audit data. -Only Full PROMS Administrator Users can perform this action. - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F - k11Ik1Ecxv9zouJ2E4TWnR8V5tAppJmYsLnNlaLTxAoiKIQiibpYSmEEmSSa0IVGISMUw7rpE+yiQiuk - /IhROssPyjanpL4udeq29z3nCdcH+Wb1g+fq/zzP+R8Oh+gvPK4kNWujp1IrPek8S5Hy+X9hbXSN9aVC - eq1FwEYN8vk/mWqiDPZwI+NOHbhLj8CdDaK7npLlvnWpO0AKqZV62YgO/GMquDMN0rAevkbqlHvXZdlG - h6Rn8eATu4GJncB0Fvh8HnwPYuGpJ4vcvwZbGYWJrcpPzGXG8ngGtsZFQJOggrS0B9J0MbwNIR9uHqRQ - ee4XPhuVSy814IIB/lk9QkIIanUomFgIzkux0qHB/CUqk+eCtB2jCLEl1M1mLcBSLthKHlQqJaKjw8FZ - Mbi/ENKXEizUKD/f2k9h8jz5mumk2K0F9xUAUgE4K0JUVDji4yLBvflgMyYwlxFL9zSYq6ITa8I3DlNY - wKZ0soVSgFkAXgwuFSEmJhJJiWqwCR3YSCbY2x0QB4zwnFc6W4p+22KxiY4EXiQF74kf6/L5vdi+TYV0 - rRpsMB2sPxWsRwvpTTq87QmYOUNHg+HqQlL4ryscbK4UPGD5vu60CWw8G7evbkN7bSykXm0w/FMBew6E - CsXQFQMpaLKezP6OLeDL+8AFM5hLBzaciennKcFXUCgI7o7ENQWSfRcWmmPgPEW5tNJIj8QxM9hkDthY - FthAGlh/SvAPXC7fjOrjmyC+Sl5TsCpfdzYEK92llUbllDiaD3HEDPG9CaLDCGnI9IdEhwnioBHiOwMC - dj38fYbVglHy1FGJt57uL9ZS10IN9cxfJPvXCzTgqSKH5xwNzVXSkFBBDsFKA4KV7IKVegQrda2e7j5N - ud8AKwnMnBpmYFAAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F - k11Ik1Ecxv9zouJ2E4TWnR8V5tAppJmYsLnNlaLTxAoiKIQiibpYSmEEmSSa0IVGISMUw7rpE+yiQiuk - /IhROssPyjanpL4udeq29z3nCdcH+Wb1g+fq/zzP+R8Oh+gvPK4kNWujp1IrPek8S5Hy+X9hbXSN9aVC - eq1FwEYN8vk/mWqiDPZwI+NOHbhLj8CdDaK7npLlvnWpO0AKqZV62YgO/GMquDMN0rAevkbqlHvXZdlG - h6Rn8eATu4GJncB0Fvh8HnwPYuGpJ4vcvwZbGYWJrcpPzGXG8ngGtsZFQJOggrS0B9J0MbwNIR9uHqRQ - ee4XPhuVSy814IIB/lk9QkIIanUomFgIzkux0qHB/CUqk+eCtB2jCLEl1M1mLcBSLthKHlQqJaKjw8FZ - Mbi/ENKXEizUKD/f2k9h8jz5mumk2K0F9xUAUgE4K0JUVDji4yLBvflgMyYwlxFL9zSYq6ITa8I3DlNY - wKZ0soVSgFkAXgwuFSEmJhJJiWqwCR3YSCbY2x0QB4zwnFc6W4p+22KxiY4EXiQF74kf6/L5vdi+TYV0 - rRpsMB2sPxWsRwvpTTq87QmYOUNHg+HqQlL4ryscbK4UPGD5vu60CWw8G7evbkN7bSykXm0w/FMBew6E - CsXQFQMpaLKezP6OLeDL+8AFM5hLBzaciennKcFXUCgI7o7ENQWSfRcWmmPgPEW5tNJIj8QxM9hkDthY - FthAGlh/SvAPXC7fjOrjmyC+Sl5TsCpfdzYEK92llUbllDiaD3HEDPG9CaLDCGnI9IdEhwnioBHiOwMC - dj38fYbVglHy1FGJt57uL9ZS10IN9cxfJPvXCzTgqSKH5xwNzVXSkFBBDsFKA4KV7IKVegQrda2e7j5N - ud8AKwnMnBpmYFAAAAAASUVORK5CYII= - - - - This will perform Index Maintenance to realign indexes to optimize performance. -This function will cause no change to data or records in PROMS. -It should however be performed when other users are not in PROMS, as it could -cause slowdown or errors for other users while it is running. - - + 17, 17 - - - This allows the user to remove folders and sub folders as well as their contents. - -Be sure a current backup of the database exists prior performing this function. - -It is recommended that this be done during off hours. + + + When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all the of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents. Certain actions like loading a new RO.FST require that these PDFs be regenerated which is normally done at print time. +This function will generate (and save) any missing saved attachment PDFS stored in the database (not the PDFs of the entire procedure that you had previous printed). This will cause printing to be faster when you print after this as the PDFs will be pre-genrated in those cases (and thus not require regeneration unless changes were made to the Word Sections or ROs after running this). - - This allows the user to remove folders and sub folders as well as their contents. - -Be sure a current backup of the database exists prior performing this function. - -It is recommended that this be done during off hours. + + When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all the of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents. Certain actions like loading a new RO.FST require that these PDFs be regenerated which is normally done at print time. +This function will generate (and save) any missing saved attachment PDFS stored in the database (not the PDFs of the entire procedure that you had previous printed). This will cause printing to be faster when you print after this as the PDFs will be pre-genrated in those cases (and thus not require regeneration unless changes were made to the Word Sections or ROs after running this). - - - This function will allow the user to remove annotations from the selected working drafts. - -Be sure a current backup of the database exists prior to running this function. - -If more than one working draft is selected, it is recommended that this be performed during off hours. - - - This function will allow the user to remove annotations from the selected working drafts. - -Be sure a current backup of the database exists prior to running this function. - -If more than one working draft is selected, it is recommended that this be performed during off hours. - - - This will allow for the deletion of groups of annotations and allow for deleting entire folders within PROMS. Use the tree nodes to select which items to delete. - -Click on the on/off switches to turn on/off each tool. - -Note that only one of these tools can be run at a time. - When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all the of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents. - -This function will remove all of the saved attachment PDFS stored in the database (not the PDFs of the entire procedure that you had previous printed). This will force PROMS to regenerate (and save) the word attachment PDFs the next time the procedure is printed. + To allow for a quicker search of the contents within a PROMS Step editor table, a text version of the table is stored separately. If the PROMS Search function is not finding something in a table, this tool will refresh the content of that separately stored table text. Another search should then be performed for the content that was not originally found. - When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all the of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents. - -This function will remove all of the saved attachment PDFS stored in the database (not the PDFs of the entire procedure that you had previous printed). This will force PROMS to regenerate (and save) the word attachment PDFs the next time the procedure is printed. + To allow for a quicker search of the contents within a PROMS Step editor table, a text version of the table is stored separately. If the PROMS Search function is not finding something in a table, this tool will refresh the content of that separately stored table text. Another search should then be performed for the content that was not originally found. + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F @@ -302,6 +224,53 @@ Should an item become orphaned (disconnected) from the rest of the data, it will Should an item become orphaned (disconnected) from the rest of the data, it will no longer be accessible. This tool removes any orphaned items from the database. + + + Purges all audit information and change history older than the above date. +It is recommended that you perform a database backup before performing this action. +Note after purging the information, this will automatically perform the Index +Maintenance function to realign indexes with the cut down audit data. +Only Full PROMS Administrator Users can perform this action. + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F + k11Ik1Ecxv9zouJ2E4TWnR8V5tAppJmYsLnNlaLTxAoiKIQiibpYSmEEmSSa0IVGISMUw7rpE+yiQiuk + /IhROssPyjanpL4udeq29z3nCdcH+Wb1g+fq/zzP+R8Oh+gvPK4kNWujp1IrPek8S5Hy+X9hbXSN9aVC + eq1FwEYN8vk/mWqiDPZwI+NOHbhLj8CdDaK7npLlvnWpO0AKqZV62YgO/GMquDMN0rAevkbqlHvXZdlG + h6Rn8eATu4GJncB0Fvh8HnwPYuGpJ4vcvwZbGYWJrcpPzGXG8ngGtsZFQJOggrS0B9J0MbwNIR9uHqRQ + ee4XPhuVSy814IIB/lk9QkIIanUomFgIzkux0qHB/CUqk+eCtB2jCLEl1M1mLcBSLthKHlQqJaKjw8FZ + Mbi/ENKXEizUKD/f2k9h8jz5mumk2K0F9xUAUgE4K0JUVDji4yLBvflgMyYwlxFL9zSYq6ITa8I3DlNY + wKZ0soVSgFkAXgwuFSEmJhJJiWqwCR3YSCbY2x0QB4zwnFc6W4p+22KxiY4EXiQF74kf6/L5vdi+TYV0 + rRpsMB2sPxWsRwvpTTq87QmYOUNHg+HqQlL4ryscbK4UPGD5vu60CWw8G7evbkN7bSykXm0w/FMBew6E + CsXQFQMpaLKezP6OLeDL+8AFM5hLBzaciennKcFXUCgI7o7ENQWSfRcWmmPgPEW5tNJIj8QxM9hkDthY + FthAGlh/SvAPXC7fjOrjmyC+Sl5TsCpfdzYEK92llUbllDiaD3HEDPG9CaLDCGnI9IdEhwnioBHiOwMC + dj38fYbVglHy1FGJt57uL9ZS10IN9cxfJPvXCzTgqSKH5xwNzVXSkFBBDsFKA4KV7IKVegQrda2e7j5N + ud8AKwnMnBpmYFAAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F + k11Ik1Ecxv9zouJ2E4TWnR8V5tAppJmYsLnNlaLTxAoiKIQiibpYSmEEmSSa0IVGISMUw7rpE+yiQiuk + /IhROssPyjanpL4udeq29z3nCdcH+Wb1g+fq/zzP+R8Oh+gvPK4kNWujp1IrPek8S5Hy+X9hbXSN9aVC + eq1FwEYN8vk/mWqiDPZwI+NOHbhLj8CdDaK7npLlvnWpO0AKqZV62YgO/GMquDMN0rAevkbqlHvXZdlG + h6Rn8eATu4GJncB0Fvh8HnwPYuGpJ4vcvwZbGYWJrcpPzGXG8ngGtsZFQJOggrS0B9J0MbwNIR9uHqRQ + ee4XPhuVSy814IIB/lk9QkIIanUomFgIzkux0qHB/CUqk+eCtB2jCLEl1M1mLcBSLthKHlQqJaKjw8FZ + Mbi/ENKXEizUKD/f2k9h8jz5mumk2K0F9xUAUgE4K0JUVDji4yLBvflgMyYwlxFL9zSYq6ITa8I3DlNY + wKZ0soVSgFkAXgwuFSEmJhJJiWqwCR3YSCbY2x0QB4zwnFc6W4p+22KxiY4EXiQF74kf6/L5vdi+TYV0 + rRpsMB2sPxWsRwvpTTq87QmYOUNHg+HqQlL4ryscbK4UPGD5vu60CWw8G7evbkN7bSykXm0w/FMBew6E + CsXQFQMpaLKezP6OLeDL+8AFM5hLBzaciennKcFXUCgI7o7ENQWSfRcWmmPgPEW5tNJIj8QxM9hkDthY + FthAGlh/SvAPXC7fjOrjmyC+Sl5TsCpfdzYEK92llUbllDiaD3HEDPG9CaLDCGnI9IdEhwnioBHiOwMC + dj38fYbVglHy1FGJt57uL9ZS10IN9cxfJPvXCzTgqSKH5xwNzVXSkFBBDsFKA4KV7IKVegQrda2e7j5N + ud8AKwnMnBpmYFAAAAAASUVORK5CYII= + + + + This will perform Index Maintenance to realign indexes to optimize performance. +This function will cause no change to data or records in PROMS. +It should however be performed when other users are not in PROMS, as it could +cause slowdown or errors for other users while it is running. This allows the user to check referenced object links in procedure step data for multiple working drafts in a batch mode. @@ -388,8 +357,46 @@ If more than one procedure is selected, it is recommended that this be performed ud8AKwnMnBpmYFAAAAAASUVORK5CYII= - - - 25 + + This allows the user to remove folders and sub folders as well as their contents. + +Be sure a current backup of the database exists prior performing this function. + +It is recommended that this be done during off hours. + + + + This allows the user to remove folders and sub folders as well as their contents. + +Be sure a current backup of the database exists prior performing this function. + +It is recommended that this be done during off hours. + + + + + This function will allow the user to remove annotations from the selected working drafts. + +Be sure a current backup of the database exists prior to running this function. + +If more than one working draft is selected, it is recommended that this be performed during off hours. + + + This function will allow the user to remove annotations from the selected working drafts. + +Be sure a current backup of the database exists prior to running this function. + +If more than one working draft is selected, it is recommended that this be performed during off hours. + + + This will allow for the deletion of groups of annotations and allow for deleting entire folders within PROMS. Use the tree nodes to select which items to delete. + +Click on the on/off switches to turn on/off each tool. + +Note that only one of these tools can be run at a time. + + + 25 + \ No newline at end of file diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs index aebad38d..2dec2bda 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs @@ -1003,40 +1003,34 @@ namespace VEPROMS.CSLA.Library if (pdfTmp == null) return false; FileInfo pdfFile = new FileInfo(pdfTmp); - FileStream fs = pdfFile.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite); - Byte[] buf = new byte[pdfFile.Length]; - fs.Read(buf, 0, buf.Length); - fs.Close(); + Byte[] buf = new byte[pdfFile.Length]; - // B2023-022 & B2023-023 commented out the deletion of the temporary Word section PDF file - // These files are deleted when the procedure pdf file is closed after being generated. - // PROMS was crashing because it could not find these temporary files to delete. - //try - //{ - // pdfFile.Delete(); - //} - //catch { } - - using (Document doc = docInfo.Get()) + using (FileStream fs = pdfFile.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { - DocStyle myDocStyle = sect.ActiveSection.MyDocStyle; - SectionConfig sc = sect.ActiveSection.MyConfig as SectionConfig; - int ss = sect.MyDocVersion.DocVersionConfig.SelectedSlave; - - if (sc != null && sc.Section_WordMargin == "Y") - { - using (Pdf myPdf = Pdf.MakePdf(doc, ss * 10 + MSWordToPDF.DebugStatus, 0, 0, 0, 0, (double)sect.MSWordPageCount, buf)) {; } - } - else - { - using (Pdf myPdf1 = Pdf.MakePdf(doc, ss * 10 + MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength, - (int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth, (double)sect.MSWordPageCount, buf)) {; } - } - - doc.UpdateDRoUsages(roids); - doc.Save(); + fs.Read(buf, 0, buf.Length); + fs.Close(); } + using (Document doc = docInfo.Get()) + { + DocStyle myDocStyle = sect.ActiveSection.MyDocStyle; + SectionConfig sc = sect.ActiveSection.MyConfig as SectionConfig; + int ss = sect.MyDocVersion.DocVersionConfig.SelectedSlave; + + if (sc != null && sc.Section_WordMargin == "Y") + { + using (Pdf myPdf = Pdf.MakePdf(doc, ss * 10 + MSWordToPDF.DebugStatus, 0, 0, 0, 0, (double)sect.MSWordPageCount, buf)) {; } + } + else + { + using (Pdf myPdf1 = Pdf.MakePdf(doc, ss * 10 + MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength, + (int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth, (double)sect.MSWordPageCount, buf)) {; } + } + + doc.UpdateDRoUsages(roids); + doc.Save(); + } + docInfo.RefreshConfig(); return true; @@ -1482,12 +1476,22 @@ namespace VEPROMS.CSLA.Library } catch { } - if (CloseWordWhenDone) + try + { + if (CloseWordWhenDone) + { + CloseAppAfterWait(); + } + } + catch (Exception ex) { - CloseAppAfterWait(); - } + System.Windows.Forms.Application.DoEvents(); + _MyLog.Error("Failed to close Microsoft Word. Collecting reclaimable memory.", ex); + GC.Collect(); + _MyLog.Warn("Finished collecting reclaimable memory."); + } - if (statusChange != null) statusChange(VolianStatusType.Complete, 0, string.Empty); + if (statusChange != null) statusChange(VolianStatusType.Complete, 0, string.Empty); if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) Volian.Base.Library.BaselineMetaFile.WriteLine("++EndTxt++"); // [jpr 2022.07.26] - For memory optimization diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Pdf.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Pdf.cs index 699521a0..9bd0d5d8 100644 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Pdf.cs +++ b/PROMS/VEPROMS.CSLA.Library/Generated/Pdf.cs @@ -522,19 +522,22 @@ namespace VEPROMS.CSLA.Library } public static Pdf MakePdf(Document myDocument, int debugStatus, int topRow, int pageLength, int leftMargin, int pageWidth, double pageCount, byte[] docPdf) { - Pdf tmp = Pdf.New(myDocument, debugStatus, topRow, pageLength, leftMargin, pageWidth, pageCount, docPdf); - if (tmp.IsSavable) - tmp = tmp.Save(); - else + using (Pdf tmp = Pdf.New(myDocument, debugStatus, topRow, pageLength, leftMargin, pageWidth, pageCount, docPdf)) { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) + if (tmp.IsSavable) + return tmp.Save(); + else { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; + Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); + tmp._ErrorMessage = "Failed Validation:"; + foreach (Csla.Validation.BrokenRule br in brc) + { + tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; + } + return tmp; } } - return tmp; + } public static Pdf Get(int docID, int debugStatus, int topRow, int pageLength, int leftMargin, int pageWidth) { diff --git a/PROMS/VEPROMS.CSLA.Library/Minimal/Maintenance.cs b/PROMS/VEPROMS.CSLA.Library/Minimal/Maintenance.cs index a4ef77e1..e1c2cb0b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Minimal/Maintenance.cs +++ b/PROMS/VEPROMS.CSLA.Library/Minimal/Maintenance.cs @@ -86,7 +86,38 @@ namespace VEPROMS.CSLA.Library throw new DbCslaException("Error in vesp_GetOtherActiveSessions: retrieving data failed", ex); } } - #endregion + #endregion - } + #region Get Docs by Unit + //C2026-007 Get Missing Docs by Unit + // for Generating/Regenerating Pdf table + // can be ran overnight to assist with Printing when RO Updates + // and large Word Sections conatining ROs + public static DataTable GetMissingDocsByUnit() + { + try + { + using (SqlConnection cn = Database.VEPROMS_SqlConnection) + { + using (SqlCommand cm = cn.CreateCommand()) + { + cm.CommandType = CommandType.StoredProcedure; + cm.CommandText = "GetMissingDocsByUnit"; + cm.CommandTimeout = Database.DefaultTimeout; + using (SqlDataAdapter da = new SqlDataAdapter(cm)) + { + DataTable dt = new DataTable(); + da.Fill(dt); + return dt; + } + } + } + } + catch (Exception ex) + { + throw new DbCslaException("Error in GetMissingDocsByUnit: retrieving data failed", ex); + } + } + #endregion + } } -- 2.49.1 From d17688fc9d010d4b710a04865fec078ddb18f1c1 Mon Sep 17 00:00:00 2001 From: John Jenko Date: Tue, 17 Mar 2026 11:24:24 -0400 Subject: [PATCH 06/19] C2026-030 corrected the Alarm format cover page --- PROMS/Formats/fmtall/BNPPalrall.xml | Bin 237646 -> 237670 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/PROMS/Formats/fmtall/BNPPalrall.xml b/PROMS/Formats/fmtall/BNPPalrall.xml index 58b11ba9d32e29e7dbed94e42cc9ce01b0ec172c..0cb98e6b9b933083ae03eafe4478c48c7e982fde 100644 GIT binary patch delta 77 zcmX?ifbZD>zJ?aYElg$$rcao}#4>F@lfw3p1x$R5aPD*ZY delta 82 zcmaEMfbZM^zJ?aYElg$$roCojn;!C!Nnm@>0wys=ICnabt1x}ZLZ&|mA*LlvO55)( OV&Xt3+YS^<`2zrCS0HBq -- 2.49.1 From 4b479b3ceb2a3f21854e569b9182624c2891635e Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Tue, 17 Mar 2026 15:30:35 -0400 Subject: [PATCH 07/19] B2026-022-Adding-RO-Editor-symbols-to-RO-Tables --- .../LibSource/RODBInterface/RODBInterface.cs | 16 ++++++++++++++-- PROMS/Volian.Controls.Library/VlnFlexGrid.cs | 9 ++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/PROMS/ReferencedObjects/LibSource/RODBInterface/RODBInterface.cs b/PROMS/ReferencedObjects/LibSource/RODBInterface/RODBInterface.cs index 2beac2bd..ee29fbcd 100644 --- a/PROMS/ReferencedObjects/LibSource/RODBInterface/RODBInterface.cs +++ b/PROMS/ReferencedObjects/LibSource/RODBInterface/RODBInterface.cs @@ -2147,7 +2147,6 @@ namespace RODBInterface foreach (int chr in chrAry) { if (chr > 166) - { xmlstrTmp.Append($"\\u{(int)chr}?"); } @@ -2205,7 +2204,6 @@ namespace RODBInterface foreach (int chr in chrAry) { if (chr > 166) - { xmlstrTmp.Append($"\\u{(int)chr}?"); } @@ -2660,7 +2658,21 @@ namespace RODBInterface } } StatMsgWindow.StatusMessage = echild.GetAttribute("MenuTitle"); + StringBuilder tinfo2Tmp = new StringBuilder(); // B2026-025 prep the info field data so it will be saved correctly. str = "UPDATE " + echild.GetAttribute("Table") + " SET Info = '" + tinfo2 + "'"; + char[] chrAry = tinfo2.ToCharArray(); + foreach (int chr in chrAry) + { + if (chr > 166) + { + tinfo2Tmp.Append($"\\u{(int)chr}?"); + } + else + { + tinfo2Tmp.Append((char)chr); + } + } + str = "UPDATE " + echild.GetAttribute("Table") + " SET Info = '" + tinfo2Tmp.ToString() + "'"; str = str + ", ModDateTime = '" + dt + "' WHERE RecID = '" + echild.GetAttribute("RecID") + "';"; DBE.Command(str); DBE.Reader(); diff --git a/PROMS/Volian.Controls.Library/VlnFlexGrid.cs b/PROMS/Volian.Controls.Library/VlnFlexGrid.cs index 465d323a..f7f2310f 100644 --- a/PROMS/Volian.Controls.Library/VlnFlexGrid.cs +++ b/PROMS/Volian.Controls.Library/VlnFlexGrid.cs @@ -2479,10 +2479,8 @@ namespace Volian.Controls.Library foreach (Match match in Regex.Matches(rtn, pattern, RegexOptions.IgnoreCase)) { mValue = match.Value; - mValue2 = @"\f1 " + mValue + @"\f0"; - rtn = rtn.Replace(match.Value, mValue2); - // @"\f1\u9474 ?\f0") - // linkValue = linkValue.Replace(match.Value, "\\f1 " + match.Value + "\\f0"); + mValue2 = $"\\f1 {mValue}\\f0"; + rtn = rtn.Replace(match.Value, mValue2); } @@ -3840,9 +3838,6 @@ namespace Volian.Controls.Library this.MergedRanges.Clear(); this.Clear(); this.IsRoTable = true; - //valtext = valtext.Replace(@"\u8209?", "-"); - //valtext = Regex.Replace(valtext, @"\\u([0-9]{1,4})\?", m => int.TryParse(m?.Groups[1]?.Value, out int result) ? Convert.ToChar(result).ToString() : ""); - //valtext = valtext.Replace("-", @"\u8209?"); this.ParseTableFromText(valtext, GridLinePattern.Single); this.AutoSizeCols(); this.AutoSizeRows(); -- 2.49.1 From e03ae6195ab988749521792b9f6d00c334dcc08e Mon Sep 17 00:00:00 2001 From: mschill Date: Wed, 18 Mar 2026 07:53:17 -0400 Subject: [PATCH 08/19] =?UTF-8?q?C2026-028=20Update=20Tooltip=20for=20?= =?UTF-8?q?=E2=80=9CSet=20All=20at=20Level=E2=80=9D=20in=20Applicability.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs index 74a354b4..cc37fbea 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs @@ -49,7 +49,7 @@ namespace Volian.Controls.Library this.btnApplicabilitychg.Size = new System.Drawing.Size(80, 22); this.btnApplicabilitychg.Margin = new System.Windows.Forms.Padding(2); this.btnApplicabilitychg.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.superTooltip1.SetSuperTooltip(this.btnApplicabilitychg, new DevComponents.DotNetBar.SuperTooltipInfo("Change applicability settings - All At Level", "", "When clicked, all steps at the level of the current step will have their applicability settings changed.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); + this.superTooltip1.SetSuperTooltip(this.btnApplicabilitychg, new DevComponents.DotNetBar.SuperTooltipInfo("Change applicability settings - All At Level", "", "When clicked, all steps at the level of the current step will have their applicability settings changed. Note that for two column procedures, the left column and right column are handled separately.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); this.btnApplicabilitychg.TabIndex = 0; this.btnApplicabilitychg.Text = "Set All at Level"; this.btnApplicabilitychg.ColorTable = DevComponents.DotNetBar.eButtonColor.BlueOrb; -- 2.49.1 From 5eca8a5150a670dc3c3b86beb79009744e2a261e Mon Sep 17 00:00:00 2001 From: mschill Date: Wed, 18 Mar 2026 14:44:45 -0400 Subject: [PATCH 09/19] B2026-030 GoTo sometimes requires being pressed twice for ROs --- PROMS/Volian.Controls.Library/DisplayRO.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayRO.cs b/PROMS/Volian.Controls.Library/DisplayRO.cs index c1f7725e..b40aa139 100644 --- a/PROMS/Volian.Controls.Library/DisplayRO.cs +++ b/PROMS/Volian.Controls.Library/DisplayRO.cs @@ -1164,12 +1164,21 @@ namespace Volian.Controls.Library tbROValue.Text = null; lbROId.Text = string.Empty; - // Disable all buttons by default - btnGoToRO.Enabled = false; + // Disable all buttons by default btnSaveRO.Enabled = false; btnCancelRO.Enabled = false; btnPreviewRO.Enabled = false; - } + + //B2026-030 GoTo sometimes requires being pressed twice + if (MyUserInfo != null && MyDvi != null && selectedChld.value != null) + { + btnGoToRO.Enabled = UserInfo.CanEditROs(MyUserInfo, MyDvi); // Writers and Reviewers cannot edit ROs (run the RO Editor) + } + else + { + btnGoToRO.Enabled = false; + } + } #endregion } -- 2.49.1 From a10798c9831aa9fd39696f269358e76f7aa84709 Mon Sep 17 00:00:00 2001 From: mschill Date: Fri, 20 Mar 2026 15:30:51 -0400 Subject: [PATCH 10/19] B2026-033 Tooltip for Generate Word Attachments --- .../frmBatchRefresh.Designer.cs | 4 ++-- PROMS/VEPROMS User Interface/frmBatchRefresh.resx | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs b/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs index 41c381d5..ceed4fe9 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs @@ -1317,7 +1317,7 @@ this.swRegenWordAttmts.Name = "swRegenWordAttmts"; this.swRegenWordAttmts.Size = new System.Drawing.Size(91, 22); this.swRegenWordAttmts.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.superTooltip1.SetSuperTooltip(this.swRegenWordAttmts, new DevComponents.DotNetBar.SuperTooltipInfo("Generate Word Attachments", "", resources.GetString("swRegenWordAttmts.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(300, 200))); + this.superTooltip1.SetSuperTooltip(this.swRegenWordAttmts, new DevComponents.DotNetBar.SuperTooltipInfo("Generate Word Attachments", "", resources.GetString("swRegenWordAttmts.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(300, 250))); this.swRegenWordAttmts.SwitchClickTogglesValue = true; this.swRegenWordAttmts.TabIndex = 34; this.swRegenWordAttmts.Value = true; @@ -1334,7 +1334,7 @@ this.labelX1.Location = new System.Drawing.Point(107, 150); this.labelX1.Name = "labelX1"; this.labelX1.Size = new System.Drawing.Size(186, 22); - this.superTooltip1.SetSuperTooltip(this.labelX1, new DevComponents.DotNetBar.SuperTooltipInfo("Generate Word Attachments", "", resources.GetString("labelX1.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(300, 200))); + this.superTooltip1.SetSuperTooltip(this.labelX1, new DevComponents.DotNetBar.SuperTooltipInfo("Generate Word Attachments", "", resources.GetString("labelX1.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(300, 250))); this.labelX1.TabIndex = 33; this.labelX1.Text = "Generate Missing Word Attachments"; // diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.resx b/PROMS/VEPROMS User Interface/frmBatchRefresh.resx index 15533721..c8355cb0 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.resx +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.resx @@ -121,15 +121,15 @@ 17, 17 - When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all the of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents. Certain actions like loading a new RO.FST require that these PDFs be regenerated which is normally done at print time. + When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents. Certain actions like loading a new RO.FST require that these PDFs be regenerated which is normally done at print time. -This function will generate (and save) any missing saved attachment PDFS stored in the database (not the PDFs of the entire procedure that you had previous printed). This will cause printing to be faster when you print after this as the PDFs will be pre-genrated in those cases (and thus not require regeneration unless changes were made to the Word Sections or ROs after running this). +This function will generate (and save) any missing saved attachment PDFs stored in the database (not the PDFs of the entire procedure that you had previous printed). This will cause printing to be faster when you print after this as the PDFs will be pre-genrated in those cases (and thus not require regeneration unless changes were made to the Word Sections or ROs after running this). - When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all the of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents. Certain actions like loading a new RO.FST require that these PDFs be regenerated which is normally done at print time. + When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents. Certain actions like loading a new RO.FST require that these PDFs be regenerated which is normally done at print time. -This function will generate (and save) any missing saved attachment PDFS stored in the database (not the PDFs of the entire procedure that you had previous printed). This will cause printing to be faster when you print after this as the PDFs will be pre-genrated in those cases (and thus not require regeneration unless changes were made to the Word Sections or ROs after running this). +This function will generate (and save) any missing saved attachment PDFs stored in the database (not the PDFs of the entire procedure that you had previous printed). This will cause printing to be faster when you print after this as the PDFs will be pre-genrated in those cases (and thus not require regeneration unless changes were made to the Word Sections or ROs after running this). @@ -183,7 +183,7 @@ RO paths, ROFST versions, and the contents of RO figures are stored in the datab Be sure a current backup exists prior to running this function!! - When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all the of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents. + When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents. This function will remove all of the saved attachment PDFS stored in the database (not the PDFs of the entire procedure that you had previous printed). This will force PROMS to regenerate (and save) the word attachment PDFs the next time the procedure is printed. @@ -202,9 +202,9 @@ RO paths, ROFST versions, and the contents of RO figures are stored in the datab Be sure a current backup exists prior to running this function!! - When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all the of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents. + When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents. -This function will remove all of the saved attachment PDFS stored in the database (not the PDFs of the entire procedure that you had previous printed). This will force PROMS to regenerate (and save) the word attachment PDFs the next time the procedure is printed. +This function will remove all of the saved attachment PDFs stored in the database (not the PDFs of the entire procedure that you had previous printed). This will force PROMS to regenerate (and save) the word attachment PDFs the next time the procedure is printed. -- 2.49.1 From 8cbc8c497ee963c5f91e264d0a19f2f2df49620e Mon Sep 17 00:00:00 2001 From: mschill Date: Mon, 23 Mar 2026 06:30:41 -0400 Subject: [PATCH 11/19] C2026-007 - Handle case for Step Progress when all switchboxes are turned off and then Regen Word Attachments is turned back on. --- PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs b/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs index 41c381d5..7145cd52 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs @@ -1322,6 +1322,7 @@ this.swRegenWordAttmts.TabIndex = 34; this.swRegenWordAttmts.Value = true; this.swRegenWordAttmts.ValueObject = "Y"; + this.swRegenWordAttmts.ValueChanged += new System.EventHandler(this.swCk_ValueChanged); // // labelX1 // -- 2.49.1 From 714751f4045e70d213f92ab3746d10b0d9a6b872 Mon Sep 17 00:00:00 2001 From: mschill Date: Tue, 24 Mar 2026 08:45:55 -0400 Subject: [PATCH 12/19] C2026-007 Admin Tool Generate Word Attachments --- PROMS/VEPROMS User Interface/PROMSFixes.Sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PROMS/VEPROMS User Interface/PROMSFixes.Sql b/PROMS/VEPROMS User Interface/PROMSFixes.Sql index 0cbd1891..7e34dfd6 100644 --- a/PROMS/VEPROMS User Interface/PROMSFixes.Sql +++ b/PROMS/VEPROMS User Interface/PROMSFixes.Sql @@ -24753,7 +24753,7 @@ BEGIN select Docs.DocID, UnitID, SectionID = MIN(SectionID) FROM (SELECT DISTINCT [DocID] - FROM [VEPROMS_Barakah].[dbo].[tblDocuments]) Docs + FROM [tblDocuments]) Docs INNER JOIN Entries on Docs.DocID = Entries.DocID INNER JOIN Contents on Entries.ContentID = Contents.ContentID inner join Items on Items.ContentID = Contents.ContentID -- 2.49.1 From d76c81a9d86b0287e8063a1b8b2f3d641ba3da74 Mon Sep 17 00:00:00 2001 From: John Jenko Date: Tue, 24 Mar 2026 16:27:22 -0400 Subject: [PATCH 13/19] B2026-034 Fixed issue where import of procedure set failed when it was deleting the temporary folders that are created during the process, preventing the importing code to try and fix transitions and foldout information (link). --- PROMS/VEPROMS User Interface/dlgExportImport.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/PROMS/VEPROMS User Interface/dlgExportImport.cs b/PROMS/VEPROMS User Interface/dlgExportImport.cs index 1606a03a..f1e052bf 100644 --- a/PROMS/VEPROMS User Interface/dlgExportImport.cs +++ b/PROMS/VEPROMS User Interface/dlgExportImport.cs @@ -947,14 +947,16 @@ namespace VEPROMS pi = AddProcedure(xd.DocumentElement, dvi, pi); GC.Collect(); // need to cleanup memory after importing each procedure due to use of Regular Expressions in processing RO and Transition links } - DirectoryInfo di = new DirectoryInfo(PEIPath); - DirectoryInfo[] dis = di.GetDirectories(); - for (int d = 0; d < dis.Length; d++) - dis[d].Delete(true); lblImportStatus.Text = "Updating Transitions"; AddTransitions(); FixFloatingFoldouts(); SaveTransitionAndItemContentIDs(); + // B2026-034 remove the folders created from un-ziping the import set file - this was done prior to updating transitions + // so if there was an issue deleting these temporay folders and files, the actual importing will be completed + DirectoryInfo di = new DirectoryInfo(PEIPath); + DirectoryInfo[] dis = di.GetDirectories(); + for (int d = 0; d < dis.Length; d++) + dis[d].Delete(true); return true; } } -- 2.49.1 From c0d12f57214c08f4c7318a87f5d77b44176dbeeb Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Wed, 25 Mar 2026 11:34:58 -0400 Subject: [PATCH 14/19] B2026-023-Adding-RO-Editor-symbols-to-RO-X_Y_plots --- PROMS/XYPlots/XYPlots.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PROMS/XYPlots/XYPlots.cs b/PROMS/XYPlots/XYPlots.cs index dc098b3f..7721e5af 100644 --- a/PROMS/XYPlots/XYPlots.cs +++ b/PROMS/XYPlots/XYPlots.cs @@ -491,10 +491,12 @@ namespace XYPlots // remove an extra spaces between >< //Buff = Regex.Replace(Buff, @"[ ]+<", "<"); Buff = Buff.Replace(">\r ", ">\r\n "); + Buff = Buff.Replace(">\n ", ">\r\n "); // C2022-003 if RO has symbols Buff = Regex.Replace(Buff, @"[ ]+<", "<"); // some data only had carriage return, replace these with cr/nl so that following code // will work Buff = Buff.Replace(">\r<", ">\r\n<"); + Buff = Buff.Replace(">\n<", ">\r\n<"); // C2022-003 if RO has symbols Buff = Buff.Replace("><", ">\r\n<"); // some data had cr/cr/nl, change to cr/nl Buff = Buff.Replace("\r\r\n", "\r\n"); @@ -520,6 +522,7 @@ namespace XYPlots Buff = Buff.Substring(0, Buff.Length - 2) + " \r\n\0x00"; // needs to end with null else if (Buff.EndsWith(">")) // doesn't end with return chars... Buff = Buff.Substring(0, Buff.Length - 1) + " \r\n\0x00"; // needs to end with null + Buff = Regex.Replace(Buff, @"\\u([0-9]{1,4})\?", m => int.TryParse(m?.Groups[1]?.Value, out int result) ? Convert.ToChar(result).ToString() : ""); Buff = Regex.Replace(Buff, @"([0-9])\r\n([0-9])", "$1 $2"); } private void CloseGraph() -- 2.49.1 From b7b0e55d9407f835f03fb8257860a1b99d4929b1 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Wed, 25 Mar 2026 11:41:39 -0400 Subject: [PATCH 15/19] B2026-023-Adding-RO-Editor-symbols-to-RO-X_Y_plots --- PROMS/XYPlots/XYPlots.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PROMS/XYPlots/XYPlots.cs b/PROMS/XYPlots/XYPlots.cs index 7721e5af..8ac65c0d 100644 --- a/PROMS/XYPlots/XYPlots.cs +++ b/PROMS/XYPlots/XYPlots.cs @@ -522,7 +522,7 @@ namespace XYPlots Buff = Buff.Substring(0, Buff.Length - 2) + " \r\n\0x00"; // needs to end with null else if (Buff.EndsWith(">")) // doesn't end with return chars... Buff = Buff.Substring(0, Buff.Length - 1) + " \r\n\0x00"; // needs to end with null - Buff = Regex.Replace(Buff, @"\\u([0-9]{1,4})\?", m => int.TryParse(m?.Groups[1]?.Value, out int result) ? Convert.ToChar(result).ToString() : ""); + Buff = Regex.Replace(Buff, @"\\u([0-9]{1,4})\?", m => int.TryParse(m?.Groups[1]?.Value, out int result) ? Convert.ToChar(result).ToString() : ""); // C2022-003 RO Symbols. Convert unicode to character. Buff = Regex.Replace(Buff, @"([0-9])\r\n([0-9])", "$1 $2"); } private void CloseGraph() -- 2.49.1 From 3f662ab19d86a1e377cd99e1481992ab02d43be7 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Wed, 25 Mar 2026 22:55:52 -0400 Subject: [PATCH 16/19] B2026-018_The_Disable_Initial_Line_check_box --- PROMS/Volian.Controls.Library/DisplayTags.Designer.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayTags.Designer.cs b/PROMS/Volian.Controls.Library/DisplayTags.Designer.cs index c738e4c6..a74db97d 100644 --- a/PROMS/Volian.Controls.Library/DisplayTags.Designer.cs +++ b/PROMS/Volian.Controls.Library/DisplayTags.Designer.cs @@ -266,8 +266,7 @@ namespace Volian.Controls.Library this.cbInitialLine.Margin = new System.Windows.Forms.Padding(2); this.cbInitialLine.Name = "cbInitialLine"; this.cbInitialLine.Size = new System.Drawing.Size(112, 15); - this.superTooltipTags.SetSuperTooltip(this.cbInitialLine, new DevComponents.DotNetBar.SuperTooltipInfo("Manual Page Break", "", "When set, starts this step at the top of a page.\r\n\r\nkeyboard command: ", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); + this.superTooltipTags.SetSuperTooltip(this.cbInitialLine, new DevComponents.DotNetBar.SuperTooltipInfo("Disable Initial Line", "", "When set, The initial line will be removed from this step.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); this.cbInitialLine.TabIndex = 1; this.cbInitialLine.Text = "Disable Initial Line"; this.cbInitialLine.Visible = false; @@ -277,7 +276,6 @@ namespace Volian.Controls.Library // this.groupPanelcmbShwRplWds.CanvasColor = System.Drawing.SystemColors.Control; this.groupPanelcmbShwRplWds.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - //this.groupPanelcmbShwRplWds.Controls.Add(this.cbInitialLine); this.groupPanelcmbShwRplWds.Controls.Add(this.cmbShwRplWds); this.groupPanelcmbShwRplWds.DisabledBackColor = System.Drawing.Color.Empty; this.groupPanelcmbShwRplWds.Dock = System.Windows.Forms.DockStyle.Top; -- 2.49.1 From ea048e6d82ebb46b06f8eb165f53060505aa4cb9 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Thu, 26 Mar 2026 07:55:27 -0400 Subject: [PATCH 17/19] B2026-018_The_Disable_Initial_Line_check_box --- PROMS/Volian.Controls.Library/DisplayTags.Designer.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/PROMS/Volian.Controls.Library/DisplayTags.Designer.cs b/PROMS/Volian.Controls.Library/DisplayTags.Designer.cs index a74db97d..6ff9ced5 100644 --- a/PROMS/Volian.Controls.Library/DisplayTags.Designer.cs +++ b/PROMS/Volian.Controls.Library/DisplayTags.Designer.cs @@ -879,3 +879,4 @@ namespace Volian.Controls.Library private System.Windows.Forms.Button btnSaveChangeID; } } + -- 2.49.1 From 7b96ef1b4c2bd8016ea1211aea5493a5242befd7 Mon Sep 17 00:00:00 2001 From: mschill Date: Thu, 26 Mar 2026 09:02:14 -0400 Subject: [PATCH 18/19] BNPP Cover Page Consolidation --- .../BNPP_CoverPageConsolidation.sql | 147 ++++++++++ .../BNPP_CoverPageConsolidation_Test.sql | 263 ++++++++++++++++++ 2 files changed, 410 insertions(+) create mode 100644 PROMS/SQL/ClientSpecific/BNPP_CoverPageConsolidation.sql create mode 100644 PROMS/SQL/ClientSpecific/BNPP_CoverPageConsolidation_Test.sql diff --git a/PROMS/SQL/ClientSpecific/BNPP_CoverPageConsolidation.sql b/PROMS/SQL/ClientSpecific/BNPP_CoverPageConsolidation.sql new file mode 100644 index 00000000..3ba8cd8e --- /dev/null +++ b/PROMS/SQL/ClientSpecific/BNPP_CoverPageConsolidation.sql @@ -0,0 +1,147 @@ + /***************************************************************************** + Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE + Copyright 2022 - Volian Enterprises, Inc. All rights reserved. +*****************************************************************************/ + +-- ============================================= +-- Author: Matthew Schill +-- Create date: 03/20/2026 +-- Description: Script to consolidate Cover Pages for Barakah +-- by Converting multi-unit procedures with Cover Pages +-- to use 1 Library Document Cover Page +-- ============================================= + + select Contents.ContentID + , Contenttext = Contents.Text + , Items.ItemID + , tblDocuments.DocID + , ParentContentID + , ParentItemID + , LibTitle = ISNULL(LibTitle,'') + , numLibCP + , numCP + ,BaseFlag = 0 + INTO #tmpUpdate + from Contents + inner join Entries on Contents.ContentID = Entries.ContentID + inner join tblDocuments on tblDocuments.DocID = Entries.DocID + inner join Items on Items.ContentID = Contents.ContentID + outer apply + (select ParentContentID=ContentID, ParentItemID = PItm.ItemID + FROM dbo.vefn_ParentItems(Items.ItemID) PItm + where PItm.ItemID <> Items.ItemID + ) parent + outer apply + (select numLibCP = Count(*) + FROM dbo.vefn_ChildItems(ParentItemID) PItm + INNER JOIN Contents on Contents.ContentID = PItm.ContentID + INNER JOIN Entries on Contents.ContentID = Entries.ContentID + INNER JOIN tblDocuments on tblDocuments.DocID = Entries.DocID + where PItm.ItemID <> ParentItemID + AND Contents.text like 'Cover Page%' and ISNULL(tblDocuments.LibTitle,'') <> '' + ) childWithLibTitle + outer apply + (select numCP = Count(*) + FROM dbo.vefn_ChildItems(ParentItemID) PItm + INNER JOIN Contents on Contents.ContentID = PItm.ContentID + where PItm.ItemID <> ParentItemID + AND Contents.text like 'Cover Page%' + ) child + where Contents.text like 'Cover Page%' + order by ParentContentID asc, CASE WHEN ISNULL(LibTitle,'') <> '' THEN 1 ELSE 2 END asc, Contents.Text asc + + UPDATE #tmpUpdate SET BaseFlag = 1 where LibTitle <> '' and numLibCP = 1 + + UPDATE #tmpUpdate SET BaseFlag = CASE WHEN tU.LibTitle <> '' THEN 1 ELSE 2 END FROM #tmpUpdate tU + where BaseFlag = 0 AND tU.ContentID IN + ( + Select ContentID FROM + (SELECT sub.ContentID, + row_number() OVER(PARTITION BY sub.ParentContentID ORDER BY CASE WHEN ISNULL(sub.LibTitle,'') <> '' THEN 1 ELSE 2 END asc, sub.Contenttext asc) as pos + FROM #tmpUpdate sub + ) x + WHERE x.pos = 1 + ) + + declare @Cont TABLE + ( + ContentID int, + ItemID int, + xConfig xml + ) + insert into @Cont + SELECT tU.ContentID, ItemID, xConfig = CAST(tblContents.config AS xml) FROM + tblContents + INNER JOIN + #tmpUpdate tU ON tU.ContentID = tblContents.ContentID + where tU.BaseFlag > 0 + + Update @Cont Set xConfig.modify('delete //MasterSlave') From @Cont; + + Update tblContents SET Text = 'Cover Page', Config = CAST(xConfig AS varchar(max)), + DTS = GETDATE(), UserID = 'CPVolian2026' + FROM + @Cont CNT INNER JOIN + tblContents ON CNT.ContentID = tblContents.ContentID; + + --Update items PreviousIds + UPDATE tblItems Set PreviousID = IdToSwapTO.ItemID + FROM + tblItems + INNER JOIN + #tmpUpdate tU ON tblItems.PreviousID = tU.ItemID AND tU.BaseFlag = 0 + INNER JOIN #tmpUpdate IdToSwapTO ON IdToSwapTO.ParentContentID = tU.ParentContentID AND IdToSwapTO.BaseFlag IN (1,2) + + UPDATE tblItems Set DeleteStatus = 1, DTS = GETDATE(), UserID = 'CPVolian2026' + FROM + #tmpUpdate tU INNER JOIN + tblItems ON tU.ContentID = tblItems.ContentID + WHERE tU.BaseFlag = 0; + + UPDATE tblContents Set DeleteStatus = 1, DTS = GETDATE(), UserID = 'CPVolian2026' + FROM + #tmpUpdate tU INNER JOIN + tblContents ON tU.ContentID = tblContents.ContentID + WHERE tU.BaseFlag = 0; + + DELETE FROM + tblEntries + FROM + tblEntries + INNER JOIN + #tmpUpdate tU ON tU.ContentID = tblEntries.ContentID + WHERE tU.BaseFlag in (0,2); + + INSERT INTO [dbo].[tblEntries] + ([ContentID] + ,[DocID] + ,[DTS] + ,[UserID] + ,[DeleteStatus]) + SELECT + DISTINCT tU.ContentID, + 766, -- docid 766 "Cover Page 1" + GETDATE(), + 'CPVolian2026', + 0 + FROM + #tmpUpdate tU + INNER JOIN + @Cont CNT ON tU.ContentID = CNT.ContentID + WHERE tU.BaseFlag = 2; + + drop table #tmpUpdate; + +IF (@@Error = 0) SELECT '[Barakah Cover Page Consolidation] Succeeded' +ELSE SELECT '[Barakah Cover Page Consolidation] Error' +go + + + + + + + + + + diff --git a/PROMS/SQL/ClientSpecific/BNPP_CoverPageConsolidation_Test.sql b/PROMS/SQL/ClientSpecific/BNPP_CoverPageConsolidation_Test.sql new file mode 100644 index 00000000..411179db --- /dev/null +++ b/PROMS/SQL/ClientSpecific/BNPP_CoverPageConsolidation_Test.sql @@ -0,0 +1,263 @@ + +-- ============================================= +-- Author: Matthew Schill +-- Create date: 03/20/2026 +-- Description: Script to consolidate Cover Pages for Barakah +-- by Converting multi-unit procedures with Cover Pages +-- to use 1 Library Document Cover Page +-- ============================================= + + ----@isTest = 0 will change data + ----@isTest = 1 for internal testing (no data will be changed) +DECLARE @isTest bit = 1; + + ----Per Cover Page, pull how many cover pages + ----Each Cover Page's procedure has + ----and how many of those are library documents + select Contents.ContentID + , Contenttext = Contents.Text + , Items.ItemID + , tblDocuments.DocID + , ParentContentID + , ParentItemID + , LibTitle = ISNULL(LibTitle,'') + , numLibCP + , numCP + ,BaseFlag = 0 + INTO #tmpUpdate + from Contents + inner join Entries on Contents.ContentID = Entries.ContentID + inner join tblDocuments on tblDocuments.DocID = Entries.DocID + inner join Items on Items.ContentID = Contents.ContentID + outer apply + (select ParentContentID=ContentID, ParentItemID = PItm.ItemID + FROM dbo.vefn_ParentItems(Items.ItemID) PItm + where PItm.ItemID <> Items.ItemID + ) parent + outer apply + (select numLibCP = Count(*) + FROM dbo.vefn_ChildItems(ParentItemID) PItm + INNER JOIN Contents on Contents.ContentID = PItm.ContentID + INNER JOIN Entries on Contents.ContentID = Entries.ContentID + INNER JOIN tblDocuments on tblDocuments.DocID = Entries.DocID + where PItm.ItemID <> ParentItemID + AND Contents.text like 'Cover Page%' and ISNULL(tblDocuments.LibTitle,'') <> '' + ) childWithLibTitle + outer apply + (select numCP = Count(*) + FROM dbo.vefn_ChildItems(ParentItemID) PItm + INNER JOIN Contents on Contents.ContentID = PItm.ContentID + where PItm.ItemID <> ParentItemID + AND Contents.text like 'Cover Page%' + ) child + where Contents.text like 'Cover Page%' + order by ParentContentID asc, CASE WHEN ISNULL(LibTitle,'') <> '' THEN 1 ELSE 2 END asc, Contents.Text asc + +--BaseFlag +-- 0 = a Cover Page that will be deleted +-- 1 = is base item (Cover Page will get renamed and applicability set to all) +-- 2 = would be base item but not linked to Lib document (Cover Page will get renamed and applicability set to all + will need linked to library doc) + +---- If only 1 Library Doc CP for the CP's procedure and this is it, then mark this CP as the one we will keep + UPDATE #tmpUpdate SET BaseFlag = 1 where LibTitle <> '' and numLibCP = 1 + +---- If multiple Library Document CPs, pick the first one as the one we will keep (BaseFlag = 1) +---- If no Library Document CPs, pick the first one as the one we will repurpose (BaseFlag = 2) + UPDATE #tmpUpdate SET BaseFlag = CASE WHEN tU.LibTitle <> '' THEN 1 ELSE 2 END FROM #tmpUpdate tU + where BaseFlag = 0 AND tU.ContentID IN + ( + Select ContentID FROM + (SELECT sub.ContentID, + row_number() OVER(PARTITION BY sub.ParentContentID ORDER BY CASE WHEN ISNULL(sub.LibTitle,'') <> '' THEN 1 ELSE 2 END asc, sub.Contenttext asc) as pos + FROM #tmpUpdate sub + ) x + WHERE x.pos = 1 + ) + +----BEGIN TESTS-- + if(@isTest = 1) + BEGIN + select Count(*), 'Should be Zero - not exactly one BaseFlag set to non 0 for each Parent Item' FROM #tmpUpdate TU + OUTER APPLY + (select numBaseFlagSet = SUM(CASE WHEN sub.BaseFlag > 0 THEN 1 ELSE 0 END) + FROM #tmpUpdate sub + where sub.ParentContentID = TU.ParentContentID + ) sub + where numBaseFlagSet <> 1 + + select Count(*), 'Should be Zero - 0 Lib Docs, BaseFlag is 1' FROM #tmpUpdate TU + where numLibCP = 0 and BaseFlag = 1 + + select Count(*), 'Should be Zero - at least 1 Lib Docs, BaseFlag is 2' FROM #tmpUpdate TU + where numLibCP > 0 and BaseFlag = 2 + + select Count(*), 'Should be Zero - 1 Lib Docs, BaseFlag not 1 for that Lib doc' FROM #tmpUpdate TU + where numLibCP = 1 and LibTitle <> '' and BaseFlag <> 1 + + select Count(*), 'Should be Zero - 1 Lib Docs, BaseFlag not 0 for ones without Lib Doc' FROM #tmpUpdate TU + where numLibCP = 1 and LibTitle = '' and BaseFlag <> 0 + + select Count(*), 'Should be Zero - 1 CP, no Lib Docs, BaseFlag not 2' FROM #tmpUpdate TU + where numLibCP = 0 and numCP = 1 and BaseFlag <> 2 + + select Count(*), 'Should be Zero - more than 1 Lib Docs, BaseFlag is 1' FROM #tmpUpdate TU + where numLibCP = 0 and BaseFlag = 1 + + select Count(*), 'Should be Zero - not exactly one BaseFlag set to non 0 for each Parent Item' FROM #tmpUpdate TU + OUTER APPLY + (select numBaseFlagSet = SUM(CASE WHEN sub.BaseFlag > 0 THEN 1 ELSE 0 END) + FROM #tmpUpdate sub + where sub.ParentContentID = TU.ParentContentID + ) sub + where numBaseFlagSet <> 1 + + select Count(*), 'Should be Zero - 0 Lib Docs, BaseFlag is 1' FROM #tmpUpdate TU + where numLibCP = 0 + and BaseFlag = 1 + + --all Parents should have exactly 1 Baseflag=1 or BaseFlage = 2 + select 'Should be No Records where not a BaseFlag 1 or 2' + select NumNotBaseFlag12 = Count(*) + FROM #tmpUpdate TU + Group by ParentContentID + HAVING SUM(CASE WHEN BaseFlag in (1,2) THEN 1 ELSE 0 END) <> 1 + + select 'Should be No Records where with both a BaseFlag 1 and 2' + select NumBothBaseFlag12 = Count(*) + FROM #tmpUpdate TU + Group by ParentContentID + HAVING SUM(BaseFlag) > 2 + + END + --END TESTS-- + +--BaseFlag +-- 0 = a Cover Page that will be deleted +-- 1 = is base item (Cover Page will get renamed and applicability set to all) +-- 2 = would be base item but not linked to Lib document (Cover Page will get renamed and applicability set to all + will need linked to library doc) + +----Update config for Coverpage 1 to remove +----from that config +----cover page 1s + declare @Cont TABLE + ( + ContentID int, + ItemID int, + xConfig xml + ) + insert into @Cont + SELECT tU.ContentID, ItemID, xConfig = CAST(tblContents.config AS xml) FROM + tblContents + INNER JOIN + #tmpUpdate tU ON tU.ContentID = tblContents.ContentID + where tU.BaseFlag > 0 + + if(@isTest = 1) + BEGIN + select WRD='Have Masterslave in xconfig', NumwithMasterSlave = Count(*) FROM @Cont CNT + INNER JOIN + tblContents ON CNT.ContentID = tblContents.ContentID + where CAST(xConfig AS varchar(max)) like '%MasterSlave%' + END + + Update @Cont Set xConfig.modify('delete //MasterSlave') From @Cont; + + if(@isTest = 1) + BEGIN + select WRD='None should have Masterslave Removed in xconfig', NumwithMasterSlave = Count(*) FROM @Cont CNT + INNER JOIN + tblContents ON CNT.ContentID = tblContents.ContentID + where CAST(xConfig AS varchar(max)) like '%MasterSlave%' + + select 'Show Records and how the ids will be re-linked' + + Select tblItems.ItemID, tblItems.ContentID, tblItems.PreviousID, tblContents.Text, + PreviousItemID = tU.ItemID, PreviousContentID = tU.ContentID, PreviousText = tUCont.Text, + RelinkToItemID = IdToSwapTO.ItemID, RelinkToContentID = IdToSwapTO.ContentID, RelinkToText = IdToSwapTOCont.Text + FROM + tblItems + INNER JOIN + tblContents on tblContents.ContentID = tblItems.ContentID + INNER JOIN + #tmpUpdate tU ON tblItems.PreviousID = tU.ItemID AND tU.BaseFlag = 0 + INNER JOIN + tblContents tUCont on tUCont.ContentID = tU.ContentID + LEFT OUTER JOIN #tmpUpdate IdToSwapTO ON IdToSwapTO.ParentContentID = tU.ParentContentID AND IdToSwapTO.BaseFlag IN (1,2) + LEFT OUTER JOIN tblContents IdToSwapTOCont on IdToSwapTOCont.ContentID = IdToSwapTO.ContentID + + END + ELSE + BEGIN + --Update Config for Contents and set Text = 'Cover Page' + Update tblContents SET Text = 'Cover Page', Config = CAST(xConfig AS varchar(max)), + DTS = GETDATE(), UserID = 'CPVolian2026' + FROM + @Cont CNT INNER JOIN + tblContents ON CNT.ContentID = tblContents.ContentID; + + --Update items PreviousIds + UPDATE tblItems Set PreviousID = IdToSwapTO.ItemID + FROM + tblItems + INNER JOIN + #tmpUpdate tU ON tblItems.PreviousID = tU.ItemID AND tU.BaseFlag = 0 + INNER JOIN #tmpUpdate IdToSwapTO ON IdToSwapTO.ParentContentID = tU.ParentContentID AND IdToSwapTO.BaseFlag IN (1,2) + + --delete where BaseFlag = 0 ---Items,Content,Entries, --set DeleteStatus = 1 + --these are ones that will be replaced by a library document + UPDATE tblItems Set DeleteStatus = 1, DTS = GETDATE(), UserID = 'CPVolian2026' + FROM + #tmpUpdate tU INNER JOIN + tblItems ON tU.ContentID = tblItems.ContentID + WHERE tU.BaseFlag = 0; + + UPDATE tblContents Set DeleteStatus = 1, DTS = GETDATE(), UserID = 'CPVolian2026' + FROM + #tmpUpdate tU INNER JOIN + tblContents ON tU.ContentID = tblContents.ContentID + WHERE tU.BaseFlag = 0; + + --delete entries where Baseflag = 2 + --create new entries where Baseflag = 2 + + DELETE FROM + tblEntries + FROM + tblEntries + INNER JOIN + #tmpUpdate tU ON tU.ContentID = tblEntries.ContentID + WHERE tU.BaseFlag in (0,2); + + INSERT INTO [dbo].[tblEntries] + ([ContentID] + ,[DocID] + ,[DTS] + ,[UserID] + ,[DeleteStatus]) + SELECT + DISTINCT tU.ContentID, + 766, -- docid 766 "Cover Page 1" + GETDATE(), + 'CPVolian2026', + 0 + FROM + #tmpUpdate tU + INNER JOIN + @Cont CNT ON tU.ContentID = CNT.ContentID + WHERE tU.BaseFlag = 2; + + END; + + drop table #tmpUpdate; + + + + + + + + + + + + -- 2.49.1 From 17a28def4ed8b49cca1269911a9f6734f999d68b Mon Sep 17 00:00:00 2001 From: mschill Date: Thu, 26 Mar 2026 09:17:13 -0400 Subject: [PATCH 19/19] Update Copyright date --- PROMS/SQL/ClientSpecific/BNPP_CoverPageConsolidation.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PROMS/SQL/ClientSpecific/BNPP_CoverPageConsolidation.sql b/PROMS/SQL/ClientSpecific/BNPP_CoverPageConsolidation.sql index 3ba8cd8e..65bf270e 100644 --- a/PROMS/SQL/ClientSpecific/BNPP_CoverPageConsolidation.sql +++ b/PROMS/SQL/ClientSpecific/BNPP_CoverPageConsolidation.sql @@ -1,6 +1,6 @@ /***************************************************************************** Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - Copyright 2022 - Volian Enterprises, Inc. All rights reserved. + Copyright 2026 - Volian Enterprises, Inc. All rights reserved. *****************************************************************************/ -- ============================================= -- 2.49.1