From 5e2e2f841c04bcd695b34cf9f9e3817aea6d4d2d Mon Sep 17 00:00:00 2001 From: mschill Date: Tue, 24 Sep 2024 10:47:44 -0400 Subject: [PATCH 1/2] B2024-074 When Deleting annotations via the Administrative Tools -> Delete -> Delete Annotations, and checking if a procedure is checked out prior to deletion: 1. If no Number for Procedure, Display Title. 2. If only deleting annotations from an individual procedure, verify can check out procedure. --- .../VEPROMS User Interface/frmBatchRefresh.cs | 16 +++++ .../Extension/MultiUserExt.cs | 68 ++++++++++++------- 2 files changed, 61 insertions(+), 23 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.cs b/PROMS/VEPROMS User Interface/frmBatchRefresh.cs index e5c85cb9..5fea1635 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.cs +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.cs @@ -11,6 +11,7 @@ using Volian.Controls.Library; using DevComponents.DotNetBar; using JR.Utils.GUI.Forms; using Volian.Controls.Library; +using System.Linq; namespace VEPROMS { @@ -1799,6 +1800,21 @@ namespace VEPROMS } } + //B2024-074 If only deleting annotations from an individual procedure, verify can check out procedure. + string msgpi = string.Empty; + foreach (ProcedureInfo pi in pil) + { + //LINQ used for 1st check of if statement + //basically check if procedure was already part of a docVersionsFolder + //before checking if procedure was checked out already + //to avoid duplicate messages for checked out procedures + if (!dvil.Any(x => x.Procedures.Any(y => y.ItemID == pi.ItemID)) && !MySessionInfo.CanCheckOutItem(pi.ItemID, CheckOutType.Procedure, ref msgpi)) + { + sbDocVersions.AppendLine(msgpi); + cancelledOut = true; + } + } + if (cancelledOut) { StringBuilder sb = new StringBuilder(); diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs index d9072509..7e525bcc 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs @@ -156,32 +156,38 @@ namespace VEPROMS.CSLA.Library SessionInfoList sil = DataPortal.Fetch(new SessionInfoList.CanCheckOutItemCriteria(objectID, objectType)); if (sil.Count == 0) return true; - if (objectType == CheckOutType.Session) - { - if (sil.Count == 1) - { - OwnerInfoList oil = OwnerInfoList.GetBySessionID(sil[0].SessionID); - if (oil.Count == 0) - return true; - else - { - message = "Export Procedure Set and Import Procedure Set are not available because you have open procedures or documents"; - return false; - } - } - else - { - message = "Export Procedure Set and Import Procedure Set are not available because there are other sessions open in the database"; - return false; - } - } + if (objectType == CheckOutType.Session) + { + if (sil.Count == 1) + { + OwnerInfoList oil = OwnerInfoList.GetBySessionID(sil[0].SessionID); + if (oil.Count == 0) + return true; + else + { + message = "Export Procedure Set and Import Procedure Set are not available because you have open procedures or documents"; + return false; + } + } + else + { + message = "Export Procedure Set and Import Procedure Set are not available because there are other sessions open in the database"; + return false; + } + } bool rv = true; // C2015-022 part of separate windows logic, check the processID instead of the sessionID foreach (SessionInfo si in sil) { if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Procedure) { - message = string.Format("The procedure {0} is already checked out to {1}", ItemInfo.Get(objectID).MyProcedure.DisplayNumber, si.UserID); + //B2024-074 If no Number for Procedure, Display Title + ProcedureInfo tmpproc = ItemInfo.Get(objectID).MyProcedure; + string name = tmpproc.DisplayNumber; + if (string.IsNullOrEmpty(name)) + { name = tmpproc.DisplayText; } + + message = string.Format("The procedure {0} is already checked out to {1}", name, si.UserID); rv = rv && false; } else if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Document) @@ -195,8 +201,16 @@ namespace VEPROMS.CSLA.Library OwnerInfo oi = OwnerInfo.GetBySessionIDandVersionID(si.SessionID, objectID); if (oi == null) message = message + string.Format("The working draft is already checked out to {0}", si.UserID) + Environment.NewLine; - else if(oi.OwnerType == 0) - message = message + string.Format("The procedure {0} is already checked out to {1}", ItemInfo.Get(oi.OwnerItemID).MyProcedure.DisplayNumber, si.UserID) + Environment.NewLine; + else if (oi.OwnerType == 0) + { + //B2024-074 If no Number for Procedure, Display Title + ProcedureInfo tmpproc = ItemInfo.Get(oi.OwnerItemID).MyProcedure; + string name = tmpproc.DisplayNumber; + if (string.IsNullOrEmpty(name)) + { name = tmpproc.DisplayText; } + + message = message + string.Format("The procedure {0} is already checked out to {1}", name, si.UserID) + Environment.NewLine; + } else if (oi.OwnerType == 1) message = message + string.Format("The document {0} is already checked out to {1}", DocumentInfo.Get(oi.OwnerItemID).DocumentEntries[0].MyContent.Text, si.UserID) + Environment.NewLine; else if (oi.OwnerType == 2) @@ -211,7 +225,15 @@ namespace VEPROMS.CSLA.Library if (oi != null) { if (oi.OwnerType == 0) - message = message + string.Format("The procedure {0} is already checked out to {1}", ItemInfo.Get(oi.OwnerItemID).MyProcedure.DisplayNumber, si.UserID) + Environment.NewLine; + { + //B2024-074 If no Number for Procedure, Display Title + ProcedureInfo tmpproc = ItemInfo.Get(oi.OwnerItemID).MyProcedure; + string name = tmpproc.DisplayNumber; + if (string.IsNullOrEmpty(name)) + { name = tmpproc.DisplayText; } + + message = message + string.Format("The procedure {0} is already checked out to {1}", name, si.UserID) + Environment.NewLine; + } else if (oi.OwnerType == 1) message = message + string.Format("The document {0} is already checked out to {1}", DocumentInfo.Get(oi.OwnerItemID).DocumentEntries[0].MyContent.Text, si.UserID) + Environment.NewLine; else if (oi.OwnerType == 2) From a830856df2b496fdbbedaf6846e79d67907d3419 Mon Sep 17 00:00:00 2001 From: John Jenko Date: Fri, 27 Sep 2024 10:34:16 -0400 Subject: [PATCH 2/2] F2023-136 Adjust formats to not count the cover page when calculating the page numbers for the Automatic Table of Contents. --- PROMS/Formats/fmtall/FNPSAM1all.xml | Bin 110854 -> 110912 bytes PROMS/Formats/fmtall/FNPall.xml | Bin 144076 -> 144134 bytes PROMS/Formats/fmtall/fnpnmpall.xml | Bin 79606 -> 79626 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/PROMS/Formats/fmtall/FNPSAM1all.xml b/PROMS/Formats/fmtall/FNPSAM1all.xml index 250ab1f80f2bbed5dae3fdc81eee2c3bdc404651..4485997d75ed0b96a1a6b4ecf760e0e3b71a3f0b 100644 GIT binary patch delta 36 ucmV+<0NekD;s(It27t5yUW}K3l>s)Bq|*?Wkbwa{mr$PpJh$YG0U{(YX%9;P delta 27 jcmX@`h^_4rTf-K{xSr_^D;T||-;re0*v{3Lgdve3iNT*C4J@8Fed9&O M$n6uJGun6q0G-$q$N&HU delta 26 icmZpB#&PB;N5d9IyXVs<{ACQ8yziCB_6N@y)w}_>^bJ4& diff --git a/PROMS/Formats/fmtall/fnpnmpall.xml b/PROMS/Formats/fmtall/fnpnmpall.xml index 23116552674af3e074a9d68adae21dfde1718d63..f3300d420c3b0c01449a064f707b0a29b3775868 100644 GIT binary patch delta 54 zcmezNmZj?*%LbmuoQ@2o3?&Tt3<{gMANP79xRbdbn@;AN#<5+@fH8-0yMrF%HVyy_ CFA+ij delta 29 kcmeBr$MWqh%Lbmu)7R)QnoQoXhh?+h;}Fm7Kwcad0NIlbBLDyZ