B2018-009 - The folder tree view was showing both DocVersions (Working Drafts and Folders). It was not consistent, Sometimes Working Drafts would be shown for folders and sometimes they would not. The code has been changed to only show folders.
Also, since you can select any folder, it is possible to select a folder that does not have any procedures. The code has been changed to only allow you to add a transition to a valid folder. B2018-005 - Changes to Tables not being saved if the user selects a button from the Ribbon that creates a step while a cell is still in edit mode. This has been corrected
This commit is contained in:
parent
01ce36b86a
commit
3b8a984566
@ -561,6 +561,15 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
private void cbTranProcsFillIn(ItemInfo prcitm)
|
||||
{
|
||||
// B2018-009 - disable the save button if a folder is selected that does not contain procedures
|
||||
if (prcitm == null)
|
||||
{
|
||||
_TreeComboSetHasDV = false;
|
||||
SaveCancelEnabling();
|
||||
return;
|
||||
}
|
||||
else
|
||||
_TreeComboSetHasDV = true;
|
||||
ItemInfo curSelProc = null;
|
||||
if (cbTranProcs.Items.Count > 0) curSelProc = cbTranProcs.SelectedItem as ItemInfo;
|
||||
if (curSelProc != null && prcitm.ItemID == curSelProc.ItemID) return;
|
||||
@ -699,29 +708,33 @@ namespace Volian.Controls.Library
|
||||
DropDownNode newnode = new DropDownNode(fic.FolderID, fic.ToString());
|
||||
par.Nodes.Add(newnode);
|
||||
newnode.Tag = fic;
|
||||
if (fic.HasChildren) // allow for '+' for tree expansion
|
||||
// B2018-009 Eliminate Working Draft (DocVersions) from the procedure tree for transitions
|
||||
if (fic.ChildFolderCount > 0) // allow for '+' for tree expansion
|
||||
{
|
||||
DropDownNode tnt = new DropDownNode(0, "VLN_DUMMY");
|
||||
newnode.Nodes.Add(tnt);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (fi.FolderDocVersionCount > 0)
|
||||
{
|
||||
foreach (DocVersionInfo dv in fi.FolderDocVersions)
|
||||
{
|
||||
if ((VersionTypeEnum)dv.VersionType == VersionTypeEnum.WorkingDraft)
|
||||
{
|
||||
DropDownNode newnode = new DropDownNode(dv.VersionID, dv.ToString());
|
||||
newnode.Tag = dv;
|
||||
par.Nodes.Add(newnode);
|
||||
}
|
||||
}
|
||||
}
|
||||
// B2018-009 Eliminate Working Draft (DocVersions) from the procedure tree for transitions
|
||||
//else if (fi.FolderDocVersionCount > 0)
|
||||
//{
|
||||
// foreach (DocVersionInfo dv in fi.FolderDocVersions)
|
||||
// {
|
||||
// if ((VersionTypeEnum)dv.VersionType == VersionTypeEnum.WorkingDraft)
|
||||
// {
|
||||
// DropDownNode newnode = new DropDownNode(dv.VersionID, dv.ToString());
|
||||
// newnode.Tag = dv;
|
||||
// par.Nodes.Add(newnode);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
vlnTreeComboSets.Value = par;
|
||||
vlnTreeComboSets.DropDownControl.SelectedNode = par;
|
||||
}
|
||||
// B2018-009 variable used to disable the save button if a folder is selected does not contain procedures
|
||||
private bool _TreeComboSetHasDV = false;
|
||||
private void DropDown_FinishEditing(object sender, DropDownValueChangedEventArgs e)
|
||||
{
|
||||
DropDownNode selnd = (DropDownNode)vlnTreeComboSets.DropDownControl.SelectedNode;
|
||||
@ -739,10 +752,24 @@ namespace Volian.Controls.Library
|
||||
// note that the folder may contain more than one docversion, check for
|
||||
// only 1 working draft.
|
||||
int cntwd = 0;
|
||||
if (fi.FolderDocVersions != null) // B2018-009 Only look for DocVersions if some exist
|
||||
{
|
||||
foreach (DocVersionInfo dvt in fi.FolderDocVersions)
|
||||
{
|
||||
if ((VersionTypeEnum)dvt.VersionType == VersionTypeEnum.WorkingDraft) cntwd++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Based on your selection, cannot get list of procedures, Select another folder.");
|
||||
// disable ALL other controls
|
||||
cbTranProcs.Enabled = false;
|
||||
cbTranSects.Enabled = false;
|
||||
tvTran.Enabled = false;
|
||||
// B2018-009 - disable the save button if a folder is selected that does not contain procedures
|
||||
cbTranProcsFillIn(null);
|
||||
return;
|
||||
}
|
||||
if (cntwd == 1) defines_set = true;
|
||||
}
|
||||
}
|
||||
@ -755,6 +782,8 @@ namespace Volian.Controls.Library
|
||||
cbTranProcs.Enabled = false;
|
||||
cbTranSects.Enabled = false;
|
||||
tvTran.Enabled = false;
|
||||
// B2018-009 - disable the save button if a folder is selected that does not contain procedures
|
||||
cbTranProcsFillIn(null);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -781,6 +810,8 @@ namespace Volian.Controls.Library
|
||||
cbTranProcs.Enabled = false;
|
||||
cbTranSects.Enabled = false;
|
||||
tvTran.Enabled = false;
|
||||
// B2018-009 - disable the save button if a folder is selected that does not contain procedures
|
||||
cbTranProcsFillIn(null);
|
||||
return;
|
||||
}
|
||||
cbTranProcsFillIn(dv.Procedures[0]);
|
||||
@ -1054,7 +1085,8 @@ namespace Volian.Controls.Library
|
||||
bool hasChanged = SettingsChanged;
|
||||
bool isenh = MyRTB != null && MyRTB.MyItemInfo != null && MyRTB.MyItemInfo.IsEnhancedStep;
|
||||
// B2018-002 - Invalid Transitions - Set button enabled if it has a default section or it doesn't need a default
|
||||
btnTranSave.Enabled = (HasDefault || !NeedsDefault) && !isenh && hasChanged && UserInfo.CanEdit(MyUserInfo, Mydvi); //Can Insert Transitons
|
||||
// B2018-009 - Don't enable the save button if a folder is selected that does not contain procedures
|
||||
btnTranSave.Enabled = _TreeComboSetHasDV && (HasDefault || !NeedsDefault) && !isenh && hasChanged && UserInfo.CanEdit(MyUserInfo, Mydvi); //Can Insert Transitons
|
||||
btnTranCancel.Enabled = _CurTrans != null && hasChanged;
|
||||
groupPanelTranFmt.Text = (!HasDefault && NeedsDefault) ? "Requires Default" : "Select Format";
|
||||
// B2018-002 - Invalid Transitions - Set tool tip based upon HasDefault and NeedsDefault
|
||||
|
@ -1064,6 +1064,8 @@ namespace Volian.Controls.Library
|
||||
// else do a after from current HLS - if not at HLS, go up parents until find it.
|
||||
else if (fromtype == 0 && !_MyEditItem.MyItemInfo.IsStepSection)
|
||||
{
|
||||
if (_MyEditItem.MyItemInfo.IsTable) // B2018-005 Save Current Changes to the table
|
||||
_MyEditItem.MyParentEditItem.Select(); // High Level Step
|
||||
EditItem hlsEditItem = _MyEditItem;
|
||||
while (!hlsEditItem.MyItemInfo.IsHigh)
|
||||
hlsEditItem = hlsEditItem.ActiveParent;
|
||||
@ -1072,7 +1074,7 @@ namespace Volian.Controls.Library
|
||||
else if (contenttype == 21040)
|
||||
{
|
||||
if (_MyEditItem.MyItemInfo.IsTable) // B2018-005 Save Current Changes to the table
|
||||
_MyEditItem.MyParentEditItem.Select();
|
||||
_MyEditItem.MyParentEditItem.Select(); // SupInfo
|
||||
_MyEditItem.AddChild((E_FromType)fromtype, 20040);
|
||||
}
|
||||
else if (InsertingTable(contenttype))
|
||||
@ -1366,14 +1368,14 @@ namespace Volian.Controls.Library
|
||||
private void btnInsBefore_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_MyEditItem.MyItemInfo.IsTable) // B2018-005 Save Current Changes to the table
|
||||
_MyEditItem.MyParentEditItem.Select();
|
||||
_MyEditItem.MyParentEditItem.Select(); // Previous
|
||||
_MyEditItem.AddSiblingBefore();
|
||||
}
|
||||
|
||||
private void btnInsAfter_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_MyEditItem.MyItemInfo.IsTable) // B2018-005 Save Current Changes to the table
|
||||
_MyEditItem.MyParentEditItem.Select();
|
||||
_MyEditItem.MyParentEditItem.Select(); // Next
|
||||
_MyEditItem.AddSiblingAfter();
|
||||
}
|
||||
/// <summary>
|
||||
@ -3540,7 +3542,7 @@ namespace Volian.Controls.Library
|
||||
StepTabPanel tmp = Parent as StepTabPanel;
|
||||
if (tmp.MyDisplayTabControl.MyCopyStep == null) return;
|
||||
if (_MyEditItem.MyItemInfo.IsTable) // B2018-005 Save Current Changes to the table
|
||||
_MyEditItem.MyParentEditItem.Select();
|
||||
_MyEditItem.MyParentEditItem.Select(); // Paste After
|
||||
MyEditItem.PasteSiblingAfter(tmp.MyDisplayTabControl.MyCopyStep.ItemID);
|
||||
}
|
||||
private void btnPasteBefore_Click(object sender, EventArgs e)
|
||||
@ -3548,7 +3550,7 @@ namespace Volian.Controls.Library
|
||||
StepTabPanel tmp = Parent as StepTabPanel;
|
||||
if (tmp.MyDisplayTabControl.MyCopyStep == null) return;
|
||||
if (_MyEditItem.MyItemInfo.IsTable) // B2018-005 Save Current Changes to the table
|
||||
_MyEditItem.MyParentEditItem.Select();
|
||||
_MyEditItem.MyParentEditItem.Select(); // Paste Before
|
||||
MyEditItem.PasteSiblingBefore(tmp.MyDisplayTabControl.MyCopyStep.ItemID);
|
||||
}
|
||||
private void btnStepPaste_Click(object sender, EventArgs e)
|
||||
|
Loading…
x
Reference in New Issue
Block a user