This is an automated email from the ASF dual-hosted git repository. adityasharma pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push: new 6804a9d Fixed: Unable to create event in SFA component (OFBIZ-9901) When creating event for the party other than the loggedin user, the party should be in CAL_OWNER role to be added to event. Added appropriate check in service along with the error message. Thanks Rubia Elza Joshep for reporting the issue and Aditi Patidar for providing the patch 6804a9d is described below commit 6804a9dac3a9c8e9c0c4678661e7918dc50cf6eb Author: Aditya Sharma <adityasha...@apache.org> AuthorDate: Sat Jul 25 18:48:39 2020 +0530 Fixed: Unable to create event in SFA component (OFBIZ-9901) When creating event for the party other than the loggedin user, the party should be in CAL_OWNER role to be added to event. Added appropriate check in service along with the error message. Thanks Rubia Elza Joshep for reporting the issue and Aditi Patidar for providing the patch --- applications/party/config/PartyErrorUiLabels.xml | 3 +++ .../minilang/workeffort/WorkEffortSimpleServices.xml | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/applications/party/config/PartyErrorUiLabels.xml b/applications/party/config/PartyErrorUiLabels.xml index b352887..0fe95e7 100644 --- a/applications/party/config/PartyErrorUiLabels.xml +++ b/applications/party/config/PartyErrorUiLabels.xml @@ -828,6 +828,9 @@ <value xml:lang="zh">无法新建已存在的会员角色</value> <value xml:lang="zh-TW">無法新建已存在的團體角色</value> </property> + <property key="PartyRoleAssociationRequired"> + <value xml:lang="en">Party id: ${partyId} should be in role: ${roleDescription}</value> + </property> <property key="partyroleservices.could_not_create_party_role_read"> <value xml:lang="de">Akteur Rolle kann nicht erstellt werden (Lesefehler).</value> <value xml:lang="en">could not create party role read</value> diff --git a/applications/workeffort/minilang/workeffort/WorkEffortSimpleServices.xml b/applications/workeffort/minilang/workeffort/WorkEffortSimpleServices.xml index 7c47e60..cf65e6e 100644 --- a/applications/workeffort/minilang/workeffort/WorkEffortSimpleServices.xml +++ b/applications/workeffort/minilang/workeffort/WorkEffortSimpleServices.xml @@ -22,6 +22,22 @@ under the License. xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd"> <simple-method method-name="createWorkEffortAndPartyAssign" short-description="Create Work Effort and assign to a party with a role"> + <entity-one entity-name="PartyRole" value-field="partyRole"> + <field-map field-name="partyId" from-field="parameters.partyId"/> + <field-map field-name="roleTypeId" value="CAL_OWNER"/> + </entity-one> + <if-empty field="partyRole"> + <entity-one entity-name="RoleType" value-field="roleType"> + <field-map field-name="roleTypeId" value="CAL_OWNER"/> + </entity-one> + <if-not-empty field="roleType"> + <set field="roleDescription" from-field="roleType.description"/> + </if-not-empty> + <set field="partyId" from-field="parameters.partyId"></set> + <add-error> + <fail-property resource="PartyErrorUiLabels" property="PartyRoleAssociationRequired" /> + </add-error> + </if-empty> <set-service-fields service-name="createWorkEffort" map="parameters" to-map="create"/> <call-service service-name="createWorkEffort" in-map-name="create"> <result-to-field result-name="workEffortId"/>