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

@@ -98,13 +98,18 @@ namespace Volian.Controls.Library
}
#endregion
#region Constructors
public DisplayTabItem(IContainer container, DisplayTabControl myDisplayTabControl, ItemInfo myItemInfo, string myKey)
public DisplayTabItem(IContainer container, DisplayTabControl myDisplayTabControl, ItemInfo myItemInfo, string myKey, bool viewonlymode = false)
{
_MyItemInfo = myItemInfo;
if (MyItemInfo.MyContent.MyEntry == null)
OwnerID = myDisplayTabControl.MySessionInfo.CheckOutItem(myItemInfo.MyProcedure.ItemID, CheckOutType.Procedure);
else
OwnerID = myDisplayTabControl.MySessionInfo.CheckOutItem(myItemInfo.MyContent.MyEntry.DocID, CheckOutType.Document);
//C2019-036 View Only mode work with Checked Out Procedures
//don't want to check out if opening in View Only Mode Due to someone else having it checked out
if (!viewonlymode)
{
if (MyItemInfo.MyContent.MyEntry == null)
OwnerID = myDisplayTabControl.MySessionInfo.CheckOutItem(myItemInfo.MyProcedure.ItemID, CheckOutType.Procedure);
else
OwnerID = myDisplayTabControl.MySessionInfo.CheckOutItem(myItemInfo.MyContent.MyEntry.DocID, CheckOutType.Document);
}
//Console.WriteLine("DisplayTabItem");
_MyKey = myKey;
_MyDisplayTabControl = myDisplayTabControl;
@@ -112,7 +117,7 @@ namespace Volian.Controls.Library
InitializeComponent();
this.Click += new EventHandler(DisplayTabItem_Click);
if (myItemInfo.MyContent.MyEntry == null)
SetupStepTabPanel();
SetupStepTabPanel(viewonlymode);
else
SetupDSOTabPanel();
SetupSecurity(myItemInfo);
@@ -128,6 +133,11 @@ namespace Volian.Controls.Library
private bool MesssageShown = false;
public void SetupSecurity(ItemInfo myItem)
{
//C2019-036 View Only mode work with Checked Out Procedures
//is in View Only Mode, so do not set up the Security
if (OwnerID == 0)
return;
UserInfo ui = UserInfo.GetByUserID(OwnerInfo.Get(OwnerID).SessionUserID);
if (ui == null)
@@ -246,7 +256,7 @@ namespace Volian.Controls.Library
/// <summary>
/// Creates and sets-up a StepTabPanel
/// </summary>
private void SetupStepTabPanel()
private void SetupStepTabPanel(bool viewonlymode = false)
{
((System.ComponentModel.ISupportInitialize)(_MyDisplayTabControl.MyBar)).BeginInit();
_MyDisplayTabControl.MyBar.SuspendLayout();
@@ -276,7 +286,7 @@ namespace Volian.Controls.Library
_MyDisplayTabControl.MyBar.ResumeLayout(false);
DocVersionInfo dvi = _MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo; //MyRTBItem.MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo;
if (dvi == null) return;
if (dvi.VersionType > 127)
if (dvi.VersionType > 127 || viewonlymode)
MyStepTabPanel.MyStepPanel.VwMode = E_ViewMode.View;
// C2021 - 027: Procedure level PC/PC - add _MyIteminfo to argument list
if (dvi.MultiUnitCount > 1)