[ofbiz-framework] branch release18.12 updated: 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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch release18.12 updated: 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

adityasharma
This is an automated email from the ASF dual-hosted git repository.

adityasharma pushed a commit to branch release18.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release18.12 by this push:
     new b5ae3a5  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
b5ae3a5 is described below

commit b5ae3a5b710ed225bbbeccc9a641e4469c9fa9de
Author: Aditya Sharma <[hidden email]>
AuthorDate: Sat Jul 25 18:53:50 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 b01c812..1b9392c 100644
--- a/applications/party/config/PartyErrorUiLabels.xml
+++ b/applications/party/config/PartyErrorUiLabels.xml
@@ -762,6 +762,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 67d18f5..8b76d7c 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"/>