From 111fe1856536737f85b885a847938fda123b5aee Mon Sep 17 00:00:00 2001 From: Rich Date: Wed, 5 Jul 2017 19:38:43 +0000 Subject: [PATCH] C2016-023 - Copy using clipboard Convert Transition to text if the destination procedure set is different than the current procedure set and the destination procedure number exists in the current procedure set. C2016-023 - Copy Step Convert Transition to text if the destination procedure set is different than the current procedure set and the destination procedure number exists in the current procedure set. --- .../Extension/DisplayText.cs | 22 ++++++++++++++++++- .../Extension/ItemInsertExt.cs | 20 +++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs index 88ee748c..764eecfa 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs @@ -860,7 +860,27 @@ namespace VEPROMS.CSLA.Library // Replace Transition Text foreach (ContentTransition ct in ctReplacements.Values) using (TransitionInfo tran = TransitionInfo.Get(ct.TransitionID)) - _MyItem.MyContent.FixTransitionText(tran); + { // C2016-023 Convert Transition to Text is the transtion is to a different procedure set + // and the destination proedure number matches a procedure number in the current set + bool forceConvertToText = false; + if (tran.MyContent.ContentItems[0].MyDocVersion.VersionID != tran.MyItemToID.MyDocVersion.VersionID && + (tran.MyContent.ContentItems[0].ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[tran.TranType].TransMenu.Contains("Proc") || + tran.MyContent.ContentItems[0].ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[tran.TranType].TransMenu.Contains("other proc"))) + { + string destProcNumber = tran.MyItemToID.MyProcedure.DisplayNumber; + foreach (ProcedureInfo prci in tran.MyContent.ContentItems[0].MyDocVersion.Procedures) + { + if (prci.DisplayNumber == destProcNumber) + { + forceConvertToText = true; + break; + } + } + + } + + _MyItem.MyContent.FixTransitionText(tran,forceConvertToText); + } _MyItem.Save(); } if (roUsgReplacements.Count > 0) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index e015ae25..b45d9c4b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -838,6 +838,26 @@ namespace VEPROMS.CSLA.Library !tran.MyContent.ContentItems[0].ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[tran.TranType].TransMenu.Contains("other proc")) //B2017-068 paste with transition fix forceConvertToText = true; } + if (!forceConvertToText) + { + // C2016-023 Convert Transition to Text is the transtion is to a different procedure set + // and the destination proedure number matches a procedure number in the current set + if (tran.MyContent.ContentItems[0].MyDocVersion.VersionID != tran.MyItemToID.MyDocVersion.VersionID && + (tran.MyContent.ContentItems[0].ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[tran.TranType].TransMenu.Contains("Proc") || + tran.MyContent.ContentItems[0].ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[tran.TranType].TransMenu.Contains("other proc"))) + { + string destProcNumber = tran.MyItemToID.MyProcedure.DisplayNumber; + foreach (ProcedureInfo prci in tran.MyContent.ContentItems[0].MyDocVersion.Procedures) + { + if (prci.DisplayNumber == destProcNumber) + { + forceConvertToText = true; + break; + } + } + + } + } content.FixTransitionText(tran, forceConvertToText); if (content.IsDirty) content.Save();