C2019-036 View Only mode work with Checked Out Procedures

This commit is contained in:
2025-11-17 07:05:52 -05:00
parent b0e4128d3c
commit bd89af5e8c
9 changed files with 208 additions and 27 deletions

View File

@@ -603,6 +603,8 @@ namespace Volian.Controls.Library
{
ItemInfo myItemInfo = myItemInfo2;
bool viewonlymode = false;
//B2025-046 Remember Tabs failing when swapping versions of PROMS
if (myItemInfo?.MyDocVersion == null) // bug fix: B2016-108 disconnected data will not have a MyDocVersion
{
@@ -620,8 +622,11 @@ namespace Volian.Controls.Library
{
if (!MySessionInfo.CanCheckOutItem(myItemInfo.MyProcedure.ItemID, CheckOutType.Procedure, ref message))
{
FlexibleMessageBox.Show(this, message, "Procedure Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return null;
//C2019-036 View Only mode work with Checked Out Procedures
if (MessageBox.Show(this, message, "Procedure Already Checked Out", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
viewonlymode = true;
else
return null;
}
}
else
@@ -682,7 +687,7 @@ namespace Volian.Controls.Library
// C2023-016 if a Word section and doing Find/Replace don't open Word section, position to section title in step editor instead
if (myItemInfo.MyContent.MyEntry == null || doingFindReplace) // If it is not a Word document open in step editor
{
return OpenStepTabPage(myItemInfo, setFocus);
return OpenStepTabPage(myItemInfo, setFocus, viewonlymode);
}
else // Otherwise open it in the Word editor
{
@@ -1178,7 +1183,7 @@ namespace Volian.Controls.Library
//}
//public Dictionary<DocVersionInfo, frmEnhanced> dicEnhancedDocuments = new Dictionary<DocVersionInfo, frmEnhanced>();
private DisplayTabItem OpenStepTabPage(ItemInfo myItemInfo, bool setFocus)
private DisplayTabItem OpenStepTabPage(ItemInfo myItemInfo, bool setFocus, bool viewonlymode = false)
{
ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item
string key = "Item - " + proc.ItemID.ToString();
@@ -1197,7 +1202,7 @@ namespace Volian.Controls.Library
}
else // If not already open, create a new Page
{
pg = new DisplayTabItem(this.components, this, proc, key); // Open a new Procedure Tab
pg = new DisplayTabItem(this.components, this, proc, key, viewonlymode); // Open a new Procedure Tab
_MyDisplayTabItems.Add(key, pg);
if (setFocus)
{