Upped revision number to 1.8

C2020-033: 2021 UPGRADE Handling of incoming transitions on delete or review
This commit is contained in:
Kathy Ruffing 2021-01-06 15:07:57 +00:00
parent ba2e72baeb
commit fdd59a5d6b
18 changed files with 1564 additions and 1005 deletions

View File

@ -34,7 +34,7 @@ namespace AdjustBuildRevision
if (Directory.GetCurrentDirectory().ToUpper().Contains("REFOBJ")) if (Directory.GetCurrentDirectory().ToUpper().Contains("REFOBJ"))
outline = Regex.Replace(line, @"([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)""\)", DateTime.Now.ToString("2.0.yyMM.dHH") + "\")"); outline = Regex.Replace(line, @"([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)""\)", DateTime.Now.ToString("2.0.yyMM.dHH") + "\")");
else else
outline = Regex.Replace(line, @"([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)""\)", DateTime.Now.ToString("1.7.yyMM.dHH") + "\")"); outline = Regex.Replace(line, @"([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)""\)", DateTime.Now.ToString("1.8.yyMM.dHH") + "\")");
// if (outline != line) // if (outline != line)
// { // {
// Console.WriteLine("Before: '{0}'", line); // Console.WriteLine("Before: '{0}'", line);

File diff suppressed because it is too large Load Diff

View File

@ -232,6 +232,9 @@ namespace VEPROMS
tbSqlTimeout.Visible = true; tbSqlTimeout.Visible = true;
lblSqlTimeout.Visible = true; lblSqlTimeout.Visible = true;
lblSqlTimeoutDefault.Visible = true; lblSqlTimeoutDefault.Visible = true;
this.cbIncTranCvtPerm.Visible = true;
this.cbIncTranCvtPerm.Checked = _FolderConfig.General_IncTranCvtPerm; // C2020-033: defaults to does not have permission
this.lblIncTrans.Visible = true;
} }
else else
{ {
@ -244,6 +247,8 @@ namespace VEPROMS
this.btnRefObjs.Visible = false; this.btnRefObjs.Visible = false;
this.btnAnnoTypes.Visible = false; this.btnAnnoTypes.Visible = false;
this.btnRevisionStages.Visible = false; this.btnRevisionStages.Visible = false;
this.cbIncTranCvtPerm.Visible = false;
this.lblIncTrans.Visible = false;
/* This color settings property page is currently no visible... /* This color settings property page is currently no visible...
* *
@ -376,6 +381,9 @@ namespace VEPROMS
Settings.Default.ShowDefaultFolderProp = ppCbShwDefSettings.Checked; Settings.Default.ShowDefaultFolderProp = ppCbShwDefSettings.Checked;
Settings.Default.Save(); Settings.Default.Save();
_FolderConfig.Timeout = tbSqlTimeout.Text; _FolderConfig.Timeout = tbSqlTimeout.Text;
// C2020-033: Handling of external transitions - let admin decide who can convert transitions to text
if (_FolderConfig.MyFolder.FolderID == 1)_FolderConfig.General_IncTranCvtPerm = cbIncTranCvtPerm.Checked; // only do top folder
_FolderConfig.MyFolder.Config = _FolderConfig.ToString(); _FolderConfig.MyFolder.Config = _FolderConfig.ToString();
_FolderConfig.MyFolder.Save().Dispose(); _FolderConfig.MyFolder.Save().Dispose();
SaveApprStages(); SaveApprStages();

View File

@ -112,15 +112,15 @@
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="folderConfigBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="folderConfigBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>282, 17</value> <value>282, 17</value>
</metadata> </metadata>
<metadata name="superTooltip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="superTooltip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>518, 17</value> <value>518, 17</value>
</metadata> </metadata>
<data name="ppBtnDefaultGrphFileExt.SuperTooltip" xml:space="preserve"> <data name="ppBtnDefaultGrphFileExt.SuperTooltip" xml:space="preserve">
@ -128,10 +128,7 @@
Check "Show Default Settings" to display the "default" graphic file extension setting (below the Graphic File Extension selection box).</value> Check "Show Default Settings" to display the "default" graphic file extension setting (below the Graphic File Extension selection box).</value>
</data> </data>
<metadata name="imageCodecInfoBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="imageCodecInfoBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>665, 17</value>
</metadata>
<metadata name="imageCodecInfoBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>665, 17</value> <value>665, 17</value>
</metadata> </metadata>
<data name="ppBtnDeftDisAutoDuplx.SuperTooltip" xml:space="preserve"> <data name="ppBtnDeftDisAutoDuplx.SuperTooltip" xml:space="preserve">
@ -169,24 +166,23 @@ Check "Show Default Settings" to display the "default" Change Bar Custom Message
Check "Show Default Settings" to display the "default" Change Bar Custom Message (below the Line One selection box).</value> Check "Show Default Settings" to display the "default" Change Bar Custom Message (below the Line One selection box).</value>
</data> </data>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="ppBtnChgTextColors.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="ppBtnChgTextColors.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAK9gAA JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAAr2AAAK9gHCr3ADAAACtUlE
CvYBwq9wAwAAArVJREFUOE+lkV1IU2EYx0/eBHURdWXWcsxCQuqqMAwk+u6iaLlAxb78yDKllSViGllK QVQ4T6WRXUhTYRjHT94EdRF1ZdZyzEJC6qowDCT67qJouUDFvvzIMqWVJWIaWUqJKy0dmmIJabYmOZyO
iSstHZpiCWm2Jjmcjj7oQgVrGg7nYTq3NLZ0H859eN5zzj7aeTpntLXhVXTxg/d53+f/43nfFwOA/yKm PuhCBWsaDudhOrc0tnQfzn143nPOPtp5Ome0teFVdPGD93nf5//jed8XA4D/IqagXbJSSl+JSF2Zn8Rv
oF2yUkpfiUhdmZ/EbwZJ3e0A0pz3kIuNTdF90UQWtOttA6HJ9lHW1h9ejwrCUJZnPxFe7EfaApsVr7kV Bknd7QDSnPeQi41N0X3RRBa0620Docn2UdbWH16PCsJQlmc/EV7sR9oCmxWvuRUd5vgTlpUj/FqAsnc4
Heb4E5aVI/xagLJ3OGlPH4oROF/7KHuna1krNi+PirykRZq5SkDOVHgp+4tFLgB9JQCNZwEUJSEB7ehm aU8fihE4X/soe6drWSs2L4+KvKRFmrlKQM5UeCn7i0UuAH0lAI1nARQlIQHt6GZoRw9DWlo9esVJ8vun
aEcPQ1paPXrFSfL7p3NyNF9zIFaAi4F29y6FBI0i0AswyGSPvO5+aFENQP5jJUjkKnBMlVvVbXsdBpWw c3I0X3MgVoCLgXb3LoUEjSLQCzDIZI+87n5oUQ1A/mMlSOQqcEyVW9Vtex0GlbBhlYBa7gpNQGTthAp2
YZWAWu4KTUBk7YQKdtuQiAFla4J8iQKwNBbsEqC5UmQeyZl7V53sWpnKT48IiHGRjzQ/0XACDvY6DBem 25CIAWVrgnyJArA0FuwSoLlSZB7JmXtXnexamcpPjwiIcZGPND/RcAIO9joMF6aszZCUpQRsA0uKnBME
rM2QlKUEbANLipwTBFzTec6BGp53oiO5OSJAxrKrxoH9NDLVD9KWNiu1KGUoq5QhzRJA5lo2KAZkvALI XNN5zoEanneiI7k5IkDGsqvGgf00MtUP0pY2K7UoZSirlCHNEkDmWjYoBmS8AshQBC48B32o59PqFoH8
UAQuPAd9qOfT6haB/K/AVMdnH+bg8HNeUN2VCkvDR8GNFwSI2cuMxJAOpz9iUCjHgNDnwdK4kBVs836V r8BUx2cf5uDwc15Q3ZUKS8NHwY0XBIjZy4zEkA6nP2JQKMeA0OfB0riQFWzzfpXyekICNH8/Dhkr13IF
8npCAjR/Pw4ZK9dyBQeBFxX3V28MWsfOMMRsLtzQJ0HKUwywi5wgFxZGTrgU9zYxE+1bSiMTEDPiuLDA B4EXFfdXbwxax84wxGwu3NAnQcpTDLCLnCAXFkZOuBT3NjET7VtKIxMQM+K4sMCiFDDqlq0W25gQVqYv
ohQw6patFtuYEFamL0Chch1g1zHY8QgD52SG/9vL3c7eqnjm88P1oUwotKLNWxMW2Ab5YFDsmXBrs9hr QKFyHWDXMdjxCAPnZIb/28vdzt6qeObzw/WhTCi0os1bExbYBvlgUOyZcGuz2GvksBIWXXbQoREGpt+l
5LASFl120KERBqbfpSLZnfigujkh9hujManSjg1JBB778CGwjBwHh/oUmIYOk19e7QvIKxN8k+2bH0T3 Itmd+KC6OSH2G6MxqdKODUkEHvvwIbCMHAeH+hSYhg6TX17tC8grE3yT7ZsfRPdHFu7RI5EpdN27RL13
Rxbu0SORKXTdu0S9d7cvvK9LDL6pSvzVV5vk13bwO+dlvIxwT5iY4t8B7Dezkt2u9ZJf+wAAAABJRU5E ty+8r0sMvqlK/NVXm+TXdvA752W8jHBPmJji3wHsN7OS3a71kl/7AAAAAElFTkSuQmCC
rkJggg==
</value> </value>
</data> </data>
<data name="ppBtnDefEdCols.SuperTooltip" xml:space="preserve"> <data name="ppBtnDefEdCols.SuperTooltip" xml:space="preserve">
@ -225,21 +221,27 @@ We also found that the various printer drivers can differ in the starting positi
* The text of the Watermark will be the approval stage description text.</value> * The text of the Watermark will be the approval stage description text.</value>
</data> </data>
<metadata name="dlgROFolder.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="dlgROFolder.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>928, 17</value> <value>928, 17</value>
</metadata> </metadata>
<data name="lblIncTrans.Text" xml:space="preserve">
<value>PROMS has the capability to convert incoming transition links to text when steps, sections, or
procedures are deleted.  If PROMS security does not permit the user to write to the set that
contains the incoming transition, PROMS will not allow the transition to be converted to text. 
If you want to override security in these cases, use the checkbox below.</value>
</data>
<data name="txbxRemoveMsg.Text" xml:space="preserve"> <data name="txbxRemoveMsg.Text" xml:space="preserve">
<value>For the Remove button to be active, you must first clear all occurences of this Annotation Type. <value>For the Remove button to be active, you must first clear all occurences of this Annotation Type.
We suggest using the Search function where you can search for the usage of a selected Annotation Type.</value> We suggest using the Search function where you can search for the usage of a selected Annotation Type.</value>
</data> </data>
<metadata name="formatInfoListBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="formatInfoListBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1066, 17</value> <value>1066, 17</value>
</metadata> </metadata>
<metadata name="annotationTypesBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="annotationTypesBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>102</value> <value>102</value>
</metadata> </metadata>
</root> </root>

View File

@ -1365,7 +1365,7 @@ namespace VEPROMS
this.displaySearch1.Size = new System.Drawing.Size(314, 462); this.displaySearch1.Size = new System.Drawing.Size(314, 462);
this.displaySearch1.TabIndex = 0; this.displaySearch1.TabIndex = 0;
this.displaySearch1.TopFolderID = 1; this.displaySearch1.TopFolderID = 1;
this.displaySearch1.TypesSelected = null; this.displaySearch1.TypesSelected = "";
// //
// toolstabResults // toolstabResults
// //

View File

@ -387,6 +387,8 @@ namespace VEPROMS
tv.InsertItemInfo += new vlnTreeViewItemInfoInsertEvent(tv_InsertItemInfo); tv.InsertItemInfo += new vlnTreeViewItemInfoInsertEvent(tv_InsertItemInfo);
tv.NodeInsert += new vlnTreeViewEvent(tv_NodeInsert); tv.NodeInsert += new vlnTreeViewEvent(tv_NodeInsert);
tv.PasteItemInfo += new vlnTreeViewItemInfoPasteEvent(tv_PasteItemInfo); tv.PasteItemInfo += new vlnTreeViewItemInfoPasteEvent(tv_PasteItemInfo);
tv.SearchIncTrans += new vlnTreeViewSearchIncTransEvent(tv_SearchIncTrans);
tc.SearchIncTrans += new DisplayTabControlEditorSearchIncTransEvent(tc_SearchIncTrans);
tv.GetChangeId += new vlnTreeViewGetChangeIdEvent(tv_GetChangeId); tv.GetChangeId += new vlnTreeViewGetChangeIdEvent(tv_GetChangeId);
tv.NodeCopy += new vlnTreeViewEvent(tv_NodeCopy); tv.NodeCopy += new vlnTreeViewEvent(tv_NodeCopy);
tv.ClipboardStatus += new vlnTreeViewClipboardStatusEvent(tv_ClipboardStatus); tv.ClipboardStatus += new vlnTreeViewClipboardStatusEvent(tv_ClipboardStatus);
@ -1198,6 +1200,22 @@ namespace VEPROMS
{ {
return tc.PasteRTBItem(args.MyItemInfo, args.CopyStartID, args.PasteType, (int)args.Type); return tc.PasteRTBItem(args.MyItemInfo, args.CopyStartID, args.PasteType, (int)args.Type);
} }
// C2020-033: Display the search panel with Incoming Transition info for the tree view
// and for the editor.
private ItemInfo tv_SearchIncTrans(object sender, vlnTreeItemInfoEventArgs args)
{
displaySearch1.SearchIncTransII = args.MyItemInfo;
toolsPanel.Expanded = true;
displaySearch1.UpdateSearchIncTransResults();
return args.MyItemInfo;
}
private ItemInfo tc_SearchIncTrans(object sender, vlnTreeItemInfoEventArgs args)
{
displaySearch1.SearchIncTransII = args.MyItemInfo;
toolsPanel.Expanded = true;
displaySearch1.UpdateSearchIncTransResults();
return args.MyItemInfo;
}
private bool _RemoveFromPROMSWindowForms = true; private bool _RemoveFromPROMSWindowForms = true;
public bool ClosingWithError = false; // B2019-098: prevent looping between error & exit dialog public bool ClosingWithError = false; // B2019-098: prevent looping between error & exit dialog
private bool _WeAreExitingPROMS = false; // B2019-101 if exiting PROMS from main window don't prompt on each child window (separate windows) private bool _WeAreExitingPROMS = false; // B2019-101 if exiting PROMS from main window don't prompt on each child window (separate windows)
@ -1636,6 +1654,7 @@ namespace VEPROMS
StepTabRibbon.MyUserInfo = MyUserInfo; // set the user's security information in the ribbon StepTabRibbon.MyUserInfo = MyUserInfo; // set the user's security information in the ribbon
DisplayTransition.MyUserInfo = MyUserInfo; // set the user's security information in the Transition panel DisplayTransition.MyUserInfo = MyUserInfo; // set the user's security information in the Transition panel
DisplayTags.MyUserInfo = MyUserInfo; // set the user's security information in the Tags panel DisplayTags.MyUserInfo = MyUserInfo; // set the user's security information in the Tags panel
DisplaySearch.MyUserInfo = MyUserInfo; // set the user's security information in the Search panel
DisplayHistory.MyUserInfo = MyUserInfo; // set the user's security information in the History panel DisplayHistory.MyUserInfo = MyUserInfo; // set the user's security information in the History panel
DisplayApplicability.MyUserInfo = MyUserInfo; // set the user's security information in the Applicability panel DisplayApplicability.MyUserInfo = MyUserInfo; // set the user's security information in the Applicability panel
StepRTB.MyUserInfo = MyUserInfo; // set the user's security information in the StepRTB StepRTB.MyUserInfo = MyUserInfo; // set the user's security information in the StepRTB

View File

@ -149,6 +149,29 @@ namespace VEPROMS.CSLA.Library
get { return (_Folder != null ? _Folder.ShortName : _FolderInfo.ShortName); } get { return (_Folder != null ? _Folder.ShortName : _FolderInfo.ShortName); }
set { if (_Folder != null)_Folder.ShortName = value; } set { if (_Folder != null)_Folder.ShortName = value; }
} }
// C2020-033: Handling of external transitions - let admin decide who can convert transitions to text
[Category("General")]
[DisplayName("Non-Admin Convert Incoming Transitions To Text")]
[RefreshProperties(RefreshProperties.All)]
[Description("Non-Admin Convert Incoming Transitions To Text")]
public bool General_IncTranCvtPerm
{
get
{
string s = _Xp["General", "IncTranCvtPemr"];// get the saved value
//Dont't bother getting parent value, this is stored on 'top' node
if (s == string.Empty)
return false;
if (s.ToUpper() == "TRUE") return true;
return false;
}
set
{
_Xp["General", "IncTranCvtPemr"] = value ? "TRUE" : "FALSE";
OnPropertyChanged("General_IncTranCvtPerm");
}
}
[Category("Format Settings")] [Category("Format Settings")]
[DisplayName("Format")] [DisplayName("Format")]
[Description("Format")] [Description("Format")]

View File

@ -5431,7 +5431,7 @@ namespace VEPROMS.CSLA.Library
} }
} }
#endregion #endregion
// C2020-018 used for a more descriptive warning message when deleting Procedures, Sections, Steps that have external transitions pointing to them // C2020-018 used for a more descriptive warning message when deleting Procedures, Sections, Steps that have incoming transitions pointing to them
public string GetTypeDescription() public string GetTypeDescription()
{ {
if (this != null) if (this != null)
@ -5535,7 +5535,7 @@ namespace VEPROMS.CSLA.Library
// itemInfo.ToXml(xn); // itemInfo.ToXml(xn);
// } // }
//} //}
internal ItemInfoList(ItemInfo itemInfo) public ItemInfoList(ItemInfo itemInfo)
{ {
AddItem(itemInfo); AddItem(itemInfo);
} }
@ -5928,7 +5928,7 @@ namespace VEPROMS.CSLA.Library
} }
this.RaiseListChangedEvents = true; this.RaiseListChangedEvents = true;
} }
internal void AddItem(ItemInfo itemInfo) public void AddItem(ItemInfo itemInfo)
{ {
IsReadOnly = false; IsReadOnly = false;
this.Add(itemInfo); this.Add(itemInfo);

View File

@ -36,6 +36,9 @@ namespace VEPROMS.CSLA.Library
{ {
public ItemInfo HandleSqlExceptionOnDelete(Exception ex) public ItemInfo HandleSqlExceptionOnDelete(Exception ex)
{ {
// C2020-033: The dialog message has been changed to reference the Tools/Search/Incoming Transitions tab and
// the return value was changed to return null (this was returning first in list, but now user gets all
// listed in the search dialog). This comment is for each of the dialogs below.
string itemDesc = this.GetTypeDescription(); // C2020-018 made the message more accurate when deleting a Procedure, Section, or Step string itemDesc = this.GetTypeDescription(); // C2020-018 made the message more accurate when deleting a Procedure, Section, or Step
if (ex.Message.Contains("has External Transitions and has no next step")) if (ex.Message.Contains("has External Transitions and has no next step"))
{ {
@ -44,14 +47,8 @@ namespace VEPROMS.CSLA.Library
//C2020-018 build the message based on the type description //C2020-018 build the message based on the type description
string msg1 = string.Format("Transitions exist to this {0} and cannot be adjusted automatically.", itemDesc); string msg1 = string.Format("Transitions exist to this {0} and cannot be adjusted automatically.", itemDesc);
DialogResult ans = FlexibleMessageBox.Show(msg1 + DialogResult ans = FlexibleMessageBox.Show(msg1 +
"\r\n\r\nDo you want to be placed at the " + (exTrans.Count > 1 ? "first " : "") + "location with the problem Transition?" + "\r\n\r\nThe list of all locations are shown in the Tools/Search/Incoming Transitions tab.",
"\r\n\r\nLocations with Problem Transitions" + "Cannot Delete This " + itemDesc, MessageBoxButtons.OK, MessageBoxIcon.Information);
exTrans.Summarize(),
"Cannot Delete This " + itemDesc, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.Yes)
{
return exTrans[0].MyContent.ContentItems[0];
}
} }
} }
else if (ex.Message.Contains("has External Transitions to Procedure")) else if (ex.Message.Contains("has External Transitions to Procedure"))
@ -59,14 +56,8 @@ namespace VEPROMS.CSLA.Library
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(ItemID)) using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(ItemID))
{ {
DialogResult ans = FlexibleMessageBox.Show("Transitions exist to this procedure and cannot be adjusted automatically." + DialogResult ans = FlexibleMessageBox.Show("Transitions exist to this procedure and cannot be adjusted automatically." +
"\r\n\r\nDo you want to be placed at the " + (exTrans.Count > 1 ? "first " : "") + "location with the problem Transition?" + "\r\n\r\nThe list of all locations are shown in the Tools/Search/Incoming Transitions tab.",
"\r\n\r\nLocations with Problem Transitions" + "Cannot Delete This Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information);
exTrans.Summarize(),
"Cannot Delete This Procedure", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.Yes)
{
return exTrans[0].MyContent.ContentItems[0];
}
} }
} }
// B2020-091: If deleting a section that has transitions pointing to it, show list: // B2020-091: If deleting a section that has transitions pointing to it, show list:
@ -75,14 +66,8 @@ namespace VEPROMS.CSLA.Library
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(ItemID)) using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(ItemID))
{ {
DialogResult ans = FlexibleMessageBox.Show("Transitions exist to this section and cannot be adjusted automatically." + DialogResult ans = FlexibleMessageBox.Show("Transitions exist to this section and cannot be adjusted automatically." +
"\r\n\r\nDo you want to be placed at the " + (exTrans.Count > 1 ? "first " : "") + "location with the problem Transition?" + "\r\n\r\nThe list of all locations are shown in the Tools/Search/Incoming Transitions tab.",
"\r\n\r\nLocations with Problem Transitions" + "Cannot Delete This Section", MessageBoxButtons.OK, MessageBoxIcon.Information);
exTrans.Summarize(),
"Cannot Delete This Section", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.Yes)
{
return exTrans[0].MyContent.ContentItems[0];
}
} }
} }
else if (ex.Message.Contains("has External Transitions to it's children")) else if (ex.Message.Contains("has External Transitions to it's children"))
@ -92,15 +77,8 @@ namespace VEPROMS.CSLA.Library
//C2020-018 build the message based on the type description //C2020-018 build the message based on the type description
string msg1 = string.Format("Transitions exist to {0} this {1} and cannot be adjusted automatically.", (this.IsSection) ? "steps in" : "children of", itemDesc); string msg1 = string.Format("Transitions exist to {0} this {1} and cannot be adjusted automatically.", (this.IsSection) ? "steps in" : "children of", itemDesc);
DialogResult ans = FlexibleMessageBox.Show(msg1 + DialogResult ans = FlexibleMessageBox.Show(msg1 +
"\r\n\r\nDo you want to be placed at the " + (exTrans.Count > 1 ? "first " : "") + "location with the problem Transition?" + "\r\n\r\nThe list of all locations are shown in the Tools/Search/Incoming Transitions tab.",
"\r\n\r\nLocations with Problem Transitions:" + "Cannot Delete This " + itemDesc, MessageBoxButtons.OK, MessageBoxIcon.Information);
exTrans.Summarize(),
"Cannot Delete This "+itemDesc, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.No) return this;// If answer "NO" then return self
if (ans == DialogResult.Yes)
{
return exTrans[0].MyContent.ContentItems[0];
}
} }
} }
else else

File diff suppressed because it is too large Load Diff

View File

@ -31,6 +31,28 @@ namespace Volian.Controls.Library
} }
#endregion #endregion
#region Properties #region Properties
// C2020-033: SearchIncTransII represents the item that the transitions go to. It can be either the item the user
// tried to delete or that the user selected to get Incoming Transitions from tree view or ribbon.
private ItemInfo _SearchIncTransII = null;
public ItemInfo SearchIncTransII
{
get
{
return _SearchIncTransII;
}
set
{
_SearchIncTransII = value;
if (_SearchIncTransII != null) lblSrchIncTran.Text = _SearchIncTransII.Path;
else lblSrchIncTran.Text = "";
}
}
private static UserInfo _MyUserInfo = null;
public static UserInfo MyUserInfo
{
get { return _MyUserInfo; }
set { _MyUserInfo = value; }
}
private string _strSrchText = ""; private string _strSrchText = "";
private List<DocVersionInfo> lstCheckedDocVersions = new List<DocVersionInfo>(); private List<DocVersionInfo> lstCheckedDocVersions = new List<DocVersionInfo>();
private List<int> lstCheckedStepTypes = new List<int>(); private List<int> lstCheckedStepTypes = new List<int>();
@ -61,6 +83,7 @@ namespace Volian.Controls.Library
void _SearchResults_ListChanged(object sender, ListChangedEventArgs e) void _SearchResults_ListChanged(object sender, ListChangedEventArgs e)
{ {
lbSrchResults.SelectedIndex = -1; // Don't select an item from the new list lbSrchResults.SelectedIndex = -1; // Don't select an item from the new list
lbSrchResultsIncTrans.SelectedIndex = -1;
} }
private string _DisplayMember = "SearchPath"; private string _DisplayMember = "SearchPath";
@ -167,7 +190,20 @@ namespace Volian.Controls.Library
if(wordSectionTreeNode != null) //B2020-070 NULL reference check if(wordSectionTreeNode != null) //B2020-070 NULL reference check
wordSectionTreeNode.Enabled = true; wordSectionTreeNode.Enabled = true;
btnSearch.Enabled = true; btnSearch.Enabled = true;
if (e.NewTab == tabROSearch) xpSetToSearch.Enabled = true;
xpStepTypes.Enabled = true;
lbSrchResults.Visible = true;
lbSrchResultsIncTrans.Visible = false;
if (e.NewTab == tabIncTrans) // C2020-033: Incoming transitions
{
xpSetToSearch.Enabled = false;
xpStepTypes.Enabled = false;
lbSrchResults.Visible = false;
lbSrchResultsIncTrans.Visible = true;
lbSrchResultsIncTrans.CheckBoxesVisible = true;
lbSrchResultsIncTrans.AutoScroll = true;
}
else if (e.NewTab == tabROSearch)
{ {
LoadROComboTree(); LoadROComboTree();
} }
@ -175,7 +211,7 @@ namespace Volian.Controls.Library
{ {
if (wordSectionTreeNode != null) //B2020-070 NULL reference check if (wordSectionTreeNode != null) //B2020-070 NULL reference check
{ {
wordSectionTreeNode.Enabled = false; // C2020-010: Disable Word Section choice for Transition search wordSectionTreeNode.Enabled = false; // C2020-010: Disable Word Section choice for Transition search
wordSectionTreeNode.Checked = false; wordSectionTreeNode.Checked = false;
} }
btnSearch.Enabled = (cbxTranCategory.Items.Count > 0); // B2017-038 disable search button if no format selected btnSearch.Enabled = (cbxTranCategory.Items.Count > 0); // B2017-038 disable search button if no format selected
@ -187,7 +223,7 @@ namespace Volian.Controls.Library
foreach (DevComponents.AdvTree.Node n in dicExpandedFolderNodes.Keys) foreach (DevComponents.AdvTree.Node n in dicExpandedFolderNodes.Keys)
{ {
DocVersionInfo dvi = (DocVersionInfo)n.Tag; DocVersionInfo dvi = (DocVersionInfo)n.Tag;
if(cbxTranVersion.Tag.ToString().Contains(dvi.VersionID.ToString())) if (cbxTranVersion.Tag.ToString().Contains(dvi.VersionID.ToString()))
n.Enabled = true; n.Enabled = true;
else else
n.Enabled = false; n.Enabled = false;
@ -1036,18 +1072,27 @@ namespace Volian.Controls.Library
private void DisplayResults() private void DisplayResults()
{ {
_LoadingList = true; _LoadingList = true;
lbSrchResults.DisplayMember = _DisplayMember; // C2020-033: Incoming Transition tab. Note that this tab uses a different control for the search
// results, it uses the dotnetbar list that has check boxes. Because of this, various places throughout
// the code will check for what tab is displayed and will work eith the associated list box, either
// lbSrchResults or lbSrchResultsIncTrans
if (tabSearchTypes.SelectedTab != tabSearchTypes.Tabs[4]) lbSrchResults.DisplayMember = _DisplayMember;
else lbSrchResultsIncTrans.DisplayMember = _DisplayMember;
if (_SearchResults != null) if (_SearchResults != null)
{ {
if (cbSorted.Checked) if (cbSorted.Checked)
{ {
Csla.SortedBindingList<ItemInfo> sortedResults = new Csla.SortedBindingList<ItemInfo>(_SearchResults); Csla.SortedBindingList<ItemInfo> sortedResults = new Csla.SortedBindingList<ItemInfo>(_SearchResults);
sortedResults.ApplySort(_DisplayMember, ListSortDirection.Ascending); sortedResults.ApplySort(_DisplayMember, ListSortDirection.Ascending);
lbSrchResults.DataSource = sortedResults; if (tabSearchTypes.SelectedTab != tabSearchTypes.Tabs[4]) lbSrchResults.DataSource = sortedResults;
else lbSrchResultsIncTrans.DataSource = sortedResults;
} }
else else
{
//PopulatelbSrcResults(_SearchResults); //PopulatelbSrcResults(_SearchResults);
lbSrchResults.DataSource = _SearchResults; if (tabSearchTypes.SelectedTab != tabSearchTypes.Tabs[4]) lbSrchResults.DataSource = _SearchResults;
else lbSrchResultsIncTrans.DataSource = _SearchResults;
}
grpPanSearchResults.Text = string.Format("Search Results Found: {0}", _SearchResults.Count); grpPanSearchResults.Text = string.Format("Search Results Found: {0}", _SearchResults.Count);
grpPanSearchResults.Style.BackColor = Color.LightGreen;// Color.YellowGreen; Color.DarkSeaGreen; grpPanSearchResults.Style.BackColor = Color.LightGreen;// Color.YellowGreen; Color.DarkSeaGreen;
} }
@ -1057,7 +1102,7 @@ namespace Volian.Controls.Library
grpPanSearchResults.Style.BackColor = saveGrpPanSearchResults; grpPanSearchResults.Style.BackColor = saveGrpPanSearchResults;
} }
// Turn Print and Results display style on/off based on whether there are search results // Turn Print and Results display style on/off based on whether there are search results
if (lbSrchResults.Items.Count > 0) if (_SearchResults != null && _SearchResults.Count > 0)
{ {
btnPrnSrchRslts.Enabled = true; btnPrnSrchRslts.Enabled = true;
btnClearSearchResults.Enabled = true; btnClearSearchResults.Enabled = true;
@ -1075,6 +1120,7 @@ namespace Volian.Controls.Library
} }
lbSrchResults.SelectedIndex = -1; lbSrchResults.SelectedIndex = -1;
lbSrchResultsIncTrans.SelectedIndex = -1;
LastResultsMouseOverIndex = -1; LastResultsMouseOverIndex = -1;
_LoadingList = false; _LoadingList = false;
@ -1125,24 +1171,56 @@ namespace Volian.Controls.Library
LastResultsMouseOverIndex = ResultsMouseOverIndex; LastResultsMouseOverIndex = ResultsMouseOverIndex;
} }
} }
// C2020-033: lbSrchResultsIncTrans_ItemClicked is used to check permissions of a selection before allowing an
// item to be clicked and to turn on/off the btnTranCvtSelToTxt button for converting selected to test.
// Two variables are used to keep track if items are checked in the list box:
// JustDidSelection - selecting an item event goes into both SelectedValueChanged & ItemClicked
// but need to keep track of itemclicked which is event for checking/unchecking of Incoming Transition
// items in lbSrchResultsIncTrans
// IncTransSelectedCount is used to keep track if any items are checked
private int IncTransSelectedCount = 0;
bool JustDidSelection = false;
private void lbSrchResultsIncTrans_ItemClicked(object sender, EventArgs e)
{
ListBoxItem lbi = sender as ListBoxItem;
ItemBindingData ibd = lbi.Tag as ItemBindingData;
ItemInfo ii = ibd.DataItem as ItemInfo;
bool allowNonAdmin = IncTranCvtPerm();
if (lbi.CheckState == CheckState.Checked && ii != null)
{
if (!allowNonAdmin && !UserInfo.CanEdit(MyUserInfo, ii.MyDocVersion))
{
FlexibleMessageBox.Show("You do not have permission to edit the procedure, section, or step.",
"Convert Transition to Text", MessageBoxButtons.OK, MessageBoxIcon.Information);
lbi.CheckState = CheckState.Unchecked;
}
else
if (!JustDidSelection) IncTransSelectedCount++;
}
else
if (!JustDidSelection && IncTransSelectedCount > 0) IncTransSelectedCount--; // user unchecked an item
if (!JustDidSelection) btnTranCvtSelToTxt.Enabled = IncTransSelectedCount > 0;
JustDidSelection = false;
}
private bool _ProcessingSelectedValueChanged = false; private bool _ProcessingSelectedValueChanged = false;
private void lbSrchResults_SelectedValueChanged(object sender, EventArgs e) private void lbSrchResults_SelectedValueChanged(object sender, EventArgs e)
{ {
if (_LoadingList) return; if (_LoadingList) return;
if (_ProcessingSelectedValueChanged) return; if (_ProcessingSelectedValueChanged) return;
_ProcessingSelectedValueChanged = true; _ProcessingSelectedValueChanged = true;
JustDidSelection = true;
// If the list is being refreshed, then set the selection index to -1 (no selection) // If the list is being refreshed, then set the selection index to -1 (no selection)
if (_SearchResults.RefreshingList && lbSrchResults.SelectedIndex != -1) if (_SearchResults.RefreshingList && lbSrchResults.SelectedIndex != -1)
lbSrchResults.SelectedIndex = -1; lbSrchResultsIncTrans.SelectedIndex = lbSrchResults.SelectedIndex = -1;
else else
{ {
_ItemInfo = lbSrchResults.SelectedValue as ItemInfo; _ItemInfo = (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[4])? lbSrchResultsIncTrans.SelectedValue as ItemInfo : lbSrchResults.SelectedValue as ItemInfo;
if ((tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[1]) && (_ItemInfo != null)) if ((tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[1]) && (_ItemInfo != null))
{ {
// B2020-019: Don't set the CurrentAnnotation to an annotation in a procedure that cannot be opened. // B2020-019: Don't set the CurrentAnnotation to an annotation in a procedure that cannot be opened.
AnnotationInfo tmpca = AnnotationInfo.Get(_ItemInfo.SearchAnnotationID); AnnotationInfo tmpca = AnnotationInfo.Get(_ItemInfo.SearchAnnotationID);
DisplayTabItem dti = null; DisplayTabItem dti = null;
if (tmpca != null) dti = _TabControl.OpenItem(tmpca.MyItem); // open the corresponding procedure text if (tmpca != null) dti = _TabControl.OpenItem(tmpca.MyItem); // open the corresponding procedure text
if (dti != null) if (dti != null)
{ {
_AnnotationDetails.CurrentAnnotation = tmpca; _AnnotationDetails.CurrentAnnotation = tmpca;
@ -1359,6 +1437,7 @@ namespace Volian.Controls.Library
private void btnSearch_Click(object sender, EventArgs e) private void btnSearch_Click(object sender, EventArgs e)
{ {
IncTransSelectedCount = 0;
_fromLoad = false; _fromLoad = false;
DateTime start = DateTime.Now; DateTime start = DateTime.Now;
Cursor savcursor = Cursor; Cursor savcursor = Cursor;
@ -1368,9 +1447,18 @@ namespace Volian.Controls.Library
try try
{ {
LastSearchWasAnnotations = false; // B2019-119 only refresh annotation search results if an annotation search was done LastSearchWasAnnotations = false; // B2019-119 only refresh annotation search results if an annotation search was done
lbSrchResults.DataSource = null; if (tabSearchTypes.SelectedTab != tabSearchTypes.Tabs[4])
lbSrchResults.Items.Clear(); {
toolTip1.SetToolTip(lbSrchResults, null); lbSrchResults.DataSource = null;
lbSrchResults.Items.Clear();
toolTip1.SetToolTip(lbSrchResults, null);
}
else // C2020-033: Incoming Transiiotns
{
lbSrchResultsIncTrans.DataSource = null;
lbSrchResultsIncTrans.Items.Clear();
toolTip1.SetToolTip(lbSrchResultsIncTrans, null);
}
Cursor = Cursors.WaitCursor; Cursor = Cursors.WaitCursor;
SearchResults = null; SearchResults = null;
bool includeRTFformat = false; bool includeRTFformat = false;
@ -1407,7 +1495,7 @@ namespace Volian.Controls.Library
ReportTitle = "Step Element Report"; //"Proms - Search by Type: " + typstr; ReportTitle = "Step Element Report"; //"Proms - Search by Type: " + typstr;
TypesSelected = "Filtered By: " + typstr; TypesSelected = "Filtered By: " + typstr;
SearchString = null; SearchString = null;
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, "", cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, ItemSearchIncludeLinks.Value, includeRTFformat, includeSpecialChars, unitPrefix,"",""); SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, "", cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, ItemSearchIncludeLinks.Value, includeRTFformat, includeSpecialChars, unitPrefix, "", "");
cmbResultsStyleIndex = 1; //display step locations in results cmbResultsStyleIndex = 1; //display step locations in results
} }
} }
@ -1433,19 +1521,19 @@ namespace Volian.Controls.Library
// does not allow the preceding/following text to have a number, '.', letter or other rtf // does not allow the preceding/following text to have a number, '.', letter or other rtf
// commands. If the search string starts/ends with a letter, then use an expression that does not // commands. If the search string starts/ends with a letter, then use an expression that does not
// find the preceding/following text that is text, i.e. a letter. // find the preceding/following text that is text, i.e. a letter.
if (Regex.IsMatch(TextSearchString, @"^[\d\.]")) // starts with a number or '.' decimal pt if (Regex.IsMatch(TextSearchString, @"^[\d\.]")) // starts with a number or '.' decimal pt
{ {
byWordPrefix = @"[^0-9a-zA-Z.vbpi:\\-]"; byWordPrefix = @"[^0-9a-zA-Z.vbpi:\\-]";
} }
else if (Regex.IsMatch(TextSearchString, @"^[a-zA-Z]")) // starts with a letter else if (Regex.IsMatch(TextSearchString, @"^[a-zA-Z]")) // starts with a letter
{ {
byWordPrefix = @"[^a-zA-Z]"; byWordPrefix = @"[^a-zA-Z]";
} }
if (Regex.IsMatch(TextSearchString, @"[\d\.]$")) // ends with a number or decimal if (Regex.IsMatch(TextSearchString, @"[\d\.]$")) // ends with a number or decimal
{ {
byWordSuffix = @"[^0-9a-zA-Z.vbpi:\\-]"; byWordSuffix = @"[^0-9a-zA-Z.vbpi:\\-]";
} }
else if (Regex.IsMatch(TextSearchString, @"[a-zA-Z]$")) // ends with a letter else if (Regex.IsMatch(TextSearchString, @"[a-zA-Z]$")) // ends with a letter
{ {
byWordSuffix = @"[^a-zA-Z]"; byWordSuffix = @"[^a-zA-Z]";
} }
@ -1465,7 +1553,7 @@ namespace Volian.Controls.Library
//ReportTitle = string.Format("Proms - Annotation Search for '{0}'", cbxTextSearchAnnotation.Text); //ReportTitle = string.Format("Proms - Annotation Search for '{0}'", cbxTextSearchAnnotation.Text);
if (cbxTextSearchAnnotation.Text == null || cbxTextSearchAnnotation.Text == "") if (cbxTextSearchAnnotation.Text == null || cbxTextSearchAnnotation.Text == "")
{ {
ReportTitle = string.Format("Find {0}{1}", cbxAnnoTypes.Text, (cbxAnnoTypes.SelectedIndex > 0)?" Annotations" : "" ); ReportTitle = string.Format("Find {0}{1}", cbxAnnoTypes.Text, (cbxAnnoTypes.SelectedIndex > 0) ? " Annotations" : "");
} }
else else
{ {
@ -1477,7 +1565,7 @@ namespace Volian.Controls.Library
//SearchResults = ItemInfoList.GetListFromAnnotationSearch(dviSearchList, typeSearchList, textSearchString, srchStr, cbxCaseSensitiveAnnoText.Checked); //SearchResults = ItemInfoList.GetListFromAnnotationSearch(dviSearchList, typeSearchList, textSearchString, srchStr, cbxCaseSensitiveAnnoText.Checked);
SearchResults = ItemInfoList.GetListFromAnnotationSearch(DVISearchList, TypeSearchList, AnnotationSearchType, cbxTextSearchAnnotation.Text, cbxCaseSensitiveAnnoText.Checked,unitPrefix); SearchResults = ItemInfoList.GetListFromAnnotationSearch(DVISearchList, TypeSearchList, AnnotationSearchType, cbxTextSearchAnnotation.Text, cbxCaseSensitiveAnnoText.Checked, unitPrefix);
//UpdateAnnotationSearchResults(); //UpdateAnnotationSearchResults();
cmbResultsStyleIndex = 2; // display annotation text in results cmbResultsStyleIndex = 2; // display annotation text in results
} }
@ -1498,7 +1586,7 @@ namespace Volian.Controls.Library
cmbResultsStyleIndex = 3; // display step text in results cmbResultsStyleIndex = 3; // display step text in results
} }
} }
else if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[3]) //Transition Search else if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[3]) //Transition Search
{ {
ReportTitle = string.Format("Search For Transitions: Transition Type: {0}, Transition Category: {1}", cbxTranFormat.SelectedItem, cbxTranCategory.SelectedItem); ReportTitle = string.Format("Search For Transitions: Transition Type: {0}, Transition Category: {1}", cbxTranFormat.SelectedItem, cbxTranCategory.SelectedItem);
string docVersionList = string.Empty; string docVersionList = string.Empty;
@ -1520,6 +1608,44 @@ namespace Volian.Controls.Library
SearchResults = ItemInfoList.GetListFromTransitionSearch(docVersionList, cbxTranFormat.SelectedIndex - 1, cbxTranCategory.SelectedItem.ToString() == "All" ? "" : cbxTranCategory.SelectedItem.ToString(), TypeSearchList); SearchResults = ItemInfoList.GetListFromTransitionSearch(docVersionList, cbxTranFormat.SelectedIndex - 1, cbxTranCategory.SelectedItem.ToString() == "All" ? "" : cbxTranCategory.SelectedItem.ToString(), TypeSearchList);
cmbResultsStyleIndex = 3; // display step text in results cmbResultsStyleIndex = 3; // display step text in results
} }
else if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[4])
{
// C2020-033: Incoming Transitions: Make an iteminfolist from the list returned from
// GetExternalTransitionsToChildren (also gets transitions to the item itself)
ItemInfo trII = SearchIncTransII;
if (trII != null)
{
ReportTitle = string.Format("Search For Incoming Transitions to {0}: ", trII.Path);
TypesSelected = "Filtered By: " + typstr;
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(trII.ItemID))
{
ItemInfoList iil = null;
bool first = true;
foreach (TransitionInfo ti in exTrans)
{
if (first)
{
ContentInfo ci = ContentInfo.Get(ti.FromID);
ItemInfo tmp = ci.ContentItems[0];
iil = new ItemInfoList(tmp);
first = false;
}
else
{
ContentInfo ci = ContentInfo.Get(ti.FromID);
ItemInfo tmp = ci.ContentItems[0];
iil.AddItem(tmp);
}
}
SearchResults = iil;
if (SearchResults == null || SearchResults.Count == 0)
{
FlexibleMessageBox.Show("No Matches Found.", "Search");
}
cmbResultsStyleIndex = 1; //display step locations in results
}
}
}
if (SearchResults != null) if (SearchResults != null)
{ {
AddMessageForEmptyAnnotations(); AddMessageForEmptyAnnotations();
@ -1531,6 +1657,7 @@ namespace Volian.Controls.Library
FlexibleMessageBox.Show("No Matches Found.", "Search"); FlexibleMessageBox.Show("No Matches Found.", "Search");
} }
} }
btnTranCvtAllToTxt.Enabled = IncTransCvtAllToTextPerm(); // C2020-033: does user have access to at least one item
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -1556,7 +1683,7 @@ namespace Volian.Controls.Library
bool hasAnnot = false; bool hasAnnot = false;
foreach (ItemInfo ii in SearchResults) foreach (ItemInfo ii in SearchResults)
{ {
if (ii.ItemAnnotationCount > 0) if (ii.ItemAnnotations != null && ii.ItemAnnotationCount > 0)
{ {
// RHM - can an iteminfo have an itemannotationcount>0 and not have searchannotationtext. // RHM - can an iteminfo have an itemannotationcount>0 and not have searchannotationtext.
if (ii.SearchAnnotationText == null) ii.SearchAnnotationText = AnnotationInfo.Get(ii.ItemAnnotations[0].AnnotationID).SearchText; if (ii.SearchAnnotationText == null) ii.SearchAnnotationText = AnnotationInfo.Get(ii.ItemAnnotations[0].AnnotationID).SearchText;
@ -2153,9 +2280,16 @@ namespace Volian.Controls.Library
} }
private void btnClearSearchResults_Click(object sender, EventArgs e) private void btnClearSearchResults_Click(object sender, EventArgs e)
{ {
lbSrchResults.DataSource = null; if (tabSearchTypes.SelectedTab == tabIncTrans) // C2020-033: Clear the Incoming Transitions list box
{
lbSrchResultsIncTrans.DataSource = null;
lbSrchResultsIncTrans.Items.Clear();
}
else
lbSrchResults.DataSource = null;
_SearchResults = null; _SearchResults = null;
DisplayResults(); DisplayResults();
btnTranCvtAllToTxt.Enabled = false;
} }
// A timer updated the step type tree but if it was loaded from xml the timer update overwrite what // A timer updated the step type tree but if it was loaded from xml the timer update overwrite what
@ -2163,6 +2297,7 @@ namespace Volian.Controls.Library
private bool _fromLoad = false; private bool _fromLoad = false;
private void btnLoadSearchResults_Click(object sender, System.EventArgs e) private void btnLoadSearchResults_Click(object sender, System.EventArgs e)
{ {
IncTransSelectedCount = 0;
_fromLoad = true; _fromLoad = true;
_LoadingList = true; _LoadingList = true;
ofdSearchResults.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS"; ofdSearchResults.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS";
@ -2290,7 +2425,27 @@ namespace Volian.Controls.Library
break; break;
} }
case 2: //referenced object case 2: //referenced object
case 3: // transitions
{ {
FlexibleMessageBox.Show(this, "Loading Referenced Objects and Transitions searches is under construction.", "Under Construction", MessageBoxButtons.OK);
break;
}
case 4: // Incoming transitions
{
tabSearchTypes.SelectedTab = tabIncTrans;
cmbResultsStyle.Text = xd.SelectSingleNode("search/results/@style").InnerText;
string tmpi = xd.SelectSingleNode("search/results/@toid").InnerText;
SearchIncTransII = ItemInfo.Get(Convert.ToInt32(tmpi));
System.Xml.XmlNodeList nl = xd.SelectNodes("search/results/item");
foreach (System.Xml.XmlNode nd in nl)
{
int itemID = int.Parse(nd.Attributes.GetNamedItem("id").InnerText);
ItemInfo ii = ItemInfo.Get(itemID);
if (ii.SearchAnnotationText == null && ii.ItemAnnotations != null) ii.SearchAnnotationText = AnnotationInfo.Get(ii.ItemAnnotations[0].AnnotationID).SearchText;
SearchResults.AddItemInfo(ii);
}
lbSrchResultsIncTrans.DataSource = SearchResults;
DisplayResults();
break; break;
} }
} }
@ -2311,12 +2466,14 @@ namespace Volian.Controls.Library
} }
Cursor = Cursors.Default; Cursor = Cursors.Default;
} }
btnTranCvtAllToTxt.Enabled = IncTransCvtAllToTextPerm(); // C2020-033: does user have access to at least one item
_LoadingList = false; _LoadingList = false;
} }
private void btnSaveSearchResults_Click(object sender, System.EventArgs e) private void btnSaveSearchResults_Click(object sender, System.EventArgs e)
{ {
ICollection<ItemInfo> myList = lbSrchResults.DataSource as ICollection<ItemInfo>; ICollection<ItemInfo> myList = lbSrchResults.DataSource as ICollection<ItemInfo>;
if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[4]) myList = lbSrchResultsIncTrans.DataSource as ICollection<ItemInfo>; // C2020-033: use Incoming transition list
if (tabSearchTypes.SelectedTabIndex == 2 || tabSearchTypes.SelectedTabIndex == 3) // ROs & Transitions are not coded yet if (tabSearchTypes.SelectedTabIndex == 2 || tabSearchTypes.SelectedTabIndex == 3) // ROs & Transitions are not coded yet
{ {
FlexibleMessageBox.Show(this, "Saving Referenced Objects and Transitions searches is under construction.", "Under Construction", MessageBoxButtons.OK); FlexibleMessageBox.Show(this, "Saving Referenced Objects and Transitions searches is under construction.", "Under Construction", MessageBoxButtons.OK);
@ -2342,32 +2499,34 @@ namespace Volian.Controls.Library
// B2020-107: save procedures sets & step types // B2020-107: save procedures sets & step types
// do procsets selected // do procsets selected
System.Xml.XmlElement xp = null; System.Xml.XmlElement xp = null;
if (lstCheckedDocVersions != null && lstCheckedDocVersions.Count > 0)
{
xp = xd.CreateElement("procsets");
foreach (DocVersionInfo dvi in lstCheckedDocVersions)
{
System.Xml.XmlElement xee = xd.CreateElement("set");
xa = xd.CreateAttribute("fid");
xa.InnerText = dvi.MyFolder.FolderID.ToString();
xee.Attributes.SetNamedItem(xa);
xp.AppendChild(xee);
}
}
System.Xml.XmlElement xst = null; System.Xml.XmlElement xst = null;
if (lstCheckedStepTypesStr != null && lstCheckedStepTypesStr.Count > 0) if (sti != 4) // C2020-033: no procsets or step types for Incoming transitions
{ {
xst = xd.CreateElement("StepType"); if (lstCheckedDocVersions != null && lstCheckedDocVersions.Count > 0)
foreach (string str in lstCheckedStepTypesStr) // Limited by step types
{ {
System.Xml.XmlElement xee = xd.CreateElement("type"); xp = xd.CreateElement("procsets");
xa = xd.CreateAttribute("str"); foreach (DocVersionInfo dvi in lstCheckedDocVersions)
xa.InnerText = str; {
xee.Attributes.SetNamedItem(xa); System.Xml.XmlElement xee = xd.CreateElement("set");
xst.AppendChild(xee); xa = xd.CreateAttribute("fid");
xa.InnerText = dvi.MyFolder.FolderID.ToString();
xee.Attributes.SetNamedItem(xa);
xp.AppendChild(xee);
}
}
if (lstCheckedStepTypesStr != null && lstCheckedStepTypesStr.Count > 0)
{
xst = xd.CreateElement("StepType");
foreach (string str in lstCheckedStepTypesStr) // Limited by step types
{
System.Xml.XmlElement xee = xd.CreateElement("type");
xa = xd.CreateAttribute("str");
xa.InnerText = str;
xee.Attributes.SetNamedItem(xa);
xst.AppendChild(xee);
}
} }
} }
switch (sti) switch (sti)
{ {
case 0: //text case 0: //text
@ -2439,6 +2598,34 @@ namespace Volian.Controls.Library
xd.Save(sfdSearchResults.FileName); xd.Save(sfdSearchResults.FileName);
break; break;
} }
case 2: // ro
case 3: // transitions
{
FlexibleMessageBox.Show(this, "Saving Search Results for this search type is under construction.", "Under Construction", MessageBoxButtons.OK);
break;
}
case 4: // C2020-033: Incoming Transitions
{
// do results
xe = xd.CreateElement("results");
xa = xd.CreateAttribute("style");
xa.InnerText = cmbResultsStyle.Text;
xe.Attributes.SetNamedItem(xa);
xa = xd.CreateAttribute("toid");
xa.InnerText = SearchIncTransII.ItemID.ToString();
xe.Attributes.SetNamedItem(xa);
foreach (ItemInfo ii in myList)
{
System.Xml.XmlElement xee = xd.CreateElement("item");
xa = xd.CreateAttribute("id");
xa.InnerText = ii.ItemID.ToString();
xee.Attributes.SetNamedItem(xa);
xe.AppendChild(xee);
}
xd.DocumentElement.AppendChild(xe);
xd.Save(sfdSearchResults.FileName);
break;
}
} }
break; break;
} }
@ -2470,6 +2657,7 @@ namespace Volian.Controls.Library
private void btnCopySearchResults_Click(object sender, EventArgs e) private void btnCopySearchResults_Click(object sender, EventArgs e)
{ {
ICollection<ItemInfo> myList = lbSrchResults.DataSource as ICollection<ItemInfo>; ICollection<ItemInfo> myList = lbSrchResults.DataSource as ICollection<ItemInfo>;
if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[4]) myList = lbSrchResultsIncTrans.DataSource as ICollection<ItemInfo>;
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.Append("\"Location\"\t\"Type\"\t\"Text\"\t\"High-Level\"\t\"Annotations\""); sb.Append("\"Location\"\t\"Type\"\t\"Text\"\t\"High-Level\"\t\"Annotations\"");
List<int> ItemsProcessed = new List<int>(); List<int> ItemsProcessed = new List<int>();
@ -2513,18 +2701,188 @@ namespace Volian.Controls.Library
string sortedBy = ""; string sortedBy = "";
if (cbSorted.Checked) if (cbSorted.Checked)
sortedBy = string.Format("Sorted By: {0}", cmbResultsStyle.Text); //C2019-013 pass in sorted by information sortedBy = string.Format("Sorted By: {0}", cmbResultsStyle.Text); //C2019-013 pass in sorted by information
OnPrintRequest(new DisplaySearchEventArgs(ReportTitle, TypesSelected, SearchString, lbSrchResults.DataSource as ICollection<ItemInfo>,sortedBy)); ICollection<ItemInfo> srchres = lbSrchResults.DataSource as ICollection<ItemInfo>;
// C2020-033: If on the Incoming Transitions tab, use that list.
if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[4]) srchres = lbSrchResultsIncTrans.DataSource as ICollection<ItemInfo>;
OnPrintRequest(new DisplaySearchEventArgs(ReportTitle, TypesSelected, SearchString, srchres,sortedBy));
} }
private void panSearchButtons_Resize(object sender, EventArgs e) private void panSearchButtons_Resize(object sender, EventArgs e)
{ {
cmbResultsStyle.Left = labelX1.Right + 3; cmbResultsStyle.Left = labelX1.Right + 3;
cmbResultsStyle.Width = btnClearSearchResults.Left - cmbResultsStyle.Left - 3; cmbResultsStyle.Width = btnClearSearchResults.Left - cmbResultsStyle.Left - 3;
} }
// C2020-033: Convert All (that have permissions) Incoming Transitions to text
private void btnTranCvtAllToTxt_Click(object sender, EventArgs e)
{
List<int> itmsEditable = TranCvtCheckPermission(true); // Get list based on permissions
if (itmsEditable == null || itmsEditable.Count == 0) return;
TranCvtToTxt(itmsEditable);
}
// C22020-033: Use IncTransCvtAllToTextPerm to see if user has at least edit permissions to 1 in list. This
// is used to see if Convert All button is enabled.
private bool IncTransCvtAllToTextPerm()
{
if (_SearchResults == null) return false;
int cnt = 0;
bool allowNonAdmin = IncTranCvtPerm();
foreach (ItemInfo ii in _SearchResults)
{
if (allowNonAdmin || UserInfo.CanEdit(MyUserInfo, ii.MyDocVersion)) return true;
}
return false;
}
// C2020-033: Update the search panel for Incoming transitions. This gets called from the tree view & the ribbon
public void UpdateSearchIncTransResults()
{
IncTransSelectedCount = 0;
tabSearchTypes.SelectedTab = tabSearchTypes.Tabs[4];
lbSrchResultsIncTrans.DataSource = null;
lbSrchResultsIncTrans.Items.Clear();
// Get item to do search for, either from tree or from editor
ItemInfo trII = SearchIncTransII;
if (trII != null)
{
ReportTitle = string.Format("Search For Incoming Transitions to {0}: ", trII.Path);
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(trII.ItemID))
{
ItemInfoList iil = null;
bool first = true;
foreach (TransitionInfo ti in exTrans)
{
if (first)
{
ContentInfo ci = ContentInfo.Get(ti.FromID);
ItemInfo tmp = ci.ContentItems[0];
iil = new ItemInfoList(tmp);
first = false;
}
else
{
ContentInfo ci = ContentInfo.Get(ti.FromID);
ItemInfo tmp = ci.ContentItems[0];
iil.AddItem(tmp);
}
}
SearchResults = iil;
}
}
if (SearchResults != null && SearchResults.Count > 0)
{
AddMessageForEmptyAnnotations();
cmbResultsStyle.SelectedIndex = 1; //display step locations in results
DisplayResults();
}
else
{
btnPrnSrchRslts.Enabled = false;
btnClearSearchResults.Enabled = false;
btnCopySearchResults.Enabled = false;
btnSaveSearchResults.Enabled = false;
cmbResultsStyle.Enabled = false;
FlexibleMessageBox.Show("No Matches Found.", "Search");
}
btnTranCvtAllToTxt.Enabled = IncTransCvtAllToTextPerm();
btnTranCvtSelToTxt.Enabled = false;
}
public bool IncTranCvtPerm()
{
FolderInfo topFolder = FolderInfo.Get(1);
FolderConfig fc = topFolder.MyConfig as FolderConfig;
return fc.General_IncTranCvtPerm;
}
// C2020-033: Before allowing conversion of Incoming Transitions to text, get list of results that the user has permission edit.
private List<int> TranCvtCheckPermission(bool all)
{
// check if a non-reader can convert transitions to text even if a reader - this is set by an administrator on the top
// folder properties dialog
bool allowNonAdmin = IncTranCvtPerm();
List<int> itmsEditable = new List<int>(); // return this list
int listCount = 0;
if (all) // Check all in list
{
listCount = _SearchResults.Count;
foreach (ItemInfo ii in _SearchResults)
{
if (allowNonAdmin || UserInfo.CanEdit(MyUserInfo, ii.MyDocVersion)) itmsEditable.Add(ii.ContentID);
}
}
else // check only the items selected
{
listCount = lbSrchResultsIncTrans.CheckedItems.Count;
List<ListBoxItem> lbis = lbSrchResultsIncTrans.CheckedItems;
foreach (ListBoxItem lbi in lbis)
{
ItemBindingData tmpii = lbi.Tag as ItemBindingData;
ItemInfo ii = tmpii.DataItem as ItemInfo;
if (allowNonAdmin || UserInfo.CanEdit(MyUserInfo, ii.MyDocVersion)) itmsEditable.Add(ii.ContentID);
}
}
// Prompt user if convert to text should continue. If some items cannot be edited, also state that
// not all can be converted to text. If count of itmsEditable & lbis are different some cannot be edited.
if (itmsEditable.Count == 0)
{
FlexibleMessageBox.Show("You do not have permission to edit any of the procedures, sections, and/or steps" + (all ? "." : " that are selected."),
"Convert Transition to Text", MessageBoxButtons.OK, MessageBoxIcon.Information);
return null;
}
else if (itmsEditable.Count != listCount)
{
DialogResult ans = FlexibleMessageBox.Show("You only have permission to edit some of the procedures, sections, and/or steps that are selected.procedures, sections, and/or steps" + (all ? "." : " that are selected.") +
"\r\n\r\n Should the conversion of the transitions to text continue?",
"Convert Transition to Text", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.No) return null;
}
else
{
DialogResult ans = FlexibleMessageBox.Show("Are you sure you want to convert the transitions to text?",
"Convert Transition to Text", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.No) return null;
}
return itmsEditable;
}
// C2020-033: convert selected transitions to text
private void btnTranCvtSelToTxt_Click(object sender, EventArgs e)
{
// First see if all selected can be converted, i.e. user has permission to edit
List<ListBoxItem> lbis = lbSrchResultsIncTrans.CheckedItems;
List<int> itmsEditable = TranCvtCheckPermission(false);
if (itmsEditable == null || itmsEditable.Count == 0) return;
TranCvtToTxt(itmsEditable);
}
// C2020-033: For items in list, do the actual conversion of the Incoming Transition to text
private void TranCvtToTxt(List<int> itmsEditable)
{
ItemInfo trII = SearchIncTransII;
if (trII != null)
{
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(trII.ItemID))
{
foreach (TransitionInfo ti in exTrans)
{
// See if the 'item to' id is to be converted and if so do it. To figure this out,
// see if it is in the list itmsEditable.
if (itmsEditable.Contains(ti.FromID))
{
ContentInfo ci = ContentInfo.Get(ti.FromID);
ItemInfo tmp = ci.ContentItems[0];
using (Content content = Content.Get(tmp.ContentID))
{
content.FixTransitionText(ti, true);
content.Save();
}
}
}
}
}
}
} }
#region Annoation Search Type Class #region Annoation Search Type Class
// this class is used to generate the list of annotations to search. // this class is used to generate the list of annotations to search.
// this also allow us to add a dummy type which is used to search for all annotations // this also allow us to add a dummy type which is used to search for all annotations
public class AnnotationTypeSearch public class AnnotationTypeSearch
{ {
private string _Name; private string _Name;
public string Name public string Name

View File

@ -13,6 +13,7 @@ using Volian.Base.Library;
namespace Volian.Controls.Library namespace Volian.Controls.Library
{ {
public delegate ItemInfo DisplayTabControlEditorSearchIncTransEvent(object sender, vlnTreeItemInfoEventArgs args);
public delegate void DisplayTabControlEvent(object sender,EventArgs args); public delegate void DisplayTabControlEvent(object sender,EventArgs args);
public delegate void DisplayTabControlStatusEvent(object sender, DisplayTabControlStatusEventArgs args); public delegate void DisplayTabControlStatusEvent(object sender, DisplayTabControlStatusEventArgs args);
public partial class DisplayTabControlStatusEventArgs : EventArgs public partial class DisplayTabControlStatusEventArgs : EventArgs
@ -150,6 +151,13 @@ namespace Volian.Controls.Library
if (OpenInSeparateWindow != null) if (OpenInSeparateWindow != null)
OpenInSeparateWindow(this, args); OpenInSeparateWindow(this, args);
} }
// C2020-033: Provide way to expand/fill in Search/Incoming Transition panel
public event DisplayTabControlEditorSearchIncTransEvent SearchIncTrans;
public ItemInfo OnSearchIncTrans(object sender, vlnTreeItemInfoEventArgs args)
{
if (SearchIncTrans != null) return SearchIncTrans(sender, args);
return args.MyItemInfo;
}
public event ItemSelectedChangedEvent RefreshEnhancedDocument; public event ItemSelectedChangedEvent RefreshEnhancedDocument;
public void OnRefreshEnhancedDocument(ItemSelectedChangedEventArgs args) public void OnRefreshEnhancedDocument(ItemSelectedChangedEventArgs args)
{ {

View File

@ -1030,114 +1030,51 @@ namespace Volian.Controls.Library
private void HandleSqlExceptionOnDelete(Exception ex) private void HandleSqlExceptionOnDelete(Exception ex)
{ {
// C2020-018 made the messaging consistent in the message boxes // C2020-018 made the messaging consistent in the message boxes
// C2020-033: Expand/fill in the Search/Incoming Transition panel. Also, the dialog message was changed
// to give message to view panel and eliminate list in the dialog. This is done for each of cases.
if (ex.Message.Contains("has External Transitions and has no next step")) if (ex.Message.Contains("has External Transitions and has no next step"))
{ {
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnSearchIncTrans(this, new vlnTreeItemInfoEventArgs(MyStepRTB.MyItemInfo));
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(MyID)) // B2020-109: look at substeps too using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(MyID)) // B2020-109: look at substeps too
{ {
DialogResult ans = FlexibleMessageBox.Show("Transitions exist to this step and cannot be adjusted automatically." + DialogResult ans = FlexibleMessageBox.Show("Transitions exist to this step and cannot be adjusted automatically." +
"\r\n\r\nDo you want to be placed at the " + (exTrans.Count > 1 ? "first " : "") + "location with the problem Transition?" + "\r\n\r\nThe list of all locations are shown in the Tools/Search/Incoming Transitions tab.",
"\r\n\r\nLocations with Problem Transitions" + "Cannot Delete This Step", MessageBoxButtons.OK, MessageBoxIcon.Information);
exTrans.Summarize(), SetFocus();
"Cannot Delete This Step", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.Yes)
{
if (MyStepRTB.Text == "")
{
this.MyStepRTB.InsertSymbol(@"\u160?"); // since text was deleted, insert a hard space to prevent a looping effect B2016-082
using (Item itm = MyStepRTB.MyItemInfo.Get())
{
Annotation x = Annotation.MakeAnnotation(itm, AnnotationType.GetByName("Verification Required"), null, "A Hard Space was put in to keep the Transitions referencing here valid. \nPlease remove or re-assign these transitions before deleting this step.", null);
}
}
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(exTrans[0].MyContent.ContentItems[0]);
}
else
SetFocus();
} }
} }
else if (ex.Message.Contains("has External Transitions to Procedure")) else if (ex.Message.Contains("has External Transitions to Procedure"))
{ {
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnSearchIncTrans(this, new vlnTreeItemInfoEventArgs(MyStepRTB.MyItemInfo));
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(MyID)) using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(MyID))
{ {
DialogResult ans = FlexibleMessageBox.Show("Transitions exist to this procedure." + DialogResult ans = FlexibleMessageBox.Show("Transitions exist to this procedure." +
"\r\n\r\nDo you want to be placed at the " + (exTrans.Count > 1 ? "first " : "") + "location with the problem Transition?" + "\r\n\r\nThe list of all locations are shown in the Tools/Search/Incoming Transitions tab.",
"\r\n\r\nLocations with Problem Transitions" + "Cannot Delete This Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information);
exTrans.Summarize(), SetFocus();
"Cannot Delete This Procedure", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.Yes)
{
if (MyStepRTB.Text == "")
{
this.MyStepRTB.InsertSymbol(@"\u160?"); // since text was deleted, insert a hard space to prevent a looping effect B2016-082
using (Item itm = MyStepRTB.MyItemInfo.Get())
{
Annotation x = Annotation.MakeAnnotation(itm, AnnotationType.GetByName("Verification Required"), null, "A Hard Space was put in to keep the Transitions referencing here valid. \nPlease remove or re-assign these transitions before deleting this step.", null);
}
}
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(exTrans[0].MyContent.ContentItems[0]);
}
else
SetFocus();
} }
} }
// B2020-097: If deleting a section that has transitions pointing to it, show list: // B2020-097: If deleting a section that has transitions pointing to it, show list:
// B2020-098: If deleting a section that has transitions & select to remove 1st transition, crash on trying to delete section again // B2020-098: If deleting a section that has transitions & select to remove 1st transition, crash on trying to delete section again
else if (ex.Message.Contains("has External Transitions to Section")) else if (ex.Message.Contains("has External Transitions to Section"))
{ {
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnSearchIncTrans(this, new vlnTreeItemInfoEventArgs(MyStepRTB.MyItemInfo));
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(MyID)) using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(MyID))
{ {
DialogResult ans = FlexibleMessageBox.Show("Transitions exist to this section and cannot be adjusted automatically." + DialogResult ans = FlexibleMessageBox.Show("Transitions exist to this section and cannot be adjusted automatically." +
"\r\n\r\nDo you want to be placed at the " + (exTrans.Count > 1 ? "first " : "") + "location with the problem Transition?" + "\r\n\r\nThe list of all locations are shown in the Tools/Search/Incoming Transitions tab.",
"\r\n\r\nLocations with Problem Transitions" + "Cannot Delete This Section", MessageBoxButtons.OK, MessageBoxIcon.Information);
exTrans.Summarize(), MyStepPanel.SelectedEditItem = this;
"Cannot Delete This Section", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.Yes)
{
if (MyStepRTB.Text == "")
{
this.MyStepRTB.InsertSymbol(@"\u160?"); // since text was deleted, insert a hard space to prevent a looping effect B2016-082
using (Item itm = MyStepRTB.MyItemInfo.Get())
{
Annotation x = Annotation.MakeAnnotation(itm, AnnotationType.GetByName("Verification Required"), null, "A Hard Space was put in to keep the Transitions referencing here valid. \nPlease remove or re-assign these transitions before deleting this step.", null);
}
}
MyStepPanel.SelectedEditItem = this;
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(exTrans[0].MyContent.ContentItems[0]);
}
else
MyStepPanel.SelectedEditItem = this;
} }
} }
else if (ex.Message.Contains("has External Transitions to it's children")) else if (ex.Message.Contains("has External Transitions to it's children"))
{ {
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnSearchIncTrans(this, new vlnTreeItemInfoEventArgs(MyStepRTB.MyItemInfo));
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(MyID)) using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(MyID))
{ {
//DialogResult ans = FlexibleMessageBox.Show("Transitions exist to substeps of this step and cannot be adjusted automatically." +
// "\r\n\r\nDo you want to be placed on the " + (exTrans.Count > 1 ? "first " : "") + "substep with the problem Transition?" +
// "\r\n\r\nLocations with Problem Transitions:" +
// exTrans.Summarize(),
// "Cannot Delete This Step", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
DialogResult ans = FlexibleMessageBox.Show("Transitions exist to the substeps of this step and cannot be adjusted automatically." + DialogResult ans = FlexibleMessageBox.Show("Transitions exist to the substeps of this step and cannot be adjusted automatically." +
"\r\n\r\nDo you want to be placed at the " + (exTrans.Count > 1 ? "first " : "") + "location with the problem Transition?" + "\r\n\r\nThe list of all locations are shown in the Tools/Search/Incoming Transitions tab.",
"\r\n\r\nLocations with Problem Transitions:" + "Cannot Delete This Step", MessageBoxButtons.OK, MessageBoxIcon.Information);
exTrans.Summarize(),
"Cannot Delete This Step", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.Yes)
{
// B2017-182: The following code was moved from top of this method to here (and to each if/else case and only done if the text was removed,
// not when the step was deleted)
if (MyStepRTB.Text == "")
{
this.MyStepRTB.InsertSymbol(@"\u160?"); // since text was deleted, insert a hard space to prevent a looping effect B2016-082
using (Item itm = MyStepRTB.MyItemInfo.Get())
{
Annotation x = Annotation.MakeAnnotation(itm, AnnotationType.GetByName("Verification Required"), null, "A Hard Space was put in to keep the Transitions referencing here valid. \nPlease remove or re-assign these transitions before deleting this step.", null);
}
}
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(exTrans[0].MyContent.ContentItems[0]);
}
else
SetFocus(); SetFocus();
} }
} }

View File

@ -19,7 +19,7 @@ namespace Volian.Controls.Library.Properties {
// class via a tool like ResGen or Visual Studio. // class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project. // with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {
@ -270,6 +270,16 @@ namespace Volian.Controls.Library.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ChkRef {
get {
object obj = ResourceManager.GetObject("ChkRef", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>

View File

@ -2031,22 +2031,30 @@
</data> </data>
<data name="DecreaseFontSize_16x" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="DecreaseFontSize_16x" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADySURBVDhP1VGrDoMwFO0n7A/Gt+BRUzgEyczEND9BsEt9 wwAADsMBx2+oZAAAAPJJREFUOE/VUasOgzAU7SfsD8a34FFTOATJzMQ0P0GwS30lAjU1MT2HXz2iggCy
JQI1NTE9h189ooIAsutpLlDIumEmdpKTnN4X53LZT9H3fWmoiSWFl3AKFlRK7Zqm0WEYWkIjRm0zTLHa 62kuUMi6YSZ2kpOc3hfnctlP0fd9aaiJJYWXcAoWVErtmqbRYRhaQiNGbTNMsdofhWYHbgmN2DAMSVVV
H4VmB24JjdgwDElVVdMAaMSobUbXdefrQ04DoBEzQ8osy6YB0IhR2xKm4Xa63DUI7dpP01THcWy1dw1j 0wBoxKhtRtd15+tDTgOgETNDyizLpgHQiFHbEqbhdrrcNQjt2k/TVMdxbLV3DWMtgG2yHrj2hRC6KAqr
LYBtsh649oUQuigKq71rrOHal1Lquq6t/rjGCNd+FEWac26JN+hdY4Rr/x2/rrG2b96Wm9aANRTDOv5+ vWus4dqXUuq6rq3+uMYI134URZpzbok36F1jhGv/Hb+usbZv3pab1oA1FMM6/n7btk9KMWhcAznU+K6R
27ZPSjFoXAM51PiukYxfJOaUgrPczW26xj+AsRf1SGVLeHvqDQAAAABJRU5ErkJggg== jF8k5pSCs9zNbbrGP4CxF/VIZUt4e+oNAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="IncreaseFontSize_16x" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="IncreaseFontSize_16x" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wwAADsMBx2+oZAAAAO9JREFUOE+1UTEOgkAQvCf4BF/gI+hJTPyATzCW2PMKW0tjQY+tvsAXWFFcBZTn
zbF7LOtBYeIkkwyzsMzcmb/CWrvqus5JwqPxiL7v135oQWiy4e/runZZlgVCw6PxiLZt76fL04HQZBu/
8FaWZVwADY/GA/wHh8fr7czuHAgNj+PneR4XQMOb1EDszfEaF0DD0/GZXzWwcYYxflEUgdDJGhq+whZL
OH5VVYHQyRoaOn7TNIH8PHsbDBk/xcUaqdPXXKyh4+NFSfZna/iXJqePZxqF2eJt6Pg4efkXaH0bNBqA
F2BKyp78A0ka/QpjPuRAtoD1VSrCAAAAAElFTkSuQmCC
</value>
</data>
<data name="ChkRef" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADvSURBVDhPtVExDoJAELwn+ARf4CPoSUz8gE8wltjzCltL YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACASURBVDhPtY9LDoAgDAU5kmfgcOw5oUdgAWGLvqSNoJRv
Y0GPrb7AF1hRXAWU582xeyzrQWHiJJMMs7DM3Jm/wlq76rrOScKj8Yi+79d+aEFosuHv67p2WZYFQsOj nKQxKDOp6ldCCEeM0d2TakPX6rBsjEla6880Az0ZIwakta21Y4EcxLz3J2+Sb9QNvH8DT0hDAUnmAJ0d
8Yi2be+ny9OB0GQbv/BWlmVcAA2PxgP8B4fH6+3M7hwIDY/j53keF0DDm9RA7M3xGhdAw9PxmV81sHGG XS8RZEfvizMpDy0Z3xFYlsGWDLZkkTwwLTMcWZIZiPOyUhdBN2onEKujgwAAAABJRU5ErkJggg==
MX5RFIHQyRoavsIWSzh+VVWB0MkaGjp+0zSB/Dx7GwwZP8XFGqnT11ysoePjRUn2Z2v4lyanj2cahdni
bej4OHn5F2h9GzQagBdgSsqe/ANJGv0KYz7kQLaA9VUqwgAAAABJRU5ErkJggg==
</value> </value>
</data> </data>
</root> </root>

View File

@ -838,9 +838,10 @@ namespace Volian.Controls.Library
void _MyStepRTB_SelectionChanged(object sender, EventArgs e) void _MyStepRTB_SelectionChanged(object sender, EventArgs e)
{ {
if (_MyStepRTB == null) return;
_TimeActivity.Open(); _TimeActivity.Open();
//B2019-154 This will prevent duplicate processing of the ribbon menu and refresh of step items, speeding up the editing experience //B2019-154 This will prevent duplicate processing of the ribbon menu and refresh of step items, speeding up the editing experience
if (_MyStepRTB.MyItemInfo == lastItem && _MyStepRTB.SelectionStart == lastStart && _MyStepRTB.SelectionLength == lastLength && _MyStepRTB.SelectedText == lastText) if (_MyStepRTB != null && _MyStepRTB.MyItemInfo == lastItem && _MyStepRTB.SelectionStart == lastStart && _MyStepRTB.SelectionLength == lastLength && _MyStepRTB.SelectedText == lastText)
return; return;
lastItem = _MyStepRTB.MyItemInfo; lastItem = _MyStepRTB.MyItemInfo;
lastStart = _MyStepRTB.SelectionStart; lastStart = _MyStepRTB.SelectionStart;
@ -3333,7 +3334,11 @@ namespace Volian.Controls.Library
StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("LibDocs"); StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("LibDocs");
MyEditItem.MyStepPanel.OnTabDisplay(sender, args); MyEditItem.MyStepPanel.OnTabDisplay(sender, args);
} }
// C2020-033: Support the Review/Incoming Transition button to bring up Search/Incoming Transitions panel
private void btnSearchIncTrans_Click(object sender, EventArgs e)
{
MyEditItem.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnSearchIncTrans(this, new vlnTreeItemInfoEventArgs(MyStepRTB.MyItemInfo));
}
public void btnAnnots_Click(object sender, EventArgs e) public void btnAnnots_Click(object sender, EventArgs e)
{ {
StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("Annots"); StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("Annots");

View File

@ -36,6 +36,7 @@ namespace Volian.Controls.Library
public delegate void WordSectionDeletedEvent(object sender, WordSectionEventArgs args); public delegate void WordSectionDeletedEvent(object sender, WordSectionEventArgs args);
public delegate void vlnTreeViewPdfEvent(object sender, vlnTreeViewPdfArgs args); public delegate void vlnTreeViewPdfEvent(object sender, vlnTreeViewPdfArgs args);
public delegate string vlnTreeViewGetChangeIdEvent(object sender, vlnTreeItemInfoEventArgs args); public delegate string vlnTreeViewGetChangeIdEvent(object sender, vlnTreeItemInfoEventArgs args);
public delegate ItemInfo vlnTreeViewSearchIncTransEvent(object sender, vlnTreeItemInfoEventArgs args);
public partial class vlnTreeSectionInfoEventArgs public partial class vlnTreeSectionInfoEventArgs
{ {
private bool _IsDeleting = false; private bool _IsDeleting = false;
@ -443,13 +444,13 @@ namespace Volian.Controls.Library
{ {
if (NodeMove != null) NodeMove(sender, args); if (NodeMove != null) NodeMove(sender, args);
} }
public event vlnTreeViewClipboardStatusEvent ClipboardStatus; public event vlnTreeViewClipboardStatusEvent ClipboardStatus;
private ItemInfo OnClipboardStatus(object sender, vlnTreeEventArgs args) private ItemInfo OnClipboardStatus(object sender, vlnTreeEventArgs args)
{ {
ItemInfo rv = null; ItemInfo rv = null;
if (ClipboardStatus != null) rv = ClipboardStatus(sender, args); if (ClipboardStatus != null) rv = ClipboardStatus(sender, args);
return rv; return rv;
} }
public event vlnTreeViewEvent NodeCopy; public event vlnTreeViewEvent NodeCopy;
private void OnNodeCopy(object sender, vlnTreeEventArgs args) private void OnNodeCopy(object sender, vlnTreeEventArgs args)
{ {
@ -467,6 +468,13 @@ namespace Volian.Controls.Library
if (NodePSI != null) return NodePSI(sender, args); if (NodePSI != null) return NodePSI(sender, args);
return DialogResult.Cancel; return DialogResult.Cancel;
} }
// C2020-033: Support the menu item to bring up Search/Incoming Transitions panel
public event vlnTreeViewSearchIncTransEvent SearchIncTrans;
private ItemInfo OnSearchIncTransIn(object sender, vlnTreeItemInfoEventArgs args)
{
if (SearchIncTrans != null) return SearchIncTrans(sender, args);
return args.MyItemInfo;
}
public event vlnTreeViewSIEvent NodeSI; public event vlnTreeViewSIEvent NodeSI;
private DialogResult OnNodeSI(object sender, vlnTreeEventArgs args) private DialogResult OnNodeSI(object sender, vlnTreeEventArgs args)
{ {
@ -1003,12 +1011,19 @@ namespace Volian.Controls.Library
} }
#endregion #endregion
//_MyLog.WarnFormat("Context Menu 6 - {0}", GC.GetTotalMemory(true)); //_MyLog.WarnFormat("Context Menu 6 - {0}", GC.GetTotalMemory(true));
#region Menu_ExternalTransitions
// C2020-033: Support the menu item to bring up Search/Incoming Transitions panel
ItemInfo iix = tn.VEObject as ItemInfo;
if (iix != null)
{
cm.MenuItems.Add("Incoming Transitions", new EventHandler(mi_Click));
}
#endregion
#region Menu_Properties #region Menu_Properties
// Add Properties to the menu unless at the very 'top' node or on a grouping (partinfo) // Add Properties to the menu unless at the very 'top' node or on a grouping (partinfo)
// node (RNOs, Steps, Cautions, Notes) or at the step level. // node (RNOs, Steps, Cautions, Notes) or at the step level.
// B2020-105 Allow Set Administrators to rename folder's (sets of procedures) to which they have been given access. // B2020-105 Allow Set Administrators to rename folder's (sets of procedures) to which they have been given access.
if( tn.VEObject is FolderInfo) ok = (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as FolderInfo)); if ( tn.VEObject is FolderInfo) ok = (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as FolderInfo));
else ok = (tn.VEObject is DocVersionInfo) ? (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as DocVersionInfo)) else ok = (tn.VEObject is DocVersionInfo) ? (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as DocVersionInfo))
: (ui.IsAdministrator() || (tn.VEObject is ItemInfo) && (ui.IsSetAdministrator((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion) : (ui.IsAdministrator() || (tn.VEObject is ItemInfo) && (ui.IsSetAdministrator((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion)
|| ui.IsWriter((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion))); || ui.IsWriter((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion)));
@ -1782,6 +1797,11 @@ namespace Volian.Controls.Library
OnNodeSelect(this, new vlnTreeEventArgs(SelectedNode)); OnNodeSelect(this, new vlnTreeEventArgs(SelectedNode));
} }
break; break;
case "Incoming Transitions": // C2020-033: Support the menu item to bring up Search/Incoming Transitions panel
VETreeNode tnx = SelectedNode as VETreeNode;
ItemInfo iii = tnx.VEObject as ItemInfo;
if (iii != null) OnSearchIncTransIn(this, new vlnTreeItemInfoEventArgs(iii));
break;
case "Properties..."://Show the properties for the selected node case "Properties..."://Show the properties for the selected node
SetLastValues((VETreeNode)SelectedNode); SetLastValues((VETreeNode)SelectedNode);
SetupNodeProperties(); SetupNodeProperties();
@ -3257,8 +3277,18 @@ namespace Volian.Controls.Library
{ {
OnProcessing(false,"Delete Failed"); OnProcessing(false,"Delete Failed");
OnProcessingComplete(dtStart,"Delete Failed"); OnProcessingComplete(dtStart,"Delete Failed");
ItemInfo iii = ii.HandleSqlExceptionOnDelete(ex); // C2020-033: Support delete to bring up Search/Incoming Transitions panel
if(iii != null) OnOpenItem(this, new vlnTreeItemInfoEventArgs(iii)); if (ex.Message.Contains("has External Transitions"))
{
ItemInfo iis = ItemInfo.Get(ii.ItemID);
OnSearchIncTransIn(this, new vlnTreeItemInfoEventArgs(iis));
iis = ii.HandleSqlExceptionOnDelete(ex);
}
else
{
ItemInfo iii = ii.HandleSqlExceptionOnDelete(ex);
if (iii != null) OnOpenItem(this, new vlnTreeItemInfoEventArgs(iii));
}
return false; return false;
} }
} }