From 353fa0f00a0eeea6cdff1fe9d1d1fe0facb60a03 Mon Sep 17 00:00:00 2001 From: Deepak Dixit Date: Fri, 2 Sep 2016 18:55:06 +0000 Subject: [PATCH] (OFBIZ-7616) Applied patch from jira issue ================================= Add "changeByUserLoginId" field for PartyStatus ================================= Thanks Nameet for your contribution. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1759012 13f79535-47bb-0310-9956-ffa450edef68 --- applications/datamodel/entitydef/party-entitymodel.xml | 4 ++++ .../org/apache/ofbiz/party/party/PartyServices.java | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/applications/datamodel/entitydef/party-entitymodel.xml b/applications/datamodel/entitydef/party-entitymodel.xml index 951786d707..5c1206e6aa 100644 --- a/applications/datamodel/entitydef/party-entitymodel.xml +++ b/applications/datamodel/entitydef/party-entitymodel.xml @@ -2639,6 +2639,7 @@ under the License. + @@ -2648,6 +2649,9 @@ under the License. + + + setPartyStatus(DispatchContext ctx, Map context) { Delegator delegator = ctx.getDelegator(); Locale locale = (Locale) context.get("locale"); + GenericValue loggedInUserLogin = (GenericValue) context.get("userLogin"); String partyId = (String) context.get("partyId"); String statusId = (String) context.get("statusId"); @@ -249,6 +253,9 @@ public class PartyServices { // record this status change in PartyStatus table GenericValue partyStatus = delegator.makeValue("PartyStatus", UtilMisc.toMap("partyId", partyId, "statusId", statusId, "statusDate", statusDate)); + if (loggedInUserLogin != null) { + partyStatus.put("changeByUserLoginId", loggedInUserLogin.get("userLoginId")); + } partyStatus.create(); // disable all userlogins for this user when the new status is disabled @@ -429,6 +436,9 @@ public class PartyServices { // create the status history GenericValue partyStat = delegator.makeValue("PartyStatus", UtilMisc.toMap("partyId", partyId, "statusId", statusId, "statusDate", now)); + if (userLogin != null) { + partyStat.put("changeByUserLoginId", userLogin.get("userLoginId")); + } partyStat.create(); }