[ofbiz-framework] branch trunk updated: Fixed: Display/functionality improvement in findParty of OOTB regarding classification group (OFBIZ-10302)

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

[ofbiz-framework] branch trunk updated: Fixed: Display/functionality improvement in findParty of OOTB regarding classification group (OFBIZ-10302)

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

akashjain 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 9e006d3  Fixed: Display/functionality improvement in findParty of OOTB regarding classification group (OFBIZ-10302)
9e006d3 is described below

commit 9e006d37323b3a63e19f6099bc887647cb5c4527
Author: Akash Jain <[hidden email]>
AuthorDate: Tue Sep 1 15:06:38 2020 +0530

    Fixed: Display/functionality improvement in findParty of OOTB regarding classification group (OFBIZ-10302)
   
    Thanks, Rajesh Kumar Mallah for report.
---
 applications/party/servicedef/services_view.xml                  | 2 +-
 .../main/java/org/apache/ofbiz/party/party/PartyServices.java    | 6 +++---
 applications/party/widget/partymgr/PartyForms.xml                | 9 +++++++--
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/applications/party/servicedef/services_view.xml b/applications/party/servicedef/services_view.xml
index 3c5c2c2..60eddbc 100644
--- a/applications/party/servicedef/services_view.xml
+++ b/applications/party/servicedef/services_view.xml
@@ -104,7 +104,7 @@ under the License.
         <attribute name="partyRelationshipTypeId" type="String" mode="IN" optional="true"/>
         <attribute name="ownerPartyIds" type="List" mode="IN" optional="true"/><!-- Lead Owners Parties -->
         <attribute name="sortField" type="String" mode="IN" optional="true"/>
-        <attribute name="partyClassificationGroupId" type="String" mode="IN" optional="true"/>
+        <attribute name="partyClassificationGroupId" type="List" mode="IN" optional="true"/>
 
         <attribute name="listIt" type="org.apache.ofbiz.entity.util.EntityListIterator" mode="OUT" optional="true"/>
     </service>
diff --git a/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java b/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java
index c54e611..b6bcedb 100644
--- a/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java
+++ b/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java
@@ -1707,15 +1707,15 @@ public class PartyServices {
         // PartyClassificationGroup Fields
         // ----
 
-        String partyClassificationGroupId = (String) context.get("partyClassificationGroupId");
-        if (UtilValidate.isNotEmpty(partyClassificationGroupId)) {
+        List<String> partyClassificationGroupIds = (List) context.get("partyClassificationGroupId");
+        if (UtilValidate.isNotEmpty(partyClassificationGroupIds)) {
             // add PartyClassification to view
             dynamicView.addMemberEntity("PC", "PartyClassification");
             dynamicView.addAlias("PC", "partyClassificationGroupId");
             dynamicView.addViewLink("PT", "PC", Boolean.FALSE, ModelKeyMap.makeKeyMapList("partyId"));
 
             // add the expr
-            andExprs.add(EntityCondition.makeCondition("partyClassificationGroupId", partyClassificationGroupId));
+            andExprs.add(EntityCondition.makeCondition("partyClassificationGroupId", EntityOperator.IN, partyClassificationGroupIds));
             fieldsToSelect.add("partyClassificationGroupId");
         }
 
diff --git a/applications/party/widget/partymgr/PartyForms.xml b/applications/party/widget/partymgr/PartyForms.xml
index 32affc0..52f2337 100644
--- a/applications/party/widget/partymgr/PartyForms.xml
+++ b/applications/party/widget/partymgr/PartyForms.xml
@@ -80,7 +80,7 @@ under the License.
         </field>
         <field name="partyClassificationGroupId" title="${uiLabelMap.PartyClassificationGroup}" use-when="parentTypeId == null">
             <drop-down allow-multiple="true" size="5" allow-empty="false">
-                <entity-options entity-name="PartyClassificationGroupAndType" description="${typeDescription}" key-field-name="partyClassificationGroupId">
+                <entity-options entity-name="PartyClassificationGroupAndType" description="${typeDescription} - ${partyClassificationGroupId}" key-field-name="partyClassificationGroupId">
                     <entity-order-by field-name="partyClassificationGroupId"/>
                 </entity-options>
             </drop-down>
@@ -142,13 +142,18 @@ under the License.
                 <field-map field-name="partyId" from-field="partyId"/>
                 <field-map field-name="userLogin" from-field="userLogin"/>
             </service>
+            <entity-and entity-name="PartyClassification" list="partyClassifications" use-cache="true">
+                <field-map field-name="partyId" from-field="partyId"/>
+            </entity-and>
+            <set field="fieldId" value="partyClassificationGroupId"/>
+            <set field="partyClassificationGroupIds" value="${groovy:org.apache.ofbiz.entity.util.EntityUtil.getFieldListFromEntityList(partyClassifications, fieldId, true);}"/>
         </row-actions>
         <field name="partyId" sort-field="true" widget-style="buttontext">
             <hyperlink description="${partyId}" target="viewprofile">
                 <parameter param-name="partyId"/>
             </hyperlink>
         </field>
-        <field name="ClassificationGroup"><display description="${parameters.partyClassificationGroupId}"/></field>
+        <field name="ClassificationGroup" use-when="partyClassificationGroupIds.size() > 0"><display description="${partyClassificationGroupIds}"/></field>
         <field name="userLoginId" use-when="userLoginSize > 1"><include-grid name="ListPartyUserLogin" location="component://party/widget/partymgr/PartyForms.xml"/></field>
         <field name="userLoginId" use-when="userLoginSize == 1"><display description="${logins[0].userLoginId}"/></field>
         <field name="userLoginId" use-when="userLoginSize == 0"><display description="(${uiLabelMap.CommonNone})"/></field>