diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index ad292adb..4486eba4 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -179,7 +179,19 @@ namespace Volian.Controls.Library } if (!itemHasLink) { - if (inSource && (MyItemInfo.IsHigh || ((MyItemInfo.IsCaution || MyItemInfo.IsNote) && MyItemInfo.MyHLS.GetMyEnhancedDocuments().Count > 0))) + // don't put up 'create missing' if the enhanced procedure does not have a section for this step: + ItemInfo sectInfo = MyItemInfo.ActiveSection; + SectionConfig sectConfig = sectInfo.MyConfig as SectionConfig; + bool hasEnhSect = false; + foreach (EnhancedDocument edsect in sectConfig.MyEnhancedDocuments) + { + if (edsect.Type == edtypebtn) + { + hasEnhSect = true; + break; + } + } + if (inSource && hasEnhSect && (MyItemInfo.IsHigh || ((MyItemInfo.IsCaution || MyItemInfo.IsNote) && MyItemInfo.MyHLS.GetMyEnhancedDocuments().Count > 0))) { biEnhanced.Visible = true; biEnhanced.Text = string.Format("Create Missing Enhanced {0} Document Step", dveds.GetByType(edtypebtn).Name);