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
This commit is contained in:
John Jenko 2013-06-10 19:53:02 +00:00
parent df121e54a9
commit f963dfc03c
4 changed files with 35 additions and 21 deletions

View File

@ -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.

View File

@ -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;
}

View File

@ -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;

View File

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