B2020-062 – Fix bug where the date/time prefix/suffix would automatically turn on (after turning it off) when the procedure is printed. Also disabled the Date/Time Prefix/Suffix switch on the print dialog when the prefix/suffix is plain text entered by the user. Original report of bug was that the PDF Links option did not work when there was a PDF file date/time prefix/suffix.
This commit is contained in:
parent
8d9d19db7d
commit
8601061eef
@ -149,6 +149,7 @@ namespace VEPROMS
|
|||||||
get { return cbxGenerateConActSum.Checked; }
|
get { return cbxGenerateConActSum.Checked; }
|
||||||
set { cbxGenerateConActSum.Checked = value; }
|
set { cbxGenerateConActSum.Checked = value; }
|
||||||
}
|
}
|
||||||
|
private bool _CreateButtonClicked = false; // B2020-062 control the toggle of date/time prefix/suffix on pdf file name
|
||||||
public DlgPrintProcedure(DocVersionInfo dvi, bool automatic)
|
public DlgPrintProcedure(DocVersionInfo dvi, bool automatic)
|
||||||
{
|
{
|
||||||
_Automatic = automatic;
|
_Automatic = automatic;
|
||||||
@ -469,10 +470,20 @@ namespace VEPROMS
|
|||||||
string PDFFilePrefix = _DocVersionConfig.Print_PDFFilePrefix;
|
string PDFFilePrefix = _DocVersionConfig.Print_PDFFilePrefix;
|
||||||
string PDFFileSuffix = _DocVersionConfig.Print_PDFFileSuffix;
|
string PDFFileSuffix = _DocVersionConfig.Print_PDFFileSuffix;
|
||||||
string PDFFileName = "";
|
string PDFFileName = "";
|
||||||
if (AllowDateTimePrefixSuffix && swtbtnPDFdtPrefixSuffix.Value)
|
|
||||||
{
|
|
||||||
PDFDTPrefix dtPre = _DocVersionConfig.Print_PDFdtFilePrefix;
|
PDFDTPrefix dtPre = _DocVersionConfig.Print_PDFdtFilePrefix;
|
||||||
PDFDTSuffix dtSuf = _DocVersionConfig.Print_PDFdtFileSuffix;
|
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
|
||||||
|
if (!AllowDateTimePrefixSuffix || (dtPre == PDFDTPrefix.None && dtSuf == PDFDTSuffix.None))
|
||||||
|
{
|
||||||
|
swtbtnPDFdtPrefixSuffix.Value = false;
|
||||||
|
swtbtnPDFdtPrefixSuffix.Enabled = false;
|
||||||
|
}
|
||||||
|
if (AllowDateTimePrefixSuffix && swtbtnPDFdtPrefixSuffix.Value)
|
||||||
|
{
|
||||||
//DateTime dts = DateTime.Now;
|
//DateTime dts = DateTime.Now;
|
||||||
if (dtPre != PDFDTPrefix.None)
|
if (dtPre != PDFDTPrefix.None)
|
||||||
PDFFilePrefix = (_PrefixSuffixDTS.ToString(dtPre.ToString())).Replace("__", " ").Replace("_", "-") + "_";
|
PDFFilePrefix = (_PrefixSuffixDTS.ToString(dtPre.ToString())).Replace("__", " ").Replace("_", "-") + "_";
|
||||||
@ -497,6 +508,7 @@ namespace VEPROMS
|
|||||||
// C2018-033 Enable/disable the switch to control whether to add Prefix and/or Suffix to PDF file name
|
// C2018-033 Enable/disable the switch to control whether to add Prefix and/or Suffix to PDF file name
|
||||||
private void SetupPrefixSuffixSwitch()
|
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 PDFFilePrefix = _DocVersionConfig.Print_PDFFilePrefix;
|
||||||
string PDFFileSuffix = _DocVersionConfig.Print_PDFFileSuffix;
|
string PDFFileSuffix = _DocVersionConfig.Print_PDFFileSuffix;
|
||||||
@ -947,7 +959,9 @@ namespace VEPROMS
|
|||||||
if (cbxMultiunitPdfLocation.SelectedItem != null)
|
if (cbxMultiunitPdfLocation.SelectedItem != null)
|
||||||
_MultiunitPdfLocation = cbxMultiunitPdfLocation.SelectedItem.ToString();
|
_MultiunitPdfLocation = cbxMultiunitPdfLocation.SelectedItem.ToString();
|
||||||
this.Cursor = Cursors.WaitCursor;
|
this.Cursor = Cursors.WaitCursor;
|
||||||
|
_CreateButtonClicked = true; // B2020-062 control the toggle of date/time prefix/suffix on pdf file name
|
||||||
CreatePDF();
|
CreatePDF();
|
||||||
|
_CreateButtonClicked = false;
|
||||||
this.Cursor = Cursors.Default;
|
this.Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user