[ofbiz-framework] branch trunk updated: Improved: Field 'govAgencyPartyId' shows all parties, not just Government Agencies (OFBIZ-10863)

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: Improved: Field 'govAgencyPartyId' shows all parties, not just Government Agencies (OFBIZ-10863)

jleroux@apache.org
This is an automated email from the ASF dual-hosted git repository.

jleroux 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 54ab93f  Improved: Field 'govAgencyPartyId' shows all parties, not just Government Agencies (OFBIZ-10863)
54ab93f is described below

commit 54ab93ff2a8ecc439c40ab63a005d12c1ec4265f
Author: Jacques Le Roux <[hidden email]>
AuthorDate: Sun Feb 21 14:22:00 2021 +0100

    Improved: Field 'govAgencyPartyId' shows all parties, not just Government Agencies (OFBIZ-10863)
   
    The field govAgencyPartyId in the AddFixedAssetRegistration form shows all
    parties through the lookup target-form-name="LookupPartyName function.
   
    This should be limited to those parties that qualify with the constraint.
   
    Thanks: Pierre Smits for report Priya Sharma for the fix
---
 .../webapp/accounting/WEB-INF/controller.xml       |  2 ++
 applications/accounting/widget/FixedAssetForms.xml |  4 ++--
 applications/datamodel/data/demo/PartyDemoData.xml |  5 ++++
 applications/datamodel/data/seed/PartySeedData.xml |  1 +
 applications/party/config/PartyUiLabels.xml        | 12 ++++++++++
 applications/party/widget/partymgr/LookupForms.xml |  7 ++++++
 .../party/widget/partymgr/LookupScreens.xml        | 28 ++++++++++++++++++++++
 7 files changed, 57 insertions(+), 2 deletions(-)

diff --git a/applications/accounting/webapp/accounting/WEB-INF/controller.xml b/applications/accounting/webapp/accounting/WEB-INF/controller.xml
index 3f2440b..331b1ea 100644
--- a/applications/accounting/webapp/accounting/WEB-INF/controller.xml
+++ b/applications/accounting/webapp/accounting/WEB-INF/controller.xml
@@ -2239,6 +2239,7 @@ under the License.
     <request-map uri="LookupPartyGroup"><security auth="true" https="true"/><response name="success" type="view" value="LookupPartyGroup"/></request-map>
     <request-map uri="LookupPartyName"><security auth="true" https="true"/><response name="success" type="view" value="LookupPartyName"/></request-map>
     <request-map uri="LookupInternalOrganization"><security auth="true" https="true"/><response name="success" type="view" value="LookupInternalOrganization"/></request-map>
+    <request-map uri="LookupGovernmentAgency"><security auth="true" https="true"/><response name="success" type="view" value="LookupGovernmentAgency"/></request-map>
 
     <request-map uri="LookupPayment"><security auth="true" https="true"/><response name="success" type="view" value="LookupPayment"/></request-map>
     <request-map uri="LookupInvoice"><security auth="true" https="true"/><response name="success" type="view" value="LookupInvoice"/></request-map>
@@ -2811,6 +2812,7 @@ under the License.
     <view-map name="LookupPartyGroup" type="screen" page="component://party/widget/partymgr/LookupScreens.xml#LookupPartyGroup"/>
     <view-map name="LookupPartyName" type="screen" page="component://party/widget/partymgr/LookupScreens.xml#LookupPartyName"/>
     <view-map name="LookupInternalOrganization" type="screen" page="component://party/widget/partymgr/LookupScreens.xml#LookupInternalOrganization"/>
+    <view-map name="LookupGovernmentAgency" type="screen" page="component://party/widget/partymgr/LookupScreens.xml#LookupGovernmentAgency"/>
 
     <view-map name="LookupProduct" type="screen" page="component://product/widget/catalog/LookupScreens.xml#LookupProduct"/>
     <view-map name="LookupProductFeature" type="screen" page="component://product/widget/catalog/LookupScreens.xml#LookupProductFeature"/>
diff --git a/applications/accounting/widget/FixedAssetForms.xml b/applications/accounting/widget/FixedAssetForms.xml
index 289a871..c72e19d 100644
--- a/applications/accounting/widget/FixedAssetForms.xml
+++ b/applications/accounting/widget/FixedAssetForms.xml
@@ -296,7 +296,7 @@ under the License.
         <field name="fromDate"><display/></field>
         <field name="registrationNumber" title="${uiLabelMap.AccountingFixedAssetRegNumber}"><text size="20"/></field>
         <field name="licenseNumber" title="${uiLabelMap.AccountingFixedAssetLicenseNumber}"><text size="20"/></field>
-        <field name="govAgencyPartyId" title="${uiLabelMap.AccountingFixedAssetGovAgencyPartyId}"><lookup target-form-name="LookupPartyName"/></field>
+        <field name="govAgencyPartyId" title="${uiLabelMap.AccountingFixedAssetGovAgencyPartyId}"><lookup target-form-name="LookupGovernmentAgency"/></field>
         <field name="deleteLink" title=" " widget-style="buttontext">
             <hyperlink description="${uiLabelMap.CommonDelete}" target="deleteFixedAssetRegistration" also-hidden="false">
                 <parameter param-name="fixedAssetId"/>
@@ -313,7 +313,7 @@ under the License.
         <field name="fixedAssetId"><hidden/></field>
         <field name="licenseNumber" title="${uiLabelMap.AccountingFixedAssetLicenseNumber}"><text size="20"/></field>
         <field name="registrationNumber" title="${uiLabelMap.AccountingFixedAssetRegNumber}"><text size="20"/></field>
-        <field name="govAgencyPartyId" title="${uiLabelMap.AccountingFixedAssetGovAgencyPartyId}"><lookup target-form-name="LookupPartyName"/></field>
+        <field name="govAgencyPartyId" title="${uiLabelMap.AccountingFixedAssetGovAgencyPartyId}"><lookup target-form-name="LookupGovernmentAgency"/></field>
         <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
 
diff --git a/applications/datamodel/data/demo/PartyDemoData.xml b/applications/datamodel/data/demo/PartyDemoData.xml
index 33c3230..b52c8c7 100644
--- a/applications/datamodel/data/demo/PartyDemoData.xml
+++ b/applications/datamodel/data/demo/PartyDemoData.xml
@@ -118,4 +118,9 @@ under the License.
     <UserLogin userLoginId="auditor" partyId="DemoAuditor" currentPassword="{SHA}47b56994cbc2b6d10aa1be30f70165adb305a41a"/>
     <UserLoginSecurityGroup groupId="VIEWADMIN" userLoginId="auditor" fromDate="2001-01-01 12:00:00.0"/>
     
+    <!-- Government Agency Demo Data -->
+    <Party partyId="DemoGovAgency" statusId="PARTY_ENABLED" partyTypeId="PARTY_GROUP"/>
+    <PartyGroup partyId="DemoGovAgency" groupName="Demo Government Agency"/>
+    <PartyRole partyId="DemoGovAgency" roleTypeId="GOV_AGENCY"/>
+
 </entity-engine-xml>
diff --git a/applications/datamodel/data/seed/PartySeedData.xml b/applications/datamodel/data/seed/PartySeedData.xml
index 64c23c0..eba8d03 100644
--- a/applications/datamodel/data/seed/PartySeedData.xml
+++ b/applications/datamodel/data/seed/PartySeedData.xml
@@ -234,6 +234,7 @@ under the License.
     <RoleType description="Tax Authority" hasTable="N" parentTypeId="ORGANIZATION_ROLE" roleTypeId="TAX_AUTHORITY"/>
     <RoleType description="Union" hasTable="N" parentTypeId="ORGANIZATION_ROLE" roleTypeId="UNION"/>
     <RoleType description="Workflow Owner" hasTable="N" parentTypeId="WORKFLOW_ROLE" roleTypeId="WF_OWNER"/>
+    <RoleType description="Government Agency" hasTable="N" parentTypeId="ORGANIZATION_ROLE" roleTypeId="GOV_AGENCY"/>
 
     <!-- third level role types -->
     <RoleType description="Affiliate" hasTable="N" parentTypeId="SALES_REP" roleTypeId="AFFILIATE"/>
diff --git a/applications/party/config/PartyUiLabels.xml b/applications/party/config/PartyUiLabels.xml
index 14e14ae..d10256c 100644
--- a/applications/party/config/PartyUiLabels.xml
+++ b/applications/party/config/PartyUiLabels.xml
@@ -8202,6 +8202,18 @@
         <value xml:lang="zh">查找联系方法</value>
         <value xml:lang="zh-TW">尋找聯絡方法</value>
     </property>
+    <property key="PartyLookupGovernmentAgency">
+        <value xml:lang="ar">إيجاد وكالة حكومية</value>
+        <value xml:lang="de">Regierungsbehörde nachschlagen</value>
+        <value xml:lang="en">Lookup Government Agency</value>
+        <value xml:lang="hi-IN">सरकारी शाखा लुकअप</value>
+        <value xml:lang="it">Ricerca agenzia governativa</value>
+        <value xml:lang="ja">政府機関を探す</value>
+        <value xml:lang="pt-BR">Buscar Agência Governamental</value>
+        <value xml:lang="vi">Tìm một cơ quan chính phủ</value>
+        <value xml:lang="zh">寻找政府机构</value>
+        <value xml:lang="zh-TW">尋找政府機構</value>
+    </property>
     <property key="PartyLookupInternalOrganization">
         <value xml:lang="ar">إيجاد منظمة داخلية</value>
         <value xml:lang="de">Interne Organisation suchen</value>
diff --git a/applications/party/widget/partymgr/LookupForms.xml b/applications/party/widget/partymgr/LookupForms.xml
index 8081ed0..f9bcf0c 100644
--- a/applications/party/widget/partymgr/LookupForms.xml
+++ b/applications/party/widget/partymgr/LookupForms.xml
@@ -493,4 +493,11 @@ under the License.
         <field name="firstName" title="${uiLabelMap.PartyFirstName}"><display/></field>
         <field name="lastName"  title="${uiLabelMap.PartyLastName}"><display/></field>
     </form>
+    <form name="LookupGovernmentAgency" type="single" target="LookupGovernmentAgency" default-table-style="basic-table">
+        <field name="roleTypeId"><hidden value="GOV_AGENCY"/></field>
+        <field name="partyId"><text-find/></field>
+        <field name="groupName"><text-find/></field>
+        <field name="noConditionFind"><hidden value="Y"/><!-- if this isn't there then with all fields empty no query will be done --></field>
+        <field name="submitButton" title="${uiLabelMap.CommonFind}"><submit button-type="button"/></field>
+    </form>
 </forms>
diff --git a/applications/party/widget/partymgr/LookupScreens.xml b/applications/party/widget/partymgr/LookupScreens.xml
index e2edc2e..3a0a671 100644
--- a/applications/party/widget/partymgr/LookupScreens.xml
+++ b/applications/party/widget/partymgr/LookupScreens.xml
@@ -432,6 +432,34 @@ under the License.
             </widgets>
         </section>
     </screen>
+
+    <screen name="LookupGovernmentAgency">
+        <section>
+            <condition>
+                <if-service-permission service-name="partyBasePermissionCheck" main-action="VIEW"/>
+            </condition>
+            <actions>
+                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
+                <set field="title" from-field="uiLabelMap.PartyLookupGovernmentAgency"/>
+                <set field="entityName" value="PartyRoleAndPartyDetail"/>
+                <set field="roleTypeId" value="GOV_AGENCY"/>
+                <set field="searchFields" value="[partyId, groupName, partyGroupComments]"/>
+                <script location="component://party/groovyScripts/party/StatusCondition.groovy"/>
+                <set field="conditionFields.roleTypeId" value="GOV_AGENCY" />
+            </actions>
+            <widgets>
+                <decorator-screen name="LookupDecorator" location="component://common/widget/CommonScreens.xml">
+                    <decorator-section name="search-options">
+                        <include-form name="LookupGovernmentAgency" location="component://party/widget/partymgr/LookupForms.xml"/>
+                    </decorator-section>
+                    <decorator-section name="search-results">
+                        <include-form name="ListLookupPartyGroup" location="component://party/widget/partymgr/LookupForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+
     <screen name="LookupSupplier">
         <section>
             <condition>