From f87f541a161156489c346b0d0fca58657c9dee2b Mon Sep 17 00:00:00 2001 From: John Date: Mon, 12 Mar 2018 14:32:39 +0000 Subject: [PATCH] =?UTF-8?q?C2015-022=20Separate=20Windows=20Upgrade=20?= =?UTF-8?q?=E2=80=93=20moved=20RemoveEnhancedFromConfig=20to=20ItemExt.cs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Extension/AuditExt.cs | 39 +------------------ 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs index 294984e3..b0d75ba1 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs @@ -1632,7 +1632,8 @@ namespace VEPROMS.CSLA.Library } // B2017-069 when we restore a step that once had enhanced document links, // remove the enhanced document link information - fixes delete/restore issue of linked steps. - RemoveEnhancedFromConfig(tmp, false); + // B2017-070 - when retoring a step that once had enhanced links, remove the link info for the notes and cautions as well + tmp.RemoveEnhancedFromConfig(); return tmp; } catch (Exception ex) @@ -1641,42 +1642,6 @@ namespace VEPROMS.CSLA.Library } } - // B2017-070 - when restoring a step that once had enhanced links, remove the link info for the notes and cautions as well - public static void RemoveEnhancedFromConfig(ItemInfo tmp, bool doOneStepOnly) - { - XmlDocument xd = new XmlDocument(); - if (tmp.MyContent.Config == null || tmp.MyContent.Config == "") return; // B2017-164 & B2017-172 check for null or empty config - xd.LoadXml(tmp.MyContent.Config); - XmlNode xn = xd.DocumentElement.SelectSingleNode("Enhanced"); - if (xn != null) - { - xn.ParentNode.RemoveChild(xn); - string config = xd.OuterXml; - using (Content ctmp = tmp.MyContent.Get()) - { - ctmp.Config = config; - ctmp.Save(); - ContentInfo.Refresh(ctmp); - tmp._MyConfig = null; // refresh the memory value - } - } - if (doOneStepOnly) return; - if (tmp.IsHigh) - { - if (tmp.Cautions != null) - foreach (ItemInfo chld in tmp.Cautions) - { - RemoveEnhancedFromConfig(chld, false); - } - if (tmp.Notes != null) - foreach (ItemInfo chld in tmp.Notes) - { - RemoveEnhancedFromConfig(chld, false); - } - } - } - - // Criteria to get Item and children [Serializable()] private class RestoreCriteria {