Author: hansbak
Date: Thu Oct 27 09:46:18 2011 New Revision: 1189692 URL: http://svn.apache.org/viewvc?rev=1189692&view=rev Log: only show employ positions in the HR tree which are active: status and from/thru dates Modified: ofbiz/trunk/applications/humanres/src/org/ofbiz/humanres/HumanResEvents.java ofbiz/trunk/applications/humanres/widget/forms/EmplPositionForms.xml Modified: ofbiz/trunk/applications/humanres/src/org/ofbiz/humanres/HumanResEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/humanres/src/org/ofbiz/humanres/HumanResEvents.java?rev=1189692&r1=1189691&r2=1189692&view=diff ============================================================================== --- ofbiz/trunk/applications/humanres/src/org/ofbiz/humanres/HumanResEvents.java (original) +++ ofbiz/trunk/applications/humanres/src/org/ofbiz/humanres/HumanResEvents.java Thu Oct 27 09:46:18 2011 @@ -32,10 +32,15 @@ import javolution.util.FastMap; import net.sf.json.JSONObject; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; +import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.condition.EntityCondition; +import org.ofbiz.entity.condition.EntityExpr; +import org.ofbiz.entity.condition.EntityOperator; import org.ofbiz.entity.util.EntityUtil; public class HumanResEvents { @@ -183,11 +188,21 @@ public class HumanResEvents { } - List<GenericValue> childOfEmpls = delegator.findByAnd("EmplPosition", UtilMisc.toMap( - "partyId", partyId)); - if (UtilValidate.isNotEmpty(childOfEmpls)) { - for (GenericValue childOfEmpl : childOfEmpls ) { - Map emplMap = FastMap.newInstance(); + List<EntityExpr> exprs = FastList.newInstance(); + exprs.add(EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, partyId)); + exprs.add(EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "EMPL_POS_INACTIVE")); + + List<GenericValue> isEmpls = null; + try { + isEmpls = delegator.findList("EmplPosition", EntityCondition.makeCondition(exprs, EntityOperator.AND), null, null, null, false); + } catch (GenericEntityException e) { + Debug.logError(e, module); + } + + isEmpls = EntityUtil.filterByDate(isEmpls, UtilDateTime.nowTimestamp(), "actualFromDate", "actualThruDate", true); + if (UtilValidate.isNotEmpty(isEmpls)) { + for (GenericValue childOfEmpl : isEmpls ) { + Map emplMap = FastMap.newInstance(); Map emplAttrMap = FastMap.newInstance(); Map empldataMap = FastMap.newInstance(); Map emplDataAttrMap = FastMap.newInstance(); Modified: ofbiz/trunk/applications/humanres/widget/forms/EmplPositionForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/humanres/widget/forms/EmplPositionForms.xml?rev=1189692&r1=1189691&r2=1189692&view=diff ============================================================================== --- ofbiz/trunk/applications/humanres/widget/forms/EmplPositionForms.xml (original) +++ ofbiz/trunk/applications/humanres/widget/forms/EmplPositionForms.xml Thu Oct 27 09:46:18 2011 @@ -65,7 +65,7 @@ under the License. <field use-when="emplPosition==null&&emplPositionId!=null" name="emplPositionId" title="${uiLabelMap.HumanResEmplPositionId}" tooltip="${uiLabelMap.CommonCannotBeFound}: [${emplPositionId}]"><display/></field> <field name="partyId" use-when="emplPosition!=null" parameter-name="partyId" title="organization partyId"> <drop-down allow-empty="false"> - <entity-options description="${partyId}" entity-name="PartyRole" key-field-name="partyId"> + <entity-options description="${groupName}" entity-name="PartyRoleAndPartyDetail" key-field-name="partyId"> <entity-constraint name="roleTypeId" value="INTERNAL_ORGANIZATIO"/> <entity-order-by field-name="partyId"/> </entity-options> @@ -303,6 +303,11 @@ under the License. <form name="EmplPositionInfo" type="single" default-map-name="emplPosition" paginate-target="FindEmplPositions" header-row-style="header-row" default-table-style="basic-table"> <auto-fields-service service-name="updateEmplPosition" default-field-type="display"/> + <field name="partyId"><display-entity entity-name="PartyGroup" description="${groupName}"> + <sub-hyperlink target="EmployeeProfile" description="[${emplPosition.partyId}]"> + <parameter param-name="partyId" from-field="emplPosition.partyId"/> + </sub-hyperlink> + </display-entity></field> <field name="emplPositionTypeId"><display-entity entity-name="EmplPositionType" description="${description}"> <sub-hyperlink target="EditEmplPositionTypes" description="[${emplPosition.emplPositionTypeId}]"> <parameter param-name="emplPositionTypeId" from-field="emplPosition.emplPositionTypeId"/> |
Free forum by Nabble | Edit this page |