[ofbiz-framework] branch release18.12 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 release18.12 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 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 bceba04  Fixed: Display/functionality improvement in findParty of OOTB regarding classification group (OFBIZ-10302)
bceba04 is described below

commit bceba04c6ad28bc3f2a1038b72cd03acd8cae719
Author: Akash Jain <[hidden email]>
AuthorDate: Tue Sep 1 16:09:44 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 d0d2793..35e61d8 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 ea574ca..586c8d7 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
@@ -1697,15 +1697,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 8639d96..7b5bbbd 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">
             <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>