C2015-022 Separate Windows Upgrade – moved RemoveEnhancedFromConfig to ItemExt.cs
This commit is contained in:
parent
400ef655c7
commit
f87f541a16
@ -1632,7 +1632,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
// B2017-069 when we restore a step that once had enhanced document links,
|
// 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.
|
// 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;
|
return tmp;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
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()]
|
[Serializable()]
|
||||||
private class RestoreCriteria
|
private class RestoreCriteria
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user