This commit is contained in:
@@ -212,6 +212,8 @@ namespace AyaNova.PlugIn.V8
|
||||
Regions export wiki to user
|
||||
|
||||
todo: RAVEN workorder structure and then export here
|
||||
todo: modify each biz object export to include progress resetting code added to top of workorder service export
|
||||
reset op, subop at start of export so error doesn't show last previous item's name
|
||||
|
||||
todo: export docs, settle on "Export" and edit all references to Import to switch it around as it's probably confusing artifact from dbdump days
|
||||
|
||||
@@ -642,7 +644,7 @@ namespace AyaNova.PlugIn.V8
|
||||
repost = true;
|
||||
}
|
||||
if (repost)
|
||||
await util.PutAsync(ObjectTypeName+"/" + RavenId.ToString(), d.ToString());
|
||||
await util.PutAsync(ObjectTypeName + "/" + RavenId.ToString(), d.ToString());
|
||||
//-----
|
||||
|
||||
//Event log fixup
|
||||
@@ -1274,7 +1276,7 @@ namespace AyaNova.PlugIn.V8
|
||||
Workorder c = Workorder.GetItem(i.LT_O_Workorder.Value);
|
||||
var ObjectTID = new TypeAndID(RootObjectTypes.WorkorderService, c.ID);
|
||||
//make one on the server to update
|
||||
var rMainObject = await util.PostAsync(RavenObjectName+"/Create?serial="+c.WorkorderService.ServiceNumber);
|
||||
var rMainObject = await util.PostAsync(RavenObjectName + "/Create?serial=" + c.WorkorderService.ServiceNumber);
|
||||
long RavenId = util.IdFromResponse(rMainObject);
|
||||
Map.Add(c.ID, RavenId);
|
||||
|
||||
@@ -1294,7 +1296,7 @@ namespace AyaNova.PlugIn.V8
|
||||
|
||||
|
||||
//Attachments / FILES
|
||||
await ExportAttachments(ObjectTID, progress);
|
||||
await ExportAttachments(ObjectTID, progress, util.AyaType.WorkOrderItem);
|
||||
|
||||
//-----
|
||||
bool repost = false;
|
||||
@@ -1832,7 +1834,7 @@ namespace AyaNova.PlugIn.V8
|
||||
#endregion custom fields
|
||||
|
||||
#region Attachments exporter
|
||||
private async System.Threading.Tasks.Task ExportAttachments(TypeAndID tid, ProgressForm progress)
|
||||
private async System.Threading.Tasks.Task ExportAttachments(TypeAndID tid, ProgressForm progress, util.AyaType specificRavenType = util.AyaType.NoType)
|
||||
{
|
||||
if (!WikiPage.HasWiki(tid.ID)) return;
|
||||
|
||||
@@ -1873,7 +1875,12 @@ namespace AyaNova.PlugIn.V8
|
||||
MultipartFormDataContent formDataContent = new MultipartFormDataContent();
|
||||
|
||||
//Form data like the bizobject type and id
|
||||
formDataContent.Add(new StringContent(((int)util.RootObjectToAyaType(tid.RootObjectType)).ToString()), name: "AttachToObjectType");
|
||||
string RavenTypeAsString = "";
|
||||
if (specificRavenType != util.AyaType.NoType)
|
||||
RavenTypeAsString = ((int)specificRavenType).ToString();
|
||||
else
|
||||
RavenTypeAsString = ((int)util.RootObjectToAyaType(tid.RootObjectType)).ToString();
|
||||
formDataContent.Add(new StringContent(RavenTypeAsString), name: "AttachToObjectType");
|
||||
formDataContent.Add(new StringContent(Map[tid.ID].ToString()), name: "AttachToObjectId");
|
||||
formDataContent.Add(new StringContent(ImportTag), name: "Notes");
|
||||
formDataContent.Add(new StringContent(dFileData.ToString()), name: "FileData");
|
||||
@@ -1900,7 +1907,7 @@ namespace AyaNova.PlugIn.V8
|
||||
//Map it for later processing of wiki
|
||||
//attachment upload route returns all attachments for this object in file name order
|
||||
//so need to find *our* most recent uploaded attachment so need to find the highest raven id number
|
||||
var returnArray=((JArray)a.ObjectResponse["data"]);
|
||||
var returnArray = ((JArray)a.ObjectResponse["data"]);
|
||||
var ravenId = -1L;
|
||||
foreach (JObject o in returnArray)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user