B2016-019: Don’t display enhanced tab if not enhanced document. Also enlarge form a bit so that folder button on Output settings tab isn’t cut off
B2016-015: refresh tabs for enhanced inserted steps. B2016-017: fix crashes on replace B2016-024: do not allow insert new HLS in enhanced if positioned on substep (from ribbon) - B2016-022: insert procedure in a ‘source’ set before/after did not have Create Enhanced checkbox and B2016-017: fix crashes on replace
This commit is contained in:
@@ -871,6 +871,7 @@ namespace VEPROMS.CSLA.Library
|
||||
// if inserting after a caution or note, refreshes tabs. This will adjust bullets
|
||||
// of any previous cautions or notes.
|
||||
if (tmp.IsCaution || tmp.IsNote) ResetOrdinal();
|
||||
tmp.UpdateTransitionText(); // even though enhanced does not have transitions, this is needed to refresh tabs
|
||||
// Note that non-enhanced update transition and ro text at this point. But since
|
||||
// transitions and ro's are converted to text, this is not needed.
|
||||
|
||||
@@ -1016,28 +1017,30 @@ namespace VEPROMS.CSLA.Library
|
||||
// tmpCopyStartSourceItem is the item that was copied in source.
|
||||
ItemInfo tmpCopyStartSourceItem = ItemInfo.Get(copyStartID);
|
||||
|
||||
// if the copied step is not a 'source', then this really needs to be more of an insert for the enhanced steps.
|
||||
StepConfig stepFromCfg = tmpCopyStartSourceItem.MyConfig as StepConfig;
|
||||
if (stepFromCfg.MyEnhancedDocuments == null || stepFromCfg.MyEnhancedDocuments.Count==0)
|
||||
if (tmpCopyStartSourceItem.IsStep)
|
||||
{
|
||||
// Insert the enhanced steps. Loop through all enhanced document types, insert from
|
||||
// the paste item's linked step.
|
||||
foreach (EnhancedDocument edSource in pasteFromItem.GetMyEnhancedDocuments())
|
||||
// if the copied step is not a 'source', then this really needs to be more of an insert for the enhanced steps.
|
||||
StepConfig stepFromCfg = tmpCopyStartSourceItem.MyConfig as StepConfig;
|
||||
if (stepFromCfg.MyEnhancedDocuments == null || stepFromCfg.MyEnhancedDocuments.Count == 0)
|
||||
{
|
||||
// Insert the enhanced steps. Loop through all enhanced document types, insert from
|
||||
// the paste item's linked step.
|
||||
foreach (EnhancedDocument edSource in pasteFromItem.GetMyEnhancedDocuments())
|
||||
{
|
||||
// create a new enhanced step and link it to this new source step.
|
||||
// the new source step's item is used to know what type & what to link to.
|
||||
// The ed.Type & ed.itemid show what type of enhanced document (use to create new
|
||||
// config Type).
|
||||
ItemInfo exEnh = ItemInfo.Get(edSource.ItemID);
|
||||
ItemInfo newEnh = exEnh.InsertEnhancedSteps(tmpCopyStartSourceItem.MyContent.Text, null, addType, MyContent.Type, edSource.Type, this.ItemID);
|
||||
if (newEnh == null) return null;
|
||||
StepConfig sc = new StepConfig(MyContent.Config);
|
||||
sc.AddEnhancedDocument(edSource.Type, newEnh.ItemID);
|
||||
SaveConfig(sc.ToString());
|
||||
ItemInfo exEnh = ItemInfo.Get(edSource.ItemID);
|
||||
ItemInfo newEnh = exEnh.InsertEnhancedSteps(tmpCopyStartSourceItem.MyContent.Text, null, addType, MyContent.Type, edSource.Type, this.ItemID);
|
||||
if (newEnh == null) return null;
|
||||
StepConfig sc = new StepConfig(MyContent.Config);
|
||||
sc.AddEnhancedDocument(edSource.Type, newEnh.ItemID);
|
||||
SaveConfig(sc.ToString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// loop through all enhanced document types, pasting in the copied item(s).
|
||||
// Note that the copy/paste finds the enhanced items that relate to source,
|
||||
// i.e. copied item & paste from, and uses those to do the copy/paste.
|
||||
@@ -1859,9 +1862,9 @@ namespace VEPROMS.CSLA.Library
|
||||
internal static ItemInfo CopyPasteReplaceItemInfoFetch(int copyStartID, ItemInfo itemInfo) // int itemID, int? type, int? fromType)
|
||||
{
|
||||
ItemInfo tmp = null;
|
||||
if (itemInfo.GetType() == typeof(ProcedureInfo))
|
||||
if (itemInfo.GetType() == typeof(ProcedureInfo) || itemInfo.MyContent.Type < 10000)
|
||||
tmp = DataPortal.Fetch<ProcedureInfo>(new ItemInfo.PastingPartCriteria(copyStartID, itemInfo.ItemID, ItemInfo.EAddpingPart.Replace, itemInfo.MyContent.Type, itemInfo.MyContent.Type, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
|
||||
else if (itemInfo.GetType() == typeof(SectionInfo))
|
||||
else if (itemInfo.GetType() == typeof(SectionInfo) || itemInfo.MyContent.Type < 20000)
|
||||
tmp = DataPortal.Fetch<SectionInfo>(new ItemInfo.PastingPartCriteria(copyStartID, itemInfo.ItemID, ItemInfo.EAddpingPart.Replace, itemInfo.MyContent.Type, itemInfo.MyContent.Type, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
|
||||
else
|
||||
tmp = DataPortal.Fetch<StepInfo>(new ItemInfo.PastingPartCriteria(copyStartID, itemInfo.ItemID, ItemInfo.EAddpingPart.Replace, itemInfo.MyContent.Type, itemInfo.MyContent.Type, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
|
||||
|
Reference in New Issue
Block a user