Author: hansbak
Date: Sun Jun 21 23:28:55 2009 New Revision: 787111 URL: http://svn.apache.org/viewvc?rev=787111&view=rev Log: corrected another calendar event selection error, and included demo data for it Modified: ofbiz/trunk/applications/workeffort/data/WorkEffortDemoData.xml ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java Modified: ofbiz/trunk/applications/workeffort/data/WorkEffortDemoData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/data/WorkEffortDemoData.xml?rev=787111&r1=787110&r2=787111&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/data/WorkEffortDemoData.xml (original) +++ ofbiz/trunk/applications/workeffort/data/WorkEffortDemoData.xml Sun Jun 21 23:28:55 2009 @@ -42,6 +42,10 @@ <WorkEffortPartyAssignment workEffortId="OneOffMeeting" partyId="DemoEmployee1" statusId="PRTYASGN_ASSIGNED" roleTypeId="CAL_OWNER" availabilityStatusId="WEPA_AV_BUSY" fromDate="2008-01-01 00:00:00.0"/> <WorkEffortPartyAssignment workEffortId="OneOffMeeting" partyId="DemoEmployee2" statusId="PRTYASGN_ASSIGNED" roleTypeId="CAL_ATTENDEE" availabilityStatusId="WEPA_AV_BUSY" fromDate="2008-01-01 00:00:00.0"/> <WorkEffortPartyAssignment workEffortId="OneOffMeeting" partyId="admin" statusId="PRTYASGN_ASSIGNED" roleTypeId="CAL_ATTENDEE" availabilityStatusId="WEPA_AV_BUSY" fromDate="2008-01-01 00:00:00.0"/> + <!-- private one off event for employee1 should not show with admin--> + <WorkEffort workEffortId="PrivateDemoEmployee1" workEffortTypeId="MEETING" currentStatusId="CAL_TENTATIVE" lastStatusUpdate="2008-01-01 00:00:00.0" scopeEnumId="WES_PRIVATE" workEffortName="My Wifes birthday june 29" description="The birthday i should never forget" estimatedStartDate="2009-06-29 00:00:00.0" estimatedCompletionDate="2009-06-29 23:00:00.0"/> + <WorkEffortAssoc workEffortIdFrom="CALENDAR_PUB_DEMO" workEffortIdTo="PrivateDemoEmployee1" workEffortAssocTypeId="WORK_EFF_DEPENDENCY" fromDate="2008-01-01 00:00:00.0"/> + <WorkEffortPartyAssignment workEffortId="PrivateDemoEmployee1" partyId="DemoEmployee1" statusId="PRTYASGN_ASSIGNED" roleTypeId="CAL_OWNER" availabilityStatusId="WEPA_AV_BUSY" fromDate="2008-01-01 00:00:00.0"/> <!-- public event --> <WorkEffort workEffortId="PublicEvent" workEffortTypeId="MEETING" currentStatusId="CAL_TENTATIVE" lastStatusUpdate="2008-01-01 00:00:00.0" scopeEnumId="WES_PUBLIC" workEffortName="The general company party june 17" description="General Party" estimatedStartDate="2009-06-17 19:00:00.0" estimatedCompletionDate="2009-06-17 23:00:00.0"/> <WorkEffortAssoc workEffortIdFrom="CALENDAR_PUB_DEMO" workEffortIdTo="PublicEvent" workEffortAssocTypeId="WORK_EFF_DEPENDENCY" fromDate="2008-01-01 00:00:00.0"/> Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java?rev=787111&r1=787110&r2=787111&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java (original) +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java Sun Jun 21 23:28:55 2009 @@ -514,12 +514,15 @@ if (filterOutCanceledEvents.booleanValue()) { entityExprList.add(EntityCondition.makeCondition("currentStatusId", EntityOperator.NOT_EQUAL, "EVENT_CANCELLED")); } - // always take all recurring workefforts and 'AND' all previous conditions + // always take all recurring workefforts and 'AND' all previous conditions including the period check EntityConditionList<EntityCondition> ecl = - EntityCondition.makeCondition(UtilMisc.<EntityCondition>toList( - EntityCondition.makeCondition("tempExprId", EntityOperator.NOT_EQUAL, null), - periodCheck - ), EntityJoinOperator.OR); + EntityCondition.makeCondition(UtilMisc.<EntityCondition>toList( + EntityCondition.makeCondition("tempExprId", EntityOperator.NOT_EQUAL, null), + EntityCondition.makeCondition(UtilMisc.<EntityCondition>toList( + EntityCondition.makeCondition(entityExprList, EntityJoinOperator.AND), + periodCheck + ), EntityJoinOperator.AND) + ), EntityJoinOperator.OR); // get all public workefforts in the required period EntityConditionList<EntityCondition> eclPublic = EntityCondition.makeCondition(UtilMisc.<EntityCondition>toList( |
Free forum by Nabble | Edit this page |