diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 1fc1c4f2..366f0f3e 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -1405,6 +1405,46 @@ namespace VEPROMS.CSLA.Library } return level; } + // B2017-070 - when retoring a step that once had enhanced links, remove the link info for the notes and cautions as well + public void RemoveEnhancedFromConfig() + { + RemoveEnhancedFromConfig(false); + } + + public void RemoveEnhancedFromConfig(bool doOneStepOnly) + { + XmlDocument xd = new XmlDocument(); + if (this.MyContent.Config == null || this.MyContent.Config == "") return; // B2017-164 & B2017-172 check for null or empty config + xd.LoadXml(this.MyContent.Config); + XmlNode xn = xd.DocumentElement.SelectSingleNode("Enhanced"); + if (xn != null) + { + xn.ParentNode.RemoveChild(xn); + string config = xd.OuterXml; + using (Content ctmp = this.MyContent.Get()) + { + ctmp.Config = config; + ctmp.Save(); + ContentInfo.Refresh(ctmp); + _MyConfig = null; // refresh the memory value + } + } + if (doOneStepOnly) return; + if (this.IsHigh) + { + if (this.Cautions != null) + foreach (ItemInfo chld in this.Cautions) + { + chld.RemoveEnhancedFromConfig(false); + } + if (this.Notes != null) + foreach (ItemInfo chld in this.Notes) + { + chld.RemoveEnhancedFromConfig(false); + } + } + } + #endregion public bool HasHeader { diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index 34bc6a6f..d6f60572 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -898,7 +898,7 @@ namespace VEPROMS.CSLA.Library { // the RemoveEnhancedFromConfig method clears from the pasted step and any cautions/notes that may be off // of the pasted step. - if (pasteItem.HasEnhancedLinkedStep) ItemInfo.RemoveEnhancedFromConfig(pasteItem, false); + if (pasteItem.HasEnhancedLinkedStep) pasteItem.RemoveEnhancedFromConfig(); } } #endregion diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs index deca35e5..99c0108c 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs @@ -173,19 +173,20 @@ namespace VEPROMS.CSLA.Library } } bool rv = true; + // C2015-022 part of separate windows logic, check the processID instead of the sessionID foreach (SessionInfo si in sil) { - if (si.SessionID != this.SessionID && objectType == CheckOutType.Procedure) + if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Procedure) { message = string.Format("The procedure {0} is already checked out to {1}", ItemInfo.Get(objectID).MyProcedure.DisplayNumber, si.UserID); rv = rv && false; } - else if (si.SessionID != this.SessionID && objectType == CheckOutType.Document) + else if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Document) { message = string.Format("The document {0} is already checked out to {1}", DocumentInfo.Get(objectID).DocumentEntries[0].MyContent.Text, si.UserID); rv = rv && false; } - else if (si.SessionID != this.SessionID && objectType == CheckOutType.DocVersion) + else if (si.ProcessID != this.ProcessID && objectType == CheckOutType.DocVersion) { // gets here if other session has working draft open & click on sam working draft. OwnerInfo oi = OwnerInfo.GetBySessionIDandVersionID(si.SessionID, objectID); @@ -199,7 +200,7 @@ namespace VEPROMS.CSLA.Library message = message + string.Format("The working draft is already checked out to {0}", si.UserID); rv = rv && false; } - else if (si.SessionID != this.SessionID && objectType == CheckOutType.Folder) + else if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Folder) { // gets here if other session has working draft open & click on folder above. Gets here // if other session has wd open and click on top folder - query returns empty.