B2022-148: cannot insert outside transition in a background document that references a related EOP – transition is converted to text

This commit is contained in:
Kathy Ruffing 2023-01-24 15:32:22 +00:00
parent cb4040572c
commit e045614f8d
3 changed files with 55 additions and 11 deletions

View File

@ -1012,13 +1012,18 @@ namespace VEPROMS.CSLA.Library
(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)
// B2022-148: cannot insert outside transition in a background document that references a related EOP transition is converted to text
bool dvsLinked = DocVersionInfo.Linked(tran.MyItemToID.MyDocVersion, tran.MyContent.ContentItems[0].MyDocVersion);
if (!dvsLinked)
{
if (prci.DisplayNumber == destProcNumber)
string destProcNumber = tran.MyItemToID.MyProcedure.DisplayNumber;
foreach (ProcedureInfo prci in tran.MyContent.ContentItems[0].MyDocVersion.Procedures)
{
forceConvertToText = true;
break;
if (prci.DisplayNumber == destProcNumber)
{
forceConvertToText = true;
break;
}
}
}

View File

@ -317,7 +317,41 @@ namespace VEPROMS.CSLA.Library
AssociationConfig ac = new AssociationConfig(associationInfo);
return ac.ROUpdate_LoadingFigures;
}
#region Enhanced
// B2022-148: cannot insert outside transition in a background document that references a related EOP transition is converted to text
// Check if the 2 doc versions are linked, i.e. one is source and the other is enhanced linked to the source
public static bool Linked(DocVersionInfo dv1, DocVersionInfo dv2)
{
DocVersionConfig dvc1 = dv1.DocVersionConfig;
DocVersionConfig dvc2 = dv2.DocVersionConfig;
bool isLinked1 = dvc1 != null && (dvc1.MyEnhancedDocuments != null && dvc1.MyEnhancedDocuments.Count > 0);
bool isLinked2 = dvc2 != null && (dvc2.MyEnhancedDocuments != null && dvc2.MyEnhancedDocuments.Count > 0);
bool relatedEnh = false;
if (isLinked1 && isLinked2)
{
// does source point to this docversion as enhanced, and does this enhanced point to this source:
bool isSource1 = dvc1.MyEnhancedDocuments.Count == 1 && dvc1.MyEnhancedDocuments[0].Type == 0 && dvc1.MyEnhancedDocuments[0].VersionID == dv2.VersionID;
bool isSource2 = dvc2.MyEnhancedDocuments.Count == 1 && dvc2.MyEnhancedDocuments[0].Type == 0 && dvc2.MyEnhancedDocuments[0].VersionID == dv1.VersionID;
if (isSource1 || isSource2)
{
int sourceVersionID = isSource1 ? dv1.VersionID : dv2.VersionID;
DVEnhancedDocuments enhList = isSource1 ? dvc2.MyEnhancedDocuments : dvc1.MyEnhancedDocuments;
if (enhList != null)
{
foreach (DVEnhancedDocument ded in enhList)
{
if (ded.Type != 0 && ded.VersionID == sourceVersionID) // found it.
{
relatedEnh = true;
break;
}
}
}
}
}
return relatedEnh;
}
#endregion
#region SearchPaths
public string _SearchDVPath;
public string SearchDVPath

View File

@ -911,13 +911,18 @@ namespace VEPROMS.CSLA.Library
(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)
// B2022-148: cannot insert outside transition in a background document that references a related EOP transition is converted to text
bool dvsLinked = DocVersionInfo.Linked(tran.MyItemToID.MyDocVersion, tran.MyContent.ContentItems[0].MyDocVersion);
if (!dvsLinked)
{
if (prci.DisplayNumber == destProcNumber)
string destProcNumber = tran.MyItemToID.MyProcedure.DisplayNumber;
foreach (ProcedureInfo prci in tran.MyContent.ContentItems[0].MyDocVersion.Procedures)
{
forceConvertToText = true;
break;
if (prci.DisplayNumber == destProcNumber)
{
forceConvertToText = true;
break;
}
}
}