diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index ac197a4..fd1975a 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -520,13 +520,7 @@ namespace AyaNova.PlugIn.V8 Tagit(c.ClientGroupID, tags); SetTags(d, tags); - var hasWiki = WikiPage.HasWiki(c.ID); - if (hasWiki) - { - //await ExportAttachments(ObjectTID, progress); - d.wiki = GetWikiContent(ObjectTID); - } - + //Custom fields? if (ShouldExportCustom) d.customFields = CustomFieldData(c, DateCustomFields); @@ -538,15 +532,31 @@ namespace AyaNova.PlugIn.V8 //Attachments / FILES await ExportAttachments(ObjectTID, progress); + //----- + bool repost = false; + d = rMainObject.ObjectResponse["data"]; + // wiki + if (WikiPage.HasWiki(c.ID)) + { + // await ExportAttachments(ObjectTID, progress); + d.wiki = GetWikiContent(ObjectTID); + repost = true; + } + //docs string NonFileUrls = await ExportDocs(ObjectTID, c.Docs, progress); if (!string.IsNullOrEmpty(NonFileUrls)) { - //need to repost the object with the notes modified - d = rMainObject.ObjectResponse["data"]; + //need to repost the user with the notes modified + + d.login = null; + d.password = null; d.notes = NonFileUrls + "\n-----------------\n" + d.notes; - await util.PutAsync("Customer/" + RavenId.ToString(), d.ToString()); + repost = true; } + if (repost) + await util.PutAsync("User/" + RavenId.ToString(), d.ToString()); + //----- //Event log fixup await util.EventLog(util.AyaType.Customer, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified); @@ -588,12 +598,6 @@ namespace AyaNova.PlugIn.V8 Tagit(c.ClientGroupID, tags); SetTags(d, tags); - var hasWiki = WikiPage.HasWiki(c.ID); - if (hasWiki) - { - //await ExportAttachments(ObjectTID, progress); - d.wiki = GetWikiContent(ObjectTID); - } //Custom fields? if (ShouldExportCustom) @@ -606,15 +610,31 @@ namespace AyaNova.PlugIn.V8 //Attachments / FILES await ExportAttachments(ObjectTID, progress); + //----- + bool repost = false; + d = rMainObject.ObjectResponse["data"]; + // wiki + if (WikiPage.HasWiki(c.ID)) + { + // await ExportAttachments(ObjectTID, progress); + d.wiki = GetWikiContent(ObjectTID); + repost = true; + } + //docs string NonFileUrls = await ExportDocs(ObjectTID, c.Docs, progress); if (!string.IsNullOrEmpty(NonFileUrls)) { - //need to repost the object with the notes modified - d = rMainObject.ObjectResponse["data"]; + //need to repost the user with the notes modified + + d.login = null; + d.password = null; d.notes = NonFileUrls + "\n-----------------\n" + d.notes; - await util.PutAsync("HeadOffice/" + RavenId.ToString(), d.ToString()); + repost = true; } + if (repost) + await util.PutAsync("User/" + RavenId.ToString(), d.ToString()); + //----- //Event log fixup await util.EventLog(util.AyaType.HeadOffice, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified); @@ -654,12 +674,7 @@ namespace AyaNova.PlugIn.V8 Tagit(c.RegionID, tags); SetTags(d, tags); - var hasWiki = WikiPage.HasWiki(c.ID); - if (hasWiki) - { - d.wiki = GetWikiContent(ObjectTID); - } - + //Custom fields? if (ShouldExportCustom) d.customFields = CustomFieldData(c, DateCustomFields); @@ -671,15 +686,31 @@ namespace AyaNova.PlugIn.V8 //Attachments / FILES await ExportAttachments(ObjectTID, progress); + //----- + bool repost = false; + d = rMainObject.ObjectResponse["data"]; + // wiki + if (WikiPage.HasWiki(c.ID)) + { + // await ExportAttachments(ObjectTID, progress); + d.wiki = GetWikiContent(ObjectTID); + repost = true; + } + //docs string NonFileUrls = await ExportDocs(ObjectTID, c.Docs, progress); if (!string.IsNullOrEmpty(NonFileUrls)) { - //need to repost the object with the notes modified - d = rMainObject.ObjectResponse["data"]; + //need to repost the user with the notes modified + + d.login = null; + d.password = null; d.notes = NonFileUrls + "\n-----------------\n" + d.notes; - await util.PutAsync(ObjectTypeName + "/" + RavenId.ToString(), d.ToString()); + repost = true; } + if (repost) + await util.PutAsync("User/" + RavenId.ToString(), d.ToString()); + //----- //Event log fixup await util.EventLog(util.AyaType.Contract, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified); @@ -720,12 +751,6 @@ namespace AyaNova.PlugIn.V8 Tagit(c.RegionID, tags); SetTags(d, tags); - var hasWiki = WikiPage.HasWiki(c.ID); - if (hasWiki) - { - d.wiki = GetWikiContent(ObjectTID); - } - //Custom fields? if (ShouldExportCustom) d.customFields = CustomFieldData(c, DateCustomFields); @@ -737,15 +762,31 @@ namespace AyaNova.PlugIn.V8 //Attachments / FILES await ExportAttachments(ObjectTID, progress); + //----- + bool repost = false; + d = rMainObject.ObjectResponse["data"]; + // wiki + if (WikiPage.HasWiki(c.ID)) + { + // await ExportAttachments(ObjectTID, progress); + d.wiki = GetWikiContent(ObjectTID); + repost = true; + } + //docs string NonFileUrls = await ExportDocs(ObjectTID, c.Docs, progress); if (!string.IsNullOrEmpty(NonFileUrls)) { - //need to repost the object with the notes modified - d = rMainObject.ObjectResponse["data"]; + //need to repost the user with the notes modified + + d.login = null; + d.password = null; d.notes = NonFileUrls + "\n-----------------\n" + d.notes; - await util.PutAsync(RavenObjectName + "/" + RavenId.ToString(), d.ToString()); + repost = true; } + if (repost) + await util.PutAsync("User/" + RavenId.ToString(), d.ToString()); + //----- //Event log fixup await util.EventLog(util.AyaType.LoanUnit, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified); @@ -787,12 +828,7 @@ namespace AyaNova.PlugIn.V8 SetTags(d, tags); - var hasWiki = WikiPage.HasWiki(c.ID); - if (hasWiki) - { - d.wiki = GetWikiContent(ObjectTID); - } - + //Custom fields? if (ShouldExportCustom) d.customFields = CustomFieldData(c, DateCustomFields); @@ -804,15 +840,31 @@ namespace AyaNova.PlugIn.V8 //Attachments / FILES await ExportAttachments(ObjectTID, progress); + //----- + bool repost = false; + d = rMainObject.ObjectResponse["data"]; + // wiki + if (WikiPage.HasWiki(c.ID)) + { + // await ExportAttachments(ObjectTID, progress); + d.wiki = GetWikiContent(ObjectTID); + repost = true; + } + //docs string NonFileUrls = await ExportDocs(ObjectTID, c.Docs, progress); if (!string.IsNullOrEmpty(NonFileUrls)) { - //need to repost the object with the notes modified - d = rMainObject.ObjectResponse["data"]; + //need to repost the user with the notes modified + + d.login = null; + d.password = null; d.notes = NonFileUrls + "\n-----------------\n" + d.notes; - await util.PutAsync(RavenObjectName + "/" + RavenId.ToString(), d.ToString()); + repost = true; } + if (repost) + await util.PutAsync("User/" + RavenId.ToString(), d.ToString()); + //----- //Event log fixup await util.EventLog(util.AyaType.Part, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified); @@ -852,11 +904,6 @@ namespace AyaNova.PlugIn.V8 Tagit(c.RegionID, tags); SetTags(d, tags); - var hasWiki = WikiPage.HasWiki(c.ID); - if (hasWiki) - { - d.wiki = GetWikiContent(ObjectTID); - } //Custom fields? if (ShouldExportCustom) @@ -868,16 +915,31 @@ namespace AyaNova.PlugIn.V8 //Attachments / FILES await ExportAttachments(ObjectTID, progress); + //----- + bool repost = false; + d = rMainObject.ObjectResponse["data"]; + // wiki + if (WikiPage.HasWiki(c.ID)) + { + // await ExportAttachments(ObjectTID, progress); + d.wiki = GetWikiContent(ObjectTID); + repost = true; + } //docs string NonFileUrls = await ExportDocs(ObjectTID, c.Docs, progress); if (!string.IsNullOrEmpty(NonFileUrls)) { - //need to repost the object with the notes modified - d = rMainObject.ObjectResponse["data"]; + //need to repost the user with the notes modified + + d.login = null; + d.password = null; d.notes = NonFileUrls + "\n-----------------\n" + d.notes; - await util.PutAsync(ObjectTypeName + "/" + RavenId.ToString(), d.ToString()); + repost = true; } + if (repost) + await util.PutAsync("User/" + RavenId.ToString(), d.ToString()); + //----- //Event log fixup await util.EventLog(util.AyaType.Project, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);