[ofbiz-framework] branch trunk updated: Fixed: Added employee lookup to search/select employee(person) while creating new employment. This will also fixed the issue of party groups being selected as a employee. (OFBIZ-11697) (#210)

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: Added employee lookup to search/select employee(person) while creating new employment. This will also fixed the issue of party groups being selected as a employee. (OFBIZ-11697) (#210)

Pawan Verma-2
This is an automated email from the ASF dual-hosted git repository.

pawan 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 32a0cb8  Fixed: Added employee lookup to search/select employee(person) while creating new employment. This will also fixed the issue of party groups being selected as a employee. (OFBIZ-11697) (#210)
32a0cb8 is described below

commit 32a0cb865e1ae48c8fb909d339c5f0fbad5aec48
Author: lodhiravi <[hidden email]>
AuthorDate: Sat Jul 4 23:11:58 2020 +0530

    Fixed: Added employee lookup to search/select employee(person) while creating new employment. This will also fixed the issue of party groups being selected as a employee. (OFBIZ-11697) (#210)
---
 .../webapp/humanres/WEB-INF/controller.xml         |  2 ++
 .../humanres/widget/forms/EmploymentForms.xml      |  2 +-
 applications/party/widget/partymgr/LookupForms.xml | 26 ++++++++++++++++++++
 .../party/widget/partymgr/LookupScreens.xml        | 28 ++++++++++++++++++++++
 4 files changed, 57 insertions(+), 1 deletion(-)

diff --git a/applications/humanres/webapp/humanres/WEB-INF/controller.xml b/applications/humanres/webapp/humanres/WEB-INF/controller.xml
index fc137a9..f446d07 100644
--- a/applications/humanres/webapp/humanres/WEB-INF/controller.xml
+++ b/applications/humanres/webapp/humanres/WEB-INF/controller.xml
@@ -1109,6 +1109,7 @@ under the License.
     
     <!-- ===================Lookup Request===================== -->
     <request-map uri="LookupPartyName"><security auth="true" https="true"/><response name="success" type="view" value="LookupPartyName"/></request-map>
+    <request-map uri="LookupEmployee"><security auth="true" https="true"/><response name="success" type="view" value="LookupEmployee"/></request-map>
     <request-map uri="LookupPayment"><security auth="true" https="true"/><response name="success" type="view" value="LookupPayment"/></request-map>
     <request-map uri="LookupBudget"><security auth="true" https="true"/><response name="success" type="view" value="LookupBudget"/></request-map>
     <request-map uri="LookupBudgetItem"><security auth="true" https="true"/><response name="success" type="view" value="LookupBudgetItem"/></request-map>
@@ -1126,6 +1127,7 @@ under the License.
     <request-map uri="LookupJobRequisition"><security auth="true" https="true"/><response name="success" type="view" value="LookupJobRequisition"/></request-map>
 
     <view-map name="LookupPartyName" type="screen" page="component://party/widget/partymgr/LookupScreens.xml#LookupPartyName"/>
+    <view-map name="LookupEmployee" type="screen" page="component://party/widget/partymgr/LookupScreens.xml#LookupEmployee"/>
     <view-map name="LookupPayment"  type="screen" page="component://accounting/widget/LookupScreens.xml#LookupPayment"/>
     <view-map name="LookupBudget"  type="screen" page="component://humanres/widget/LookupScreens.xml#LookupBudget"/>
     <view-map name="LookupBudgetItem"  type="screen" page="component://humanres/widget/LookupScreens.xml#LookupBudgetItem"/>
diff --git a/applications/humanres/widget/forms/EmploymentForms.xml b/applications/humanres/widget/forms/EmploymentForms.xml
index 0bdb322..70dd33c 100644
--- a/applications/humanres/widget/forms/EmploymentForms.xml
+++ b/applications/humanres/widget/forms/EmploymentForms.xml
@@ -123,7 +123,7 @@
             </drop-down>
         </field>
         <field name="partyIdFrom" use-when="employment!=null" title="${uiLabelMap.HumanResEmploymentPartyIdFrom}"><hidden/></field>
-        <field name="partyIdTo" use-when="employment==null" title="${uiLabelMap.HumanResEmployeePartyIdTo}" required-field="true"><lookup target-form-name="LookupPartyName"/></field>
+        <field name="partyIdTo" use-when="employment==null" title="${uiLabelMap.HumanResEmployeePartyIdTo}" required-field="true"><lookup target-form-name="LookupEmployee"/></field>
         <field name="partyIdTo" use-when="employment!=null" title="${uiLabelMap.HumanResEmployeePartyIdTo}"><hidden/></field>
         <field name="fromDate" use-when="employment==null" title="${uiLabelMap.CommonFromDate}" required-field="true"><date-time default-value="${nowTimestamp}"/></field>
         <field name="fromDate" use-when="employment!=null" title="${uiLabelMap.CommonFromDate}"><display default-value="${nowTimestamp}"/></field>
diff --git a/applications/party/widget/partymgr/LookupForms.xml b/applications/party/widget/partymgr/LookupForms.xml
index bcc03f5..8081ed0 100644
--- a/applications/party/widget/partymgr/LookupForms.xml
+++ b/applications/party/widget/partymgr/LookupForms.xml
@@ -467,4 +467,30 @@ under the License.
         <field name="lastName"  title="${uiLabelMap.PartyLastName}"><display/></field>
         <field name="groupName" title="${uiLabelMap.PartyGroupName}"><display/></field>
     </form>
+    <form name="LookupEmployee" target="LookupEmployee" type="single"
+        header-row-style="header-row" default-table-style="basic-table">
+        <field name="roleTypeId"><hidden value="EMPLOYEE"/></field>
+        <field name="partyId" title="${uiLabelMap.PartyPartyId}"><text-find/></field>
+        <field name="firstName" title="${uiLabelMap.PartyFirstName}"><text-find/></field>
+        <field name="lastName"  title="${uiLabelMap.PartyLastName}"><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>
+    <form name="ListLookupEmployee" type="list" list-name="listIt" paginate-target="LookupEmployee"
+        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
+        <actions>
+            <set field="inputFields" from-field="parameters"/>
+            <set field="orderBy" value="partyId"/>
+            <set field="entityName" value="PartyRoleNameDetail"/>
+            <script location="component://party/groovyScripts/party/FindLookUp.groovy"/>
+        </actions>
+        <field name="partyId" title="${uiLabelMap.PartyPartyId}"  widget-style="smallSubmit">
+            <hyperlink description="${partyId}" target="javascript:set_value('${partyId}')" also-hidden="false" target-type="plain"/>
+        </field>
+        <field name="partyTypeId" title="${uiLabelMap.PartyTypeId}">
+            <display-entity also-hidden="false" entity-name="PartyType"/>
+        </field>
+        <field name="firstName" title="${uiLabelMap.PartyFirstName}"><display/></field>
+        <field name="lastName"  title="${uiLabelMap.PartyLastName}"><display/></field>
+    </form>
 </forms>
diff --git a/applications/party/widget/partymgr/LookupScreens.xml b/applications/party/widget/partymgr/LookupScreens.xml
index 9004c92..e2edc2e 100644
--- a/applications/party/widget/partymgr/LookupScreens.xml
+++ b/applications/party/widget/partymgr/LookupScreens.xml
@@ -460,4 +460,32 @@ under the License.
             </widgets>
         </section>
     </screen>
+    <screen name="LookupEmployee">
+        <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.PartyLookupPartyByName"/>
+                <set field="queryString" from-field="result.queryString"/>
+                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0"/>
+                <set field="viewSizeDefaultValue" value="${groovy: modelTheme.getDefaultViewSize()}" type="Integer"/>
+                <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/>
+                <set field="entityName" value="PartyRoleNameDetail"/>
+                <set field="searchFields" value="[partyId, firstName, middleName, lastName]"/>
+                <set field="conditionFields.roleTypeId" value="EMPLOYEE" />
+            </actions>
+            <widgets>
+                <decorator-screen name="LookupDecorator" location="component://common/widget/CommonScreens.xml">
+                    <decorator-section name="search-options">
+                        <include-form name="LookupEmployee" location="component://party/widget/partymgr/LookupForms.xml"/>
+                    </decorator-section>
+                    <decorator-section name="search-results">
+                        <include-form name="ListLookupEmployee" location="component://party/widget/partymgr/LookupForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>