Enhanced Documents for Procedures – add checkbox
Enhanced Documents for Sections – add radiobox Enhanced Documents – set sync checkbox
This commit is contained in:
@@ -149,6 +149,24 @@ namespace VEPROMS
|
||||
}
|
||||
|
||||
}
|
||||
// Saving of enhanced data: Only need to save if the form_load determined that this may have enhanced & radio type
|
||||
// boxes were enabled:
|
||||
if (_isStepSection && checkEnhancedSettings && rbEnhLnkContents.Enabled)
|
||||
{
|
||||
// get string that should be used for "LnkEnh"
|
||||
string type = rbEnhLnkTitle.Checked ? "T" : rbEnhLnkNo.Checked ? "N" : "Y";
|
||||
if (_SectionConfig.Section_LnkEnh != type)
|
||||
{
|
||||
// note that the enhanced section will get created and linked from vlntreeview (to keep the code
|
||||
// consistent between the way procedures and sections are done).
|
||||
using (Section ssav = Section.Get(_SectionConfig.MySection.ItemID))
|
||||
{
|
||||
ssav.SectionConfig.Section_LnkEnh = type;
|
||||
ssav.Save();
|
||||
ItemInfo.Refresh(ssav);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
@@ -249,12 +267,12 @@ namespace VEPROMS
|
||||
cmbo.WatermarkText = deftext;
|
||||
}
|
||||
}
|
||||
|
||||
private bool checkEnhancedSettings = false;
|
||||
private void frmSectionProperties_Load(object sender, EventArgs e)
|
||||
{
|
||||
_Initializing = true;
|
||||
sectionConfigBindingSource.DataSource = _SectionConfig;
|
||||
|
||||
|
||||
ppCmbxFormat.DataSource = null;
|
||||
ppCmbxFormat.DisplayMember = "FullName";
|
||||
ppCmbxFormat.ValueMember = "FullName";
|
||||
@@ -292,7 +310,7 @@ namespace VEPROMS
|
||||
ppBtnDefaultPaginationStyle.Visible = false;
|
||||
|
||||
//Console.WriteLine("{0}, {1}, current pagination", _SectionConfig.MySection.DisplayNumber, ppCmbxSectPagination.SelectedValue);
|
||||
ppCmbxSectPagination.SelectedValueChanged +=new EventHandler(ppCmbxSectPagination_SelectedValueChanged);
|
||||
ppCmbxSectPagination.SelectedValueChanged += new EventHandler(ppCmbxSectPagination_SelectedValueChanged);
|
||||
|
||||
ppCmbxNumColumns.DataSource = EnumDetail<SectionConfig.SectionColumnMode>.Details();
|
||||
ppCmbxNumColumns.DisplayMember = "Description";
|
||||
@@ -314,7 +332,7 @@ namespace VEPROMS
|
||||
//ppCmbxAccPgPrintSize.ValueMember = "Evalue";
|
||||
//ppCmbxAccPgPrintSize.SelectedIndex = -1;
|
||||
|
||||
if (!_isStepSection)
|
||||
if (!_isStepSection)
|
||||
ppCmbxLibDocFill();
|
||||
|
||||
// check type of section from document styles to determine if the stepsection checkbox should
|
||||
@@ -353,7 +371,7 @@ namespace VEPROMS
|
||||
// be checked.
|
||||
ppCbPrnSecNumTitle.Enabled = _isStepSection;//true; // pf.FormatData.SectData.UseMetaSections;
|
||||
//ppCbPrnSecNumTitle.Checked = ppCbPrnSecNumTitle.Enabled && _SectionConfig.Section_PrintHdr != "N";
|
||||
ppCbPrnSecNumTitle.Checked = (_isStepSection &&_SectionConfig.Section_PrintHdr != "N");
|
||||
ppCbPrnSecNumTitle.Checked = (_isStepSection && _SectionConfig.Section_PrintHdr != "N");
|
||||
ppCbPrnSecNumTitle.Visible = _isStepSection; // only display if we are on a step editor section
|
||||
|
||||
// check if format has automated table of contents, if so, check if config flag is set that this
|
||||
@@ -391,7 +409,7 @@ namespace VEPROMS
|
||||
// Handle Default Step Section. First, this checkbox is only visible if it is
|
||||
// a step section & it is the highest level (top, right below procedures).
|
||||
ppCbDefaultStepSection.Visible = false;
|
||||
if (_isStepSection && _SectionConfig.MySection.MySectionInfo.MyParent.IsProcedure)
|
||||
if (_isStepSection && _SectionConfig.MySection.MySectionInfo.MyParent.IsProcedure)
|
||||
{
|
||||
ppCbDefaultStepSection.Visible = true;
|
||||
ppCbDefaultStepSection.Checked = _SectionConfig.Section_OriginalSteps == "Y";
|
||||
@@ -407,8 +425,50 @@ namespace VEPROMS
|
||||
ppCbDefaultStepSection.Text = "Make this the Default Step Section";
|
||||
}
|
||||
|
||||
_Initializing = false;
|
||||
//_InitialIndex = ppCmbxFormat.SelectedIndex;
|
||||
// if the parent has enhanced documents (and is not an enhanced document, i.e. the test
|
||||
// ed.Type != 0 proves that) put up the group panel on the automation tab that allows for setting of
|
||||
// link types (none, title only, content). The radio buttons are only enabled if the section is
|
||||
// NEW (determined by the 'LnkEnh' being empty).
|
||||
if (_isStepSection)
|
||||
{
|
||||
ProcedureInfo pi = ProcedureInfo.Get(_SectionConfig.MySection.MySectionInfo.MyProcedure.ItemID);
|
||||
ProcedureConfig picfg = pi.MyConfig as ProcedureConfig;
|
||||
bool hasEnh = false;
|
||||
if (picfg.MyEnhancedDocuments != null && picfg.MyEnhancedDocuments.Count > 0)
|
||||
{
|
||||
foreach (EnhancedDocument ed in picfg.MyEnhancedDocuments)
|
||||
{
|
||||
if (ed.Type != 0)
|
||||
{
|
||||
checkEnhancedSettings = true;
|
||||
hasEnh = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (hasEnh)
|
||||
{
|
||||
grpLnkEnh.Visible = true;
|
||||
if (_SectionConfig.Section_LnkEnh == null || _SectionConfig.Section_LnkEnh == "" || _SectionConfig.Section_LnkEnh == "Y")
|
||||
rbEnhLnkContents.Checked = true;
|
||||
else if (_SectionConfig.Section_LnkEnh == "N")
|
||||
rbEnhLnkNo.Checked = true;
|
||||
else // "T" for title:
|
||||
rbEnhLnkTitle.Checked = true;
|
||||
rbEnhLnkContents.Enabled = rbEnhLnkNo.Enabled = rbEnhLnkTitle.Enabled = (_SectionConfig.Section_LnkEnh == null || _SectionConfig.Section_LnkEnh == "");
|
||||
}
|
||||
else
|
||||
grpLnkEnh.Visible = false;
|
||||
}
|
||||
else
|
||||
grpLnkEnh.Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// for word docs, no enhanced controls should be visible:
|
||||
grpLnkEnh.Visible = false;
|
||||
}
|
||||
_Initializing = false;
|
||||
//_InitialIndex = ppCmbxFormat.SelectedIndex;
|
||||
}
|
||||
int _InitialIndex = -2;
|
||||
|
||||
|
Reference in New Issue
Block a user