From 8ab96ab1a5b8b1480511bc078c6762740545a8b2 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sun, 3 May 2020 14:58:59 +0000 Subject: [PATCH] --- source/Plugins/AyaNova.Plugin.V8/V8.cs | 71 +++++++++++++++----------- 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index fd1975a..596069b 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -555,7 +555,7 @@ namespace AyaNova.PlugIn.V8 repost = true; } if (repost) - await util.PutAsync("User/" + RavenId.ToString(), d.ToString()); + await util.PutAsync("Customer/" + RavenId.ToString(), d.ToString()); //----- //Event log fixup @@ -633,7 +633,7 @@ namespace AyaNova.PlugIn.V8 repost = true; } if (repost) - await util.PutAsync("User/" + RavenId.ToString(), d.ToString()); + await util.PutAsync(ObjectTypeName+"/" + RavenId.ToString(), d.ToString()); //----- //Event log fixup @@ -709,7 +709,7 @@ namespace AyaNova.PlugIn.V8 repost = true; } if (repost) - await util.PutAsync("User/" + RavenId.ToString(), d.ToString()); + await util.PutAsync(ObjectTypeName + "/" + RavenId.ToString(), d.ToString()); //----- //Event log fixup @@ -785,7 +785,7 @@ namespace AyaNova.PlugIn.V8 repost = true; } if (repost) - await util.PutAsync("User/" + RavenId.ToString(), d.ToString()); + await util.PutAsync(RavenObjectName + "/" + RavenId.ToString(), d.ToString()); //----- //Event log fixup @@ -863,7 +863,7 @@ namespace AyaNova.PlugIn.V8 repost = true; } if (repost) - await util.PutAsync("User/" + RavenId.ToString(), d.ToString()); + await util.PutAsync(ObjectTypeName + "/" + RavenId.ToString(), d.ToString()); //----- //Event log fixup @@ -938,7 +938,7 @@ namespace AyaNova.PlugIn.V8 repost = true; } if (repost) - await util.PutAsync("User/" + RavenId.ToString(), d.ToString()); + await util.PutAsync(ObjectTypeName + "/" + RavenId.ToString(), d.ToString()); //----- //Event log fixup @@ -979,12 +979,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); @@ -996,15 +990,21 @@ namespace AyaNova.PlugIn.V8 //Attachments / FILES await ExportAttachments(ObjectTID, progress); - ////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"]; - // d.notes = NonFileUrls + "\n-----------------\n" + d.notes; - // await util.PutAsync(ObjectTypeName + "/" + RavenId.ToString(), d.ToString()); - //} + //----- + bool repost = false; + d = rMainObject.ObjectResponse["data"]; + // wiki + if (WikiPage.HasWiki(c.ID)) + { + // await ExportAttachments(ObjectTID, progress); + d.wiki = GetWikiContent(ObjectTID); + repost = true; + } + + + if (repost) + await util.PutAsync(ObjectTypeName + "/" + RavenId.ToString(), d.ToString()); + //----- //Event log fixup await util.EventLog(util.AyaType.PurchaseOrder, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified); @@ -1044,12 +1044,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); @@ -1061,15 +1055,32 @@ 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(ObjectTypeName + "/" + RavenId.ToString(), d.ToString()); + //----- + //Event log fixup await util.EventLog(util.AyaType.Unit, RavenId, SafeGetUserMap(c.Creator), SafeGetUserMap(c.Modifier), c.Created, c.Modified);