diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs index b57a8fee..916c988f 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs @@ -1657,6 +1657,7 @@ namespace VEPROMS.CSLA.Library ctmp.Config = config; ctmp.Save(); ContentInfo.Refresh(ctmp); + tmp._MyConfig = null; // refresh the memory value } } if (tmp.IsHigh) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index 5e1055b3..1ec78e28 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -529,6 +529,7 @@ namespace VEPROMS.CSLA.Library tmp.UpdateTransitionText(); tmp.UpdatePastedStepTransitionText(); PasteSetChangeId(tmp, chgid); + PasteClearEnhanced(tmp); OnNewChild(new ItemInfoInsertEventArgs(tmp, EAddpingPart.Child)); return tmp; } @@ -578,6 +579,7 @@ namespace VEPROMS.CSLA.Library tmp.UpdateROText(); tmp.UpdatePastedStepTransitionText(); PasteSetChangeId(tmp, chgid); + PasteClearEnhanced(tmp); OnNewSiblingBefore(new ItemInfoInsertEventArgs(tmp, EAddpingPart.Before)); return tmp; } @@ -608,6 +610,7 @@ namespace VEPROMS.CSLA.Library tmp.UpdateROText(); tmp.UpdatePastedStepTransitionText(); PasteSetChangeId(tmp, chgid); + PasteClearEnhanced(tmp); OnNewSiblingAfter(new ItemInfoInsertEventArgs(tmp, EAddpingPart.After)); return tmp; } @@ -867,6 +870,23 @@ namespace VEPROMS.CSLA.Library } } } + public static void PasteClearEnhanced(ItemInfo pasteItem) + { + // B2017-045: if a copied step has enhanced link config data and pasted step should not have it, clear it: + // check if the pasted item should have enhanced data. If the copied data has enhanced config data and + // it is pasted into a section without enhanced data, then clear it. + + // config data can only be on hls/notes/cautions for pasted steps. + if (!pasteItem.IsHigh && !pasteItem.IsCaution && !pasteItem.IsNote) return; + + // See if the pasted step's section is enhanced with enhanced steps, and if not, clear it + if (!pasteItem.ActiveSection.IsEnhancedSection && !pasteItem.ActiveSection.IsEnhancedSectionTitleOnly) + { + // 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); + } + } #endregion #region Insert Child public ItemInfo InsertChild(E_FromType fromType, int type, string text) @@ -2324,6 +2344,7 @@ namespace VEPROMS.CSLA.Library ItemInfo.DeleteItemInfoAndChildren(itemInfo.ItemID); // Dispose ItemInfo and Children using (Item item = Get(newItemInfo.ItemID)) ItemInfo.Refresh(item); ItemInfo.PasteSetChangeId(newItemInfo, chgid); + ItemInfo.PasteClearEnhanced(newItemInfo); if (newItemInfo.NextItem != null) using (Item item = newItemInfo.NextItem.Get()) ItemInfo.Refresh(item); newItemInfo.RefreshNextItems(); // if inserting after a caution or note, refreshes tabs. This will adjust bullets diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index eba3ba3d..a57af697 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -1681,11 +1681,6 @@ namespace Volian.Controls.Library if (stepToCfg.MyEnhancedDocuments != null && stepToCfg.MyEnhancedDocuments.Count > 0 && stepToCfg.MyEnhancedDocuments[0].Type != 0) toSourceHasEnhancedLinks = true; } } - if ((!MyItemInfo.IsEnhancedSection && !MyItemInfo.IsEnhancedStep && !toSourceHasEnhancedLinks) && fromSourceHasEnhancedLinks) - { - SetPasteButtons(false); - return; - } // enhanced: if 'from' step is not enhanced, only allow paste before/after if (MyItemInfo.IsHigh && !MyItemInfo.IsEnhancedStep) {