B2021-008: Refresh Transition Links delete transition record when no link in text
B2021-010: Incoming Transitions – Find & convert to text all including at selected item
This commit is contained in:
parent
f79ff651a5
commit
4f4402b0d0
@ -759,6 +759,17 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
// B2021-008: Delete the transition record if there is no link in the text
|
||||
if (mc.Count == 0 && itemInfo.MyContent.ContentTransitionCount > 0)
|
||||
{
|
||||
TranCheckCount++;
|
||||
TranFixCount++;
|
||||
if (itemInfo.MyContent.ContentTransitions != null)
|
||||
foreach (TransitionInfo ct in itemInfo.MyContent.ContentTransitions)
|
||||
Transition.Delete(ct.TransitionID);
|
||||
itemInfo.MyContent.RefreshContentTransitions();
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -1629,38 +1629,14 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
// 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)
|
||||
// B2021-010: Use IncomingTranGetMergedTranList to get a complete list of incoming transitions (transitions to procedure
|
||||
// were only included if there were NO transitions to items within procedure)
|
||||
ReportTitle = string.Format("Search For Incoming Transitions to {0}: ", SearchIncTransII.Path);
|
||||
SearchResults = IncomingTranGetMergedTranList();
|
||||
cmbResultsStyleIndex = 1; //display step locations in results
|
||||
if (SearchResults == null || SearchResults.Count == 0)
|
||||
{
|
||||
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
|
||||
}
|
||||
FlexibleMessageBox.Show("No Matches Found.", "Search");
|
||||
}
|
||||
}
|
||||
if (SearchResults != null)
|
||||
@ -2760,33 +2736,12 @@ namespace Volian.Controls.Library
|
||||
lbSrchResultsIncTrans.DataSource = null;
|
||||
lbSrchResultsIncTrans.Items.Clear();
|
||||
// Get item to do search for, either from tree or from editor
|
||||
ItemInfo trII = SearchIncTransII;
|
||||
if (trII != null)
|
||||
if (SearchIncTransII != 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;
|
||||
}
|
||||
// B2021-010: Use IncomingTranGetMergedTranList to get a complete list of incoming transitions (transitions to procedure
|
||||
// were only included if there were NO transitions to items within procedure)
|
||||
SearchResults = IncomingTranGetMergedTranList();
|
||||
ReportTitle = string.Format("Search For Incoming Transitions to {0}: ", SearchIncTransII.Path);
|
||||
}
|
||||
if (SearchResults != null && SearchResults.Count > 0)
|
||||
{
|
||||
@ -2875,6 +2830,53 @@ namespace Volian.Controls.Library
|
||||
UpdateSearchIncTransResults(); // B2021-009: Research after convert transitions to text
|
||||
fromTranCvtBtn = false;
|
||||
}
|
||||
// B2021-010: IncomingTranGetMergedTranList gets a complete list of incoming transitions (before fix transitions to procedure
|
||||
// were only included if there were NO transitions to items within procedure, the GetExternalTransitionsToChildren query
|
||||
// did not get transitions 'incoming to' the item itself)
|
||||
private ItemInfoList IncomingTranGetMergedTranList()
|
||||
{
|
||||
ItemInfoList iil = null;
|
||||
bool first = true;
|
||||
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(SearchIncTransII.ItemID))
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitions(SearchIncTransII.ItemID))
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
return iil;
|
||||
}
|
||||
// C2020-033: For items in list, do the actual conversion of the Incoming Transition to text
|
||||
private void TranCvtToTxt(List<int> itmsEditable)
|
||||
{
|
||||
@ -2900,6 +2902,26 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
|
||||
}
|
||||
// B2021-010: Convert the text of transitions pointing (incoming) to the item itself
|
||||
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitions(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user