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();