Use ActiveFormat rather than FormatStepData.MyFormat (this works for Steps/Sections and Procedures)
This commit is contained in:
@@ -3619,19 +3619,19 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
public bool IsInTemplate() // is this step defined by template, i.e. included in template list
|
||||
{
|
||||
if (IsStep && FormatStepData.MyFormat.PlantFormat.FormatData.TopTemplateTypes != null && FormatStepData.MyFormat.PlantFormat.FormatData.TopTemplateTypes.ContainsKey((int)MyContent.Type - 20001)) return true;
|
||||
if (IsStep && ActiveFormat.PlantFormat.FormatData.TopTemplateTypes != null && ActiveFormat.PlantFormat.FormatData.TopTemplateTypes.ContainsKey((int)MyContent.Type - 20001)) return true;
|
||||
return false;
|
||||
}
|
||||
public bool IsWithInSingleColumnTemplate() // is this step within a step defined by a 'single-column' template item
|
||||
{
|
||||
if (IsStep && FormatStepData.MyFormat.PlantFormat.FormatData.TopTemplateTypes != null)
|
||||
if (IsStep && ActiveFormat.PlantFormat.FormatData.TopTemplateTypes != null)
|
||||
{
|
||||
ItemInfo tmp = this;
|
||||
while (tmp.IsStep)
|
||||
{
|
||||
if (tmp.TemplateIndex > 0)
|
||||
{
|
||||
if (FormatStepData.MyFormat.PlantFormat.FormatData.Templates[tmp.TemplateIndex].nocolm==0) return true;
|
||||
if (ActiveFormat.PlantFormat.FormatData.Templates[tmp.TemplateIndex].nocolm == 0) return true;
|
||||
return false;
|
||||
}
|
||||
tmp = tmp.MyParent;
|
||||
@@ -3641,8 +3641,8 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
public int GetSmartTemplateTopLevelIndxOfThisType(int oftype) // used for inserting steps
|
||||
{
|
||||
if (FormatStepData == null) return -1;
|
||||
FormatData formatData = FormatStepData.MyFormat.PlantFormat.FormatData;
|
||||
if (ActiveFormat == null) return -1;
|
||||
FormatData formatData = ActiveFormat.PlantFormat.FormatData;
|
||||
if (formatData.TopTemplateTypes == null || formatData.TopTemplateTypes.Count == 0) return -1;
|
||||
if (formatData.TopTemplateTypes.ContainsKey(oftype - 20001)) return formatData.TopTemplateTypes[oftype - 20001];
|
||||
return -1;
|
||||
@@ -3650,7 +3650,7 @@ namespace VEPROMS.CSLA.Library
|
||||
public int GetSmartTemplateTopLevelIndx()
|
||||
{
|
||||
if (FormatStepData == null) return -1;
|
||||
FormatData formatData = FormatStepData.MyFormat.PlantFormat.FormatData;
|
||||
FormatData formatData = ActiveFormat.PlantFormat.FormatData;
|
||||
if (formatData.TopTemplateTypes == null || formatData.TopTemplateTypes.Count == 0) return -1;
|
||||
ItemInfo tmp = this;
|
||||
while (!tmp.IsSection)
|
||||
@@ -3662,7 +3662,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
public int GetSmartTemplateIndex(int topIndx, int curStepType)
|
||||
{
|
||||
FormatData formatData = FormatStepData.MyFormat.PlantFormat.FormatData;
|
||||
FormatData formatData = ActiveFormat.PlantFormat.FormatData;
|
||||
if (formatData.TopTemplateTypes == null || formatData.TopTemplateTypes.Count == 0) return -1;
|
||||
int indx = topIndx;
|
||||
int curType = curStepType - 20001;
|
||||
@@ -3681,8 +3681,8 @@ namespace VEPROMS.CSLA.Library
|
||||
public int GetSmartTemplateIndex(int topIndx, string strtxt)
|
||||
{
|
||||
string txt = strtxt.Replace(@"\u160?"," ");
|
||||
if (FormatStepData == null) return -1;
|
||||
FormatData formatData = FormatStepData.MyFormat.PlantFormat.FormatData;
|
||||
if (ActiveFormat == null) return -1;
|
||||
FormatData formatData = ActiveFormat.PlantFormat.FormatData;
|
||||
if (formatData.TopTemplateTypes == null || formatData.TopTemplateTypes.Count == 0) return -1;
|
||||
int indx = topIndx;
|
||||
while (indx < formatData.Templates.Count)
|
||||
|
Reference in New Issue
Block a user