From 189b78d7d301429b47a70099591a9f7fffd497dc Mon Sep 17 00:00:00 2001 From: Kevin Laskey Date: Tue, 6 Aug 2024 09:14:36 -0400 Subject: [PATCH 1/5] B2024-057 - Added check to see if anything is checked out for annotations and folder delete from admin area. --- .../VEPROMS User Interface/frmBatchRefresh.cs | 93 ++++++++++++++----- 1 file changed, 71 insertions(+), 22 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.cs b/PROMS/VEPROMS User Interface/frmBatchRefresh.cs index 1ae0f399..cc3a6eb1 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.cs +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.cs @@ -239,7 +239,7 @@ namespace VEPROMS return loadedWorkingDraft; } - + private bool LoadDocVersions(FolderInfo fic, TreeNode tnc, bool noProcs) { bool rtnval = false; @@ -1755,19 +1755,77 @@ namespace VEPROMS txtResults.Clear(); txtProcess.Clear(); + this.Cursor = Cursors.WaitCursor; + + //Create checked proce and doc info lists. + List pil = new List(); + List dvil = new List(); + + // Create a list of procedures the user selected + foreach (TreeNode tn in myProcedures.Keys) + if (tn.Checked) + pil.Add(myProcedures[tn]); + + // Create a list of doc versions the user selected + foreach (TreeNode tn in myDocVersions.Keys) + if (tn.Checked) + dvil.Add(myDocVersions[tn]); + + bool cancelledOut = false; // Flag to indicate if the process should be cancelled + StringBuilder sbDocVersions = new StringBuilder(); + + foreach (DocVersionInfo dq in dvil) + { + string msg = string.Empty; + if (!MySessionInfo.CanCheckOutItem(dq.VersionID, CheckOutType.DocVersion, ref msg)) + { + string msgp = string.Empty; + foreach (ProcedureInfo pi in dq.Procedures) + { + if (!MySessionInfo.CanCheckOutItem(pi.ItemID, CheckOutType.Procedure, ref msgp)) + { + FolderInfo fi = (FolderInfo)dq.ActiveParent; + int itemID = (int)fi.FolderID; + string folderName = fi.Name; + + if (swDeleteFolder.Value) + sbDocVersions.AppendLine($"{folderName} - {msgp}"); + else + sbDocVersions.AppendLine(msgp); + + cancelledOut = true; + } + } + } + } + + if (cancelledOut) + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine("The batch update process was not successful for all working drafts selected."); + sb.AppendLine("The following procedures are currently checked out..."); + sb.AppendLine(); + sb.AppendLine(sbDocVersions.ToString()); + sb.AppendLine(); + if (swDeleteFolder.Value) + sb.AppendLine("If you want to delete these folders, please contact the respective users and have them close any procedures in the working draft."); + else + sb.AppendLine("If you want to delete annotations from these working drafts, please contact the respective users and have them close any procedures in the working draft."); + sb.AppendLine(); + txtProcess.AppendText(sb.ToString()); + return; + } + + + + if (swDeleteFolder.Value) { if (FlexibleMessageBox.Show(this, "Are you sure you want to remove the selected folders and their contents?", "Confirm Folder Deletion", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { txtProcess.AppendText("Deleting Folders..."); - //Load Selected Folders with docversions - List dvil = new List(); - foreach (TreeNode tn in myDocVersions.Keys) - if (tn.Checked) - dvil.Add(myDocVersions[tn]); - - //Load Selected Folders with docversions + //Load Selected Folders List ef = new List(); foreach (TreeNode tn in myFolders.Keys) @@ -1782,18 +1840,6 @@ namespace VEPROMS // Write progress status txtProcess.AppendText("Deleting Annotations..."); - // Create a list of procedures the user selected - List pil = new List(); - foreach (TreeNode tn in myProcedures.Keys) - if (tn.Checked) - pil.Add(myProcedures[tn]); - - // Create a list of doc versions the user selected - List dvil = new List(); - foreach (TreeNode tn in myDocVersions.Keys) - if (tn.Checked) - dvil.Add(myDocVersions[tn]); - frmAnnotationsCleanup frmAnnoDel = new frmAnnotationsCleanup(this, pil, dvil); frmAnnoDel.ShowDialog(); @@ -1860,8 +1906,8 @@ namespace VEPROMS } - txtResults.AppendText($"Folder deletion process completed, {foldersDeleted} folder(s) have been deleted. "); - txtResults.AppendText(Environment.NewLine); + + //Run Repair int prgStpIdx = -1; @@ -1874,6 +1920,9 @@ namespace VEPROMS MessageBox.Show($"Folder deletion completed, {foldersDeleted} folders have been deleted.", "Delete Folders"); ClearStepProgress(); + + txtResults.AppendText($"Folder deletion process completed, {foldersDeleted} folders have been deleted."); + txtResults.AppendText(Environment.NewLine); } private bool DeleteFolderByID(int folderID) -- 2.47.2 From d091a37171fb3ce7fc700562d4db2a51d9d50111 Mon Sep 17 00:00:00 2001 From: Kevin Laskey Date: Tue, 6 Aug 2024 10:29:06 -0400 Subject: [PATCH 2/5] B2024-055 - Update tooltips on admin delete functions --- PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs | 6 +++--- PROMS/VEPROMS User Interface/frmBatchRefresh.resx | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs b/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs index 0ec4e750..c6086457 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs @@ -513,7 +513,7 @@ this.swDeleteFolder.Name = "swDeleteFolder"; this.swDeleteFolder.Size = new System.Drawing.Size(69, 22); this.swDeleteFolder.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.superTooltip1.SetSuperTooltip(this.swDeleteFolder, new DevComponents.DotNetBar.SuperTooltipInfo("Check RO Links", "", resources.GetString("swDeleteFolder.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(250, 150))); + this.superTooltip1.SetSuperTooltip(this.swDeleteFolder, new DevComponents.DotNetBar.SuperTooltipInfo("Delete Folders", "", resources.GetString("swDeleteFolder.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(250, 150))); this.swDeleteFolder.SwitchClickTogglesValue = true; this.swDeleteFolder.TabIndex = 39; this.swDeleteFolder.ValueChanged += new System.EventHandler(this.swDeleteFolder_ValueChanged); @@ -529,7 +529,7 @@ this.labelX13.Location = new System.Drawing.Point(85, 42); this.labelX13.Name = "labelX13"; this.labelX13.Size = new System.Drawing.Size(168, 22); - this.superTooltip1.SetSuperTooltip(this.labelX13, new DevComponents.DotNetBar.SuperTooltipInfo("Check RO Links", "", resources.GetString("labelX13.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(350, 175))); + this.superTooltip1.SetSuperTooltip(this.labelX13, new DevComponents.DotNetBar.SuperTooltipInfo("Delete Folders", "", resources.GetString("labelX13.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(350, 175))); this.labelX13.TabIndex = 38; this.labelX13.Text = "Delete Folders"; // @@ -543,7 +543,7 @@ this.swDeleteAnnotations.Name = "swDeleteAnnotations"; this.swDeleteAnnotations.Size = new System.Drawing.Size(69, 22); this.swDeleteAnnotations.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.superTooltip1.SetSuperTooltip(this.swDeleteAnnotations, new DevComponents.DotNetBar.SuperTooltipInfo("Refresh Transitions", "", resources.GetString("swDeleteAnnotations.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(265, 175))); + this.superTooltip1.SetSuperTooltip(this.swDeleteAnnotations, new DevComponents.DotNetBar.SuperTooltipInfo("Delete Annotations", "", resources.GetString("swDeleteAnnotations.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(265, 175))); this.swDeleteAnnotations.SwitchClickTogglesValue = true; this.swDeleteAnnotations.TabIndex = 37; this.swDeleteAnnotations.Value = true; diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.resx b/PROMS/VEPROMS User Interface/frmBatchRefresh.resx index c140c84f..d743cefb 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.resx +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.resx @@ -121,9 +121,7 @@ 17, 17 - This allows the user to check referenced objects links in procedure step data for multiple working drafts in a batch mode. - -Bad referenced bject links will be identified with an Bad RO Link annotation. Use the PROMS Search tool to list all of the steps that have this annotation. + 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. @@ -142,11 +140,11 @@ It is recommended that this be done during off hours. - This function will refresh transitions in all procedures selected below, whether they were selected individually or as a group via a procedure set. + 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 procedure is selected, it is recommended that this be performed during off hours. +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. -- 2.47.2 From 4b61495960e06f84e482b62105d288f6b5ef5648 Mon Sep 17 00:00:00 2001 From: Kevin Laskey Date: Tue, 6 Aug 2024 10:48:05 -0400 Subject: [PATCH 3/5] B2024-057 - updated curors --- PROMS/VEPROMS User Interface/frmBatchRefresh.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.cs b/PROMS/VEPROMS User Interface/frmBatchRefresh.cs index cc3a6eb1..e5c85cb9 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.cs +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.cs @@ -1813,6 +1813,7 @@ namespace VEPROMS sb.AppendLine("If you want to delete annotations from these working drafts, please contact the respective users and have them close any procedures in the working draft."); sb.AppendLine(); txtProcess.AppendText(sb.ToString()); + this.Cursor = Cursors.Default; return; } @@ -1846,6 +1847,7 @@ namespace VEPROMS } + this.Cursor = Cursors.Default; } private void ProcessDelete(List foldersToDelete, List emptyFoldersToDelete) -- 2.47.2 From 1f3a1dabbc8ea8b1d0ba1e8e86ee996fe75a8cb8 Mon Sep 17 00:00:00 2001 From: Kevin Laskey Date: Tue, 6 Aug 2024 10:58:04 -0400 Subject: [PATCH 4/5] B2024-055 - Update tooltips for the labels on delete annotations and delete folders --- PROMS/VEPROMS User Interface/frmBatchRefresh.resx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.resx b/PROMS/VEPROMS User Interface/frmBatchRefresh.resx index d743cefb..ceac1979 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.resx +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.resx @@ -130,13 +130,12 @@ It is recommended that this be done during off hours. - This allows the user to check referenced objects links in procedure step data for multiple working drafts in a batch mode. - -Bad referenced bject links will be identified with an Bad RO Link annotation. Use the PROMS Search tool to list all of the steps that have this annotation. + 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. + @@ -147,11 +146,11 @@ 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. + This function will allow the user to remove annotations from the selected working drafts. -Click on the on/off switches to turn on/off each tool. +Be sure a current backup of the database exists prior to running this function. -Note that only one of these tools can be run at a time. +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. -- 2.47.2 From 5f7af3309d1aaa4bc6b59dfc36e58e0c1e5bc505 Mon Sep 17 00:00:00 2001 From: Kevin Laskey Date: Tue, 6 Aug 2024 11:17:17 -0400 Subject: [PATCH 5/5] B2024-054 - Update Annotation tooltip --- PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs b/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs index c6086457..9eef5ffc 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs @@ -561,7 +561,7 @@ this.labelX14.Location = new System.Drawing.Point(85, 14); this.labelX14.Name = "labelX14"; this.labelX14.Size = new System.Drawing.Size(186, 22); - this.superTooltip1.SetSuperTooltip(this.labelX14, new DevComponents.DotNetBar.SuperTooltipInfo("Process Deletions", "", resources.GetString("labelX14.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(200, 175))); + this.superTooltip1.SetSuperTooltip(this.labelX14, new DevComponents.DotNetBar.SuperTooltipInfo("Delete Annotations", "", resources.GetString("labelX14.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(200, 175))); this.labelX14.TabIndex = 36; this.labelX14.Text = "Delete Annotations"; // -- 2.47.2