(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
This commit is contained in:
@@ -2639,6 +2639,7 @@ under the License.
|
||||
<field name="statusId" type="id-ne"></field>
|
||||
<field name="partyId" type="id-ne"></field>
|
||||
<field name="statusDate" type="date-time"></field>
|
||||
<field name="changeByUserLoginId" type="id-vlong"></field>
|
||||
<prim-key field="statusId"/>
|
||||
<prim-key field="partyId"/>
|
||||
<prim-key field="statusDate"/>
|
||||
@@ -2648,6 +2649,9 @@ under the License.
|
||||
<relation type="one" fk-name="PARTY_STS_PARTY" rel-entity-name="Party">
|
||||
<key-map field-name="partyId"/>
|
||||
</relation>
|
||||
<relation type="one" fk-name="PARTY_STTS_USRLGN" title="ChangeBy" rel-entity-name="UserLogin">
|
||||
<key-map field-name="changeByUserLoginId" rel-field-name="userLoginId"/>
|
||||
</relation>
|
||||
</entity>
|
||||
<entity entity-name="OldPartyTaxInfo" table-name="PARTY_TAX_INFO"
|
||||
package-name="org.apache.ofbiz.party.party"
|
||||
|
||||
@@ -173,6 +173,9 @@ public class PartyServices {
|
||||
// create the status history
|
||||
GenericValue statusRec = delegator.makeValue("PartyStatus",
|
||||
UtilMisc.toMap("partyId", partyId, "statusId", statusId, "statusDate", now));
|
||||
if (userLogin != null) {
|
||||
statusRec.put("changeByUserLoginId", userLogin.get("userLoginId"));
|
||||
}
|
||||
toBeStored.add(statusRec);
|
||||
}
|
||||
|
||||
@@ -213,6 +216,7 @@ public class PartyServices {
|
||||
public static Map<String, Object> setPartyStatus(DispatchContext ctx, Map<String, ? extends Object> 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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user