C2024-003-Print-Sub-Section

This commit is contained in:
2024-02-22 16:54:56 -05:00
parent 77d31a4a99
commit dcfdf5f852
7 changed files with 978 additions and 879 deletions

View File

@@ -18,14 +18,14 @@ namespace VEPROMS
{
public bool SaveLinks
{
get
{
get
{
return swtbtnPDFLinks.Value;
}
}
public int RemoveTrailingHardReturnsAndManualPageBreaks
{
get
get
{
// C2021-010: Remove trailing returns/spaces & manual page breaks & allow save.
// return values: 0=None; 1=Trailing; 2=ManualPgBrk; 3=Both.
@@ -33,7 +33,7 @@ namespace VEPROMS
if (!cbxRemoveManualPgBrk.Checked && !cbxRemoveTrailing.Checked) return 0;
if (!cbxRemoveManualPgBrk.Checked && cbxRemoveTrailing.Checked) return 1;
if (cbxRemoveManualPgBrk.Checked && !cbxRemoveTrailing.Checked) return 2;
return 3;
return 3;
}
}
private string _Prefix = ""; // RHM20150506 Multiline ItemID TextBox
@@ -59,8 +59,8 @@ namespace VEPROMS
get { return _Automatic; }
set { _Automatic = value; }
}
private int _prtSectID = -1;
public int PrtSectID
private int[] _prtSectID = new int[] { -1, -1, 0 };
public int[] PrtSectID
{
get { return _prtSectID; }
set { _prtSectID = value; }
@@ -73,8 +73,8 @@ namespace VEPROMS
public bool AllowDateTimePrefixSuffix
{
get { return _AllowDateTimePrefixSuffix; }
set
{
set
{
_AllowDateTimePrefixSuffix = value;
swtbtnPDFdtPrefixSuffix.Value = swtbtnPDFdtPrefixSuffix.Enabled = _AllowDateTimePrefixSuffix;
}
@@ -86,7 +86,7 @@ namespace VEPROMS
{
cbxDebugPagination.Checked = true;
cbxDebugText.Checked = true;
cbxMetaFile.Checked = true; // C2018-004 create meta file for baseline compares
cbxMetaFile.Checked = true; // C2018-004 create meta file for baseline compares
_IncludeWordSecTextInMetafile = true;
Application.DoEvents();
string[] parameters = System.Environment.CommandLine.Split(" ".ToCharArray());
@@ -101,7 +101,7 @@ namespace VEPROMS
cbxDebug.Checked = false;
else if (parameter.ToUpper() == "/NM")
cbxMetaFile.Checked = false; // C2018-004 turn off create meta file for baseline compares
else if (parameter.ToUpper() == "/NW")
else if (parameter.ToUpper() == "/NW")
_IncludeWordSecTextInMetafile = false; // C2018-023 turn off putting Word attachment text in the meta file for baseline compares
}
CreatePDFs();
@@ -143,10 +143,11 @@ namespace VEPROMS
}
public string PDFPath
{
get {// B2018-069 Revert to Temporary for Baseline testing
get
{// B2018-069 Revert to Temporary for Baseline testing
if (PromsPrinter.BaselineTesting)
return VlnSettings.TemporaryFolder;
return txbPDFLocation.Text;
return txbPDFLocation.Text;
}
set { txbPDFLocation.Text = value; }
}
@@ -190,7 +191,7 @@ namespace VEPROMS
if (_MyProcedure != null && _MyProcedure.ProcHasSupInfoData)
{
swtbtnBlankPgsForDuplex.Enabled = false;
tbBlankPage.Enabled = true; // C2019-004: Allow user to define duplex blank page text (similar changes throughout file are not commented)
tbBlankPage.Enabled = true; // C2019-004: Allow user to define duplex blank page text (similar changes throughout file are not commented)
}
btnCreatePDF.Text = "Create PDFs";
HandleDocVersionSettings();
@@ -235,7 +236,7 @@ namespace VEPROMS
gpnlDebug.Visible = Volian.Base.Library.VlnSettings.DebugMode;
swtbtnGeneratePlacekeeper.Value = false;
cbxGenerateConActSum.Checked = false;
swtbtnGeneratePlacekeeper.Visible = lblGeneratePlacekeeper.Visible = oneProcedure &&
swtbtnGeneratePlacekeeper.Visible = lblGeneratePlacekeeper.Visible = oneProcedure &&
((MyProcedure.ActiveFormat.PlantFormat.FormatData.PurchaseOptions & E_PurchaseOptions.AutoPlacekeeper) == E_PurchaseOptions.AutoPlacekeeper);
// C2021-062 make visable the check box to assign rev number for all procedures being printed
// also make visable the Rev Num entry field.
@@ -280,7 +281,7 @@ namespace VEPROMS
expPrnSetting.Expanded = swtbtnBlankPgsForDuplex.Value || swtbtnChgBar.Value || swtbtnGeneratePlacekeeper.Value || swtbtnPDFLinks.Value || swtbtnPROMSVersion.Value || swtbtnWaterMark.Value || swtbtnPDFdtPrefixSuffix.Value;
}
public DlgPrintProcedure(ProcedureInfo pi, bool automatic) // RHM20150506 Multiline ItemID TextBox
{
{
InitializeComponent();
Automatic = automatic;
_AllProcedures = false;
@@ -309,7 +310,7 @@ namespace VEPROMS
{
base.OnActivated(e);
if (Owner != null)
Location = new Point(Owner.Left + Owner.Width / 2 - Width / 2, Owner.Top + Owner.Height/2 - Height/2);
Location = new Point(Owner.Left + Owner.Width / 2 - Width / 2, Owner.Top + Owner.Height / 2 - Height / 2);
}
private void HandleDocVersionSettings()
{
@@ -323,10 +324,10 @@ namespace VEPROMS
// if the default setting is 'SelectBeforePrinting', expand the Additional Print Settings panel
if (_DocVersionConfig.Print_ChangeBar == PrintChangeBar.SelectBeforePrinting)
{
swtbtnChgBar.Value = false;
cbxOvrrideDefChgBars.Checked = false;
expPrnSetting.Expanded = true;
}
swtbtnChgBar.Value = false;
cbxOvrrideDefChgBars.Checked = false;
expPrnSetting.Expanded = true;
}
}
private void GetDocVersionSettings()
@@ -341,14 +342,14 @@ namespace VEPROMS
cbxOpenAfterCreate2.Checked = _DocVersionConfig.Print_AlwaysViewPDFAfterCreate;
// Changebars on/off
if (_DocVersionConfig.Print_ChangeBar == PrintChangeBar.Without)
swtbtnChgBar.Value = false;
swtbtnChgBar.Value = false;
else
swtbtnChgBar.Value = true;
swtbtnChgBar.Value = true;
// Watermark on/off
if (_DocVersionConfig.Print_Watermark == PrintWatermark.None)
swtbtnWaterMark.Value = false;
swtbtnWaterMark.Value = false;
else
swtbtnWaterMark.Value = true;
swtbtnWaterMark.Value = true;
// Auto Duplexing on/off - Auto duplex was used only by Point Beach formats These buttons were removed from the dialog
// There was not print coding to support this format flag
@@ -373,7 +374,7 @@ namespace VEPROMS
// default to using OriginalPageBreaks (16bit page breaks) if App.config is set
// to true:
//cbxOrPgBrk.Visible = VlnSettings.OriginalPageBreak && VlnSettings.DebugMode;
cbxOrPgBrk.Visible = false; //per Harry
cbxOrPgBrk.Visible = false; //per Harry
cbxOrPgBrk.Checked = false;
}
@@ -410,7 +411,7 @@ namespace VEPROMS
private Timer _MyTimer;
public void SetupForProcedure() // RHM20150506 Multiline ItemID TextBox
{
if(_DocVersionInfo == null)this.Text = "Create PDF for " + ProcNum;
if (_DocVersionInfo == null) this.Text = "Create PDF for " + ProcNum;
// get list of previous pdf files
// if no previous pdf file, then get path from frmVersionProperties
// dlgSelectFile.InitialDirectory = pdf path from frmVersionProperties
@@ -419,20 +420,20 @@ namespace VEPROMS
//txbPDFLocation.Text = _PDFPath;
BuildPDFFileName();
ProcedureConfig pc = _MyProcedure.MyConfig as ProcedureConfig;
if(SelectedSlave > 0) pc.SelectedSlave = SelectedSlave;
if (SelectedSlave > 0) pc.SelectedSlave = SelectedSlave;
if (pc != null)
{
//C2021-062 use the save rev number for all procedures if set, or just use the rev number in the current procedure config
RevNum = (_NewRevForAllProcs == null) ? pc.Print_Rev : _NewRevForAllProcs;
RevDate = pc.Print_RevDate; //== null || pc.Print_RevDate=="" ? DateTime.Today : Convert.ToDateTime(pc.Print_RevDate);
ReviewDate = pc.Print_ReviewDate; // == null ? DateTime.Today : Convert.ToDateTime(pc.Print_ReviewDate);
//Now check the format flags to determine if/how the Rev string should be parsed.
// This will covert the old way (16-bit) of setting a RevDate (appending it to the RevNumber)
// to the new way saving the RevNumber and RevDate in there own config fields
//Now check the format flags to determine if/how the Rev string should be parsed.
// This will covert the old way (16-bit) of setting a RevDate (appending it to the RevNumber)
// to the new way saving the RevNumber and RevDate in there own config fields
if ((_MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate && RevNum.Contains("/"))
|| (_MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash && RevNum.Contains("\\")))
|| (_MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash && RevNum.Contains("\\")))
{
int indx = RevNum.IndexOf(_MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash ? '\\' : '/');
int indx = RevNum.IndexOf(_MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash ? '\\' : '/');
pc.Print_RevDate = RevDate = RevNum.Substring(indx + 1);
pc.Print_Rev = RevNum = RevNum.Substring(0, indx);
// save the RevNumber and RevDate to the procedure's config.
@@ -529,9 +530,9 @@ namespace VEPROMS
PDFDTSuffix dtSuf = _DocVersionConfig.Print_PDFdtFileSuffix;
if (dtPre != PDFDTPrefix.None) PDFFilePrefix = ""; // incase user entered prefix text but then selected a date/time (in working draft properties)
if (dtSuf != PDFDTSuffix.None) PDFFileSuffix = ""; // incase user entered suffix text but then selected a date/time (in working draft properties)
// B2020-062 control the toggle of date/time prefix/suffix on pdf file name
// disable the date/time Prefix/Suffix switch if no date/time was selected
// This switch is does not affect the use of it if the user typed in text for prefix/suffix
// B2020-062 control the toggle of date/time prefix/suffix on pdf file name
// disable the date/time Prefix/Suffix switch if no date/time was selected
// This switch is does not affect the use of it if the user typed in text for prefix/suffix
if (!AllowDateTimePrefixSuffix || (dtPre == PDFDTPrefix.None && dtSuf == PDFDTSuffix.None))
{
swtbtnPDFdtPrefixSuffix.Value = false;
@@ -564,7 +565,7 @@ namespace VEPROMS
private void SetupPrefixSuffixSwitch()
{
if (_CreateButtonClicked) return; // B2020-062 control the toggle of date/time prefix/suffix on pdf file name
// note that MyProcedure must be set before calling this because BuildPDFFileName() will be called when the swbtnPDFPrefixSuffix is set
// note that MyProcedure must be set before calling this because BuildPDFFileName() will be called when the swbtnPDFPrefixSuffix is set
string PDFFilePrefix = _DocVersionConfig.Print_PDFFilePrefix;
string PDFFileSuffix = _DocVersionConfig.Print_PDFFileSuffix;
PDFDTPrefix dtPre = _DocVersionConfig.Print_PDFdtFilePrefix;
@@ -607,7 +608,7 @@ namespace VEPROMS
private void swtbtnWaterMark_ValueChanged(object sender, EventArgs e)
{
if (!swtbtnWaterMark.Value) // C2021-019: make both invisible
if (!swtbtnWaterMark.Value) // C2021-019: make both invisible
{
cbxWaterMark.Visible = swtbtnWaterMark.Value;
lblWaterMarkOvrd.Visible = swtbtnWaterMark.Value;
@@ -634,7 +635,7 @@ namespace VEPROMS
if (!Directory.Exists(PDFPath))
{
string msg = string.Format("'{0}' does not exist. \n\nCreate it?", PDFPath);
DialogResult dr= MessageBox.Show(msg, "Folder Not Found", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
DialogResult dr = MessageBox.Show(msg, "Folder Not Found", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dr == DialogResult.Yes)
{
try
@@ -668,7 +669,7 @@ namespace VEPROMS
public ProcedureInfo MyProcedure
{
get { return _MyProcedure; }
set
set
{
_MyProcedure = value;
// if procedure has supplemental information, the automatially check the add blank pages for duplex printing
@@ -723,18 +724,18 @@ namespace VEPROMS
// B2019-128: The combo box list did not include the 'None' option so the selected value was not the correct watermark (had to add 1 to the selected index)
string waterMarkText = (swtbtnWaterMark.Value) ? cbxWaterMark.Text : "None"; // C2021-019
string watermarkColor = "Blue"; // this is the default watermark color
// Determine change bar settings. First get from config & then see if override from dialog.
// Also check that format allows override.
// Determine change bar settings. First get from config & then see if override from dialog.
// Also check that format allows override.
ChangeBarDefinition cbd = DetermineChangeBarSettings();
int n = _DocVersionInfo.Procedures.Count;
int i = 0;
pbPDFsStatus.Maximum = n;
pbPDFsStatus.Visible = true;
VlnSvgPageHelper.CountInApplProcs = 1; // B2021-127: BNPPalr - Auto set of serial #, skip Front Matter as per PAL 11/1/21 (set to 1 not 0)
VlnSvgPageHelper.CountInApplProcs = 1; // B2021-127: BNPPalr - Auto set of serial #, skip Front Matter as per PAL 11/1/21 (set to 1 not 0)
this.Text = string.Format("Processing {0}", _DocVersionInfo.MyFolder.Name);
foreach (ProcedureInfo myProc in _DocVersionInfo.Procedures)
{
string locpdfname = null; // get pdf file name for later merge code
string locpdfname = null; // get pdf file name for later merge code
MyProcedure = myProc;
// C2021-019: Override Watermark Text, 'waterMarkText' will have whatever watermark text should be printed
ProcedureConfig procConfig = MyProcedure.MyConfig as ProcedureConfig;
@@ -772,7 +773,7 @@ namespace VEPROMS
string myPDFPath = GetMultiunitPDFPath();
_MergedPdfPath = myPDFPath; // If Slave, need its subdirectory/unit path for merging
// RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered.
// B2021-102 put in the using for better memory management
// B2021-102 put in the using for better memory management
using (frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, waterMarkText, cbxDebug.Checked, cbxOrPgBrk.Checked,
cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, myPDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50),
swtbtnBlankPgsForDuplex.Value, _AllProcedures || Automatic, Prefix, SaveLinks, RemoveTrailingHardReturnsAndManualPageBreaks, swtbtnPROMSVersion.Value, true, tbBlankPage.Text, _MergedPfd, watermarkColor, PrtSectID))//;//C2018-009 print PROMS version
@@ -871,7 +872,7 @@ namespace VEPROMS
}
}
pbPDFsStatus.Visible = false;
if(!Automatic)
if (!Automatic)
ShowDebugFiles();
ProfileTimer.Pop(profileDepth);
ProfileTimer.ShowTimerTable();
@@ -943,7 +944,7 @@ namespace VEPROMS
if (cbxDebugText.Checked)
Volian.Base.Library.DebugText.Show();
if (cbxMetaFile.Checked)// C2018-004 create meta file for baseline compares
Volian.Base.Library.BaselineMetaFile.Show(); // baseline
Volian.Base.Library.BaselineMetaFile.Show(); // baseline
}
public void CreatePDF() // RHM20150506 Multiline ItemID TextBox
{
@@ -958,9 +959,9 @@ namespace VEPROMS
return;
}
MyProcedure.SelectedChildToPrint = SelectedSlave; // B2023-035 for BNPP Alarms save the number of the child selected to print
// B2021-127: BNPPalr - Auto set of serial #, skip Front Matter as per PAL 11/1/21 (set to 1 not 0)
// Only do if set has applicability, printing an individual procedure, need to determine
// applicability count.
// B2021-127: BNPPalr - Auto set of serial #, skip Front Matter as per PAL 11/1/21 (set to 1 not 0)
// Only do if set has applicability, printing an individual procedure, need to determine
// applicability count.
if (MyProcedure.MyDocVersion.MultiUnitCount > 1)
{
VlnSvgPageHelper.CountInApplProcs = 1;
@@ -977,12 +978,12 @@ namespace VEPROMS
Volian.Print.Library.Rtf2Pdf.PdfDebug = cbxDebug.Checked;
// B2019-044 don't print the watermark if the watermark switch on the print dialog is turned off
cbxWaterMark.Visible = true;
string waterMarkText = (swtbtnWaterMark.Value) ? cbxWaterMark.Text : "None" ; // B2018-124 use text of watermark form drop down list instead of enum value
string waterMarkText = (swtbtnWaterMark.Value) ? cbxWaterMark.Text : "None"; // B2018-124 use text of watermark form drop down list instead of enum value
string watermarkColor = "Blue"; // this is the default watermark color
frmPDFStatusForm.SetUnitWatermark(MyProcedure, ref waterMarkText, ref watermarkColor); //C2022-004 Unit Designator Watermark
ProcedureConfig procConfig = MyProcedure.MyConfig as ProcedureConfig;
string waterMarkTextOverride = "";
if (procConfig != null) waterMarkTextOverride = procConfig.GetValue("PSI", "WATERMARKOVERRIDE"); // C2021-019: override watermark text
if (procConfig != null) waterMarkTextOverride = procConfig.GetValue("PSI", "WATERMARKOVERRIDE"); // C2021-019: override watermark text
if (swtbtnWaterMark.Value && waterMarkTextOverride != null && waterMarkTextOverride != "") waterMarkText = waterMarkTextOverride;
// Determine change bar settings. First get from config & then see if override from dialog.
// Also check that format allows override.
@@ -1199,7 +1200,7 @@ namespace VEPROMS
grpDateSelector.Text = "Select Revision Date";
grpDateSelector.Visible = calDateSelector.Visible = true;
//C2021-007 position the calendar to the current RevDate or if no RevDate, position to today's date
DateTime initSelDate =(txbDate.Text != null && txbDate.Text.Length != 0)? Convert.ToDateTime(txbDate.Text) : DateTime.Today;
DateTime initSelDate = (txbDate.Text != null && txbDate.Text.Length != 0) ? Convert.ToDateTime(txbDate.Text) : DateTime.Today;
calDateSelector.DisplayMonth = calDateSelector.SelectedDate = initSelDate;
}
@@ -1298,11 +1299,11 @@ namespace VEPROMS
}
private void expPrnSetting_ExpandedChanging(object sender, DevComponents.DotNetBar.ExpandedChangeEventArgs e)
{
if (expPrnSetting.Expanded)
{
if (expPrnSetting.Expanded)
//this.Size = new Size(this.Size.Width+(expPrnSetting.Size.Width-expPrnSetting.TitlePanel.Size.Height), this.Size.Height);
//else
this.Size = new Size(this.Size.Width-(expPrnSetting.Size.Width-expPrnSetting.TitlePanel.Size.Height), this.Size.Height);
//else
this.Size = new Size(this.Size.Width - (expPrnSetting.Size.Width - expPrnSetting.TitlePanel.Size.Height), this.Size.Height);
//Refresh();
}
@@ -1334,12 +1335,12 @@ namespace VEPROMS
{
DateTime dtStart = DateTime.Now;
_MergedPfd = new MergedPdf(PDFPath, _DocVersionInfo);
PromsPrinter.MergedLandscapePages = null; // B2019-152: MergedLandscapePages has data set when creating separate pdfs (DoCreatePDF)
DoCreatePDF(); // create indivitual pdfs
PromsPrinter.MergedLandscapePages = null; // B2019-152: MergedLandscapePages has data set when creating separate pdfs (DoCreatePDF)
DoCreatePDF(); // create indivitual pdfs
if (_MergedPdfPath != null && _MergedPdfPath != PDFPath) PDFPath = _MergedPfd.Folder = _MergedPdfPath;
// C2021-063 pass in whether to generate Alarm Point List text when a merge is done
if (!_MergedPfd.DoTheMerge(PromsPrinter.MergedLandscapePages,cbxAlmPtTxt.Checked)) return; // merge them together.
// if the property to show the file after printing is set (on the version dialog), display it. Otherwise do a dialog to let user know it's done
if (!_MergedPfd.DoTheMerge(PromsPrinter.MergedLandscapePages, cbxAlmPtTxt.Checked)) return; // merge them together.
// if the property to show the file after printing is set (on the version dialog), display it. Otherwise do a dialog to let user know it's done
if (_DocVersionConfig.Print_MergedPdfsViewAfter)
{
if (_MergedPfd.MergedPdfs != null && _MergedPfd.MergedPdfs.Count > 0)

View File

@@ -91,13 +91,13 @@ namespace VEPROMS
get { return _DidAll; }
set { _DidAll = value; }
}
private int _prtSectID = -1;
public int PrtSectID
private int[] _prtSectID = new int[] { -1, -1, 0 };
public int[] PrtSectID
{
get { return _prtSectID; }
set { _prtSectID = value; }
}
public frmPDFStatusForm(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, bool openPDF, bool overWrite, string pdfPath, ChangeBarDefinition cbd, string pdfFile, Point newLocation, bool insertBlankPages, bool allOrAuto, string prefix, bool saveLinks, int removeTrailingHardReturnsAndManualPageBreaks, bool showPROMSVer, bool didAll, string blankPageText, MergedPdf mergedPdf, string watermarkColor, int PrtSectID = -1)
public frmPDFStatusForm(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, bool openPDF, bool overWrite, string pdfPath, ChangeBarDefinition cbd, string pdfFile, Point newLocation, bool insertBlankPages, bool allOrAuto, string prefix, bool saveLinks, int removeTrailingHardReturnsAndManualPageBreaks, bool showPROMSVer, bool didAll, string blankPageText, MergedPdf mergedPdf, string watermarkColor, int[] PrtSectID = null)
{
// B2021-088 moved this if/else from CreatePDF() so that the Approval logic will have access to this logic
ProcedureInfo MyProcedure = myItem as ProcedureInfo;
@@ -107,7 +107,7 @@ namespace VEPROMS
if (MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave > 0 || MyProcedure.ActiveFormat.PlantFormat.FormatData.TransData.UseTransitionModifier || MyProcedure.ActiveFormat.PlantFormat.FormatData.TransData.UseSpecificTransitionModifier)
{
// B2023-035 Pass in the select child (selectedSlave) which may be different than docversionconfig's SelectedSlave
MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave, allOrAuto, MyProcedure.SelectedChildToPrint);
MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave, allOrAuto, MyProcedure.SelectedChildToPrint);
}
else
MyProcedure = ProcedureInfo.GetItemAndChildren(MyProcedure.ItemID, allOrAuto);
@@ -129,11 +129,11 @@ namespace VEPROMS
// if the version number of PROMS is 1.0, then we are running a Demo version.
// When running a Demo version, force a "Sample" watermark when printing.
// B2020-022 append a ".pdf" extension if the file name does on have one.
MyPromsPrinter = new PromsPrinter(myItem, rev, (VlnSettings.ReleaseMode.Equals("DEMO")) ? "Sample" : watermark, debugOutput, origPgBrk, pdfPath + @"\Compare", false, overWrite, cbd, (pdfFile.ToUpper().EndsWith(".PDF"))?pdfFile:pdfFile+".pdf", insertBlankPages, allOrAuto,Prefix,saveLinks,removeTrailingHardReturnsAndManualPageBreaks, blankPageText, DidAll, mergedPdf, watermarkColor);
MyPromsPrinter = new PromsPrinter(myItem, rev, (VlnSettings.ReleaseMode.Equals("DEMO")) ? "Sample" : watermark, debugOutput, origPgBrk, pdfPath + @"\Compare", false, overWrite, cbd, (pdfFile.ToUpper().EndsWith(".PDF")) ? pdfFile : pdfFile + ".pdf", insertBlankPages, allOrAuto, Prefix, saveLinks, removeTrailingHardReturnsAndManualPageBreaks, blankPageText, DidAll, mergedPdf, watermarkColor);
MyPromsPrinter.PromsVersion = (showPROMSVer) ? AboutVEPROMS.PROMSVersion : ""; //C2018-009 print PROMS version
PDFPath = pdfPath;
this.Text = "Creating PDF of " + myItem.DisplayNumber;
_NewLocation = newLocation;
@@ -296,8 +296,8 @@ namespace VEPROMS
}
while (!MyPromsPrinter.MergeNotIncluded && _PdfFile == null && MessageBox.Show("Try Again?", "PDF Creation Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes);
if (_PdfFile == null)
{
this.Close();
@@ -318,7 +318,7 @@ namespace VEPROMS
DateTime tEnd = DateTime.Now;
MyStatus = _PdfFile + " created.";
MyStatus = string.Format("{0} created in {1:0.} milliseconds", _PdfFile, (TimeSpan.FromTicks(tEnd.Ticks - tStart.Ticks).TotalMilliseconds));
if (OpenPDF)
{
OpenPDFandPlacekeeper(_PdfFile);
@@ -332,8 +332,8 @@ namespace VEPROMS
if (UserInfo.CanEdit(frmVEPROMS.SMyUserInfo, MyPromsPrinter.MyItem.MyDocVersion))
{
// C2023-018: Clarify message on temporary/permanent removal of returns/spaces & page breaks
if (FlexibleMessageBox.Show(this, "The procedure PDF file was created by temporarily removing certain hard returns,\r\ntrailing spaces, and/or manual page breaks that could affect the pagination\r\n"+
"of the procedure.\r\n\r\nAfter reviewing the PDF file, do you want to permanently remove the deleted hard returns, \r\nspaces and/or manual page breaks?\r\n\r\n"+
if (FlexibleMessageBox.Show(this, "The procedure PDF file was created by temporarily removing certain hard returns,\r\ntrailing spaces, and/or manual page breaks that could affect the pagination\r\n" +
"of the procedure.\r\n\r\nAfter reviewing the PDF file, do you want to permanently remove the deleted hard returns, \r\nspaces and/or manual page breaks?\r\n\r\n" +
"An annotation will be added to every location where data has been deleted. The locations \r\ncan be found by performing a Global Search for the \"Manual Pagination Issues\" annotation type.",
"Confirm Pagination Changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
@@ -345,7 +345,7 @@ namespace VEPROMS
}
btnOpenFolder.Visible = btnOpenPDF.Visible = true;
if (CloseWhenDone)
{
OpenPDFandPlacekeeper(null);
@@ -422,7 +422,7 @@ namespace VEPROMS
}
catch (Exception ex)
{
string str = string.Format("{0} - {1} - {2}",pdffile,ex.GetType().Name,ex.Message);
string str = string.Format("{0} - {1} - {2}", pdffile, ex.GetType().Name, ex.Message);
MessageBox.Show(str, "Error Opening PDFFile", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}

View File

@@ -116,7 +116,7 @@ namespace VEPROMS
//added by jcb 20130718 to support create pdf button when multi-unit and user selects a unit
pi.MyDocVersion.DocVersionConfig.SelectedSlave = pi.ProcedureConfig.SelectedSlave;
DlgPrintProcedure prnDlg = new DlgPrintProcedure(pi);
//added by jcb 20130718 to support create pdf button when multi-unit and user selects a unit
@@ -356,12 +356,12 @@ namespace VEPROMS
cmbFont.SelectedIndex = -1;
string[] parameters = System.Environment.CommandLine.Split(" ".ToCharArray());
string db = Volian.Base.Library.VlnSettings.GetDB();
if (db != null)
Database.SelectedDatabase = db;
//B2018-129 Most Recently Used list was being cleared. Needed to remove a (string) type case in the IF statement
if (!string.IsNullOrEmpty((string)Properties.Settings.Default["DefaultDB"]))
if (!string.IsNullOrEmpty((string)Properties.Settings.Default["DefaultDB"]))
Database.LastDatabase = Properties.Settings.Default.DefaultDB;
// Setup the Context menu for DisplaySearch including the symbols
@@ -400,7 +400,7 @@ namespace VEPROMS
// B2019-107 Error Log message for inconsistent PromsFixes
_MyLog.InfoFormat("\r\nSession Beginning\r\n<===={0}[SQL:{1:yyMM.ddHH}]====== User: {2}/{3} Started {4} ===============>{5}"
, Application.ProductVersion, Database.RevDate, Environment.UserDomainName, Environment.UserName, DateTime.Now.ToString("dddd MMMM d, yyyy h:mm:ss tt"), FormatInfo.Failed ?? "");
// C2022-030 Notify the user if the stored procedure in the database are not update to date
// with those in the PROMSFixes.sql delivered with the PROMS executable
string pfVersion = ExeInfo.GetAssocicatedPROMSFixesVersion();
@@ -418,8 +418,8 @@ namespace VEPROMS
sbMsg.Append("\n\nPlease have your DBA update the database with the PROMSFixes.sql script file that was\ndelivered with this PROMS executable.");
sbMsg.Append("\n\nThe PROMSFixes.sql file is included with the PROMS installation download.");
sbMsg.Append("\n\nIt can also be found in your PROMS executable folder:");
sbMsg.AppendFormat("\n\t{0}",ExeInfo.PROMSExecutableFolderPath());
FlexibleMessageBox.Show(sbMsg.ToString(),"SQL Stored Procedures Version Difference");
sbMsg.AppendFormat("\n\t{0}", ExeInfo.PROMSExecutableFolderPath());
FlexibleMessageBox.Show(sbMsg.ToString(), "SQL Stored Procedures Version Difference");
}
foreach (string parameter in parameters)
@@ -527,7 +527,7 @@ namespace VEPROMS
tv.ViewPDF += new vlnTreeViewPdfEvent(tv_ViewPDF);
displayApplicability.ApplicabilityViewModeChanged += new DisplayApplicability.DisplayApplicabilityEvent(displayApplicability_ApplicabilityViewModeChanged);
tv.ExportImportProcedureSets += new vlnTreeViewEvent(tv_ExportImportProcedureSets);
tv.PrintTransitionReport += new vlnTreeViewEvent(tv_PrintTransitionReport);
tv.ProcessingComplete += tv_ProcessingComplete;
@@ -690,7 +690,7 @@ namespace VEPROMS
else
{
int ownerid = MySessionInfo.CheckOutItem(fi.FolderID, CheckOutType.Session);
dlgExportImport dlg = new dlgExportImport(args.Index == 0 ? "Export" : "Import", fi, this, (E_UCFImportOptions)Properties.Settings.Default.UCFImportOpt);//Added frmVEPROMS Parameter
dlg.ShowDialog(this);
@@ -1139,7 +1139,7 @@ namespace VEPROMS
dvi.DocVersionConfig.SelectedSlave = 0;
}
void tv_PrintProcedure(object sender, vlnTreeEventArgs args)
{
ProcedureInfo pi = (args.Node as VETreeNode).VEObject as ProcedureInfo;
@@ -1178,8 +1178,8 @@ namespace VEPROMS
pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
}
}
catch(Exception ex)
{
catch (Exception ex)
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("Could not create PDF Print");
@@ -1197,7 +1197,21 @@ namespace VEPROMS
{
//args.Node.Parent.
SectionInfo si2 = (args.Node as VETreeNode).VEObject as SectionInfo;
int _prtSectID = si2.ItemID;
int[] _prtSectID = new int[3];
if (si2.IsSubsection == true)
{
// If section is a subsection.
_prtSectID[0] = si2.MyParent.ItemID; // section
_prtSectID[1] = si2.ItemID; // sub section
_prtSectID[2] = Convert.ToInt32(si2.IsSubsection); // IsSubSection flag
}
else
{
// If section is a regular section
_prtSectID[0] = si2.ItemID; // section
_prtSectID[1] = -1; // sub section
_prtSectID[2] = Convert.ToInt32(si2.IsSubsection); // IsSubSection flag
}
if (si2 == null) return;
@@ -1641,11 +1655,11 @@ namespace VEPROMS
if (!_WeAreExitingPROMS && !ClosingWithError && tc.SelectedDisplayTabItem != null && tc._MyDisplayTabItems.Count > 0)
{
// B2019-071 dialog to ask user if we are to close one tab or exit
DlgCloseTabsOrExit dctoe = new DlgCloseTabsOrExit(MyParent == null, PROMSWindowForms.Count > 0);
DlgCloseTabsOrExit dctoe = new DlgCloseTabsOrExit(MyParent == null, PROMSWindowForms.Count > 0);
dctoe.ShowDialog();
// B2019-101 flag that we are exiting from PROMS main window (separate windows)
_WeAreExitingPROMS = (MyParent == null && dctoe.ExitPROMS);
_WeAreExitingPROMS = (MyParent == null && dctoe.ExitPROMS);
if (dctoe.Cancel) // B2019-071 user decided to not close any tab and not exit PROMS - so do nothing and continue working
{
@@ -1667,7 +1681,7 @@ namespace VEPROMS
tc.CloseTabItem(tc.SelectedDisplayTabItem);
// B2019-071 close just the current tab and continue working
if (!dctoe.ExitPROMS)
if (!dctoe.ExitPROMS)
{
n = 0;
e.Cancel = true;
@@ -1700,7 +1714,7 @@ namespace VEPROMS
}
// This keeps PROMS from Hanging under certain circumstances
tc.ShuttingDown = true;
tc.ShuttingDown = true;
// B2019-161 When shutting down output the timing information (to the error log)
if (VolianTimer.TimingsOn)
@@ -1882,12 +1896,12 @@ namespace VEPROMS
private DevComponents.DotNetBar.ButtonItem btnUserControlOfFormatsExport;
private DevComponents.DotNetBar.ButtonItem btnUserControlOfFormatsImport;
private TabItemsToClose _MyCloseTabList = new TabItemsToClose();
public TabItemsToClose MyCloseTabList
{
get { return _MyCloseTabList; }
}
private bool _DisablePing = false;
public bool DisablePing
{
@@ -1997,7 +2011,7 @@ namespace VEPROMS
if (ContentInfo.IsInCache(id))
{
ContentInfo ci = ContentInfo.Get(id);
if (MySessionInfo.LastContentChange >= ci.LastChangedInt64)
{
using (Content c = Content.Get(id))
@@ -2021,7 +2035,7 @@ namespace VEPROMS
}
}
catch { }
//MySemaphore.Release();
//_MyLog.DebugFormat("{0},{1:X},{2:X},{3:X}", DateTime.Now.ToLongTimeString(), lastChanged, MySessionInfo.LastContentChange, MySessionInfo.LastChangedInt64);
}
@@ -2092,7 +2106,7 @@ namespace VEPROMS
btnResetSecurity = new ButtonItem("btnResetSecurity", "Reset Security");
btnSecurity.SubItems.Add(btnResetSecurity);
btnResetSecurity.Click += new EventHandler(btnResetSecurity_Click);
//batch refresh transitions
btnAdministrativeTools = new ButtonItem("btnAdministrativeTools", "Administrative Tools");
btnAdministrativeTools.Click += new EventHandler(btnAdministrativeTools_Click);
@@ -2106,7 +2120,7 @@ namespace VEPROMS
this.superTooltip1.SetSuperTooltip(btnResetSecurity, new SuperTooltipInfo("Reset Security", null, null, null, null, eTooltipColor.Gray));
this.superTooltip1.SetSuperTooltip(btnAdministrativeTools, new SuperTooltipInfo("Administrative Tools", null, null, null, null, eTooltipColor.Gray));
this.superTooltip1.SetSuperTooltip(btnUpdateFormats, new SuperTooltipInfo("Update Formats", null, null, null, null, eTooltipColor.Gray));
try
{
MyUserInfo = UserInfo.GetByUserID(VlnSettings.UserID);
@@ -2153,7 +2167,7 @@ namespace VEPROMS
btnFormats.Visible = isVisible;
btnSecurity.Visible = isVisible;
btnAdmin.Enabled = (isVisible || HasSetAdministrator(MyUserInfo));
tmrCloseTabItems = new Timer();
tmrCloseTabItems.Interval = 100;
tmrCloseTabItems.Tick += new EventHandler(tmrCloseTabItems_Tick);
@@ -2161,7 +2175,7 @@ namespace VEPROMS
CloseSessionsNoLongerActive();
MySessionInfo = SessionInfo.BeginSession(Environment.MachineName, System.Diagnostics.Process.GetCurrentProcess().Id);
if (MySessionInfo == null)
{
MessageBox.Show("This database is locked by the Administrator. Please try again later", "PROMS is Locked");
@@ -2205,7 +2219,7 @@ namespace VEPROMS
if (Settings.Default["Size"] != null) this.Size = Settings.Default.Size;
//if (Settings.Default["WindowState"] != null) this.WindowState = Settings.Default.WindowState;
//if (Settings.Default.SaveTreeviewExpanded) epProcedures.Expanded = Settings.Default.TreeviewExpanded;
// if the Procedures panel was left open from the last session, then open it
epProcedures.Expanded = Settings.Default.TreeviewExpanded;
if (Settings.Default["QATItems"] != null) ribbonControl1.QatLayout = Settings.Default.QATItems;
@@ -2377,7 +2391,7 @@ namespace VEPROMS
TurnChangeManagerOn.Execute();
}
}
// C2015-022 Separate Windows. This is a dictionary of child PROMS windows forms (frmVEPROMS)
//
Dictionary<int, frmVEPROMS> _PROMSWindowForms = null;
@@ -2425,7 +2439,7 @@ namespace VEPROMS
while (!(_tn.VEObject is FolderInfo))
{
// back up to the first folder tree node
_tn = (VETreeNode)_tn.Parent;
_tn = (VETreeNode)_tn.Parent;
}
_tn.Nodes.Clear(); // remove the child nodes from main window - child window now has this part of the procedure tree
@@ -2522,7 +2536,7 @@ namespace VEPROMS
}
DialogResult dr = System.Windows.Forms.DialogResult.Yes;
// RHM20150507 Table Scrunch
Rtf2Pdf.AllowTableScrunching = cbScrunch.Checked ? _DefaultScrunchingRules : TableScrunching.None;
@@ -2754,7 +2768,7 @@ namespace VEPROMS
tmrCloseTabItems.Enabled = false;
_TimeActivity1.Open();
while (MyCloseTabList.CountDTI > 0)
{
DisplayTabItem dti = MyCloseTabList.PopDTI();
@@ -3866,7 +3880,7 @@ namespace VEPROMS
{
infoPanel.Expanded = true;
infoTabs.SelectedTab = infotabRO;
displayRO.ProgressBar = bottomProgBar;
displayRO.MyRTB = (SelectedStepTabPanel == null) ? null :
@@ -4025,7 +4039,7 @@ namespace VEPROMS
// need this to update RO Tree after UpdateRofst (B2015-226)
// B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.MyROFST = SelectedROFst;
displayRO.MyROFST = SelectedROFst;
displayRO.LoadTree();
// resetting the MyROFSTLookup for the search & reports panels will refresh the RO trees after UpdateRofst in each of those panels (B2015-226)
@@ -4068,7 +4082,7 @@ namespace VEPROMS
SetCaption(tv.SelectedNode as VETreeNode);
displayApplicability.MyDisplayTabItem = tc.SelectedDisplayTabItem;
if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0)
{
displayRO.MyROFST = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
@@ -4283,7 +4297,7 @@ namespace VEPROMS
// B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.ProgressBar = bottomProgBar;
displayRO.MyRTB = args.MyEditItem.MyStepRTB;
displayRO.LoadTree();
displayRO.LoadTree();
displayBookMarks.MyEditItem = args.MyEditItem;
displayHistory.MyEditItem = args.MyEditItem;
@@ -4302,7 +4316,7 @@ namespace VEPROMS
displayRO.ROTypeFilter = SelectedStepTabPanel.MyStepPanel.SelectedEditItem is Volian.Controls.Library.GridItem && (SelectedStepTabPanel.MyStepPanel.SelectedEditItem as Volian.Controls.Library.GridItem).MyFlexGrid.IsRoTable ?
E_ROValueType.Table : (SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyItemInfo.IsFigure) ? E_ROValueType.Image : E_ROValueType.Text;
if (_LastStepRTB.IsRoTable && _LastStepRTB.MyItemInfo.MyContent.ContentRoUsageCount > 0)
displayRO.CurROLink = _LastStepRTB.MyItemInfo.MyContent.ContentRoUsages[0];
@@ -4420,7 +4434,7 @@ namespace VEPROMS
displayRO.ROTypeFilter = SelectedStepTabPanel.MyStepPanel.SelectedEditItem is Volian.Controls.Library.GridItem && (SelectedStepTabPanel.MyStepPanel.SelectedEditItem as Volian.Controls.Library.GridItem).MyFlexGrid.IsRoTable ?
E_ROValueType.Table : (SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyItemInfo.IsFigure) ? E_ROValueType.Image : E_ROValueType.Text;
displayRO.ProgressBar = bottomProgBar;
displayRO.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB;
displayRO.CurROLink = args.MyLinkText.MyRoUsageInfo;
@@ -4446,7 +4460,7 @@ namespace VEPROMS
if (!tv.Focused && tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.SelectedItemInfo != null)
tv.AdjustTree(tc.SelectedDisplayTabItem.SelectedItemInfo);
VETreeNode vtn = tv.SelectedNode as VETreeNode;
VETreeNode vtn = tv.SelectedNode as VETreeNode;
if (vtn == null) return;
StepInfo stpinf = vtn.VEObject as StepInfo;
if (stpinf == null || !stpinf.IsRNOPart) //B2017-037 is this a RNO step type element - don't allow insert before/after
@@ -4884,7 +4898,7 @@ namespace VEPROMS
private void btnUpdateFormat_Click(object sender, EventArgs e)
{
UpdateFormats(null);
UpdateFormats(null);
}
private void UpdateFormats(string mypath)
@@ -4955,7 +4969,7 @@ namespace VEPROMS
try
{
frmSendErrorLog frm = new frmSendErrorLog(Properties.Settings.Default.OutlookEmail, Properties.Settings.Default["SMTPServer"].ToString(), Properties.Settings.Default["SMTPUser"].ToString(), ErrorLogFileName);
if (frm.ShowDialog(this) == DialogResult.OK)
{
Properties.Settings.Default.OutlookEmail = frm.OutlookEmail;