Enhanced Document support
Null check Move DisplayText.cs to CSLA Enhanced Documents – don’t allow ‘Save’ RO on enhanced step Enhanced Documents windowing Enhanced Documents remove unnecessary options Enhanced Documents – don’t allow ‘Save’ transition on enhanced step Enhanced Documents/Insert,Delete,Paste
This commit is contained in:
parent
77cdf81736
commit
6366af8b47
@ -28,14 +28,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
return eds;
|
return eds;
|
||||||
}
|
}
|
||||||
public DVEnhancedDocument this[int type]
|
public DVEnhancedDocument GetByType(int type)
|
||||||
{
|
{
|
||||||
get
|
foreach (DVEnhancedDocument ed in this)
|
||||||
{
|
if (ed.Type == type) return ed;
|
||||||
foreach (DVEnhancedDocument ed in this)
|
return null;
|
||||||
if (ed.Type == type) return ed;
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public DVEnhancedDocument this[string name]
|
public DVEnhancedDocument this[string name]
|
||||||
{
|
{
|
||||||
@ -46,6 +43,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public bool HasSourcePointer
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
foreach (DVEnhancedDocument ed in this)
|
||||||
|
if (ed.Type == 0) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public partial class DVEnhancedDocument
|
public partial class DVEnhancedDocument
|
||||||
{
|
{
|
||||||
@ -86,7 +92,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
Type = type;
|
Type = type;
|
||||||
VersionID = versionID;
|
VersionID = versionID;
|
||||||
PdfX = pdfX;
|
PdfX = pdfX;
|
||||||
PdfToken = PdfToken;
|
PdfToken = pdfToken;
|
||||||
}
|
}
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
@ -110,6 +116,49 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
set { _MyEnhancedDocuments = value; }
|
set { _MyEnhancedDocuments = value; }
|
||||||
}
|
}
|
||||||
|
public void SaveDVEnhancedDocuments()
|
||||||
|
{
|
||||||
|
// get all of the current enhanced links from datastructure in code. This list may have been
|
||||||
|
// modified by adding items during code execution by associating source <--> background etc.
|
||||||
|
DVEnhancedDocuments edsToAdd = new DVEnhancedDocuments();
|
||||||
|
foreach (DVEnhancedDocument ed in MyEnhancedDocuments)
|
||||||
|
edsToAdd.Add(ed);
|
||||||
|
|
||||||
|
// from the existing list in xml, remove any that are in the 'editted (edsToAdd) list
|
||||||
|
// so that what remains are those that need added to xml that will then be written to database
|
||||||
|
foreach (XmlNode xn in _Xp.XmlContents.SelectNodes("//Enhanced"))
|
||||||
|
{
|
||||||
|
DVEnhancedDocument tmp = edsToAdd.GetByType(int.Parse(xn.Attributes["Type"].Value));
|
||||||
|
if (tmp != null)
|
||||||
|
{
|
||||||
|
if (xn.Attributes["Name"].Value != tmp.Name)
|
||||||
|
xn.Attributes["Name"].Value = tmp.Name;
|
||||||
|
if (int.Parse(xn.Attributes["Type"].Value) != tmp.Type)
|
||||||
|
xn.Attributes["Type"].Value = tmp.Type.ToString();
|
||||||
|
if (int.Parse(xn.Attributes["VersionID"].Value) != tmp.VersionID)
|
||||||
|
xn.Attributes["VersionID"].Value = tmp.VersionID.ToString();
|
||||||
|
if (int.Parse(xn.Attributes["PdfX"].Value) != tmp.PdfX)
|
||||||
|
xn.Attributes["PdfX"].Value = tmp.PdfX.ToString();
|
||||||
|
if (xn.Attributes["PdfToken"].Value != tmp.PdfToken)
|
||||||
|
xn.Attributes["PdfToken"].Value = tmp.PdfToken;
|
||||||
|
edsToAdd.Remove(tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WILL NEED THIS FOR New/ADD
|
||||||
|
//foreach (DVEnhancedDocument edadd in edsToAdd)
|
||||||
|
//{
|
||||||
|
// // Add (example): <Enhanced Type="Background" ItemID="43138" /><Enhanced Type="Deviation" ItemID="67165" />
|
||||||
|
// // First add 'Enhanced' element:
|
||||||
|
// XmlNode newEnhNode = _Xp.XmlContents.CreateNode(XmlNodeType.Element, "Enhanced", _Xp.XmlContents.NamespaceURI);
|
||||||
|
// XmlNode xnEnh = _Xp.XmlContents.DocumentElement.AppendChild(newEnhNode);
|
||||||
|
// // Now add the 'Type' and 'ItemID' attributes:
|
||||||
|
// XmlAttribute xa = xnEnh.Attributes.Append(_Xp.XmlContents.CreateAttribute("Type"));
|
||||||
|
// xa.Value = edadd.Type.ToString();
|
||||||
|
// xa = xnEnh.Attributes.Append(_Xp.XmlContents.CreateAttribute("ItemID"));
|
||||||
|
// xa.Value = edadd.ItemID.ToString();
|
||||||
|
//}
|
||||||
|
}
|
||||||
#region DynamicTypeDescriptor
|
#region DynamicTypeDescriptor
|
||||||
internal override bool IsReadOnly
|
internal override bool IsReadOnly
|
||||||
{
|
{
|
||||||
|
@ -53,7 +53,8 @@ namespace DescriptiveEnum
|
|||||||
/// <returns>The description, if any, else the passed name</returns>
|
/// <returns>The description, if any, else the passed name</returns>
|
||||||
public static string GetEnumDescription(System.Type value, string name)
|
public static string GetEnumDescription(System.Type value, string name)
|
||||||
{
|
{
|
||||||
FieldInfo fi= value.GetField(name);
|
FieldInfo fi= value.GetField(name);
|
||||||
|
if (fi == null) return "";
|
||||||
DescriptionAttribute[] attributes =
|
DescriptionAttribute[] attributes =
|
||||||
(DescriptionAttribute[])fi.GetCustomAttributes(
|
(DescriptionAttribute[])fi.GetCustomAttributes(
|
||||||
typeof(DescriptionAttribute), false);
|
typeof(DescriptionAttribute), false);
|
||||||
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using DescriptiveEnum;
|
using DescriptiveEnum;
|
||||||
|
using System.Xml;
|
||||||
|
|
||||||
namespace VEPROMS.CSLA.Library
|
namespace VEPROMS.CSLA.Library
|
||||||
{
|
{
|
||||||
@ -875,6 +876,45 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
set { _MyEnhancedDocuments = value; }
|
set { _MyEnhancedDocuments = value; }
|
||||||
}
|
}
|
||||||
|
public void AddEnhancedDocument(int type, int itemid)
|
||||||
|
{
|
||||||
|
MyEnhancedDocuments.Add(type, itemid);
|
||||||
|
SaveEnhancedDocuments();
|
||||||
|
}
|
||||||
|
public void SaveEnhancedDocuments()
|
||||||
|
{
|
||||||
|
// get all of the current enhanced links from datastructure in code. This list may have been
|
||||||
|
// modified by adding items during code execution by associating source <--> background etc.
|
||||||
|
EnhancedDocuments edsToAdd = new EnhancedDocuments();
|
||||||
|
foreach (EnhancedDocument ed in MyEnhancedDocuments)
|
||||||
|
edsToAdd.Add(ed);
|
||||||
|
|
||||||
|
// from the existing list in xml, remove any that are in the 'editted (edsToAdd) list
|
||||||
|
// so that what remains are those that need added to xml that will then be written to database
|
||||||
|
foreach (XmlNode xn in _Xp.XmlContents.SelectNodes("//Enhanced"))
|
||||||
|
{
|
||||||
|
//EnhancedDocument tmp = edsToAdd[int.Parse(xn.Attributes["Type"].Value)];
|
||||||
|
EnhancedDocument tmp = edsToAdd.GetByType(int.Parse(xn.Attributes["Type"].Value)); // [int.Parse(xn.Attributes["Type"].Value)];
|
||||||
|
if (tmp != null)
|
||||||
|
{
|
||||||
|
if (int.Parse(xn.Attributes["ItemID"].Value) != tmp.ItemID)
|
||||||
|
xn.Attributes["ItemID"].Value = tmp.ItemID.ToString();
|
||||||
|
edsToAdd.Remove(tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach (EnhancedDocument edadd in edsToAdd)
|
||||||
|
{
|
||||||
|
// Add (example): <Enhanced Type="Background" ItemID="43138" /><Enhanced Type="Deviation" ItemID="67165" />
|
||||||
|
// First add 'Enhanced' element:
|
||||||
|
XmlNode newEnhNode = _Xp.XmlContents.CreateNode(XmlNodeType.Element, "Enhanced", _Xp.XmlContents.NamespaceURI);
|
||||||
|
XmlNode xnEnh = _Xp.XmlContents.DocumentElement.AppendChild(newEnhNode);
|
||||||
|
// Now add the 'Type' and 'ItemID' attributes:
|
||||||
|
XmlAttribute xa = xnEnh.Attributes.Append(_Xp.XmlContents.CreateAttribute("Type"));
|
||||||
|
xa.Value = edadd.Type.ToString();
|
||||||
|
xa = xnEnh.Attributes.Append(_Xp.XmlContents.CreateAttribute("ItemID"));
|
||||||
|
xa.Value = edadd.ItemID.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region IItemConfig Members
|
#region IItemConfig Members
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using DescriptiveEnum;
|
using DescriptiveEnum;
|
||||||
|
using System.Xml;
|
||||||
|
|
||||||
namespace VEPROMS.CSLA.Library
|
namespace VEPROMS.CSLA.Library
|
||||||
{
|
{
|
||||||
@ -349,11 +350,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return _Xp["Section", "LnkEnh"];
|
return _Xp["Step", "LnkEnh"]; //KBR - wrong in data/xml?? is in step node not section node.
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_Xp["Section", "LnkEnh"] = value;
|
_Xp["Step", "LnkEnh"] = value;
|
||||||
OnPropertyChanged("Section_LnkEnh");
|
OnPropertyChanged("Section_LnkEnh");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -909,7 +910,74 @@ namespace VEPROMS.CSLA.Library
|
|||||||
OnPropertyChanged("Edit_LnkEnh");
|
OnPropertyChanged("Edit_LnkEnh");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private EnhancedDocuments _MyEnhancedDocuments = null;
|
||||||
|
public EnhancedDocuments MyEnhancedDocuments
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_MyEnhancedDocuments == null)
|
||||||
|
{
|
||||||
|
_MyEnhancedDocuments = EnhancedDocuments.Load(_Xp);
|
||||||
|
}
|
||||||
|
return _MyEnhancedDocuments;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_MyEnhancedDocuments = value;
|
||||||
|
//OnPropertyChanged("EnhancedDocuments");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void AddEnhancedDocument(int type, int itemid)
|
||||||
|
{
|
||||||
|
MyEnhancedDocuments.Add(type, itemid);
|
||||||
|
SaveEnhancedDocuments();
|
||||||
|
}
|
||||||
|
public void SaveEnhancedDocuments()
|
||||||
|
{
|
||||||
|
if (MyEnhancedDocuments == null || MyEnhancedDocuments.Count == 0) // clear out the xml node
|
||||||
|
{
|
||||||
|
//XmlNode dd = _Xp.XmlContents.SelectSingleNode("//Slave[@index='" + index.ToString() + "']");
|
||||||
|
//dd.ParentNode.RemoveChild(dd);
|
||||||
|
List<XmlNode> nodesToDel = new List<XmlNode>();
|
||||||
|
foreach (XmlNode xnr in _Xp.XmlContents.SelectNodes("//Enhanced")) nodesToDel.Add(xnr);
|
||||||
|
if (nodesToDel != null)
|
||||||
|
{
|
||||||
|
XmlNode par = nodesToDel[0].ParentNode;
|
||||||
|
foreach (XmlNode xxnr in nodesToDel) par.RemoveChild(xxnr);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// get all of the current enhanced links from datastructure in code. This list may have been
|
||||||
|
// modified by adding items during code execution by associating source <--> background etc.
|
||||||
|
EnhancedDocuments edsToAdd = new EnhancedDocuments();
|
||||||
|
foreach (EnhancedDocument ed in MyEnhancedDocuments)
|
||||||
|
edsToAdd.Add(ed);
|
||||||
|
|
||||||
|
// from the existing list in xml, remove any that are in the 'editted (edsToAdd) list
|
||||||
|
// so that what remains are those that need added to xml that will then be written to database
|
||||||
|
foreach (XmlNode xn in _Xp.XmlContents.SelectNodes("//Enhanced"))
|
||||||
|
{
|
||||||
|
EnhancedDocument tmp = edsToAdd.GetByType(int.Parse(xn.Attributes["Type"].Value)); //edsToAdd[int.Parse(xn.Attributes["Type"].Value)];
|
||||||
|
if (tmp != null)
|
||||||
|
{
|
||||||
|
if (int.Parse(xn.Attributes["ItemID"].Value) != tmp.ItemID)
|
||||||
|
xn.Attributes["ItemID"].Value = tmp.ItemID.ToString();
|
||||||
|
edsToAdd.Remove(tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach (EnhancedDocument edadd in edsToAdd)
|
||||||
|
{
|
||||||
|
// Add (example): <Enhanced Type="Background" ItemID="43138" /><Enhanced Type="Deviation" ItemID="67165" />
|
||||||
|
// First add 'Enhanced' element:
|
||||||
|
XmlNode newEnhNode = _Xp.XmlContents.CreateNode(XmlNodeType.Element, "Enhanced", _Xp.XmlContents.NamespaceURI);
|
||||||
|
XmlNode xnEnh = _Xp.XmlContents.DocumentElement.AppendChild(newEnhNode);
|
||||||
|
// Now add the 'Type' and 'ItemID' attributes:
|
||||||
|
XmlAttribute xa = xnEnh.Attributes.Append(_Xp.XmlContents.CreateAttribute("Type"));
|
||||||
|
xa.Value = edadd.Type.ToString();
|
||||||
|
xa = xnEnh.Attributes.Append(_Xp.XmlContents.CreateAttribute("ItemID"));
|
||||||
|
xa.Value = edadd.ItemID.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,14 +22,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
return ed;
|
return ed;
|
||||||
}
|
}
|
||||||
public EnhancedDocument this[int type]
|
public EnhancedDocument GetByType(int type)
|
||||||
{
|
{
|
||||||
get
|
foreach (EnhancedDocument ed in this)
|
||||||
{
|
if (ed.Type == type) return ed;
|
||||||
foreach (EnhancedDocument ed in this)
|
return null;
|
||||||
if (ed.Type == type) return ed;
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public partial class EnhancedDocument
|
public partial class EnhancedDocument
|
||||||
@ -396,8 +393,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// so that what remains are those that need added to xml that will then be written to database
|
// so that what remains are those that need added to xml that will then be written to database
|
||||||
foreach (XmlNode xn in _Xp.XmlContents.SelectNodes("//Enhanced"))
|
foreach (XmlNode xn in _Xp.XmlContents.SelectNodes("//Enhanced"))
|
||||||
{
|
{
|
||||||
EnhancedDocument tmp = edsToAdd[int.Parse(xn.Attributes["Type"].Value)];
|
//EnhancedDocument tmp = edsToAdd[int.Parse(xn.Attributes["Type"].Value)];
|
||||||
if (tmp != null) edsToAdd.Remove(tmp);
|
EnhancedDocument tmp = edsToAdd.GetByType(int.Parse(xn.Attributes["Type"].Value));
|
||||||
|
if (tmp != null)
|
||||||
|
{
|
||||||
|
if (int.Parse(xn.Attributes["ItemID"].Value) != tmp.ItemID)
|
||||||
|
xn.Attributes["ItemID"].Value = tmp.ItemID.ToString();
|
||||||
|
edsToAdd.Remove(tmp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach (EnhancedDocument edadd in edsToAdd)
|
foreach (EnhancedDocument edadd in edsToAdd)
|
||||||
{
|
{
|
||||||
|
@ -346,6 +346,23 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (this is ProcedureInfo) return this as ProcedureInfo;
|
if (this is ProcedureInfo) return this as ProcedureInfo;
|
||||||
return ProcedureInfo.Get(ItemID);
|
return ProcedureInfo.Get(ItemID);
|
||||||
}
|
}
|
||||||
|
private string _EnhType = null;
|
||||||
|
public string EnhType
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_EnhType != null) return _EnhType;
|
||||||
|
if (!IsSection)
|
||||||
|
_EnhType = "";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// get the section's enhtype from the config
|
||||||
|
SectionConfig sc = MyConfig as SectionConfig;
|
||||||
|
_EnhType = sc.Section_LnkEnh;
|
||||||
|
}
|
||||||
|
return _EnhType;
|
||||||
|
}
|
||||||
|
}
|
||||||
public bool InList(params int[] IDs)
|
public bool InList(params int[] IDs)
|
||||||
{
|
{
|
||||||
foreach (int id in IDs)
|
foreach (int id in IDs)
|
||||||
@ -356,6 +373,17 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
return _CacheByPrimaryKey.ContainsKey(itemID.ToString());
|
return _CacheByPrimaryKey.ContainsKey(itemID.ToString());
|
||||||
}
|
}
|
||||||
|
public static string ReplaceLinkWithNewID(string tmpForLink)
|
||||||
|
{
|
||||||
|
tmpForLink = Regex.Replace(tmpForLink, @"#Link:ReferencedObject:[0-9]+ ", @"#Link:ReferencedObject:<NewID> ");
|
||||||
|
tmpForLink = Regex.Replace(tmpForLink, @"#Link:Transition:([0-9]+) [0-9]+ ", @"#Link:Transition:$1 <NewID> ");
|
||||||
|
tmpForLink = Regex.Replace(tmpForLink, @"#Link:TransitionRange:([0-9]+) [0-9]+ ", @"#Link:TransitionRange:$1 <NewID> ");
|
||||||
|
tmpForLink = tmpForLink.Replace(@"\u8212 \'96", @"-"); // Replace EM Dash with hyphen
|
||||||
|
tmpForLink = tmpForLink.Replace(@"\u8211 \'96", @"-"); // Replace EN Dash with hyphen
|
||||||
|
tmpForLink = tmpForLink.Replace(@"\u8212 ", @"-"); // Replace EM Dash with hyphen
|
||||||
|
tmpForLink = tmpForLink.Replace(@"\u8211 ", @"-"); // Replace EN Dash with hyphen
|
||||||
|
return tmpForLink;
|
||||||
|
}
|
||||||
public void SetHeader(VE_Font myFont, string myText)
|
public void SetHeader(VE_Font myFont, string myText)
|
||||||
{
|
{
|
||||||
_MyHeader = new MetaTag(myFont);
|
_MyHeader = new MetaTag(myFont);
|
||||||
@ -552,36 +580,36 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
public static void ResetTranCounters()
|
public static void ResetTranCounters()
|
||||||
{
|
{
|
||||||
TranCheckCount = 0;
|
TranCheckCount = 0;
|
||||||
TranFixCount = 0;
|
TranFixCount = 0;
|
||||||
}
|
}
|
||||||
public static int TranCheckCount = 0;
|
public static int TranCheckCount = 0;
|
||||||
public static int TranFixCount = 0;
|
public static int TranFixCount = 0;
|
||||||
internal static TransitionInfoList TransitionsToDisconnected;
|
internal static TransitionInfoList TransitionsToDisconnected;
|
||||||
internal static TransitionInfoList TransitionsToNonEditable;
|
internal static TransitionInfoList TransitionsToNonEditable;
|
||||||
internal static void MyRefreshTransitions(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup)
|
internal static void MyRefreshTransitions(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup)
|
||||||
{
|
{
|
||||||
//TransitionInfoList til = TransitionInfoList.GetByFromID(itemInfo.ItemID);
|
//TransitionInfoList til = TransitionInfoList.GetByFromID(itemInfo.ItemID);
|
||||||
//Console.WriteLine("Procedure: {0}, transitions: {1}", (itemInfo as ProcedureInfo).DisplayNumber, til.Count);
|
//Console.WriteLine("Procedure: {0}, transitions: {1}", (itemInfo as ProcedureInfo).DisplayNumber, til.Count);
|
||||||
//foreach (TransitionInfo traninfo in til)
|
//foreach (TransitionInfo traninfo in til)
|
||||||
//{
|
//{
|
||||||
// string oldText = itemInfo.MyContent.Text;
|
// string oldText = itemInfo.MyContent.Text;
|
||||||
// itemInfo.MyContent.FixTransitionText(traninfo, tranLookup);
|
// itemInfo.MyContent.FixTransitionText(traninfo, tranLookup);
|
||||||
// string newText = itemInfo.MyContent.Text;
|
// string newText = itemInfo.MyContent.Text;
|
||||||
// if (newText != oldText)
|
// if (newText != oldText)
|
||||||
// {
|
// {
|
||||||
// Content content = Content.Get(itemInfo.MyContent.ContentID);
|
// Content content = Content.Get(itemInfo.MyContent.ContentID);
|
||||||
// content.FixTransitionText(traninfo);
|
// content.FixTransitionText(traninfo);
|
||||||
// content.Save();
|
// content.Save();
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
if (itemInfo.MyContent.ContentPartCount > 0)
|
if (itemInfo.MyContent.ContentPartCount > 0)
|
||||||
foreach (PartInfo pi in itemInfo.MyContent.ContentParts)
|
foreach (PartInfo pi in itemInfo.MyContent.ContentParts)
|
||||||
foreach (ItemInfo ii in pi.MyItems)
|
foreach (ItemInfo ii in pi.MyItems)
|
||||||
MyRefreshTransitions(ii, itemInfo, (itemInfo as SectionInfo) ?? sectionInfo, procInfo, docVersionInfo, tranLookup);
|
MyRefreshTransitions(ii, itemInfo, (itemInfo as SectionInfo) ?? sectionInfo, procInfo, docVersionInfo, tranLookup);
|
||||||
if (itemInfo.MyContent.ContentTransitionCount > 0)
|
if (itemInfo.MyContent.ContentTransitionCount > 0)
|
||||||
{
|
{
|
||||||
itemInfo.ResetOrdinal();
|
itemInfo.ResetOrdinal();
|
||||||
@ -660,7 +688,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//private static bool IsTransitionToDisconnected(TransitionInfo ti)
|
//private static bool IsTransitionToDisconnected(TransitionInfo ti)
|
||||||
//{
|
//{
|
||||||
// foreach (TransitionInfo til in TransitionsToDisconnected)
|
// foreach (TransitionInfo til in TransitionsToDisconnected)
|
||||||
@ -680,12 +708,12 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
public static void ResetROCounters()
|
public static void ResetROCounters()
|
||||||
{
|
{
|
||||||
ROCheckCount = 0;
|
ROCheckCount = 0;
|
||||||
ROFixCount = 0;
|
ROFixCount = 0;
|
||||||
}
|
}
|
||||||
public static int ROCheckCount = 0;
|
public static int ROCheckCount = 0;
|
||||||
public static int ROFixCount = 0;
|
public static int ROFixCount = 0;
|
||||||
private static AnnotationType _VolianCommentType = null; // Using this to flag ro value issues with byron to braidwood
|
private static AnnotationType _VolianCommentType = null; // Using this to flag ro value issues with byron to braidwood
|
||||||
public static AnnotationType VolianCommentType
|
public static AnnotationType VolianCommentType
|
||||||
{
|
{
|
||||||
@ -732,30 +760,30 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
internal static void MyRefreshReferenceObjects(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo)
|
internal static void MyRefreshReferenceObjects(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo)
|
||||||
{
|
{
|
||||||
if (itemInfo.MyContent.ContentPartCount > 0)
|
if (itemInfo.MyContent.ContentPartCount > 0)
|
||||||
foreach (PartInfo pi in itemInfo.MyContent.ContentParts)
|
foreach (PartInfo pi in itemInfo.MyContent.ContentParts)
|
||||||
foreach (ItemInfo ii in pi.MyItems)
|
foreach (ItemInfo ii in pi.MyItems)
|
||||||
MyRefreshReferenceObjects(ii, itemInfo, (itemInfo as SectionInfo) ?? sectionInfo, docVersionInfo);
|
MyRefreshReferenceObjects(ii, itemInfo, (itemInfo as SectionInfo) ?? sectionInfo, docVersionInfo);
|
||||||
ROFstInfo rofstinfo = docVersionInfo.DocVersionAssociations[0].MyROFst;
|
ROFstInfo rofstinfo = docVersionInfo.DocVersionAssociations[0].MyROFst;
|
||||||
ROFSTLookup lookup = rofstinfo.GetROFSTLookup(docVersionInfo);
|
ROFSTLookup lookup = rofstinfo.GetROFSTLookup(docVersionInfo);
|
||||||
lookup.MyDocVersionInfo = docVersionInfo;
|
lookup.MyDocVersionInfo = docVersionInfo;
|
||||||
if (itemInfo.MyContent.ContentRoUsageCount > 0)
|
if (itemInfo.MyContent.ContentRoUsageCount > 0)
|
||||||
{
|
{
|
||||||
foreach (RoUsageInfo rousage in itemInfo.MyContent.ContentRoUsages)
|
foreach (RoUsageInfo rousage in itemInfo.MyContent.ContentRoUsages)
|
||||||
{
|
{
|
||||||
if (sectionInfo != null)
|
if (sectionInfo != null)
|
||||||
{
|
{
|
||||||
ROCheckCount++;
|
ROCheckCount++;
|
||||||
string oldText = itemInfo.MyContent.Text;
|
string oldText = itemInfo.MyContent.Text;
|
||||||
string roval = lookup.GetTranslatedRoValue(rousage.ROID, sectionInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta);
|
string roval = lookup.GetTranslatedRoValue(rousage.ROID, sectionInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta);
|
||||||
ROFSTLookup.rochild roch = lookup.GetRoChild(rousage.ROID);
|
ROFSTLookup.rochild roch = lookup.GetRoChild(rousage.ROID);
|
||||||
itemInfo.MyContent.FixContentText(rousage, roval, roch.type, rofstinfo, itemInfo);
|
itemInfo.MyContent.FixContentText(rousage, roval, roch.type, rofstinfo, itemInfo);
|
||||||
string newText = itemInfo.MyContent.Text;
|
string newText = itemInfo.MyContent.Text;
|
||||||
if (newText != oldText)
|
if (newText != oldText)
|
||||||
{
|
{
|
||||||
ROFixCount++;
|
ROFixCount++;
|
||||||
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
||||||
if (roval == "?")
|
if (roval == "?")
|
||||||
{
|
{
|
||||||
oldText = content.ConvertROToText(rousage, roval, roch.type, rofstinfo);
|
oldText = content.ConvertROToText(rousage, roval, roch.type, rofstinfo);
|
||||||
@ -763,13 +791,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
content.FixContentText(rousage, roval, roch.type, rofstinfo);
|
content.FixContentText(rousage, roval, roch.type, rofstinfo);
|
||||||
content.Save();
|
content.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
internal static void SetParentSectionAndDocVersionPageNum(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup)
|
internal static void SetParentSectionAndDocVersionPageNum(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup)
|
||||||
{
|
{
|
||||||
if (itemInfo.MyContent.ContentPartCount > 0)
|
if (itemInfo.MyContent.ContentPartCount > 0)
|
||||||
{
|
{
|
||||||
@ -807,7 +835,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
internal static string GetCombinedTab(ItemInfo itemInfo, string parTab)
|
internal static string GetCombinedTab(ItemInfo itemInfo, string parTab)
|
||||||
{
|
{
|
||||||
string pTab = parTab == null ? "" : parTab;
|
string pTab = parTab == null ? "" : parTab;
|
||||||
int profileDepth = ProfileTimer.Push( ">>>> itemInfo.MyTab.CleanText.Trim");
|
int profileDepth = ProfileTimer.Push(">>>> itemInfo.MyTab.CleanText.Trim");
|
||||||
string thisTab = itemInfo.MyTab.CleanText.Trim();
|
string thisTab = itemInfo.MyTab.CleanText.Trim();
|
||||||
ProfileTimer.Pop(profileDepth);
|
ProfileTimer.Pop(profileDepth);
|
||||||
if (thisTab != null && thisTab != "" && !char.IsLetterOrDigit(thisTab[0])) return pTab;
|
if (thisTab != null && thisTab != "" && !char.IsLetterOrDigit(thisTab[0])) return pTab;
|
||||||
@ -837,26 +865,26 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
if (docVersionInfo.DocVersionAssociationCount == 1)
|
if (docVersionInfo.DocVersionAssociationCount == 1)
|
||||||
{
|
{
|
||||||
ROFstInfo rofstinfo = docVersionInfo.DocVersionAssociations[0].MyROFst;
|
ROFstInfo rofstinfo = docVersionInfo.DocVersionAssociations[0].MyROFst;
|
||||||
//rofstinfo.docVer = docVersionInfo;
|
//rofstinfo.docVer = docVersionInfo;
|
||||||
ROFSTLookup lookup = rofstinfo.GetROFSTLookup(docVersionInfo);
|
ROFSTLookup lookup = rofstinfo.GetROFSTLookup(docVersionInfo);
|
||||||
lookup.MyDocVersionInfo = docVersionInfo;
|
lookup.MyDocVersionInfo = docVersionInfo;
|
||||||
//DateTime dts = DateTime.Now;
|
//DateTime dts = DateTime.Now;
|
||||||
if (itemInfo.MyContent.ContentGridCount > 0)
|
if (itemInfo.MyContent.ContentGridCount > 0)
|
||||||
itemInfo.MyContent.LoadNonCachedGrid();
|
itemInfo.MyContent.LoadNonCachedGrid();
|
||||||
if (itemInfo.MyContent.ContentRoUsageCount > 0)
|
if (itemInfo.MyContent.ContentRoUsageCount > 0)
|
||||||
{
|
|
||||||
foreach (RoUsageInfo rousage in itemInfo.MyContent.ContentRoUsages)
|
|
||||||
{
|
{
|
||||||
if (sectionInfo != null)
|
foreach (RoUsageInfo rousage in itemInfo.MyContent.ContentRoUsages)
|
||||||
{
|
{
|
||||||
string roval = lookup.GetTranslatedRoValue(rousage.ROID, sectionInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta);
|
if (sectionInfo != null)
|
||||||
ROFSTLookup.rochild roch = lookup.GetRoChild(rousage.ROID);
|
{
|
||||||
itemInfo.MyContent.FixContentText(rousage, roval, roch.type, rofstinfo, itemInfo);
|
string roval = lookup.GetTranslatedRoValue(rousage.ROID, sectionInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta);
|
||||||
|
ROFSTLookup.rochild roch = lookup.GetRoChild(rousage.ROID);
|
||||||
|
itemInfo.MyContent.FixContentText(rousage, roval, roch.type, rofstinfo, itemInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Force Error Message
|
// Force Error Message
|
||||||
@ -972,7 +1000,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
foreach (ItemInfo item in _CacheByPrimaryKey[key]) myCache.Add(item);
|
foreach (ItemInfo item in _CacheByPrimaryKey[key]) myCache.Add(item);
|
||||||
foreach (ItemInfo item in myCache)
|
foreach (ItemInfo item in myCache)
|
||||||
item.OnOrdinalChange();
|
item.OnOrdinalChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public bool IsFirstSubStep
|
public bool IsFirstSubStep
|
||||||
{
|
{
|
||||||
@ -1009,7 +1037,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
if (IsProcedure) return false;
|
if (IsProcedure) return false;
|
||||||
SectionConfig scfg = ActiveSection.MyConfig as SectionConfig;
|
SectionConfig scfg = ActiveSection.MyConfig as SectionConfig;
|
||||||
if (MyDocStyle.StructureStyle.Style == null || scfg == null) return false;
|
if (MyDocStyle.StructureStyle.Style == null || scfg == null) return false;
|
||||||
bool PlacekeepOption = ((ActiveFormat.PlantFormat.FormatData.PurchaseOptions & E_PurchaseOptions.AutoPlacekeeper) == E_PurchaseOptions.AutoPlacekeeper)
|
bool PlacekeepOption = ((ActiveFormat.PlantFormat.FormatData.PurchaseOptions & E_PurchaseOptions.AutoPlacekeeper) == E_PurchaseOptions.AutoPlacekeeper)
|
||||||
&& scfg.Section_Placekeeper.Equals("Y");
|
&& scfg.Section_Placekeeper.Equals("Y");
|
||||||
//return (PlacekeepOption && IsHigh);
|
//return (PlacekeepOption && IsHigh);
|
||||||
@ -1170,7 +1198,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
else if (item.IsRNOPart)
|
else if (item.IsRNOPart)
|
||||||
{
|
{
|
||||||
level = (item.ActiveParent as ItemInfo).StepLevel + item.RNOLevel - item.ColumnMode;
|
level = (item.ActiveParent as ItemInfo).StepLevel + item.RNOLevel - item.ColumnMode;
|
||||||
// RHM Change 20140522
|
// RHM Change 20140522
|
||||||
//level = (item.ActiveParent as ItemInfo).StepLevel;// +item.RNOLevel - item.ColumnMode;
|
//level = (item.ActiveParent as ItemInfo).StepLevel;// +item.RNOLevel - item.ColumnMode;
|
||||||
}
|
}
|
||||||
return level;
|
return level;
|
||||||
@ -1434,11 +1462,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
private E_FromType? _FromType = null;
|
private E_FromType? _FromType = null;
|
||||||
public E_FromType? FromType
|
public E_FromType? FromType
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (ItemID == 95759 && _FromType == null)
|
if (ItemID == 95759 && _FromType == null)
|
||||||
Console.WriteLine("\"Null FromType\",{0},{1},\"{2}\",{3}", ItemID, MyContent.Type,DisplayNumber,MyItemInfoUnique);
|
Console.WriteLine("\"Null FromType\",{0},{1},\"{2}\",{3}", ItemID, MyContent.Type, DisplayNumber, MyItemInfoUnique);
|
||||||
return _FromType;
|
return _FromType;
|
||||||
}
|
}
|
||||||
set { _FromType = value; }
|
set { _FromType = value; }
|
||||||
}
|
}
|
||||||
@ -1447,7 +1475,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (FromType != null)
|
if (FromType != null)
|
||||||
return (MyPrevious == null && FromType == E_FromType.Caution);
|
return (MyPrevious == null && FromType == E_FromType.Caution);
|
||||||
return ((ItemPartCount > 0) && (ItemParts[0].PartType == E_FromType.Caution));
|
return ((ItemPartCount > 0) && (ItemParts[0].PartType == E_FromType.Caution));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1538,7 +1566,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
case 45: // Continuous Action AND sub-step
|
case 45: // Continuous Action AND sub-step
|
||||||
case 46: // Continuous Action OR sub-step
|
case 46: // Continuous Action OR sub-step
|
||||||
case 47: //Continuous Actoin Paragraph sub-step
|
case 47: //Continuous Actoin Paragraph sub-step
|
||||||
includeOnCAS = !sd.ExcludeFromContActSum; // if flag is not set then Automatically include this step/sub-step on the Continuous Action Summary
|
includeOnCAS = !sd.ExcludeFromContActSum; // if flag is not set then Automatically include this step/sub-step on the Continuous Action Summary
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
includeOnCAS = !sd.ExcludeFromContActSum; //false; // don't automatically include this step/sub-step on the Continuous Action Summary
|
includeOnCAS = !sd.ExcludeFromContActSum; //false; // don't automatically include this step/sub-step on the Continuous Action Summary
|
||||||
@ -1684,10 +1712,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (MyContent.Type / 10000 != 2) _IsHigh = false;
|
if (MyContent.Type / 10000 != 2) _IsHigh = false;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ItemInfo parent = ActiveParent as ItemInfo;
|
ItemInfo parent = ActiveParent as ItemInfo;
|
||||||
if (parent == null) _IsHigh = false;
|
if (parent == null) _IsHigh = false;
|
||||||
// IsHigh was returning true if this item is a caution or note off of a section..
|
// IsHigh was returning true if this item is a caution or note off of a section..
|
||||||
// from the (parent.MyContent.Type / 1000) == 1.
|
// from the (parent.MyContent.Type / 1000) == 1.
|
||||||
else if ((parent.MyContent.Type / 10000) != 1)
|
else if ((parent.MyContent.Type / 10000) != 1)
|
||||||
_IsHigh = false;
|
_IsHigh = false;
|
||||||
else if (IsCaution || IsNote) _IsHigh = false;
|
else if (IsCaution || IsNote) _IsHigh = false;
|
||||||
@ -1928,6 +1956,54 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return ((FirstSibling.ItemPartCount > 0) && (FirstSibling.ItemParts[0].PartType == E_FromType.Step));
|
return ((FirstSibling.ItemPartCount > 0) && (FirstSibling.ItemParts[0].PartType == E_FromType.Step));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public bool IsEnhancedStep
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (FormatStepData != null)
|
||||||
|
{
|
||||||
|
E_AccStep? actable = FormatStepData.StepEditData.AcTable;
|
||||||
|
return (actable != null && MyActiveSection != null && MyActiveSection.IsEnhancedSection && ((actable & E_AccStep.EnhancedLinkedStep) != 0));
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public bool IsEnhancedSection
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (!IsSection) return false;
|
||||||
|
SectionConfig sc = MyConfig as SectionConfig;
|
||||||
|
if (sc.MyEnhancedDocuments != null && sc.MyEnhancedDocuments.Count == 1 && sc.MyEnhancedDocuments[0].Type == 0) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public bool IsEnhancedSectionTitleOnly // this is an enhanced document (sectionitem) but only the title is linked.
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (!IsSection) return false;
|
||||||
|
SectionConfig sc = MyConfig as SectionConfig;
|
||||||
|
// go back to source & see what type is:
|
||||||
|
if (sc.MyEnhancedDocuments != null && sc.MyEnhancedDocuments.Count == 1 && sc.MyEnhancedDocuments[0].Type == 0)
|
||||||
|
{
|
||||||
|
SectionInfo siSource = SectionInfo.Get(sc.MyEnhancedDocuments[0].ItemID);
|
||||||
|
SectionConfig scs = siSource.MyConfig as SectionConfig;
|
||||||
|
if (scs.Section_LnkEnh == "T") return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public bool IsEnhancedProcedure // this is NOT a source, it is enhanced, i.e. background or deviation
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (!IsProcedure) return false;
|
||||||
|
ProcedureConfig pc = MyConfig as ProcedureConfig;
|
||||||
|
if (pc.MyEnhancedDocuments != null && pc.MyEnhancedDocuments.Count == 1 && pc.MyEnhancedDocuments[0].Type == 0) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
public bool IsInSubStep
|
public bool IsInSubStep
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -2025,7 +2101,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
string myNumber = DisplayNumber;
|
string myNumber = DisplayNumber;
|
||||||
if (parNumber == null || myNumber == null) return false;
|
if (parNumber == null || myNumber == null) return false;
|
||||||
ItemInfo par2 = par.ActiveParent as ItemInfo;
|
ItemInfo par2 = par.ActiveParent as ItemInfo;
|
||||||
if (par2 != null && par2.IsSection)
|
if (par2 != null && par2.IsSection)
|
||||||
{
|
{
|
||||||
// check for 6.1 (parent) and 6.1.1.
|
// check for 6.1 (parent) and 6.1.1.
|
||||||
if (DisplayNumber.StartsWith((ActiveParent as SectionInfo).DisplayNumber.Trim())) return true;
|
if (DisplayNumber.StartsWith((ActiveParent as SectionInfo).DisplayNumber.Trim())) return true;
|
||||||
@ -2072,7 +2148,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private E_FromType ItemType
|
private E_FromType ItemType
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -2286,7 +2362,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// str = str.Replace("<u>", MyDocVersion.DocVersionConfig.Unit_Number);
|
// str = str.Replace("<u>", MyDocVersion.DocVersionConfig.Unit_Number);
|
||||||
//if (str.Contains("<U>"))
|
//if (str.Contains("<U>"))
|
||||||
// str = str.Replace("<U>", MyDocVersion.DocVersionConfig.Unit_Number);
|
// str = str.Replace("<U>", MyDocVersion.DocVersionConfig.Unit_Number);
|
||||||
return ConvertToDisplayText(str,false);
|
return ConvertToDisplayText(str, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Used in Comanche Peak EOP and Flex formats for step designators. Will allow a hard return to be used that that caution type.
|
// Used in Comanche Peak EOP and Flex formats for step designators. Will allow a hard return to be used that that caution type.
|
||||||
@ -2406,7 +2482,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public static string StripLinks(string rtf)
|
public static string StripLinks(string rtf)
|
||||||
{
|
{
|
||||||
string retval = rtf;
|
string retval = rtf;
|
||||||
retval = Regex.Replace(retval, @"\\v.*?\\v0", "");
|
retval = Regex.Replace(retval, @"\\v.*?\\v0 ?", "");
|
||||||
retval = retval.Replace("\u252C", "");// Unicode 9516 Transition
|
retval = retval.Replace("\u252C", "");// Unicode 9516 Transition
|
||||||
retval = retval.Replace("\u2566", "");// Unicode 9574 Transition
|
retval = retval.Replace("\u2566", "");// Unicode 9574 Transition
|
||||||
retval = retval.Replace("\u0015", "");// Unicode 21 RO
|
retval = retval.Replace("\u0015", "");// Unicode 21 RO
|
||||||
@ -2851,7 +2927,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return false; // No Change ID - No Change Bar
|
return false; // No Change ID - No Change Bar
|
||||||
if (sc.Step_CBOverride == null)
|
if (sc.Step_CBOverride == null)
|
||||||
return chg;
|
return chg;
|
||||||
return (sc.Step_CBOverride == "On");
|
return (sc.Step_CBOverride == "On");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public bool HasChanges
|
public bool HasChanges
|
||||||
@ -3089,8 +3165,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (_ActiveFormat == null || !PrintAllAtOnce) // jsj added check for NULL ActiveParent
|
if (_ActiveFormat == null || !PrintAllAtOnce) // jsj added check for NULL ActiveParent
|
||||||
_ActiveFormat = (LocalFormat != null ? LocalFormat : (ActiveParent != null) ? ActiveParent.ActiveFormat : null);
|
_ActiveFormat = (LocalFormat != null ? LocalFormat : (ActiveParent != null) ? ActiveParent.ActiveFormat : null);
|
||||||
//Console.WriteLine("Active {0}", (_ActiveFormat == null) ? "_ActiveFormat is null" : _ActiveFormat.Name);
|
//Console.WriteLine("Active {0}", (_ActiveFormat == null) ? "_ActiveFormat is null" : _ActiveFormat.Name);
|
||||||
return _ActiveFormat;
|
return _ActiveFormat;
|
||||||
}
|
}
|
||||||
@ -3170,6 +3246,22 @@ namespace VEPROMS.CSLA.Library
|
|||||||
foreach (ItemInfo tmpInfo in _CacheByPrimaryKey[key])
|
foreach (ItemInfo tmpInfo in _CacheByPrimaryKey[key])
|
||||||
tmpInfo.MyConfig = null;
|
tmpInfo.MyConfig = null;
|
||||||
}
|
}
|
||||||
|
public EnhancedDocuments GetMyEnhancedDocuments()
|
||||||
|
{
|
||||||
|
switch (MyContent.Type / 10000)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
ProcedureConfig pConfig = MyConfig as ProcedureConfig;
|
||||||
|
return pConfig.MyEnhancedDocuments;
|
||||||
|
case 1:
|
||||||
|
SectionConfig sConfig = MyConfig as SectionConfig;
|
||||||
|
return sConfig.MyEnhancedDocuments;
|
||||||
|
case 2:
|
||||||
|
StepConfig stConfig = MyConfig as StepConfig;
|
||||||
|
return stConfig.MyEnhancedDocuments;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
//public bool HasStandardSteps()
|
//public bool HasStandardSteps()
|
||||||
//{ return MyContent.ContentItemCount > 1; }
|
//{ return MyContent.ContentItemCount > 1; }
|
||||||
public Color ForeColor
|
public Color ForeColor
|
||||||
@ -3378,7 +3470,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
localPrintLevel = PrintLevel + ((ActiveFormat.PlantFormat.FormatData.Express && IsSequential) ? 0 : CurrentSectionLevel());
|
localPrintLevel = PrintLevel + ((ActiveFormat.PlantFormat.FormatData.Express && IsSequential) ? 0 : CurrentSectionLevel());
|
||||||
if (!ActiveFormat.PlantFormat.FormatData.Express) doMeta = true;
|
if (!ActiveFormat.PlantFormat.FormatData.Express) doMeta = true;
|
||||||
}
|
}
|
||||||
if(sd.StepSectionLayoutData.TieTabToLevel && ActiveFormat.PlantFormat.FormatData.SectData.CountSubSectionsForLevel)
|
if (sd.StepSectionLayoutData.TieTabToLevel && ActiveFormat.PlantFormat.FormatData.SectData.CountSubSectionsForLevel)
|
||||||
if (SectionLevel() > 1)
|
if (SectionLevel() > 1)
|
||||||
localPrintLevel += 1;
|
localPrintLevel += 1;
|
||||||
SeqTabFmtList seqtabs = ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.SeqTabFmtList;
|
SeqTabFmtList seqtabs = ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.SeqTabFmtList;
|
||||||
@ -3393,7 +3485,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
// Check to be sure the parent tab should be included... If this sequential is within a note
|
// Check to be sure the parent tab should be included... If this sequential is within a note
|
||||||
// or caution or equipment list, don't use parent tab AND always start the numbering as a numeric
|
// or caution or equipment list, don't use parent tab AND always start the numbering as a numeric
|
||||||
if (doMeta && IsSequential && (InNote() || InCaution() ||
|
if (doMeta && IsSequential && (InNote() || InCaution() ||
|
||||||
(MyParent.IsEquipmentList && !MyParent.FormatStepData.TabData.IdentPrint.Contains("{seq}"))))
|
(MyParent.IsEquipmentList && !MyParent.FormatStepData.TabData.IdentPrint.Contains("{seq}"))))
|
||||||
{
|
{
|
||||||
// if immediate parent is note, caution or equip, use numeric, otherwise use alpha.
|
// if immediate parent is note, caution or equip, use numeric, otherwise use alpha.
|
||||||
@ -3470,7 +3562,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
parentTab = myparent.MyTab.CleanText.Trim();
|
parentTab = myparent.MyTab.CleanText.Trim();
|
||||||
if (((MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_AddDotZeroStdHLS) == E_DocStructStyle.DSS_AddDotZeroStdHLS) && myparent.MyContent.Type == 20002)
|
if (((MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_AddDotZeroStdHLS) == E_DocStructStyle.DSS_AddDotZeroStdHLS) && myparent.MyContent.Type == 20002)
|
||||||
parentTab = parentTab.Replace(".0", ""); // this was added in, remove for substeps.
|
parentTab = parentTab.Replace(".0", ""); // this was added in, remove for substeps.
|
||||||
tbformat = parentTab + (parentTab.EndsWith(".") ? "" : parentTab=="" ? "" : ".") + tbformat.TrimStart();
|
tbformat = parentTab + (parentTab.EndsWith(".") ? "" : parentTab == "" ? "" : ".") + tbformat.TrimStart();
|
||||||
}
|
}
|
||||||
else if (IsSequential && ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.SkipNonSeqTabWithPar)
|
else if (IsSequential && ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.SkipNonSeqTabWithPar)
|
||||||
{
|
{
|
||||||
@ -3524,7 +3616,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (!IsSection && !IsProcedure && tbformat.IndexOf("{Section Prefix}") >= 0)
|
if (!IsSection && !IsProcedure && tbformat.IndexOf("{Section Prefix}") >= 0)
|
||||||
{
|
{
|
||||||
string tmpsectpref = SectionPrefix(tbformat) ?? string.Empty;
|
string tmpsectpref = SectionPrefix(tbformat) ?? string.Empty;
|
||||||
if (ActiveSection.MyTab.CleanText != null && ActiveSection.MyTab.CleanText != "" && tmpsectpref != string.Empty) trimTabStart = true;
|
if (ActiveSection.MyTab!=null && ActiveSection.MyTab.CleanText != null && ActiveSection.MyTab.CleanText != "" && tmpsectpref != string.Empty) trimTabStart = true;
|
||||||
tbformat = tbformat.Replace("{Section Prefix}", SectionPrefix(tbformat));
|
tbformat = tbformat.Replace("{Section Prefix}", SectionPrefix(tbformat));
|
||||||
if (tbformate != null) tbformate = tbformate.Replace("{Section Prefix}", SectionPrefix(tbformate));
|
if (tbformate != null) tbformate = tbformate.Replace("{Section Prefix}", SectionPrefix(tbformate));
|
||||||
}
|
}
|
||||||
@ -3778,7 +3870,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MyDocStyle != null && (MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_SkipOneStepLevel) == E_DocStructStyle.DSS_SkipOneStepLevel)
|
if (MyDocStyle != null && (MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_SkipOneStepLevel) == E_DocStructStyle.DSS_SkipOneStepLevel)
|
||||||
level++;
|
level++;
|
||||||
if (MyDocStyle != null && (MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_SkipTwoStepLevels) == E_DocStructStyle.DSS_SkipTwoStepLevels && level == 0)
|
if (MyDocStyle != null && (MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_SkipTwoStepLevels) == E_DocStructStyle.DSS_SkipTwoStepLevels && level == 0)
|
||||||
@ -3912,7 +4004,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// use of the MixCautionsAndNotes format flag - no bullet is used, if more that one replace the tab
|
// use of the MixCautionsAndNotes format flag - no bullet is used, if more that one replace the tab
|
||||||
// with a bullet. Also, if only one in group and tab text ends with 'S', remove it:
|
// with a bullet. Also, if only one in group and tab text ends with 'S', remove it:
|
||||||
bool mixCandN = MixCautionNotesDiffType();
|
bool mixCandN = MixCautionNotesDiffType();
|
||||||
if ((MyPrevious == null && (nextItem == null||specialCalvertAlarm)) || mixCandN || FormatStepData.SeparateBox)
|
if ((MyPrevious == null && (nextItem == null || specialCalvertAlarm)) || mixCandN || FormatStepData.SeparateBox)
|
||||||
{
|
{
|
||||||
if (_MyHeader.CleanText.ToUpper().EndsWith("S"))
|
if (_MyHeader.CleanText.ToUpper().EndsWith("S"))
|
||||||
{
|
{
|
||||||
@ -3949,10 +4041,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// For calvert formats, if all tabs are null or empty, then don't add a bullet in.
|
// For calvert formats, if all tabs are null or empty, then don't add a bullet in.
|
||||||
bool allnull = ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert && (tbformat == null || tbformat == "") && (nextTbFormat == null || tbformat == "") && (prevTbFormat == null || prevTbFormat == "");
|
bool allnull = ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert && (tbformat == null || tbformat == "") && (nextTbFormat == null || tbformat == "") && (prevTbFormat == null || prevTbFormat == "");
|
||||||
if (!allnull && (tbformat == nextTbFormat || tbformat == prevTbFormat))
|
if (!allnull && (tbformat == nextTbFormat || tbformat == prevTbFormat))
|
||||||
{
|
{
|
||||||
tbformat = ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB;
|
tbformat = ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB;
|
||||||
TabToIdentBAdjustFont();
|
TabToIdentBAdjustFont();
|
||||||
}
|
}
|
||||||
else if ((nextTbFormat == null || tbformat != nextTbFormat) && (prevTbFormat == null || tbformat != prevTbFormat))
|
else if ((nextTbFormat == null || tbformat != nextTbFormat) && (prevTbFormat == null || tbformat != prevTbFormat))
|
||||||
{
|
{
|
||||||
tbformat = "";
|
tbformat = "";
|
||||||
@ -3972,9 +4064,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
(MyPrevious != null && MyPrevious.MyContent.Type == MyContent.Type) ||
|
(MyPrevious != null && MyPrevious.MyContent.Type == MyContent.Type) ||
|
||||||
(NextItem != null && nextItem.MyContent.Type == MyContent.Type))
|
(NextItem != null && nextItem.MyContent.Type == MyContent.Type))
|
||||||
{
|
{
|
||||||
tbformat = tbformat + ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB;
|
tbformat = tbformat + ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB;
|
||||||
TabToIdentBAdjustFont();
|
TabToIdentBAdjustFont();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (FormatStepData.TabData.IsTransition)
|
else if (FormatStepData.TabData.IsTransition)
|
||||||
return tbformat;
|
return tbformat;
|
||||||
@ -4027,9 +4119,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// treat cautions and notes as different if they are all NOT exactly the same type
|
// treat cautions and notes as different if they are all NOT exactly the same type
|
||||||
if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.OnlyBulletSameCautionNoteType)
|
if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.OnlyBulletSameCautionNoteType)
|
||||||
{
|
{
|
||||||
if (MyPrevious != null && MyPrevious.MyContent.Type != MyContent.Type &&
|
if (MyPrevious != null && MyPrevious.MyContent.Type != MyContent.Type &&
|
||||||
((MyPrevious.IsCaution && this.IsCaution) || (MyPrevious.IsNote && this.IsNote))) return true;
|
((MyPrevious.IsCaution && this.IsCaution) || (MyPrevious.IsNote && this.IsNote))) return true;
|
||||||
if (NextItem != null && NextItem.MyContent.Type != MyContent.Type &&
|
if (NextItem != null && NextItem.MyContent.Type != MyContent.Type &&
|
||||||
((NextItem.IsCaution && this.IsCaution) || (NextItem.IsNote && this.IsNote))) return true;
|
((NextItem.IsCaution && this.IsCaution) || (NextItem.IsNote && this.IsNote))) return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4132,6 +4224,55 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
#region EnhancedSupport
|
||||||
|
public void ClearEnhancedSectionFromSource(int srcId)
|
||||||
|
{
|
||||||
|
using (Section ssrc = Section.Get(srcId))
|
||||||
|
{
|
||||||
|
SectionConfig ssrcc = ssrc.MyConfig as SectionConfig;
|
||||||
|
EnhancedDocuments newEds = new EnhancedDocuments();
|
||||||
|
foreach (EnhancedDocument ed in ssrcc.MyEnhancedDocuments)
|
||||||
|
{
|
||||||
|
if (ed.ItemID != ItemID) newEds.Add(ed);
|
||||||
|
}
|
||||||
|
if (newEds.Count > 0)
|
||||||
|
{
|
||||||
|
ssrcc.MyEnhancedDocuments = null;
|
||||||
|
ssrcc.MyEnhancedDocuments = newEds;
|
||||||
|
ssrcc.SaveEnhancedDocuments();
|
||||||
|
ssrc.MyContent.Config = ssrcc.ToString();
|
||||||
|
ssrc.Save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void ClearEnhancedSectionLink()
|
||||||
|
{
|
||||||
|
// for this source section, clear any enhanced flags in connected section
|
||||||
|
// where the enhanced type is "T", i.e. title only
|
||||||
|
if (!IsSection) return;
|
||||||
|
SectionConfig sc = MyConfig as SectionConfig;
|
||||||
|
if (sc.Section_LnkEnh != "T" || sc.MyEnhancedDocuments == null || sc.MyEnhancedDocuments.Count == 0) return;
|
||||||
|
foreach (EnhancedDocument ed in sc.MyEnhancedDocuments)
|
||||||
|
{
|
||||||
|
using (Section s = Section.Get(ed.ItemID))
|
||||||
|
{
|
||||||
|
// have to get config from a SectionInfo, it is null off of this section (not sure why)
|
||||||
|
SectionInfo si = SectionInfo.Get(ed.ItemID);
|
||||||
|
SectionConfig esc = si.MyConfig as SectionConfig;
|
||||||
|
esc.MyEnhancedDocuments.Clear();
|
||||||
|
esc.SaveEnhancedDocuments();
|
||||||
|
s.MyContent.Config = esc.ToString();
|
||||||
|
s.Save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sc.Section_LnkEnh = null;
|
||||||
|
using (Section mysect = Section.Get(ItemID))
|
||||||
|
{
|
||||||
|
mysect.MyContent.Config = sc.ToString();
|
||||||
|
mysect.Save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
#region ParentNoteOrCaution
|
#region ParentNoteOrCaution
|
||||||
private bool _ParentNoteOrCautionLoaded = false;
|
private bool _ParentNoteOrCautionLoaded = false;
|
||||||
private ItemInfo _ParentNoteOrCaution;
|
private ItemInfo _ParentNoteOrCaution;
|
||||||
@ -4246,20 +4387,20 @@ namespace VEPROMS.CSLA.Library
|
|||||||
private int? _TemplateColumnMode = null;
|
private int? _TemplateColumnMode = null;
|
||||||
public int TemplateColumnMode
|
public int TemplateColumnMode
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (_TemplateColumnMode == null)
|
if (_TemplateColumnMode == null)
|
||||||
{
|
{
|
||||||
ItemInfo pi = ActiveParent as ItemInfo;
|
ItemInfo pi = ActiveParent as ItemInfo;
|
||||||
if (pi != null)
|
if (pi != null)
|
||||||
{
|
{
|
||||||
if (!pi.IsStep) // only steps are in template
|
if (!pi.IsStep) // only steps are in template
|
||||||
_TemplateColumnMode = -1;
|
_TemplateColumnMode = -1;
|
||||||
else if (pi.FormatStepData.UseOldTemplate)
|
else if (pi.FormatStepData.UseOldTemplate)
|
||||||
_TemplateColumnMode = pi.TemplateChildColumnMode;
|
_TemplateColumnMode = pi.TemplateChildColumnMode;
|
||||||
else
|
else
|
||||||
_TemplateColumnMode = pi.TemplateColumnMode; // go up parents until find of columnmode or section
|
_TemplateColumnMode = pi.TemplateColumnMode; // go up parents until find of columnmode or section
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return _TemplateColumnMode ?? -1;
|
return _TemplateColumnMode ?? -1;
|
||||||
}
|
}
|
||||||
@ -4325,9 +4466,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
// GetSmartTemplateIndex(int topIndx, string strtxt): Added for Calvert Alarms since their
|
// GetSmartTemplateIndex(int topIndx, string strtxt): Added for Calvert Alarms since their
|
||||||
// template also uses the text, not just the type, to find a match in the template.
|
// template also uses the text, not just the type, to find a match in the template.
|
||||||
public int GetSmartTemplateIndex(int topIndx, string strtxt)
|
public int GetSmartTemplateIndex(int topIndx, string strtxt)
|
||||||
{
|
{
|
||||||
string txt = strtxt.Replace(@"\u160?"," ");
|
string txt = strtxt.Replace(@"\u160?", " ");
|
||||||
if (ActiveFormat == null) return -1;
|
if (ActiveFormat == null) return -1;
|
||||||
FormatData formatData = ActiveFormat.PlantFormat.FormatData;
|
FormatData formatData = ActiveFormat.PlantFormat.FormatData;
|
||||||
if (formatData.TopTemplateTypes == null || formatData.TopTemplateTypes.Count == 0) return -1;
|
if (formatData.TopTemplateTypes == null || formatData.TopTemplateTypes.Count == 0) return -1;
|
||||||
@ -4338,7 +4479,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (txt == null && formatData.Templates[indx].type == (MyContent.Type - 20001)) return indx;
|
if (txt == null && formatData.Templates[indx].type == (MyContent.Type - 20001)) return indx;
|
||||||
// now see if we're on the topType, if so, look under this one for the step type
|
// now see if we're on the topType, if so, look under this one for the step type
|
||||||
// that we're on, the TEXT ALSO NEEDS TO MATCH. If found return the index of it.
|
// that we're on, the TEXT ALSO NEEDS TO MATCH. If found return the index of it.
|
||||||
if (txt != null && formatData.Templates[indx].text!=null && (txt.Trim() == formatData.Templates[indx].text.Trim())
|
if (txt != null && formatData.Templates[indx].text != null && (txt.Trim() == formatData.Templates[indx].text.Trim())
|
||||||
&& ((MyContent.Type - 20001) == formatData.Templates[indx].type)) return indx;
|
&& ((MyContent.Type - 20001) == formatData.Templates[indx].type)) return indx;
|
||||||
indx++;
|
indx++;
|
||||||
}
|
}
|
||||||
@ -4495,7 +4636,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
#endregion ItemInfo
|
#endregion ItemInfo
|
||||||
#region Tab
|
#region Tab
|
||||||
@ -4564,7 +4705,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
// this trims off any symbols at the start of the tab
|
// this trims off any symbols at the start of the tab
|
||||||
return _ReplaceSymbols.Replace(CleanText, "").Replace("#","");
|
return _ReplaceSymbols.Replace(CleanText, "").Replace("#", "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5373,7 +5514,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public string TranCategory { get { return _TranCategory; } }
|
public string TranCategory { get { return _TranCategory; } }
|
||||||
// added stepTypeList parameter to allow a transition search is selected step elements (B2015-055)
|
// added stepTypeList parameter to allow a transition search is selected step elements (B2015-055)
|
||||||
private string _StepTypeList;
|
private string _StepTypeList;
|
||||||
public string StepTypeList { get { return _StepTypeList;} }
|
public string StepTypeList { get { return _StepTypeList; } }
|
||||||
public ItemListTransitionSearchCriteria(string docVersionList, int tranType, string tranCategory, string stepTypeList)
|
public ItemListTransitionSearchCriteria(string docVersionList, int tranType, string tranCategory, string stepTypeList)
|
||||||
{
|
{
|
||||||
_DocVersionList = docVersionList;
|
_DocVersionList = docVersionList;
|
||||||
@ -5635,6 +5776,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
public partial class ProcedureInfo : ItemInfo, IVEDrillDownReadOnly
|
public partial class ProcedureInfo : ItemInfo, IVEDrillDownReadOnly
|
||||||
{
|
{
|
||||||
|
public bool CreateEnhanced = false;
|
||||||
public string PDFNumber
|
public string PDFNumber
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -5718,27 +5860,27 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public new Procedure Get()
|
public new Procedure Get()
|
||||||
{
|
{
|
||||||
return (Procedure)(_Editable = Procedure.Get(ItemID));
|
return (Procedure)(_Editable = Procedure.Get(ItemID));
|
||||||
}
|
}
|
||||||
//public static void RefreshTransitions(ProcedureInfo tmp)
|
//public static void RefreshTransitions(ProcedureInfo tmp)
|
||||||
//{
|
//{
|
||||||
// RefreshTransitions(tmp, null, null);
|
// RefreshTransitions(tmp, null, null);
|
||||||
//}
|
//}
|
||||||
public static void RefreshTransitions(ProcedureInfo tmp)//, TransitionInfoList transitionToDisconnected, TransitionInfoList transitionsToNonEditable)
|
public static void RefreshTransitions(ProcedureInfo tmp)//, TransitionInfoList transitionToDisconnected, TransitionInfoList transitionsToNonEditable)
|
||||||
{
|
{
|
||||||
//TransitionsToDisconnected = transitionToDisconnected;
|
//TransitionsToDisconnected = transitionToDisconnected;
|
||||||
//TransitionsToNonEditable = transitionsToNonEditable;
|
//TransitionsToNonEditable = transitionsToNonEditable;
|
||||||
TransitionLookup tranLookup = new TransitionLookup(0, tmp.ItemID, tmp.MyLookup);
|
TransitionLookup tranLookup = new TransitionLookup(0, tmp.ItemID, tmp.MyLookup);
|
||||||
tranLookup.ApplicabilityUnit = tmp.MyDocVersion.DocVersionConfig.SelectedSlave;
|
tranLookup.ApplicabilityUnit = tmp.MyDocVersion.DocVersionConfig.SelectedSlave;
|
||||||
tranLookup.NewLookupNeeded += new TransitionLookupEvent(GetNewLookup);
|
tranLookup.NewLookupNeeded += new TransitionLookupEvent(GetNewLookup);
|
||||||
if (tmp.MyDocVersion.DocVersionConfig.SelectedSlave <= 0)
|
if (tmp.MyDocVersion.DocVersionConfig.SelectedSlave <= 0)
|
||||||
MyRefreshTransitions(tmp, tmp.MyDocVersion, null, tmp, tmp.MyDocVersion, tranLookup);
|
MyRefreshTransitions(tmp, tmp.MyDocVersion, null, tmp, tmp.MyDocVersion, tranLookup);
|
||||||
}
|
}
|
||||||
public static void RefreshReferenceObjects(ProcedureInfo tmp)
|
public static void RefreshReferenceObjects(ProcedureInfo tmp)
|
||||||
{
|
{
|
||||||
if (tmp.MyDocVersion.DocVersionConfig.SelectedSlave <= 0)
|
if (tmp.MyDocVersion.DocVersionConfig.SelectedSlave <= 0)
|
||||||
MyRefreshReferenceObjects(tmp, tmp.MyDocVersion, null, tmp.MyDocVersion);
|
MyRefreshReferenceObjects(tmp, tmp.MyDocVersion, null, tmp.MyDocVersion);
|
||||||
}
|
}
|
||||||
public static void RefreshPageNumTransitions(ProcedureInfo tmp)
|
public static void RefreshPageNumTransitions(ProcedureInfo tmp)
|
||||||
{
|
{
|
||||||
TransitionLookup tranLookup = new TransitionLookup(0, tmp.ItemID, tmp.MyLookup);
|
TransitionLookup tranLookup = new TransitionLookup(0, tmp.ItemID, tmp.MyLookup);
|
||||||
tranLookup.ApplicabilityUnit = tmp.MyDocVersion.DocVersionConfig.SelectedSlave;
|
tranLookup.ApplicabilityUnit = tmp.MyDocVersion.DocVersionConfig.SelectedSlave;
|
||||||
@ -6023,9 +6165,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
Database.LogException("ItemInfoList.DataPortal_Fetch", ex);
|
Database.LogException("ItemInfoList.DataPortal_Fetch", ex);
|
||||||
throw new DbCslaException("ItemInfoList.DataPortal_Fetch", ex);
|
throw new DbCslaException("ItemInfoList.DataPortal_Fetch", ex);
|
||||||
}
|
}
|
||||||
MyLookup = lookup;
|
MyLookup = lookup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[Serializable()]
|
[Serializable()]
|
||||||
public class ProcedureTransitionsCountCommand : CommandBase
|
public class ProcedureTransitionsCountCommand : CommandBase
|
||||||
@ -6144,7 +6286,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
private bool? _HasStepCheckOffs = null;
|
private bool? _HasStepCheckOffs = null;
|
||||||
public bool HasStepCheckOffs
|
public bool HasStepCheckOffs
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (_HasStepCheckOffs == null)
|
if (_HasStepCheckOffs == null)
|
||||||
{
|
{
|
||||||
@ -6152,7 +6294,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
//Console.WriteLine("{0},'{1}','{2}'", ItemID, ShortPath, _HasStepCheckOffs);
|
//Console.WriteLine("{0},'{1}','{2}'", ItemID, ShortPath, _HasStepCheckOffs);
|
||||||
}
|
}
|
||||||
return (bool)_HasStepCheckOffs;
|
return (bool)_HasStepCheckOffs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public bool HasInitials
|
public bool HasInitials
|
||||||
{
|
{
|
||||||
@ -6166,10 +6308,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
private static bool GetStepCheckOff(ItemInfo ii)
|
private static bool GetStepCheckOff(ItemInfo ii)
|
||||||
{
|
{
|
||||||
if (ii is StepInfo && ((ii as StepInfo).MyConfig as StepConfig).Step_CheckOffIndex > 1) return true;
|
if (ii is StepInfo && ((ii as StepInfo).MyConfig as StepConfig).Step_CheckOffIndex > 1) return true;
|
||||||
if(ii.MyContent.ContentParts != null)
|
if (ii.MyContent.ContentParts != null)
|
||||||
foreach(PartInfo pi in ii.MyContent.ContentParts)
|
foreach (PartInfo pi in ii.MyContent.ContentParts)
|
||||||
foreach(ItemInfo iic in pi.MyItems)
|
foreach (ItemInfo iic in pi.MyItems)
|
||||||
if(GetStepCheckOff(iic)) return true;
|
if (GetStepCheckOff(iic)) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//private int? _TemplateColumnMode
|
//private int? _TemplateColumnMode
|
||||||
@ -6242,7 +6384,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (Int32.TryParse(tmpstr, out x)) return x;
|
if (Int32.TryParse(tmpstr, out x)) return x;
|
||||||
// flag the case where the current section's tab already has prefixed in the parent's tab:
|
// flag the case where the current section's tab already has prefixed in the parent's tab:
|
||||||
// (without this, BGE's section headers were coming up as 6.1.6.1.1...)
|
// (without this, BGE's section headers were coming up as 6.1.6.1.1...)
|
||||||
if (IsSection && ActiveParent.IsSection)
|
if (IsSection && ActiveParent.IsSection)
|
||||||
{
|
{
|
||||||
if (DisplayNumber.StartsWith((ActiveParent as SectionInfo).DisplayNumber.Trim())) return -2;
|
if (DisplayNumber.StartsWith((ActiveParent as SectionInfo).DisplayNumber.Trim())) return -2;
|
||||||
}
|
}
|
||||||
|
@ -632,9 +632,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (GetType() == typeof(ProcedureInfo))
|
if (GetType() == typeof(ProcedureInfo) || MyContent.Type < 10000)
|
||||||
tmp = DataPortal.Fetch<ProcedureInfo>(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
|
tmp = DataPortal.Fetch<ProcedureInfo>(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
|
||||||
else if (GetType() == typeof(SectionInfo))
|
else if (GetType() == typeof(SectionInfo) || (MyContent.Type < 20000))
|
||||||
tmp = DataPortal.Fetch<SectionInfo>(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
|
tmp = DataPortal.Fetch<SectionInfo>(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
|
||||||
else
|
else
|
||||||
tmp = DataPortal.Fetch<StepInfo>(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
|
tmp = DataPortal.Fetch<StepInfo>(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
|
||||||
@ -838,19 +838,32 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Enhanced Document Support
|
#region Enhanced Document Support
|
||||||
|
public ItemInfo DoAddEnhancedSteps(int enhType, int enhItemID, EAddpingPart addpart)
|
||||||
|
{
|
||||||
|
// get the item object in the enhanced document so that inserting of the new enhanced item and
|
||||||
|
// its children can be done:
|
||||||
|
ItemInfo existingEnhancedItemInfo = ItemInfo.Get(enhItemID);
|
||||||
|
ItemInfo newEnhancedItemInfo = existingEnhancedItemInfo.InsertEnhancedSteps(MyContent.Text, null, addpart, MyContent.Type, enhType, ItemID);
|
||||||
|
if (newEnhancedItemInfo == null) return null;
|
||||||
|
StepConfig sc = new StepConfig(MyContent.Config);
|
||||||
|
sc.AddEnhancedDocument(enhType, newEnhancedItemInfo.ItemID);
|
||||||
|
SaveConfig(sc.ToString());
|
||||||
|
return newEnhancedItemInfo;
|
||||||
|
}
|
||||||
public ItemInfo InsertEnhancedSteps(string text, string number, EAddpingPart addType, int? type, int eDocType, int newSourceID)
|
public ItemInfo InsertEnhancedSteps(string text, string number, EAddpingPart addType, int? type, int eDocType, int newSourceID)
|
||||||
//public ItemInfo InsertEnhancedSiblingAfter(string text, string number, int? type, int eDocType, int newID)
|
|
||||||
{
|
{
|
||||||
ItemInfo tmp = null;
|
ItemInfo tmp = null;
|
||||||
if (addType == EAddpingPart.Child)
|
if (addType == EAddpingPart.Child)
|
||||||
{
|
{
|
||||||
E_FromType fromType = E_FromType.Caution;
|
E_FromType fromType = E_FromType.Caution;
|
||||||
if (ActiveFormat.PlantFormat.FormatData.StepDataList[(int)type- 20000].Type.ToUpper() == "NOTE") fromType = E_FromType.Note;
|
if (this.IsSection) fromType = E_FromType.Step;
|
||||||
|
else if (ActiveFormat.PlantFormat.FormatData.StepDataList[(int)type - 20000].Type.ToUpper() == "NOTE") fromType = E_FromType.Note;
|
||||||
tmp = InsertEnhancedSmartTemplateSubStep(text, number, this, addType, (int)type, fromType, newSourceID);
|
tmp = InsertEnhancedSmartTemplateSubStep(text, number, this, addType, (int)type, fromType, newSourceID);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
tmp = InsertEnhancedSmartTemplateSteps(text, number, this, addType, (int)type, newSourceID);
|
tmp = InsertEnhancedSmartTemplateSteps(text, number, this, addType, 20002, newSourceID);
|
||||||
//ItemInfo tmp = InsertEnhancedSmartTemplateSteps(text, number, this, EAddpingPart.After, (int)MyContent.Type, newID);
|
if (tmp == null) return null;
|
||||||
|
|
||||||
// if next exists, it is updated in SQL so we have to manually force the iteminfo updates
|
// if next exists, it is updated in SQL so we have to manually force the iteminfo updates
|
||||||
// Refresh ItemInfo to update PreviousID field
|
// Refresh ItemInfo to update PreviousID field
|
||||||
if (tmp.NextItem != null) using (Item item = tmp.NextItem.Get()) ItemInfo.Refresh(item);
|
if (tmp.NextItem != null) using (Item item = tmp.NextItem.Get()) ItemInfo.Refresh(item);
|
||||||
@ -858,14 +871,21 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// if inserting after a caution or note, refreshes tabs. This will adjust bullets
|
// if inserting after a caution or note, refreshes tabs. This will adjust bullets
|
||||||
// of any previous cautions or notes.
|
// of any previous cautions or notes.
|
||||||
if (tmp.IsCaution || tmp.IsNote) ResetOrdinal();
|
if (tmp.IsCaution || tmp.IsNote) ResetOrdinal();
|
||||||
// Update all of the content records that have transitions that point to the Siblings or Sibling Children of the new item
|
// Note that non-enhanced update transition and ro text at this point. But since
|
||||||
//tmp.UpdateTransitionText();
|
// transitions and ro's are converted to text, this is not needed.
|
||||||
tmp.UpdateROText();
|
|
||||||
//?? OnNewSiblingAfter(new ItemInfoInsertEventArgs(tmp, EAddpingPart.After));
|
if (addType == EAddpingPart.Child)
|
||||||
|
OnNewChild(new ItemInfoInsertEventArgs(tmp, EAddpingPart.Child));
|
||||||
|
else if (addType == EAddpingPart.After)
|
||||||
|
{
|
||||||
|
OnNewSiblingAfter(new ItemInfoInsertEventArgs(tmp, EAddpingPart.After));
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (addType == EAddpingPart.Before)
|
||||||
|
OnNewSiblingBefore(new ItemInfoInsertEventArgs(tmp, EAddpingPart.Before));
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
private ItemInfo InsertEnhancedSmartTemplateSubStep(string text, string number, ItemInfo tmp, EAddpingPart addType, int type, E_FromType fromTypeTop, int newSourceID)
|
||||||
private ItemInfo InsertEnhancedSmartTemplateSubStep(string text, string number, ItemInfo tmp, EAddpingPart addType, int type, E_FromType fromTypeTop, int newID)
|
|
||||||
{
|
{
|
||||||
int newItemID = 0;
|
int newItemID = 0;
|
||||||
int topType = GetSmartTemplateTopLevelIndxOfThisType(type);
|
int topType = GetSmartTemplateTopLevelIndxOfThisType(type);
|
||||||
@ -882,11 +902,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
if (firstSmart == null)
|
if (firstSmart == null)
|
||||||
{
|
{
|
||||||
// set stepconfig for this new enhanced item:
|
|
||||||
StepConfig sc = new StepConfig("");
|
StepConfig sc = new StepConfig("");
|
||||||
sc.AddEnhancedDocument(0, newID);
|
sc.AddEnhancedDocument(0, newSourceID);
|
||||||
|
firstSmart = NewItemInfoFetch(ItemID, addType, number, tmptext, type, (int?)fromTypeTop, null, sc.ToString(), DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
|
||||||
firstSmart = NewItemInfoFetch(ItemID, addType, number, tmptext, type, (int?)fromTypeTop, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
|
|
||||||
siblingSmart = firstSmart;
|
siblingSmart = firstSmart;
|
||||||
newItemID = firstSmart.ItemID;
|
newItemID = firstSmart.ItemID;
|
||||||
}
|
}
|
||||||
@ -942,10 +960,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (firstSmart == null)
|
if (firstSmart == null)
|
||||||
{
|
{
|
||||||
// set stepconfig for this new enhanced item:
|
// set stepconfig for this new enhanced item:
|
||||||
StepConfig sc = new StepConfig("" );
|
StepConfig sc = new StepConfig("");
|
||||||
sc.AddEnhancedDocument(0, newSourceID);
|
sc.AddEnhancedDocument(0, newSourceID);
|
||||||
firstSmart = CopyPasteItemInfoFetch(newSourceID, this.ItemID, type, type, eAddpingPart);
|
firstSmart = NewItemInfoFetch(ItemID, eAddpingPart, number, tmptext, type, null, null, sc.ToString(), DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
|
||||||
//firstSmart = NewItemInfoFetch(ItemID, eAddpingPart, number, tmptext, type, null, null, sc.ToString(), DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
|
|
||||||
siblingSmart = parentSmart = firstSmart;
|
siblingSmart = parentSmart = firstSmart;
|
||||||
newItemID = firstSmart.ItemID;
|
newItemID = firstSmart.ItemID;
|
||||||
}
|
}
|
||||||
@ -983,8 +1000,424 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
tmp = firstSmart;
|
tmp = firstSmart;
|
||||||
}
|
}
|
||||||
|
|
||||||
return tmp;
|
return tmp;
|
||||||
|
}
|
||||||
|
public ItemInfo EnhancedPasteItem(int copyStartID, ItemInfo pasteFromItem, EAddpingPart addType, string chgid)
|
||||||
|
{
|
||||||
|
EnhancedDocuments pasteFromItemsEnhancedDocuments = pasteFromItem.GetMyEnhancedDocuments();
|
||||||
|
if (pasteFromItemsEnhancedDocuments == null || pasteFromItemsEnhancedDocuments.Count == 0) return null;
|
||||||
|
ItemInfo newItemInfo = this;
|
||||||
|
ItemInfo newEnhancedItemInfo = null;
|
||||||
|
// need to save the original item ids in the copied item so that they can be
|
||||||
|
// changed to the new enhanced ids in 'config'. The oldid/newid pairs will
|
||||||
|
// be stored in a dictionary & the update will be made after the loop.
|
||||||
|
Dictionary<int, int> oldToNewEnhancedIds = new Dictionary<int, int>();
|
||||||
|
|
||||||
|
// tmpCopyStartSourceItem is the item that was copied in source.
|
||||||
|
ItemInfo tmpCopyStartSourceItem = ItemInfo.Get(copyStartID);
|
||||||
|
|
||||||
|
// loop through all enhanced document types, pasting in the copied item(s).
|
||||||
|
// Note that the copy/paste finds the enhanced items that relate to source,
|
||||||
|
// i.e. copied item & paste from, and uses those to do the copy/paste.
|
||||||
|
// sc is the config (passed in) for the item that we are pasting around.
|
||||||
|
foreach (EnhancedDocument edSource in pasteFromItem.GetMyEnhancedDocuments())
|
||||||
|
{
|
||||||
|
if (edSource.Type != 0)
|
||||||
|
{
|
||||||
|
ItemInfo tmpPasteItemFrom = ItemInfo.Get(edSource.ItemID); // here is problem
|
||||||
|
|
||||||
|
// get the 'enhanced' item to copy. To do this, get the enhanced link
|
||||||
|
// from source's config that matches this 'type'. Use that Id to get the enhanced
|
||||||
|
// Item that is to be copied:
|
||||||
|
int tmpCopyEnhancedID = 0;
|
||||||
|
foreach (EnhancedDocument edCopy in tmpCopyStartSourceItem.GetMyEnhancedDocuments())
|
||||||
|
{
|
||||||
|
if (edSource.Type == edCopy.Type)
|
||||||
|
{
|
||||||
|
tmpCopyEnhancedID = edCopy.ItemID;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (tmpCopyEnhancedID == 0) break; // no connected copied item.
|
||||||
|
if (addType == EAddpingPart.Before)
|
||||||
|
newEnhancedItemInfo = tmpPasteItemFrom.PasteSiblingBefore(tmpCopyEnhancedID, chgid);
|
||||||
|
else if (addType == EAddpingPart.After)
|
||||||
|
newEnhancedItemInfo = tmpPasteItemFrom.PasteSiblingAfter(tmpCopyEnhancedID, chgid);
|
||||||
|
else if (addType == EAddpingPart.Child)
|
||||||
|
newEnhancedItemInfo = tmpPasteItemFrom.PasteChild(tmpCopyEnhancedID, chgid);
|
||||||
|
else if (addType == EAddpingPart.Replace) // what about user interface for enhanced pasted steps?
|
||||||
|
{
|
||||||
|
ItemInfo enhReplaceItem = ItemInfo.Get(edSource.ItemID);
|
||||||
|
newEnhancedItemInfo = Item.PasteReplace(enhReplaceItem, tmpCopyEnhancedID, chgid);
|
||||||
|
}
|
||||||
|
|
||||||
|
// update the config data for the new enhanced item (procedure, section or step) to point back to the correct source
|
||||||
|
string cfgEnhStr = null;
|
||||||
|
if (newEnhancedItemInfo.IsStep)
|
||||||
|
{
|
||||||
|
StepConfig scnewenh = newEnhancedItemInfo.MyConfig as StepConfig;
|
||||||
|
if (scnewenh == null) break; //error here, i.e. should have a related enhanced step
|
||||||
|
scnewenh.MyEnhancedDocuments[0].ItemID = newItemInfo.ItemID;
|
||||||
|
scnewenh.SaveEnhancedDocuments();
|
||||||
|
cfgEnhStr = scnewenh.ToString();
|
||||||
|
}
|
||||||
|
else if (newEnhancedItemInfo.IsSection)
|
||||||
|
{
|
||||||
|
SectionConfig secnewenh = newEnhancedItemInfo.MyConfig as SectionConfig;
|
||||||
|
if (secnewenh == null) break; //error here, i.e. should have a related enhanced step
|
||||||
|
secnewenh.MyEnhancedDocuments[0].ItemID = newItemInfo.ItemID;
|
||||||
|
secnewenh.SaveEnhancedDocuments();
|
||||||
|
cfgEnhStr = secnewenh.ToString();
|
||||||
|
}
|
||||||
|
else if (newEnhancedItemInfo.IsProcedure)
|
||||||
|
{
|
||||||
|
ProcedureConfig pnewenh = newEnhancedItemInfo.MyConfig as ProcedureConfig;
|
||||||
|
if (pnewenh == null) break; //error here, i.e. should have a related enhanced step
|
||||||
|
pnewenh.MyEnhancedDocuments[0].ItemID = newItemInfo.ItemID;
|
||||||
|
pnewenh.SaveEnhancedDocuments();
|
||||||
|
cfgEnhStr = pnewenh.ToString();
|
||||||
|
}
|
||||||
|
if (cfgEnhStr != null) newEnhancedItemInfo.SaveConfig(cfgEnhStr);
|
||||||
|
// save the new enhanced step ids to set in the new source's config (to relate steps)
|
||||||
|
foreach (EnhancedDocument edNew in newItemInfo.GetMyEnhancedDocuments())
|
||||||
|
{
|
||||||
|
if (edNew.ItemID == tmpCopyEnhancedID) oldToNewEnhancedIds.Add(edNew.ItemID, newEnhancedItemInfo.ItemID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// update the config to point to new enhanced document steps for the new source item
|
||||||
|
if (oldToNewEnhancedIds.Count > 0)
|
||||||
|
{
|
||||||
|
// save the updated config info on the newly pasted source: step, section or procedure:
|
||||||
|
string cfgNewSrc = null;
|
||||||
|
if (newItemInfo.IsStep)
|
||||||
|
{
|
||||||
|
StepConfig scnewpst1 = newItemInfo.MyConfig as StepConfig;
|
||||||
|
foreach (EnhancedDocument edOrig in scnewpst1.MyEnhancedDocuments)
|
||||||
|
edOrig.ItemID = oldToNewEnhancedIds[edOrig.ItemID];
|
||||||
|
scnewpst1.SaveEnhancedDocuments();
|
||||||
|
cfgNewSrc = scnewpst1.ToString();
|
||||||
|
}
|
||||||
|
else if (newItemInfo.IsSection)
|
||||||
|
{
|
||||||
|
SectionConfig secnewpst1 = newItemInfo.MyConfig as SectionConfig;
|
||||||
|
foreach (EnhancedDocument edOrig in secnewpst1.MyEnhancedDocuments)
|
||||||
|
edOrig.ItemID = oldToNewEnhancedIds[edOrig.ItemID];
|
||||||
|
secnewpst1.SaveEnhancedDocuments();
|
||||||
|
cfgNewSrc = secnewpst1.ToString();
|
||||||
|
}
|
||||||
|
else if (newItemInfo.IsProcedure)
|
||||||
|
{
|
||||||
|
ProcedureConfig pnewpst1 = newItemInfo.MyConfig as ProcedureConfig;
|
||||||
|
foreach (EnhancedDocument edOrig in pnewpst1.MyEnhancedDocuments)
|
||||||
|
edOrig.ItemID = oldToNewEnhancedIds[edOrig.ItemID];
|
||||||
|
pnewpst1.SaveEnhancedDocuments();
|
||||||
|
cfgNewSrc = pnewpst1.ToString();
|
||||||
|
}
|
||||||
|
if (cfgNewSrc != null) newItemInfo.SaveConfig(cfgNewSrc);
|
||||||
|
}
|
||||||
|
// if this is a HLS, then need to adjust links between any associated notes/cautions too:
|
||||||
|
if (newItemInfo.IsStep)
|
||||||
|
{
|
||||||
|
StepConfig scForNC = newItemInfo.MyConfig as StepConfig;
|
||||||
|
foreach (EnhancedDocument ed in scForNC.MyEnhancedDocuments) EnhancedSetNoteCautionLinks(newItemInfo, ed.Type);
|
||||||
|
}
|
||||||
|
return newEnhancedItemInfo;
|
||||||
|
}
|
||||||
|
#region HandleEnhancedNoteCautionConfigLinks
|
||||||
|
private static void EnhancedSetNoteCautionLinks(ItemInfo newItemInfo, int enhType)
|
||||||
|
{
|
||||||
|
// For this enhanced document type, adjust all of the ids to link between source & enhanced if there are
|
||||||
|
// notes & cautions. Notes first. There may be some source notes that aren't linked and some enhanced
|
||||||
|
// that are not linked, so account for this.
|
||||||
|
// get the high level enhanced step, this will be used for both note & caution code:
|
||||||
|
ItemInfo enhHls = null;
|
||||||
|
foreach (EnhancedDocument enh in newItemInfo.GetMyEnhancedDocuments())
|
||||||
|
{
|
||||||
|
if (enh.Type == enhType)
|
||||||
|
{
|
||||||
|
enhHls = ItemInfo.Get(enh.ItemID);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (newItemInfo.IsHigh && enhHls != null && newItemInfo.Notes != null && newItemInfo.Notes.Count > 0)
|
||||||
|
{
|
||||||
|
int srcIndxNt = 0;
|
||||||
|
int enhIndxNt = 0;
|
||||||
|
// for each note association between the source & enhanced document, update
|
||||||
|
// the config items to link them.
|
||||||
|
ItemInfo srcNtItem = newItemInfo.Notes[srcIndxNt];
|
||||||
|
while (srcNtItem != null)
|
||||||
|
{
|
||||||
|
StepConfig scSourceNote = newItemInfo.Notes[srcIndxNt].MyConfig as StepConfig;
|
||||||
|
if (scSourceNote.MyEnhancedDocuments.Count > 0)
|
||||||
|
{
|
||||||
|
// Loop through for each enhanced document related to the pasted source HLS
|
||||||
|
foreach (EnhancedDocument enh in srcNtItem.GetMyEnhancedDocuments())
|
||||||
|
{
|
||||||
|
if (enh.Type == enhType)
|
||||||
|
{
|
||||||
|
// Find hls in enhanced in order to get its notes to set their config to
|
||||||
|
// point back to the new source's note itemid. There may be enhanced items that
|
||||||
|
// don't connect back, so find one that does based on Enhance HLS note list &
|
||||||
|
// the notes' links back to source.
|
||||||
|
ItemInfo enhNtItem = null;
|
||||||
|
while (enhNtItem == null && enhIndxNt < enhHls.Notes.Count)
|
||||||
|
{
|
||||||
|
ItemInfo enhTstNote = enhHls.Notes[enhIndxNt];
|
||||||
|
StepConfig enhTstNoteCfg = enhTstNote.MyConfig as StepConfig;
|
||||||
|
if (enhTstNoteCfg.MyEnhancedDocuments.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (EnhancedDocument enhNt in enhTstNote.GetMyEnhancedDocuments())
|
||||||
|
{
|
||||||
|
if (enhNt.Type == 0) // found it:
|
||||||
|
{
|
||||||
|
enhNtItem = enhTstNote;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (enhNtItem == null) enhIndxNt++;
|
||||||
|
}
|
||||||
|
if (enhNtItem != null)
|
||||||
|
{
|
||||||
|
StepConfig scNewEnhancedNote = enhNtItem.MyConfig as StepConfig;
|
||||||
|
scNewEnhancedNote.MyEnhancedDocuments[0].ItemID = newItemInfo.Notes[srcIndxNt].ItemID;
|
||||||
|
scNewEnhancedNote.SaveEnhancedDocuments();
|
||||||
|
enhNtItem.SaveConfig(scNewEnhancedNote.ToString());
|
||||||
|
foreach (EnhancedDocument noteEnh in scSourceNote.MyEnhancedDocuments)
|
||||||
|
{
|
||||||
|
if (noteEnh.Type == enhType)
|
||||||
|
{
|
||||||
|
noteEnh.ItemID = enhHls.Notes[enhIndxNt].ItemID;
|
||||||
|
scSourceNote.SaveEnhancedDocuments();
|
||||||
|
newItemInfo.Notes[srcIndxNt].SaveConfig(scSourceNote.ToString());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
enhIndxNt++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
srcIndxNt++;
|
||||||
|
srcNtItem = srcIndxNt>=newItemInfo.Notes.Count?null:newItemInfo.Notes[srcIndxNt];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// now do any cautions.
|
||||||
|
if (newItemInfo.IsHigh && newItemInfo.Cautions != null && newItemInfo.Cautions.Count > 0)
|
||||||
|
{
|
||||||
|
int srcIndxCt = 0;
|
||||||
|
int enhIndxCt = 0;
|
||||||
|
// for each caution association between the source & enhanced document, update
|
||||||
|
// the config items to link them.
|
||||||
|
ItemInfo srcCtItem = newItemInfo.Cautions[srcIndxCt];
|
||||||
|
while (srcCtItem != null)
|
||||||
|
{
|
||||||
|
StepConfig scSourceCaution = newItemInfo.Cautions[srcIndxCt].MyConfig as StepConfig;
|
||||||
|
if (scSourceCaution.MyEnhancedDocuments.Count > 0)
|
||||||
|
{
|
||||||
|
// Loop through for each enhanced document related to the pasted source HLS
|
||||||
|
foreach (EnhancedDocument enh in srcCtItem.GetMyEnhancedDocuments())
|
||||||
|
{
|
||||||
|
if (enh.Type == enhType)
|
||||||
|
{
|
||||||
|
// Find hls in enhanced in order to get its notes to set their config to
|
||||||
|
// point back to the new source's note itemid.
|
||||||
|
ItemInfo enhCtItem = null;
|
||||||
|
while (enhCtItem == null && enhIndxCt < enhHls.Cautions.Count)
|
||||||
|
{
|
||||||
|
ItemInfo enhTstCaut = enhHls.Cautions[enhIndxCt];
|
||||||
|
StepConfig enhTstCautCfg = enhTstCaut.MyConfig as StepConfig;
|
||||||
|
if (enhTstCautCfg.MyEnhancedDocuments.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (EnhancedDocument enhCt in enhTstCaut.GetMyEnhancedDocuments())
|
||||||
|
{
|
||||||
|
if (enhCt.Type == 0)
|
||||||
|
{
|
||||||
|
enhCtItem = enhTstCaut;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (enhCtItem == null) enhIndxCt++;
|
||||||
|
}
|
||||||
|
if (enhCtItem != null)
|
||||||
|
{
|
||||||
|
StepConfig scNewEnhancedCaution = enhCtItem.MyConfig as StepConfig;
|
||||||
|
scNewEnhancedCaution.MyEnhancedDocuments[0].ItemID = newItemInfo.Cautions[srcIndxCt].ItemID;
|
||||||
|
scNewEnhancedCaution.SaveEnhancedDocuments();
|
||||||
|
enhCtItem.SaveConfig(scNewEnhancedCaution.ToString());
|
||||||
|
foreach (EnhancedDocument cautionEnh in scSourceCaution.MyEnhancedDocuments)
|
||||||
|
{
|
||||||
|
if (cautionEnh.Type == enh.Type)
|
||||||
|
{
|
||||||
|
cautionEnh.ItemID = enhHls.Cautions[enhIndxCt].ItemID;
|
||||||
|
scSourceCaution.SaveEnhancedDocuments();
|
||||||
|
newItemInfo.Cautions[srcIndxCt].SaveConfig(scSourceCaution.ToString());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
enhIndxCt++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
srcIndxCt++;
|
||||||
|
srcCtItem = srcIndxCt >= newItemInfo.Cautions.Count ? null : newItemInfo.Cautions[srcIndxCt];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
#region HandleEnhancedStepConfigLinks
|
||||||
|
private void EnhancedSetStepLinks(ItemInfo newSourceSectionInfo, int enhType)
|
||||||
|
{
|
||||||
|
//for the input source section, link all HLS to enhanced HLS (and any associated cautions/notes). Note that
|
||||||
|
// this assumes that all source steps are linked, but there may be 'deleted' steps in enhanced that may not be linked back.
|
||||||
|
ItemInfo newEnhSectionInfo = null;
|
||||||
|
ItemInfo enhStep = null; // in enhanced document, find first step that has links (there may be enhanced steps that don't have links)
|
||||||
|
SectionConfig newSectCfg = newSourceSectionInfo.MyConfig as SectionConfig;
|
||||||
|
foreach (EnhancedDocument ed in newSectCfg.MyEnhancedDocuments)
|
||||||
|
{
|
||||||
|
if (ed.Type == enhType)
|
||||||
|
{
|
||||||
|
newEnhSectionInfo = ItemInfo.Get(ed.ItemID);
|
||||||
|
StepConfig cfg = newEnhSectionInfo.Steps[0].MyConfig as StepConfig;
|
||||||
|
if (cfg.MyEnhancedDocuments.Count > 0) enhStep = newEnhSectionInfo.Steps[0];
|
||||||
|
else enhStep = GetNextEnhancedStep(newEnhSectionInfo.Steps[0]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (enhStep == null) return;
|
||||||
|
// now adjust all of the ids to link between source & enhanced for this section's steps.
|
||||||
|
// The enhType represents which enhanced document we are working with, for example, backgrounds or deviations.
|
||||||
|
for (int iStp = 0; iStp < newSourceSectionInfo.Steps.Count; iStp++)
|
||||||
|
{
|
||||||
|
StepConfig scSourceStep = newSourceSectionInfo.Steps[iStp].MyConfig as StepConfig;
|
||||||
|
if (scSourceStep.MyEnhancedDocuments.Count > 0)
|
||||||
|
{
|
||||||
|
// Loop through for each enhanced document related to the pasted source HLS
|
||||||
|
foreach (EnhancedDocument enh in scSourceStep.MyEnhancedDocuments)
|
||||||
|
{
|
||||||
|
if (enh.Type == enhType)
|
||||||
|
{
|
||||||
|
// Find hls in enhanced in order to set the config to point back to the new source's itemid.
|
||||||
|
ItemInfo enhHls = enhStep;
|
||||||
|
StepConfig scNewEnhancedStep = enhHls.MyConfig as StepConfig;
|
||||||
|
scNewEnhancedStep.MyEnhancedDocuments[0].ItemID = newSourceSectionInfo.Steps[iStp].ItemID;
|
||||||
|
scNewEnhancedStep.SaveEnhancedDocuments();
|
||||||
|
enhHls.SaveConfig(scNewEnhancedStep.ToString());
|
||||||
|
// set the source to go to this enh.
|
||||||
|
enh.ItemID = enhHls.ItemID;
|
||||||
|
scSourceStep.SaveEnhancedDocuments();
|
||||||
|
newSourceSectionInfo.Steps[iStp].SaveConfig(scSourceStep.ToString());
|
||||||
|
EnhancedSetNoteCautionLinks(newSourceSectionInfo.Steps[iStp], enhType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
enhStep = GetNextEnhancedStep(enhStep);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private ItemInfo GetNextEnhancedStep(ItemInfo itemInfo)
|
||||||
|
{
|
||||||
|
if (itemInfo==null) return null;
|
||||||
|
ItemInfo curStep = itemInfo.NextItem;
|
||||||
|
while (curStep != null)
|
||||||
|
{
|
||||||
|
StepConfig cfg = curStep.MyConfig as StepConfig;
|
||||||
|
if (cfg.MyEnhancedDocuments.Count > 0) return curStep;
|
||||||
|
curStep = curStep.NextItem;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
private ItemInfo GetNextEnhancedSection(ItemInfo itemInfo)
|
||||||
|
{
|
||||||
|
if (itemInfo == null) return null;
|
||||||
|
ItemInfo curSect = itemInfo.NextItem;
|
||||||
|
while (curSect != null)
|
||||||
|
{
|
||||||
|
SectionConfig cfg = curSect.MyConfig as SectionConfig;
|
||||||
|
if (cfg.MyEnhancedDocuments.Count > 0) return curSect;
|
||||||
|
curSect = curSect.NextItem;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
public ItemInfo PasteEnhancedItems(int copyStartID, ItemInfo pasteFromItem, EAddpingPart addType, string chgid)
|
||||||
|
{
|
||||||
|
ItemInfo retItem = null;
|
||||||
|
if (IsProcedure) // newly Pasted Item is a procedure.
|
||||||
|
{
|
||||||
|
// the following pastes each type of enhanced procedure, including its sections/steps
|
||||||
|
EnhancedPasteItem(copyStartID, pasteFromItem, addType, chgid);
|
||||||
|
// for each enhanced type for this procedure, adjust the config data for its sections/steps:
|
||||||
|
ProcedureConfig sourceProcConfig = this.MyConfig as ProcedureConfig;
|
||||||
|
foreach (EnhancedDocument enhProc in sourceProcConfig.MyEnhancedDocuments)
|
||||||
|
{
|
||||||
|
if (enhProc.Type != 0)
|
||||||
|
{
|
||||||
|
ItemInfo pastedEnhancedProc = ItemInfo.Get(enhProc.ItemID);
|
||||||
|
// get the first enhanced section, there may be non-linked sections before first linked section:
|
||||||
|
SectionConfig firstEnhSectionConfig = pastedEnhancedProc.Sections == null ? null : pastedEnhancedProc.Sections[0].MyConfig as SectionConfig;
|
||||||
|
ItemInfo pastedEnhancedCurrentSection = null;
|
||||||
|
if (firstEnhSectionConfig.MyEnhancedDocuments.Count > 0) pastedEnhancedCurrentSection = pastedEnhancedProc.Sections[0];
|
||||||
|
else pastedEnhancedCurrentSection = GetNextEnhancedSection(pastedEnhancedProc.Sections[0]);
|
||||||
|
|
||||||
|
// newly pasted procedure has sections/steps, need to adjust 'MyEnhancedDocuments' config items to point to correct
|
||||||
|
if (Sections != null)
|
||||||
|
{
|
||||||
|
foreach (ItemInfo sourceSect in Sections)
|
||||||
|
{
|
||||||
|
SectionConfig srcCfg = sourceSect.MyConfig as SectionConfig;
|
||||||
|
if (srcCfg != null && (srcCfg.Section_LnkEnh=="Y" || srcCfg.Section_LnkEnh=="T") && srcCfg.MyEnhancedDocuments != null && srcCfg.MyEnhancedDocuments.Count > 0)
|
||||||
|
{
|
||||||
|
// use pastedEnhancedCurrentSection to link to:
|
||||||
|
foreach (EnhancedDocument ed in srcCfg.MyEnhancedDocuments)
|
||||||
|
{
|
||||||
|
if (ed.Type == enhProc.Type)
|
||||||
|
{
|
||||||
|
ed.ItemID = pastedEnhancedCurrentSection.ItemID;
|
||||||
|
srcCfg.SaveEnhancedDocuments();
|
||||||
|
sourceSect.SaveConfig(srcCfg.ToString());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SectionConfig enhSectCfg = pastedEnhancedCurrentSection.MyConfig as SectionConfig;
|
||||||
|
enhSectCfg.MyEnhancedDocuments[0].ItemID = sourceSect.ItemID;
|
||||||
|
enhSectCfg.SaveEnhancedDocuments();
|
||||||
|
pastedEnhancedCurrentSection.SaveConfig(enhSectCfg.ToString());
|
||||||
|
if (srcCfg.Section_LnkEnh == "Y") EnhancedSetStepLinks(sourceSect, enhProc.Type); //if steps, do them for this type
|
||||||
|
pastedEnhancedCurrentSection = GetNextEnhancedSection(pastedEnhancedCurrentSection);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
retItem = null;
|
||||||
|
}
|
||||||
|
else if (IsSection)
|
||||||
|
{
|
||||||
|
ItemInfo pastedSect = EnhancedPasteItem(copyStartID, pasteFromItem, addType, chgid);
|
||||||
|
SectionConfig sourceSectConfig = this.MyConfig as SectionConfig;
|
||||||
|
foreach (EnhancedDocument enhSect in sourceSectConfig.MyEnhancedDocuments)
|
||||||
|
if (enhSect.Type != 0) EnhancedSetStepLinks(this, enhSect.Type);
|
||||||
|
retItem = pastedSect;
|
||||||
|
}
|
||||||
|
else if (pasteFromItem.IsStep || (pasteFromItem.IsSection && addType == EAddpingPart.Child))
|
||||||
|
{
|
||||||
|
ItemInfo pastedStep = EnhancedPasteItem(copyStartID, pasteFromItem, addType, chgid);
|
||||||
|
retItem = pastedStep;
|
||||||
|
}
|
||||||
|
return retItem;
|
||||||
|
}
|
||||||
|
private void SaveConfig(string cfg)
|
||||||
|
{
|
||||||
|
using (Content c1 = Content.Get(ContentID))
|
||||||
|
{
|
||||||
|
c1.Config = cfg;
|
||||||
|
c1.Save();
|
||||||
|
}
|
||||||
|
RefreshConfig();
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region DataPortal
|
#region DataPortal
|
||||||
|
@ -180,7 +180,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
// gets here if other session has working draft open & click on sam working draft.
|
// gets here if other session has working draft open & click on sam working draft.
|
||||||
OwnerInfo oi = OwnerInfo.GetBySessionIDandVersionID(si.SessionID, objectID);
|
OwnerInfo oi = OwnerInfo.GetBySessionIDandVersionID(si.SessionID, objectID);
|
||||||
if(oi.OwnerType == 0)
|
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;
|
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 == 1)
|
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;
|
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;
|
||||||
|
@ -186,7 +186,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
AddingSub = 8,
|
AddingSub = 8,
|
||||||
AddingTable = 16,
|
AddingTable = 16,
|
||||||
AddingNext = 32,
|
AddingNext = 32,
|
||||||
AddingPrev = 64
|
AddingPrev = 64,
|
||||||
|
EnhancedLinkedStep = 128 // this will flag that this is a linked step & should not allow inserts/deletes
|
||||||
}
|
}
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum E_ReplaceFlags : uint
|
public enum E_ReplaceFlags : uint
|
||||||
|
@ -623,18 +623,22 @@ namespace VEPROMS.CSLA.Library
|
|||||||
foreach (ContentInfo tmpInfo in _CacheByPrimaryKey[key])
|
foreach (ContentInfo tmpInfo in _CacheByPrimaryKey[key])
|
||||||
{
|
{
|
||||||
tmpInfo.RefreshFields(tmp);
|
tmpInfo.RefreshFields(tmp);
|
||||||
// TODO: This needs to be handled in Generatedd Code.
|
// TODO: This needs to be handled in Generated Code.
|
||||||
if (tmp.LocalEntry != null && tmpInfo.MyEntry != null && tmp.MyEntry.MyDocument.DocID != tmpInfo.MyEntry.MyDocument.DocID)
|
if (tmp.LocalEntry != null && tmpInfo.MyEntry != null && tmp.MyEntry.MyDocument.DocID != tmpInfo.MyEntry.MyDocument.DocID)
|
||||||
EntryInfo.Refresh(tmp.MyEntry);
|
EntryInfo.Refresh(tmp.MyEntry);
|
||||||
}
|
}
|
||||||
// Update Enhanced Document Text
|
// Update Enhanced Document Text
|
||||||
StepConfig sc = new StepConfig(tmp.Config);
|
StepConfig sc = new StepConfig(tmp.Config);
|
||||||
foreach (EnhancedDocument ed in sc.MyEnhancedDocuments)
|
foreach (EnhancedDocument ed in sc.MyEnhancedDocuments)
|
||||||
{ // The following should be replaced by KBR
|
{
|
||||||
ItemInfo ii = ItemInfo.Get(ed.ItemID);
|
// Without this 'if' infinite loop. Only update text if in source and updating to point to enhanced.
|
||||||
Content cc = ii.MyContent.Get();
|
if (ed.Type != 0)
|
||||||
cc.Text = tmp.Text;
|
{
|
||||||
cc.Save();
|
ItemInfo ii = ItemInfo.Get(ed.ItemID);
|
||||||
|
DisplayText dt = new DisplayText(ii, ii.MyContent.Text, false);
|
||||||
|
string str = ItemInfo.Get(tmp.ContentItems[0].ItemID).DisplayText;
|
||||||
|
dt.Save(str);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected virtual void RefreshFields(Content tmp)
|
protected virtual void RefreshFields(Content tmp)
|
||||||
|
BIN
PROMS/Volian.Controls.Library/DisplayHistory.designer.cs
generated
BIN
PROMS/Volian.Controls.Library/DisplayHistory.designer.cs
generated
Binary file not shown.
@ -230,7 +230,8 @@ namespace Volian.Controls.Library
|
|||||||
//btnCancelRO.Enabled = ((_SavCurROLink != null) && chld.roid.Substring(0, 12).ToLower() != SavROLink.ROID.Substring(0, 12).ToLower());
|
//btnCancelRO.Enabled = ((_SavCurROLink != null) && chld.roid.Substring(0, 12).ToLower() != SavROLink.ROID.Substring(0, 12).ToLower());
|
||||||
string childroid = chld.roid.ToLower() + "0000";
|
string childroid = chld.roid.ToLower() + "0000";
|
||||||
childroid = childroid.Substring(0, 16);
|
childroid = childroid.Substring(0, 16);
|
||||||
btnSaveRO.Enabled = UserInfo.CanEdit(MyUserInfo, Mydvi) && ((_SavCurROLink == null) || !(childroid.Equals(SavROLink.ROID.ToLower()))); //added security check (UserInfo.CanEdit)
|
bool isenh = MyRTB != null && MyRTB.MyItemInfo != null && MyRTB.MyItemInfo.IsEnhancedStep;
|
||||||
|
btnSaveRO.Enabled = !isenh && UserInfo.CanEdit(MyUserInfo, Mydvi) && ((_SavCurROLink == null) || !(childroid.Equals(SavROLink.ROID.ToLower()))); //added security check (UserInfo.CanEdit)
|
||||||
btnCancelRO.Enabled = ((_SavCurROLink != null) && childroid != SavROLink.ROID.ToLower());
|
btnCancelRO.Enabled = ((_SavCurROLink != null) && childroid != SavROLink.ROID.ToLower());
|
||||||
btnGoToRO.Enabled = UserInfo.CanEditROs(MyUserInfo, Mydvi); // Writers and Reviewers cannot edit ROs (run the RO Editor)
|
btnGoToRO.Enabled = UserInfo.CanEditROs(MyUserInfo, Mydvi); // Writers and Reviewers cannot edit ROs (run the RO Editor)
|
||||||
switch (chld.type)
|
switch (chld.type)
|
||||||
|
@ -48,12 +48,39 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
public partial class DisplayTabControl : UserControl
|
public partial class DisplayTabControl : UserControl
|
||||||
{
|
{
|
||||||
|
private static bool _SyncronizeEnahnced = false;
|
||||||
|
public static bool SyncronizeEnhanced
|
||||||
|
{
|
||||||
|
get { return DisplayTabControl._SyncronizeEnahnced; }
|
||||||
|
set { DisplayTabControl._SyncronizeEnahnced = value; }
|
||||||
|
}
|
||||||
|
private static Dictionary<int, DisplayTabControl> _AllDTCs = new Dictionary<int, DisplayTabControl>();
|
||||||
|
private int? _VersionID = null;
|
||||||
|
public int? VersionID
|
||||||
|
{
|
||||||
|
get { return _VersionID; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_AllDTCs.ContainsKey((int)value))
|
||||||
|
_AllDTCs[(int)value] = this;
|
||||||
|
else
|
||||||
|
_AllDTCs.Add((int)value, this);
|
||||||
|
_VersionID = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public event ItemSelectedChangedEvent OpenEnhancedDocument;
|
public event ItemSelectedChangedEvent OpenEnhancedDocument;
|
||||||
public void OnOpenEnhancedDocument(ItemSelectedChangedEventArgs args)
|
public void OnOpenEnhancedDocument(ItemSelectedChangedEventArgs args)
|
||||||
{
|
{
|
||||||
if (OpenEnhancedDocument != null)
|
if (OpenEnhancedDocument != null)
|
||||||
OpenEnhancedDocument(this, args);
|
OpenEnhancedDocument(this, args);
|
||||||
}
|
}
|
||||||
|
public event ItemSelectedChangedEvent RefreshEnhancedDocument;
|
||||||
|
public void OnRefreshEnhancedDocument(ItemSelectedChangedEventArgs args)
|
||||||
|
{
|
||||||
|
if (RefreshEnhancedDocument != null)
|
||||||
|
RefreshEnhancedDocument(this, args);
|
||||||
|
}
|
||||||
public event DisplayTabControlStatusEvent StatusChanged;
|
public event DisplayTabControlStatusEvent StatusChanged;
|
||||||
public void ONStatusChanged(object Sender, DisplayTabControlStatusEventArgs args)
|
public void ONStatusChanged(object Sender, DisplayTabControlStatusEventArgs args)
|
||||||
{
|
{
|
||||||
@ -76,7 +103,7 @@ namespace Volian.Controls.Library
|
|||||||
/// "Item - " + Procedure ItemID for step pages
|
/// "Item - " + Procedure ItemID for step pages
|
||||||
/// "Doc - " + DocumentID for Word Documents
|
/// "Doc - " + DocumentID for Word Documents
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private Dictionary<string, DisplayTabItem> _MyDisplayTabItems;
|
public Dictionary<string, DisplayTabItem> _MyDisplayTabItems;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// When a Tab is closed it is added to this list.
|
/// When a Tab is closed it is added to this list.
|
||||||
/// When another Tab is opened, any Tabs in this list are closed
|
/// When another Tab is opened, any Tabs in this list are closed
|
||||||
@ -398,14 +425,39 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
public void RefreshItem(ItemInfo myItemInfo)
|
||||||
|
{
|
||||||
|
ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item
|
||||||
|
string key = "Item - " + proc.ItemID.ToString();
|
||||||
|
|
||||||
|
if (_MyDisplayTabItems.ContainsKey(key)) // If procedure page open use it
|
||||||
|
{
|
||||||
|
DisplayTabItem pg = _MyDisplayTabItems[key];
|
||||||
|
if (pg.MyStepTabPanel.MyStepPanel._LookupEditItems.ContainsKey(myItemInfo.ItemID))
|
||||||
|
OpenItem(myItemInfo,false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public DisplayTabItem OpenItem(ItemInfo myItemInfo2)
|
||||||
|
{
|
||||||
|
return OpenItem(myItemInfo2, true);
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Open a Step Item or a Word Item
|
/// Open a Step Item or a Word Item
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="myItemInfo"></param>
|
/// <param name="myItemInfo"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public DisplayTabItem OpenItem(ItemInfo myItemInfo2)
|
public DisplayTabItem OpenItem(ItemInfo myItemInfo2, bool setFocus)
|
||||||
{
|
{
|
||||||
ItemInfo myItemInfo = myItemInfo2;
|
ItemInfo myItemInfo = myItemInfo2;
|
||||||
|
if(VersionID!=myItemInfo.MyDocVersion.VersionID)
|
||||||
|
{
|
||||||
|
if(_AllDTCs.ContainsKey(myItemInfo.MyDocVersion.VersionID))
|
||||||
|
{
|
||||||
|
return _AllDTCs[myItemInfo.MyDocVersion.VersionID].OpenItem(myItemInfo);
|
||||||
|
}
|
||||||
|
if(VersionID != 0)
|
||||||
|
return _AllDTCs[0].OpenItem(myItemInfo);
|
||||||
|
}
|
||||||
string message = string.Empty;
|
string message = string.Empty;
|
||||||
if (myItemInfo.MyContent.MyEntry == null) //not a document
|
if (myItemInfo.MyContent.MyEntry == null) //not a document
|
||||||
{
|
{
|
||||||
@ -440,7 +492,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
_MyBar = GetParentBar(myItemInfo); // Get the docking bar associated with this item.
|
_MyBar = GetParentBar(myItemInfo); // Get the docking bar associated with this item.
|
||||||
if (myItemInfo.MyContent.MyEntry == null) // If it is a Word document open in step editor
|
if (myItemInfo.MyContent.MyEntry == null) // If it is a Word document open in step editor
|
||||||
return OpenStepTabPage(myItemInfo);
|
return OpenStepTabPage(myItemInfo,setFocus);
|
||||||
else // Otherwise open it in the Word editor
|
else // Otherwise open it in the Word editor
|
||||||
return OpenDSOTabPage(myItemInfo);
|
return OpenDSOTabPage(myItemInfo);
|
||||||
}
|
}
|
||||||
@ -637,12 +689,16 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
get { return _PnlCaret; }
|
get { return _PnlCaret; }
|
||||||
}
|
}
|
||||||
|
private static int trackerSC = 0;
|
||||||
public void ShowCaret()
|
public void ShowCaret()
|
||||||
{
|
{
|
||||||
if (_MyStepRTB != null)
|
if (_MyStepRTB != null)
|
||||||
{
|
{
|
||||||
if (_MyEditItem.RTBLastFocus)
|
if (_MyEditItem.RTBLastFocus)
|
||||||
{
|
{
|
||||||
|
trackerSC++;
|
||||||
|
/*if (trackerSC>20) */Console.WriteLine("ShowCaret: {0}", trackerSC);
|
||||||
|
//Volian.Base.Library.vlnStackTrace.ShowStack("ShowCaret: EI: {0} StepRTB: {1}", _MyEditItem.MyItemInfo.ItemID, _MyStepRTB.MyItemInfo.ItemID);
|
||||||
if (!_MyStepRTB.Visible)
|
if (!_MyStepRTB.Visible)
|
||||||
_MyStepRTB.Visible = true;
|
_MyStepRTB.Visible = true;
|
||||||
if (_MyStepRTB.SelectionLength == 0)
|
if (_MyStepRTB.SelectionLength == 0)
|
||||||
@ -665,10 +721,14 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private static int trackerHC = 0;
|
||||||
public void HideCaret()
|
public void HideCaret()
|
||||||
{
|
{
|
||||||
if (_MyStepRTB != null && !_MyStepRTB.Disposing && !_MyStepRTB.Closed)
|
if (_MyStepRTB != null && !_MyStepRTB.Disposing && !_MyStepRTB.Closed)
|
||||||
{
|
{
|
||||||
|
trackerHC++;
|
||||||
|
/* if (trackerHC>20)*/ Console.WriteLine("HideCaret {0}", trackerHC);
|
||||||
|
//Volian.Base.Library.vlnStackTrace.ShowStack("HideCaret: StepRTB: {0}", _MyStepRTB.MyItemInfo.ItemID);
|
||||||
if (_MyStepRTB.SelectionLength == 0)
|
if (_MyStepRTB.SelectionLength == 0)
|
||||||
{
|
{
|
||||||
tmrCaret.Enabled = false;
|
tmrCaret.Enabled = false;
|
||||||
@ -823,23 +883,23 @@ namespace Volian.Controls.Library
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="myItemInfo"></param>
|
/// <param name="myItemInfo"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool IsItemInfoProcedureOpen(ItemInfo ii)
|
//public bool IsItemInfoProcedureOpen(ItemInfo ii)
|
||||||
{
|
// if (ii == null) return false; //{
|
||||||
ItemInfo proc = ii.MyProcedure; // Find procedure Item
|
// ItemInfo proc = ii.MyProcedure; // Find procedure Item
|
||||||
if (dicEnhancedDocuments.ContainsKey(ii.MyProcedure.MyDocVersion))
|
// if (dicEnhancedDocuments.ContainsKey(ii.MyProcedure.MyDocVersion))
|
||||||
{
|
// {
|
||||||
frmEnhanced frm = dicEnhancedDocuments[ii.MyProcedure.MyDocVersion];
|
// frmEnhanced frm = dicEnhancedDocuments[ii.MyProcedure.MyDocVersion];
|
||||||
string key = "Item - " + proc.ItemID.ToString();
|
// string key = "Item - " + proc.ItemID.ToString();
|
||||||
if (frm.MyDisplayTabClntrol._MyDisplayTabItems.ContainsKey(key))
|
// if (frm.MyDisplayTabClntrol._MyDisplayTabItems.ContainsKey(key))
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
// return true;
|
// // return true;
|
||||||
//return false;
|
// //return false;
|
||||||
return false;
|
// return false;
|
||||||
}
|
//}
|
||||||
public Dictionary<DocVersionInfo, frmEnhanced> dicEnhancedDocuments = new Dictionary<DocVersionInfo, frmEnhanced>();
|
//public Dictionary<DocVersionInfo, frmEnhanced> dicEnhancedDocuments = new Dictionary<DocVersionInfo, frmEnhanced>();
|
||||||
|
|
||||||
private DisplayTabItem OpenStepTabPage(ItemInfo myItemInfo)
|
private DisplayTabItem OpenStepTabPage(ItemInfo myItemInfo, bool setFocus)
|
||||||
{
|
{
|
||||||
ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item
|
ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item
|
||||||
string key = "Item - " + proc.ItemID.ToString();
|
string key = "Item - " + proc.ItemID.ToString();
|
||||||
@ -847,18 +907,24 @@ namespace Volian.Controls.Library
|
|||||||
if (_MyDisplayTabItems.ContainsKey(key)) // If procedure page open use it
|
if (_MyDisplayTabItems.ContainsKey(key)) // If procedure page open use it
|
||||||
{
|
{
|
||||||
pg = _MyDisplayTabItems[key];
|
pg = _MyDisplayTabItems[key];
|
||||||
pg.Selected = true;
|
if (setFocus)
|
||||||
HandleChangeId(myItemInfo, pg);
|
{
|
||||||
if (SelectedDisplayTabItem != pg) // If the selected page doesn't match
|
pg.Selected = true;
|
||||||
SelectDisplayTabItem(pg); // Set the selected page
|
HandleChangeId(myItemInfo, pg);
|
||||||
|
if (SelectedDisplayTabItem != pg) // If the selected page doesn't match
|
||||||
|
SelectDisplayTabItem(pg); // Set the selected page
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else // If not already open, create a new Page
|
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); // Open a new Procedure Tab
|
||||||
_MyDisplayTabItems.Add(key, pg);
|
_MyDisplayTabItems.Add(key, pg);
|
||||||
pg.Selected = true;
|
if (setFocus)
|
||||||
HandleChangeId(myItemInfo, pg);
|
{
|
||||||
SelectDisplayTabItem(pg);
|
pg.Selected = true;
|
||||||
|
HandleChangeId(myItemInfo, pg);
|
||||||
|
SelectDisplayTabItem(pg);
|
||||||
|
}
|
||||||
pg.MyStepTabPanel.MyProcedureItemInfo = proc;
|
pg.MyStepTabPanel.MyProcedureItemInfo = proc;
|
||||||
|
|
||||||
// When more than one procedure is openned, the ribbon control cuts off the bottom of the buttons.
|
// When more than one procedure is openned, the ribbon control cuts off the bottom of the buttons.
|
||||||
|
@ -66,6 +66,12 @@ namespace Volian.Controls.Library
|
|||||||
get { return _MyUserRole; }
|
get { return _MyUserRole; }
|
||||||
set { _MyUserRole = value; }
|
set { _MyUserRole = value; }
|
||||||
}
|
}
|
||||||
|
private bool _Closed = false;
|
||||||
|
public bool Closed
|
||||||
|
{
|
||||||
|
get { return _Closed; }
|
||||||
|
set { _Closed = value; }
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Current SelectedItemInfo for this page
|
/// Current SelectedItemInfo for this page
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -216,8 +216,16 @@ namespace Volian.Controls.Library
|
|||||||
//if ((fmtdata.ProcData.CheckOffData.CheckOffList == null || fmtdata.ProcData.CheckOffData.CheckOffList.Count == 0) ||
|
//if ((fmtdata.ProcData.CheckOffData.CheckOffList == null || fmtdata.ProcData.CheckOffData.CheckOffList.Count == 0) ||
|
||||||
// fmtdata.ProcData.CheckOffData.Menu=="Signoff")
|
// fmtdata.ProcData.CheckOffData.Menu=="Signoff")
|
||||||
// cmbCheckoff.Enabled = false;
|
// cmbCheckoff.Enabled = false;
|
||||||
|
cbCAS.Enabled = true;
|
||||||
if (sc == null) // if there is no config data ...
|
if (((CurItemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds) ||
|
||||||
|
((CurItemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedDeviations) == E_PurchaseOptions.EnhancedDeviations))
|
||||||
|
{
|
||||||
|
cbCAS.Enabled = false;
|
||||||
|
cbPageBreak.Enabled = false;
|
||||||
|
cbPlaceKeeper.Enabled = false;
|
||||||
|
cbPlaceKeeperCont.Enabled = false;
|
||||||
|
}
|
||||||
|
else if (sc == null) // if there is no config data ...
|
||||||
{
|
{
|
||||||
if (CurItemInfo.IsHigh)cbPageBreak.Checked = false; // Page Break is set to false
|
if (CurItemInfo.IsHigh)cbPageBreak.Checked = false; // Page Break is set to false
|
||||||
cbCAS.Checked = CurItemInfo.IncludeOnContActSum; // set based on step type format flag
|
cbCAS.Checked = CurItemInfo.IncludeOnContActSum; // set based on step type format flag
|
||||||
|
@ -32,7 +32,8 @@ namespace Volian.Controls.Library
|
|||||||
if (_CurTrans == value && _CurItemFrom == MyRTB.MyItemInfo) return;
|
if (_CurTrans == value && _CurItemFrom == MyRTB.MyItemInfo) return;
|
||||||
_CurItemFrom = MyRTB.MyItemInfo;
|
_CurItemFrom = MyRTB.MyItemInfo;
|
||||||
_TranFmtIndx = 0;
|
_TranFmtIndx = 0;
|
||||||
btnTranSave.Enabled = UserInfo.CanEdit(MyUserInfo, Mydvi); //Can Insert Transitons
|
bool isenh = MyRTB != null && MyRTB.MyItemInfo != null && MyRTB.MyItemInfo.IsEnhancedStep;
|
||||||
|
btnTranSave.Enabled = !isenh && UserInfo.CanEdit(MyUserInfo, Mydvi); //Can Insert Transitons
|
||||||
btnTranCancel.Enabled = true;
|
btnTranCancel.Enabled = true;
|
||||||
}
|
}
|
||||||
else // Modify a transition
|
else // Modify a transition
|
||||||
@ -952,7 +953,8 @@ namespace Volian.Controls.Library
|
|||||||
if (sectstartid == -1) btnTranSave.Enabled = false; // if there is an invalid section start - don't allow save.
|
if (sectstartid == -1) btnTranSave.Enabled = false; // if there is an invalid section start - don't allow save.
|
||||||
IList chldrn = prcitm.GetChildren();
|
IList chldrn = prcitm.GetChildren();
|
||||||
cbTranSectsFillIn((ItemInfo)chldrn[0], sectstartid, true);
|
cbTranSectsFillIn((ItemInfo)chldrn[0], sectstartid, true);
|
||||||
btnTranSave.Enabled = UserInfo.CanEdit(MyUserInfo, Mydvi); //Can Insert Transitons
|
bool isenh = MyRTB != null && MyRTB.MyItemInfo != null && MyRTB.MyItemInfo.IsEnhancedStep;
|
||||||
|
btnTranSave.Enabled = !isenh && UserInfo.CanEdit(MyUserInfo, Mydvi); //Can Insert Transitons
|
||||||
SaveCancelEnabling();
|
SaveCancelEnabling();
|
||||||
}
|
}
|
||||||
private void tvTran_AfterSelect(object sender, TreeViewEventArgs e)
|
private void tvTran_AfterSelect(object sender, TreeViewEventArgs e)
|
||||||
@ -961,7 +963,8 @@ namespace Volian.Controls.Library
|
|||||||
E_TransUI etm = (E_TransUI)_CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[listBoxTranFmt.SelectedIndex].TransUI;
|
E_TransUI etm = (E_TransUI)_CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[listBoxTranFmt.SelectedIndex].TransUI;
|
||||||
if ((etm & E_TransUI.StepAllowNone) == E_TransUI.StepAllowNone && tvTran.SelectedNode.Tag==null)
|
if ((etm & E_TransUI.StepAllowNone) == E_TransUI.StepAllowNone && tvTran.SelectedNode.Tag==null)
|
||||||
{
|
{
|
||||||
btnTranSave.Enabled = UserInfo.CanEdit(MyUserInfo, Mydvi); //Can Insert Transitons
|
bool isenh = MyRTB != null && MyRTB.MyItemInfo != null && MyRTB.MyItemInfo.IsEnhancedStep;
|
||||||
|
btnTranSave.Enabled = !isenh && UserInfo.CanEdit(MyUserInfo, Mydvi); //Can Insert Transitons
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// check if node is a true end-point, i.e. not a 'part' node. If part node, don't
|
// check if node is a true end-point, i.e. not a 'part' node. If part node, don't
|
||||||
@ -994,7 +997,8 @@ namespace Volian.Controls.Library
|
|||||||
tvTranRangeHilites(true, _RangeNode1, _RangeNode2);
|
tvTranRangeHilites(true, _RangeNode1, _RangeNode2);
|
||||||
lblxTranRangeTip.Text = "Select First Transition\r\nfor Range";
|
lblxTranRangeTip.Text = "Select First Transition\r\nfor Range";
|
||||||
lblxTranRangeTip.BackColor = Color.Yellow;
|
lblxTranRangeTip.BackColor = Color.Yellow;
|
||||||
btnTranSave.Enabled = UserInfo.CanEdit(MyUserInfo, Mydvi); //Can Insert Transitons
|
bool isenh = MyRTB != null && MyRTB.MyItemInfo != null && MyRTB.MyItemInfo.IsEnhancedStep;
|
||||||
|
btnTranSave.Enabled = !isenh && UserInfo.CanEdit(MyUserInfo, Mydvi); //Can Insert Transitons
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1003,7 +1007,8 @@ namespace Volian.Controls.Library
|
|||||||
//bool hasChanged = _CurItemFrom != _SavCurItemFrom || _TranFmtIndx != _SavTranFmtIndx
|
//bool hasChanged = _CurItemFrom != _SavCurItemFrom || _TranFmtIndx != _SavTranFmtIndx
|
||||||
// || ( selii != null && _CurTrans.ToID != selii.ItemID);
|
// || ( selii != null && _CurTrans.ToID != selii.ItemID);
|
||||||
bool hasChanged = SettingsChanged;
|
bool hasChanged = SettingsChanged;
|
||||||
btnTranSave.Enabled = hasChanged && UserInfo.CanEdit(MyUserInfo, Mydvi); //Can Insert Transitons
|
bool isenh = MyRTB != null && MyRTB.MyItemInfo != null && MyRTB.MyItemInfo.IsEnhancedStep;
|
||||||
|
btnTranSave.Enabled = !isenh && hasChanged && UserInfo.CanEdit(MyUserInfo, Mydvi); //Can Insert Transitons
|
||||||
btnTranCancel.Enabled = _CurTrans != null && hasChanged;
|
btnTranCancel.Enabled = _CurTrans != null && hasChanged;
|
||||||
//btnTranSave.Enabled = allowSave;
|
//btnTranSave.Enabled = allowSave;
|
||||||
//if (CurTrans != null && selii != null)
|
//if (CurTrans != null && selii != null)
|
||||||
|
@ -683,7 +683,25 @@ namespace Volian.Controls.Library
|
|||||||
private static int xOffset = 0;
|
private static int xOffset = 0;
|
||||||
public void RemoveItem()
|
public void RemoveItem()
|
||||||
{
|
{
|
||||||
//Volian.Base.Library.VlnTimer _MyTimer = new VlnTimer();
|
// if this item has enhanced edititems, remove them:
|
||||||
|
StepConfig sc = MyItemInfo.MyConfig as StepConfig;
|
||||||
|
List<EnhancedDocument> thisEnhs = null;
|
||||||
|
if (sc != null)
|
||||||
|
thisEnhs = sc.MyEnhancedDocuments;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (MyItemInfo.IsSection)
|
||||||
|
{
|
||||||
|
SectionConfig secc = MyItemInfo.MyConfig as SectionConfig;
|
||||||
|
if (secc.Section_LnkEnh=="Y")thisEnhs = secc.MyEnhancedDocuments;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<int> enhIds = new List<int>();
|
||||||
|
foreach (EnhancedDocument ed in thisEnhs)
|
||||||
|
{
|
||||||
|
if (ed.Type != 0) enhIds.Add(ed.ItemID);
|
||||||
|
}
|
||||||
BeingRemoved = true;
|
BeingRemoved = true;
|
||||||
MyStepPanel.SelectedEditItem = null; // Unselect the item to be deleted
|
MyStepPanel.SelectedEditItem = null; // Unselect the item to be deleted
|
||||||
//ShowTops("\r\n");
|
//ShowTops("\r\n");
|
||||||
@ -717,6 +735,13 @@ namespace Volian.Controls.Library
|
|||||||
//_MyTimer.ShowElapsedTimes("RemoveItem");
|
//_MyTimer.ShowElapsedTimes("RemoveItem");
|
||||||
ForceEditItemRefresh(newFocus);
|
ForceEditItemRefresh(newFocus);
|
||||||
MyStepPanel.Controls.Remove(pnl);
|
MyStepPanel.Controls.Remove(pnl);
|
||||||
|
foreach (int enhId in enhIds)
|
||||||
|
{
|
||||||
|
ItemInfo ii = ItemInfo.Get(enhId);
|
||||||
|
bool success = this._MyStepPanel.MyStepTabPanel.MyDisplayTabControl.DeleteRTBItem(ii);
|
||||||
|
if (!success) // item was not displayed in editor, just delete from database (add tree if necessarY)
|
||||||
|
Item.DeleteItemAndChildren(ii);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ForceEditItemRefresh(EditItem newFocus)
|
private static void ForceEditItemRefresh(EditItem newFocus)
|
||||||
@ -998,9 +1023,9 @@ namespace Volian.Controls.Library
|
|||||||
if (MyStepPanel.SelectedEditItem is RTBItem)
|
if (MyStepPanel.SelectedEditItem is RTBItem)
|
||||||
{
|
{
|
||||||
RTBItem rtbi = MyStepPanel.SelectedEditItem as RTBItem;
|
RTBItem rtbi = MyStepPanel.SelectedEditItem as RTBItem;
|
||||||
// see if this step has associated enhanced step(s):
|
// see if this step has associated enhanced step(s). If it does, flag it so
|
||||||
StepConfig sc = new StepConfig(MyItemInfo.MyContent.Config);
|
// that the enhanced steps get inserted also.
|
||||||
|
StepConfig sc = new StepConfig(MyItemInfo.MyContent.Config);
|
||||||
if (sc.MyEnhancedDocuments.Count > 0)
|
if (sc.MyEnhancedDocuments.Count > 0)
|
||||||
{
|
{
|
||||||
rtbi.EnhAddFromItemInfo = MyItemInfo;
|
rtbi.EnhAddFromItemInfo = MyItemInfo;
|
||||||
@ -1034,6 +1059,18 @@ namespace Volian.Controls.Library
|
|||||||
ItemInfo newItemInfo = MyItemInfo.InsertSiblingAfter("", "", type);
|
ItemInfo newItemInfo = MyItemInfo.InsertSiblingAfter("", "", type);
|
||||||
AddGridIfNeeded(newItemInfo);
|
AddGridIfNeeded(newItemInfo);
|
||||||
DoAddSiblingAfter(newItemInfo, updateStatus);
|
DoAddSiblingAfter(newItemInfo, updateStatus);
|
||||||
|
if (MyStepPanel.SelectedEditItem is RTBItem)
|
||||||
|
{
|
||||||
|
RTBItem rtbi = MyStepPanel.SelectedEditItem as RTBItem;
|
||||||
|
// see if this step has associated enhanced step(s). If it does, flag it so
|
||||||
|
// that the enhanced steps get inserted also.
|
||||||
|
StepConfig sc = new StepConfig(MyItemInfo.MyContent.Config);
|
||||||
|
if (sc.MyEnhancedDocuments.Count > 0)
|
||||||
|
{
|
||||||
|
rtbi.EnhAddFromItemInfo = MyItemInfo;
|
||||||
|
rtbi.EnhAddType = EnhancedAddTypes.After;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
private void DoAddSiblingAfter(ItemInfo newItemInfo, bool updateStatus)
|
private void DoAddSiblingAfter(ItemInfo newItemInfo, bool updateStatus)
|
||||||
{
|
{
|
||||||
@ -1083,7 +1120,8 @@ namespace Volian.Controls.Library
|
|||||||
if (MyStepPanel.SelectedEditItem is RTBItem)
|
if (MyStepPanel.SelectedEditItem is RTBItem)
|
||||||
{
|
{
|
||||||
RTBItem rtbi = MyStepPanel.SelectedEditItem as RTBItem;
|
RTBItem rtbi = MyStepPanel.SelectedEditItem as RTBItem;
|
||||||
// see if this step has associated enhanced step(s):
|
// see if this step has associated enhanced step(s). If it does, flag it so
|
||||||
|
// that the enhanced steps get inserted also.
|
||||||
StepConfig sc = new StepConfig(MyItemInfo.MyContent.Config);
|
StepConfig sc = new StepConfig(MyItemInfo.MyContent.Config);
|
||||||
if (sc.MyEnhancedDocuments.Count > 0)
|
if (sc.MyEnhancedDocuments.Count > 0)
|
||||||
{
|
{
|
||||||
@ -1206,9 +1244,21 @@ namespace Volian.Controls.Library
|
|||||||
if (MyStepPanel.SelectedEditItem is RTBItem)
|
if (MyStepPanel.SelectedEditItem is RTBItem)
|
||||||
{
|
{
|
||||||
RTBItem rtbi = MyStepPanel.SelectedEditItem as RTBItem;
|
RTBItem rtbi = MyStepPanel.SelectedEditItem as RTBItem;
|
||||||
// see if this step has associated enhanced step(s):
|
// see if this step has associated enhanced step(s). If it does, flag it so
|
||||||
StepConfig sc = new StepConfig(MyItemInfo.MyContent.Config);
|
// that the enhanced steps get inserted also.
|
||||||
if (sc.MyEnhancedDocuments.Count > 0)
|
EnhancedDocuments cfgeds = null;
|
||||||
|
if (MyItemInfo.IsStepSection)
|
||||||
|
{
|
||||||
|
SectionConfig scfg = MyItemInfo.MyConfig as SectionConfig;
|
||||||
|
if (scfg.Section_LnkEnh != "Y") return;
|
||||||
|
cfgeds = scfg.MyEnhancedDocuments;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
StepConfig sc = new StepConfig(MyItemInfo.MyContent.Config);
|
||||||
|
cfgeds = sc.MyEnhancedDocuments;
|
||||||
|
}
|
||||||
|
if (cfgeds != null && cfgeds.Count > 0)
|
||||||
{
|
{
|
||||||
rtbi.EnhAddFromItemInfo = MyItemInfo;
|
rtbi.EnhAddFromItemInfo = MyItemInfo;
|
||||||
rtbi.EnhAddType = EnhancedAddTypes.Child;
|
rtbi.EnhAddType = EnhancedAddTypes.Child;
|
||||||
@ -1294,8 +1344,10 @@ namespace Volian.Controls.Library
|
|||||||
if (newEditItem != null) MyStepPanel.SelectedEditItem = newEditItem;//Update Screen
|
if (newEditItem != null) MyStepPanel.SelectedEditItem = newEditItem;//Update Screen
|
||||||
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnItemPaste(this, new vlnTreeItemInfoPasteEventArgs(newItemInfo, copyStartID, ItemInfo.EAddpingPart.Before, newItemInfo.MyContent.Type));
|
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnItemPaste(this, new vlnTreeItemInfoPasteEventArgs(newItemInfo, copyStartID, ItemInfo.EAddpingPart.Before, newItemInfo.MyContent.Type));
|
||||||
|
|
||||||
|
// MyItemInfo is the 'paste from' item, if it has enhanced need to copy and paste the steps in enhanced.
|
||||||
|
newItemInfo.EnhancedPasteItem(copyStartID, MyItemInfo, ItemInfo.EAddpingPart.Before, GetChangeId(MyItemInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetChangeId(ItemInfo iiDest)
|
private string GetChangeId(ItemInfo iiDest)
|
||||||
{
|
{
|
||||||
// get the change id for the destination's procedure's change id.
|
// get the change id for the destination's procedure's change id.
|
||||||
@ -1326,6 +1378,8 @@ namespace Volian.Controls.Library
|
|||||||
MyStepPanel.SelectedEditItem = newEditItem;//Update Screen
|
MyStepPanel.SelectedEditItem = newEditItem;//Update Screen
|
||||||
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnItemPaste(this, new vlnTreeItemInfoPasteEventArgs(newItemInfo, copyStartID, ItemInfo.EAddpingPart.After, newItemInfo.MyContent.Type));
|
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnItemPaste(this, new vlnTreeItemInfoPasteEventArgs(newItemInfo, copyStartID, ItemInfo.EAddpingPart.After, newItemInfo.MyContent.Type));
|
||||||
|
|
||||||
|
// MyItemInfo is the 'paste from' item, if it has enhanced need to copy and paste the steps in enhanced.
|
||||||
|
newItemInfo.EnhancedPasteItem(copyStartID, MyItemInfo, ItemInfo.EAddpingPart.After, GetChangeId(MyItemInfo));
|
||||||
}
|
}
|
||||||
public void PasteChild(int copyStartID)
|
public void PasteChild(int copyStartID)
|
||||||
{
|
{
|
||||||
@ -1375,6 +1429,9 @@ namespace Volian.Controls.Library
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
MyStepPanel.SelectedEditItem = newEditItem;//Update Screen
|
MyStepPanel.SelectedEditItem = newEditItem;//Update Screen
|
||||||
|
|
||||||
|
// MyItemInfo is the 'paste from' item, if it has enhanced need to copy and paste the steps in enhanced.
|
||||||
|
newItemInfo.EnhancedPasteItem(copyStartID, MyItemInfo, ItemInfo.EAddpingPart.Child, GetChangeId(MyItemInfo));
|
||||||
}
|
}
|
||||||
public EditItem PasteReplace(int copyStartID)
|
public EditItem PasteReplace(int copyStartID)
|
||||||
{
|
{
|
||||||
@ -1389,6 +1446,7 @@ namespace Volian.Controls.Library
|
|||||||
EditItem prevEditItem = MyPreviousEditItem;
|
EditItem prevEditItem = MyPreviousEditItem;
|
||||||
EditItem parentEditItem = ActiveParent;
|
EditItem parentEditItem = ActiveParent;
|
||||||
|
|
||||||
|
StepConfig savOrigPasteConfig = MyItemInfo.MyConfig as StepConfig;
|
||||||
int TopMostYBefore = TopMostEditItem.Top;
|
int TopMostYBefore = TopMostEditItem.Top;
|
||||||
int? TopMostParentY = (MyParentEditItem == null ? null : (int?)(MyParentEditItem.TopMostEditItem.Top));
|
int? TopMostParentY = (MyParentEditItem == null ? null : (int?)(MyParentEditItem.TopMostEditItem.Top));
|
||||||
int? ParentY = (MyParentEditItem == null ? null : (int?)(MyParentEditItem.Top));
|
int? ParentY = (MyParentEditItem == null ? null : (int?)(MyParentEditItem.Top));
|
||||||
@ -1452,6 +1510,8 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
MyStepPanel.SelectedEditItem = newEditItem; //Update Screen
|
MyStepPanel.SelectedEditItem = newEditItem; //Update Screen
|
||||||
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnItemPaste(this, new vlnTreeItemInfoPasteEventArgs(newItemInfo, copyStartID, ItemInfo.EAddpingPart.Replace, newItemInfo.MyContent.Type));
|
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnItemPaste(this, new vlnTreeItemInfoPasteEventArgs(newItemInfo, copyStartID, ItemInfo.EAddpingPart.Replace, newItemInfo.MyContent.Type));
|
||||||
|
// MyItemInfo is the 'paste from' item, if it has enhanced need to copy and paste the steps in enhanced.
|
||||||
|
newItemInfo.EnhancedPasteItem(copyStartID, MyItemInfo, ItemInfo.EAddpingPart.Replace, GetChangeId(MyItemInfo));
|
||||||
return newEditItem;
|
return newEditItem;
|
||||||
}
|
}
|
||||||
private bool HandleSqlExceptionOnCopy(Exception ex)
|
private bool HandleSqlExceptionOnCopy(Exception ex)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user