Add UserInfo property and modified code to assure a person with Reviewer security can only manage annotations created by themself.
Added SessionInfo property to DisplayTabControl class and managed opening and closing DisplayTabItems. Added OwnerID and UserRole properties to DisplayTabItem class and obtained owner id and setup security based on user role when opening an item. Added property to allow forced check in of word document to ignore any changes made by user. Removed debug code Added methods to setup ribbon control based on user's security role. Added SessionInfo property and events and methods to setup proper menu items to appear on the right click of a node based on user's role and checked out status of item.
This commit is contained in:
@@ -327,6 +327,7 @@ namespace Volian.Controls.Library
|
||||
e.RemoveDockTab = true;
|
||||
_RemovedDisplayTabItems.Add((DisplayTabItem)e.DockContainerItem);
|
||||
DisplayTabItem dti = e.DockContainerItem as DisplayTabItem;
|
||||
MySessionInfo.CheckInItem(dti.OwnerID);
|
||||
if (dti != null && dti.MyStepTabPanel != null)
|
||||
dti.MyStepTabPanel.MyStepPanel.Dispose();
|
||||
DisplayTabItem myTabItem = e.DockContainerItem as DisplayTabItem;
|
||||
@@ -363,6 +364,23 @@ namespace Volian.Controls.Library
|
||||
public DisplayTabItem OpenItem(ItemInfo myItemInfo2)
|
||||
{
|
||||
ItemInfo myItemInfo = myItemInfo2;
|
||||
string message = string.Empty;
|
||||
if (myItemInfo.MyContent.MyEntry == null) //not a document
|
||||
{
|
||||
if (!MySessionInfo.CanCheckOutItem(myItemInfo.MyProcedure.ItemID, CheckOutType.Procedure, ref message))
|
||||
{
|
||||
MessageBox.Show(this, message, "Procedure Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!MySessionInfo.CanCheckOutItem(myItemInfo.MyContent.MyEntry.DocID, CheckOutType.Document, ref message))
|
||||
{
|
||||
MessageBox.Show(this, message, "Document Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//if (myItemInfo.IsProcedure)
|
||||
//{
|
||||
// DateTime start = DateTime.Now;
|
||||
@@ -511,9 +529,12 @@ namespace Volian.Controls.Library
|
||||
public void CloseTabItem(DisplayTabItem myTabItem)
|
||||
{
|
||||
Bar b = myTabItem.ContainerControl as Bar;
|
||||
b.CloseDockTab(myTabItem);
|
||||
//b.Items.Remove(myTabItem);
|
||||
RemoveItem(myTabItem);
|
||||
if (b != null)
|
||||
{
|
||||
b.CloseDockTab(myTabItem);
|
||||
//b.Items.Remove(myTabItem);
|
||||
RemoveItem(myTabItem);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Look for a tab and set it to active.
|
||||
@@ -553,6 +574,12 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
#endregion
|
||||
#region Public Properties
|
||||
private SessionInfo _MySessionInfo;
|
||||
public SessionInfo MySessionInfo
|
||||
{
|
||||
get { return _MySessionInfo; }
|
||||
set { _MySessionInfo = value; }
|
||||
}
|
||||
public DevComponents.DotNetBar.Bar MyBar
|
||||
{
|
||||
get { return _MyBar; }
|
||||
@@ -834,7 +861,7 @@ namespace Volian.Controls.Library
|
||||
//if ((myItemInfo.MyContent.MyEntry.MyDocument.LibTitle ?? "") != "")
|
||||
// MessageBox.Show("WARNING: All edits made to this Library Document will be applied to all uses of the Document");
|
||||
pg = new DisplayTabItem(this.components, this, myItemInfo, key); // Open a new document page
|
||||
_MyDisplayTabItems.Add(key, pg);
|
||||
_MyDisplayTabItems.Add(key, pg);
|
||||
}
|
||||
SelectDisplayTabItem(pg);
|
||||
pg.MyDSOTabPanel.EnterPanel();
|
||||
|
Reference in New Issue
Block a user