From fc82fced844c1a37e955f2f6673187f9b9546f38 Mon Sep 17 00:00:00 2001 From: Kathy Date: Wed, 27 Sep 2017 14:34:15 +0000 Subject: [PATCH] B2017-255: When pasting a source step that has links to an enhanced step into a section that has linked enhanced steps, do not remove the links to the new enhanced step. --- .../Extension/ItemInsertExt.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index 1228a4b4..206c5b00 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -880,7 +880,21 @@ namespace VEPROMS.CSLA.Library 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) + // Also, if pasting into a source section, don't clear (B2017-225), the 'isSourceSection' portion of the code. + bool isSourceSection = false; + EnhancedDocuments eds = pasteItem.ActiveSection.GetMyEnhancedDocuments(); + if (eds != null) + { + foreach (EnhancedDocument ed in eds) + { + if (ed.Type != 0) + { + isSourceSection = true; + break; + } + } + } + if (!pasteItem.ActiveSection.IsEnhancedSection && !pasteItem.ActiveSection.IsEnhancedSectionTitleOnly && !isSourceSection) { // the RemoveEnhancedFromConfig method clears from the pasted step and any cautions/notes that may be off // of the pasted step.