#20239: Worflow local state

Work Item: 20239
This commit is contained in:
Sebastien Ros
2013-10-25 15:45:17 -07:00
parent 323daf641f
commit 673ef2c0a5
3 changed files with 5 additions and 3 deletions

View File

@@ -1,6 +1,8 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized; using System.Collections.Specialized;
using System.Linq; using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Web;
using System.Web.Mvc; using System.Web.Mvc;
using System.Web.Routing; using System.Web.Routing;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
@@ -381,7 +383,7 @@ namespace Orchard.Workflows.Controllers {
var model = new UpdatedActivityModel { var model = new UpdatedActivityModel {
ClientId = clientId, ClientId = clientId,
Data = new NameValueCollection(formValues) Data = HttpUtility.JavaScriptStringEncode(FormParametersHelper.ToJsonString(formValues))
}; };
TempData["UpdatedViewModel"] = model; TempData["UpdatedViewModel"] = model;

View File

@@ -15,7 +15,7 @@ namespace Orchard.Workflows.ViewModels {
public class UpdatedActivityModel { public class UpdatedActivityModel {
public string ClientId { get; set; } public string ClientId { get; set; }
public NameValueCollection Data { get; set; } public string Data { get; set; }
} }
} }

View File

@@ -52,7 +52,7 @@
var model = TempData["UpdatedViewModel"] as UpdatedActivityModel; var model = TempData["UpdatedViewModel"] as UpdatedActivityModel;
if (model != null) { if (model != null) {
@: updatedActivityClientId = '@(model.ClientId)'; @: updatedActivityClientId = '@(model.ClientId)';
@: updatedActivityState = '@Html.Raw(HttpUtility.JavaScriptStringEncode(FormParametersHelper.ToJsonString(model.Data)))'; @: updatedActivityState = '@Html.Raw(model.Data)';
} }
} }
else if (!Model.IsLocal) { else if (!Model.IsLocal) {