diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index e4880d74..d712d9fa 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -422,20 +422,49 @@ namespace VEPROMS.CSLA.Library // This returns a list of all of the transitions that may have been affected using(TransitionInfoList trans = TransitionInfoList.GetAffected(this.ItemID)) { + #region B2012-071 fix JCB + Content oldContent = null; foreach (TransitionInfo tran in trans) { using (Content content = tran.MyContent.Get()) { - content.FixTransitionText(tran); - if (content.IsDirty) + if (oldContent != null && content.ContentID != oldContent.ContentID) { - content.DTS = DateTime.Now; - content.Save(); + if (oldContent.IsDirty) + { + oldContent.DTS = DateTime.Now; + #region B2012-079 fix JCB + oldContent.UserID = Volian.Base.Library.VlnSettings.UserID + " - Renumber"; + #endregion B2012-079 fix JCB + oldContent.Save(); + } + else // Update ContentInfo objects to reflect the change in the transition + ContentInfo.Refresh(oldContent); + oldContent = content; } - else // Update ContentInfo objects to reflect the change in the transition - ContentInfo.Refresh(content); + if (oldContent == null) oldContent = content; + oldContent.FixTransitionText(tran); + //if (content.IsDirty) + //{ + // content.DTS = DateTime.Now; + // content.Save(); + //} } } + if (oldContent != null) + { + if (oldContent.IsDirty) + { + oldContent.DTS = DateTime.Now; + #region B2012-079 fix JCB + oldContent.UserID = Volian.Base.Library.VlnSettings.UserID + " - Renumber"; + #endregion B2012-079 fix JCB + oldContent.Save(); + } + else // Update ContentInfo objects to reflect the change in the transition + ContentInfo.Refresh(oldContent); + } + #endregion B2012-071 fix JCB } } public void UpdatePastedStepTransitionText() diff --git a/PROMS/Volian.Controls.Library/DisplayHistory.cs b/PROMS/Volian.Controls.Library/DisplayHistory.cs index cd65fbff..5df81846 100644 --- a/PROMS/Volian.Controls.Library/DisplayHistory.cs +++ b/PROMS/Volian.Controls.Library/DisplayHistory.cs @@ -117,7 +117,12 @@ namespace Volian.Controls.Library { ContentAuditInfo cai = lbChanges.SelectedItem as ContentAuditInfo; if (cai != null) - OnHistorySelectionChanged(new DisplayHistoryEventArgs(cai.ItemID)); + { + if (cai.DeleteStatus > 0) + MessageBox.Show("This item has been deleted.","Deleted Item",MessageBoxButtons.OK,MessageBoxIcon.Exclamation); + else + OnHistorySelectionChanged(new DisplayHistoryEventArgs(cai.ItemID)); + } else { AnnotationAuditInfo aai = lbChanges.SelectedItem as AnnotationAuditInfo; @@ -415,7 +420,7 @@ namespace Volian.Controls.Library _AnnotationList = aail2; foreach (ContentAuditInfo cai in cail2) { - if (cai.DTS > MyProcedureInfo.DTS) + if (cai.DTS > MyProcedureInfo.DTS || cai.ActionWhen > MyProcedureInfo.DTS) { string itemTitle = FixPath(cai.Path); lbChanges.Items.Add(cai); diff --git a/PROMS/Volian.Controls.Library/DisplayTabControl.cs b/PROMS/Volian.Controls.Library/DisplayTabControl.cs index a5bc3166..22f345c6 100644 --- a/PROMS/Volian.Controls.Library/DisplayTabControl.cs +++ b/PROMS/Volian.Controls.Library/DisplayTabControl.cs @@ -464,7 +464,8 @@ namespace Volian.Controls.Library private void CloseTabItem(DisplayTabItem myTabItem) { Bar b = myTabItem.ContainerControl as Bar; - b.Items.Remove(myTabItem); + b.CloseDockTab(myTabItem); + //b.Items.Remove(myTabItem); RemoveItem(myTabItem); } /// diff --git a/PROMS/Volian.Controls.Library/EditItem.cs b/PROMS/Volian.Controls.Library/EditItem.cs index d82e9e29..1d9ab027 100644 --- a/PROMS/Volian.Controls.Library/EditItem.cs +++ b/PROMS/Volian.Controls.Library/EditItem.cs @@ -189,6 +189,7 @@ namespace Volian.Controls.Library } // Deal with changes in content data value.MyContent.Changed += new ContentInfoEvent(MyContent_Changed); + value.MyProcedure.MyContent.Changed += new ContentInfoEvent(MyContent_Changed); // Deal with change in item data value.Changed += new ItemInfoEvent(value_Changed); value.OrdinalChanged += new ItemInfoEvent(value_OrdinalChanged); diff --git a/PROMS/Volian.Controls.Library/GridItem.Designer.cs b/PROMS/Volian.Controls.Library/GridItem.Designer.cs index 966e5844..a96438c1 100644 --- a/PROMS/Volian.Controls.Library/GridItem.Designer.cs +++ b/PROMS/Volian.Controls.Library/GridItem.Designer.cs @@ -19,6 +19,7 @@ namespace Volian.Controls.Library } base.Dispose(disposing); MyItemInfo.MyContent.Changed -= new VEPROMS.CSLA.Library.ContentInfoEvent(MyContent_Changed); + MyItemInfo.MyProcedure.MyContent.Changed -= new VEPROMS.CSLA.Library.ContentInfoEvent(MyContent_Changed); } #region Component Designer generated code diff --git a/PROMS/Volian.Controls.Library/RTBItem.designer.cs b/PROMS/Volian.Controls.Library/RTBItem.designer.cs index fe02326c..f7a64439 100644 Binary files a/PROMS/Volian.Controls.Library/RTBItem.designer.cs and b/PROMS/Volian.Controls.Library/RTBItem.designer.cs differ diff --git a/PROMS/Volian.Print.Library/PDFChronologyReport.cs b/PROMS/Volian.Print.Library/PDFChronologyReport.cs index 9d884a86..8d4fa15e 100644 --- a/PROMS/Volian.Print.Library/PDFChronologyReport.cs +++ b/PROMS/Volian.Print.Library/PDFChronologyReport.cs @@ -426,6 +426,7 @@ namespace Volian.Print.Library } } bool annotationHeader = false; + section = string.Empty; stepnum = string.Empty; foreach (AnnotationAuditInfo aai in AnnotationList) { @@ -448,6 +449,20 @@ namespace Volian.Print.Library annotationHeader = true; } string[] NewPath = GetNewPath(AuditList, aai.IContentID); + if (NewPath[0] != section) + { + section = NewPath[0]; + stepnum = string.Empty; + h = new Phrase(); + h.Font = f4; + h.Add(section); + c = new PdfPCell(h); + c.Colspan = cols; + c.HorizontalAlignment = Element.ALIGN_LEFT; + c.PaddingBottom = paddingBottom; + //c.Border = borders; + t.AddCell(c); + } if (NewPath[1] != stepnum) { stepnum = NewPath[1]; @@ -1077,10 +1092,6 @@ namespace Volian.Print.Library annotationList.Add(firstAAI); annotationList.Add(lastAAI); } - else if (lastAAI.ActionWhat == "Changed" && firstAAI.ActionWhat == "Added") // && lastAAI.SearchText == firstAAI.SearchText) - { - annotationList.Add(firstAAI); - } else if (lastAAI.ActionWhat == "Changed" && firstAAI.ActionWhat == "Added") // && lastAAI.SearchText != firstAAI.SearchText) { lastAAI.ActionWhat = firstAAI.ActionWhat; @@ -1107,9 +1118,43 @@ namespace Volian.Print.Library lastAAI = aai; } if (firstAAI != null) - annotationList.Add(firstAAI); - if (lastAAI != null) - annotationList.Add(lastAAI); + { + if (lastAAI == null) + { + annotationList.Add(firstAAI); + } + else if (lastAAI.ActionWhat == "Deleted" && firstAAI.DTS < MyProc.DTS) + { + annotationList.Add(lastAAI); + } + else if (lastAAI.ActionWhat == "Changed" && firstAAI.ActionWhat != "Added") // && lastAAI.SearchText != firstAAI.SearchText) + { + annotationList.Add(firstAAI); + annotationList.Add(lastAAI); + } + else if (lastAAI.ActionWhat == "Changed" && firstAAI.ActionWhat == "Added") // && lastAAI.SearchText != firstAAI.SearchText) + { + lastAAI.ActionWhat = firstAAI.ActionWhat; + annotationList.Add(lastAAI); + firstAAI = null; + lastAAI = null; + } + else if (lastAAI.ActionWhat == "Restored" && firstAAI.ActionWhat == "Added") // && lastAAI.SearchText != firstAAI.SearchText) + { + lastAAI.ActionWhat = firstAAI.ActionWhat; + annotationList.Add(lastAAI); + firstAAI = null; + lastAAI = null; + } + else if (lastAAI == null && firstAAI.ActionWhat == "Added") + { + annotationList.Add(firstAAI); + } + } + //if (firstAAI != null) + // annotationList.Add(firstAAI); + //if (lastAAI != null) + // annotationList.Add(lastAAI); #endregion int cols = 5; int borders = 0; @@ -1421,6 +1466,7 @@ namespace Volian.Print.Library ////c.Border = borders; //t.AddCell(c); //t.AddCell(BlankCell(cols)); + section = string.Empty; stepnum = string.Empty; foreach (AnnotationAuditInfo aai in annotationList) { @@ -1443,6 +1489,20 @@ namespace Volian.Print.Library annotationHeader = true; } string[] NewPath = GetNewPath(AuditList, aai.IContentID); + if (NewPath[0] != section) + { + section = NewPath[0]; + stepnum = string.Empty; + h = new Phrase(); + h.Font = f4; + h.Add(section); + c = new PdfPCell(h); + c.Colspan = cols; + c.HorizontalAlignment = Element.ALIGN_LEFT; + c.PaddingBottom = paddingBottom; + //c.Border = borders; + t.AddCell(c); + } if (NewPath[1] != stepnum) { stepnum = NewPath[1];