From f963dfc03c14c5dd486e90aac956425838c0997f Mon Sep 17 00:00:00 2001 From: John Date: Mon, 10 Jun 2013 19:53:02 +0000 Subject: [PATCH] Fixed initialization of the Print Section Number and Title Fixed the logic that determines the column mode of a section Logic to support the {HLSTEXT} token --- .../frmSectionProperties.cs | 3 +- .../Config/SectionConfig.cs | 41 +++++++++++-------- PROMS/Volian.Print.Library/Pagination.cs | 2 + PROMS/Volian.Print.Library/PromsPrinter.cs | 10 ++++- 4 files changed, 35 insertions(+), 21 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmSectionProperties.cs b/PROMS/VEPROMS User Interface/frmSectionProperties.cs index a2d106f9..d4d03553 100644 --- a/PROMS/VEPROMS User Interface/frmSectionProperties.cs +++ b/PROMS/VEPROMS User Interface/frmSectionProperties.cs @@ -284,7 +284,8 @@ namespace VEPROMS // Check for the print section num/title config item to determine whether that checkbox should // be checked. ppCbPrnSecNumTitle.Enabled = pf.FormatData.SectData.UseMetaSections; - ppCbPrnSecNumTitle.Checked = ppCbPrnSecNumTitle.Enabled && _SectionConfig.Section_PrintHdr != "N"; + //ppCbPrnSecNumTitle.Checked = ppCbPrnSecNumTitle.Enabled && _SectionConfig.Section_PrintHdr != "N"; + ppCbPrnSecNumTitle.Checked = _SectionConfig.Section_PrintHdr != "N"; // check if format has automated table of contents, if so, check if config flag is set that this // section should be included. diff --git a/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs b/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs index 10ea750c..2e77d024 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs @@ -475,6 +475,28 @@ namespace VEPROMS.CSLA.Library // If there is no parent value, then use the volian default if (s == string.Empty) { + SectionInfo si = _SectionInfo != null ? _SectionInfo : SectionInfo.Get(_Section.ItemID); + if (si != null) + { + E_PurchaseOptions po = (E_PurchaseOptions)(MyFormat ?? MyDefaultFormat).PlantFormat.FormatData.PurchaseOptions; + bool enhDev = (po & E_PurchaseOptions.EnhancedDeviations) == E_PurchaseOptions.EnhancedDeviations; + bool enhBack = (po & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds; + if (!enhDev && !enhBack) + { + switch (si.MyProcedure.ProcedureConfig.Format_Columns) + { + case FormatColumns.OneColumn: + return SectionColumnMode.One; + break; + case FormatColumns.TwoColumn: + return SectionColumnMode.Two; + break; + //default: + // return SectionColumnMode.One; + // break; + } + } + } int rval = 0; if (MyFormat != null) { @@ -492,24 +514,7 @@ namespace VEPROMS.CSLA.Library // it's format column. if (rval == 0) { - SectionInfo si = _SectionInfo != null? _SectionInfo: SectionInfo.Get(_Section.ItemID); - if (si != null) - { - switch (si.MyProcedure.ProcedureConfig.Format_Columns) - { - case FormatColumns.OneColumn: - return SectionColumnMode.One; - break; - case FormatColumns.TwoColumn: - return SectionColumnMode.Two; - break; - default: - return SectionColumnMode.One; - break; - } - } - else - return SectionColumnMode.One; // 16bit's default if nothing defined + return SectionColumnMode.One; // 16bit's default if nothing defined } return (SectionColumnMode)rval; } diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index a4ce350e..f13ed01f 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -135,6 +135,8 @@ namespace Volian.Print.Library return 0; // Don't Paginate (page break) on a Step Section if it's first thing on page } if (!MyItemInfo.IsHigh) return 0; // Don't Paginate on a Substep level + MyPageHelper.HLSText = MyItemInfo.DisplayText; // save the High Level Step Text + //Console.WriteLine("{0} Paginate", MyPageHelper.HLSText); StepConfig sc1 = MyItemInfo.MyConfig as StepConfig; ManualPageBreak = MyPageHelper.OriginalPageBreak ? (sc1 == null ? false : sc1.Step_ManualPagebreak) : sc1 == null ? false : sc1.Step_NewManualPagebreak; diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index b8d2c64f..77adb92b 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -381,11 +381,15 @@ namespace Volian.Print.Library // Set up Helper for the particular Section if (_MyHelper == null) { - cb.PdfWriter.PageEvent = _MyHelper = new VlnSvgPageHelper(mySection, this); + string hlsText = ""; + if (mySection.IsStepSection && mySection.Steps.Count > 0) + hlsText = mySection.Steps[0].DisplayText; // save the High level step text for use in the page list + cb.PdfWriter.PageEvent = _MyHelper = new VlnSvgPageHelper(mySection, this, hlsText); _MyHelper.AllowAllWatermarks = AllowAllWatermarks; _MyHelper.MyPdfWriter = cb.PdfWriter; _MyHelper.CreatingFoldoutPage = doingFoldout; _MyHelper.MyPdfContentByte = cb; + if (!mySection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)mySection, ((mySection.DisplayNumber ?? "") == "" ? "" : mySection.DisplayNumber + " - ") + mySection.DisplayText, null); if (DebugOutput) { @@ -418,7 +422,9 @@ namespace Volian.Print.Library } else { - _MyHelper.DidFirstPageDocStyle = false; + //Console.WriteLine("'{0}' PromsPrinter", mySection.DisplayText); + if (mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate) + _MyHelper.DidFirstPageDocStyle = false; if (!mySection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)mySection, ((mySection.DisplayNumber ?? "") == "" ? "" : mySection.DisplayNumber + " - ") + mySection.DisplayText, null); _MyHelper.MySection = mySection; OnStatusChanged("After Set Svg", PromsPrinterStatusType.SetSVG);