diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index c981091..ac197a4 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -415,15 +415,7 @@ namespace AyaNova.PlugIn.V8 Tagit(cert.UserCertificationID, tags); } SetTags(d, tags); - - // wiki - 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); @@ -450,17 +442,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 user with the notes modified - d = rMainObject.ObjectResponse["data"]; + d.login = null; d.password = null; d.notes = NonFileUrls + "\n-----------------\n" + d.notes; - await util.PutAsync("User/" + RavenId.ToString(), d.ToString()); + repost = true; } + if (repost) + await util.PutAsync("User/" + RavenId.ToString(), d.ToString()); + //----- } @@ -760,8 +766,8 @@ namespace AyaNova.PlugIn.V8 var DateCustomFields = await ExportCustomFieldSchema(ocf, ObjectTypeName, RavenObjectName); //Step 2: export the objects - PartPickList pl=PartPickList.GetAllParts(); - // PickListAutoComplete pl = PickListAutoComplete.GetList("**", "loanitem"); + PartPickList pl = PartPickList.GetAllParts(); + // PickListAutoComplete pl = PickListAutoComplete.GetList("**", "loanitem"); progress.Append("Exporting " + pl.Count.ToString() + " " + ObjectTypeName + "s"); foreach (PartPickList.PartPickListInfo i in pl) @@ -778,7 +784,7 @@ namespace AyaNova.PlugIn.V8 progress.Op(ObjectTypeName + " " + d.name); d.active = c.Active; d.notes = c.Notes; - + SetTags(d, tags); var hasWiki = WikiPage.HasWiki(c.ID); @@ -906,9 +912,9 @@ namespace AyaNova.PlugIn.V8 dynamic d = new JObject(); d.name = c.PONumber.ToString(); progress.Op(ObjectTypeName + " " + d.name); - // d.active = c.Active; + // d.active = c.Active; d.notes = c.Notes; - // Tagit(c.RegionID, tags); + // Tagit(c.RegionID, tags); SetTags(d, tags); var hasWiki = WikiPage.HasWiki(c.ID); @@ -956,10 +962,10 @@ namespace AyaNova.PlugIn.V8 var DateCustomFields = await ExportCustomFieldSchema(ocf, ObjectTypeName, ObjectTypeName); //Step 2: export the objects - PickListAutoComplete pl = PickListAutoComplete.GetList("**", "unit"); + UnitPickList pl = UnitPickList.GetListOfAll(); progress.Append("Exporting " + pl.Count.ToString() + " " + ObjectTypeName + "s"); - foreach (PickListAutoComplete.PickListAutoCompleteInfo i in pl) + foreach (UnitPickList.UnitPickListInfo i in pl) { if (!progress.KeepGoing) return; List tags = new List(); @@ -973,9 +979,9 @@ namespace AyaNova.PlugIn.V8 progress.Op(ObjectTypeName + " " + d.name); d.active = c.Active; d.notes = c.Notes; - // Tagit(c.RegionID, tags); + // Tagit(c.RegionID, tags); SetTags(d, tags); - + var hasWiki = WikiPage.HasWiki(c.ID); if (hasWiki) {