Fixed the visibility of the Convert to DocX button so that it is not visible for Library Documents, Automatic Table of Contents or Step Sections.
This commit is contained in:
parent
b4d867a517
commit
ebbc57e5bb
@ -488,21 +488,27 @@ namespace VEPROMS
|
||||
bool sav_Initializing = _Initializing;
|
||||
_Initializing = true;
|
||||
bool isLib = false;
|
||||
// Only show the Convert To DocX button for non-library MS Word Sections
|
||||
if (_SectionConfig.MySection.MyContent.MyEntry!=null && _SectionConfig.MySection.MyContent.MyEntry.MyDocument!=null && (_SectionConfig.MySection.MyContent.MyEntry.MyDocument.LibTitle != null) && (_SectionConfig.MySection.MyContent.MyEntry.MyDocument.LibTitle != "")) isLib = true;
|
||||
if (isLib)
|
||||
{
|
||||
ppBtnConvertToDocX.Visible = false; // Don't allow save as DOCX for libraries documents
|
||||
ppBtnCvrtToLibDoc.Text = "Convert this Section To A Non-Library Document";
|
||||
lblLibraryDocument.Text = "Library Document";
|
||||
superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Non-Library Document", "", "This button will convert the current section from a library document to a non-library document",
|
||||
null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76)));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_SectionConfig.MySection.MyContent.MyEntry.MyDocument != null && _SectionConfig.MySection.MyContent.MyEntry.MyDocument.FileExtension == ".RTF")
|
||||
this.ppBtnConvertToDocX.Visible = true; // Only allow save as DocX for normal word sections when the exissting text is RTF.
|
||||
else
|
||||
this.ppBtnConvertToDocX.Visible = false;
|
||||
if (isLib)
|
||||
{
|
||||
ppBtnConvertToDocX.Visible = false; // Don't allow save as DOCX for libraries documents
|
||||
ppBtnCvrtToLibDoc.Text = "Convert this Section To A Non-Library Document";
|
||||
lblLibraryDocument.Text = "Library Document";
|
||||
superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Non-Library Document", "", "This button will convert the current section from a library document to a non-library document",
|
||||
null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76)));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Only show the Convert To DocX button for RTF MS Word Sections
|
||||
if (_SectionConfig.MySection.MyContent.MyEntry.MyDocument != null && _SectionConfig.MySection.MyContent.MyEntry.MyDocument.FileExtension == ".RTF")
|
||||
{
|
||||
ItemInfo ii = ItemInfo.Get(_SectionConfig.MySection.ItemID);
|
||||
if (!ii.IsAutoTOCSection) // Only show the Convert To DocX button for non-Auto Table Of Contents Section
|
||||
this.ppBtnConvertToDocX.Visible = true; // Only allow save as DocX for normal word sections when the existing text is RTF.
|
||||
}
|
||||
else
|
||||
this.ppBtnConvertToDocX.Visible = false;
|
||||
if (_SectionConfig.MySection.MyContent.MyEntry.MyDocument == null)
|
||||
ppBtnCvrtToLibDoc.Visible = false;
|
||||
else
|
||||
@ -512,7 +518,7 @@ namespace VEPROMS
|
||||
superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Library Document button", "", "This button will convert the current section to a library document, allowing it t" +
|
||||
"o be shared with other procedures.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DocumentInfoList LibDocList = DocumentInfoList.GetLibraries(true);
|
||||
int selindx = -1;
|
||||
@ -624,9 +630,10 @@ namespace VEPROMS
|
||||
ppCmbxStyleSectionType.DataSource = newDocStyles;
|
||||
ppCmbxStyleSectionType.SelectedIndex = selindx;
|
||||
ppCmbxStyleSectionType.Refresh();
|
||||
ppBtnConvertToDocX.Visible = false;// Set the Convert To DocX button to invisible by default
|
||||
|
||||
if (!_isStepSection)
|
||||
ppCmbxLibDocFill();
|
||||
ppCmbxLibDocFill(); // set the Convert To DocX button to Visible if appropriate
|
||||
_Initializing = myInit;
|
||||
if (_isStepSection)
|
||||
SetupCheckoffsDropdowns();
|
||||
|
Loading…
x
Reference in New Issue
Block a user