Author: hansbak
Date: Mon Nov 26 19:35:55 2007 New Revision: 598510 URL: http://svn.apache.org/viewvc?rev=598510&view=rev Log: show planned and actual hours on the myTask list + fixed several bugs Modified: ofbiz/trunk/specialpurpose/assetmaint/entitydef/entitymodel.xml ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListMyTasks.bsh ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml Modified: ofbiz/trunk/specialpurpose/assetmaint/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/entitydef/entitymodel.xml?rev=598510&r1=598509&r2=598510&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/assetmaint/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/specialpurpose/assetmaint/entitydef/entitymodel.xml Mon Nov 26 19:35:55 2007 @@ -69,6 +69,9 @@ <view-link entity-alias="WE" rel-entity-alias="TE"> <key-map field-name="workEffortId"/> </view-link> + <relation type="many" rel-entity-name="WorkEffortSkillStandard"> + <key-map field-name="workEffortId"/> + </relation> </view-entity> <view-entity entity-name="FixedAssetMaintWorkEffortAndPartyAssignment" package-name="org.ofbiz.assetmaint" Modified: ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties?rev=598510&r1=598509&r2=598510&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties (original) +++ ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties Mon Nov 26 19:35:55 2007 @@ -81,6 +81,7 @@ ProjectMgrSubProjectDetails=Enter the SubProject Details below ProjectMgrSubProjectList=List of SubProject ProjectMgrSubTasks=Sub Tasks +ProjectMgrTaskCurrent=Current Task ProjectMgrTaskDetails=Enter the Task Details below ProjectMgrTaskName=Task Name ProjectMgrTasks=Tasks Modified: ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml?rev=598510&r1=598509&r2=598510&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml Mon Nov 26 19:35:55 2007 @@ -83,5 +83,8 @@ <relation type="many" rel-entity-name="TimeEntry"> <key-map field-name="workEffortId"/> </relation> + <relation type="many" rel-entity-name="WorkEffortSkillStandard"> + <key-map field-name="workEffortId"/> + </relation> </view-entity> </entitymodel> Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListMyTasks.bsh URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListMyTasks.bsh?rev=598510&r1=598509&r2=598510&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListMyTasks.bsh (original) +++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListMyTasks.bsh Mon Nov 26 19:35:55 2007 @@ -20,6 +20,10 @@ import java.util.*; import java.lang.*; +import java.util.Iterator; +import javolution.util.FastMap; +import java.math.BigDecimal; + import org.ofbiz.entity.*; import org.ofbiz.base.util.*; import org.ofbiz.base.util.UtilMisc; @@ -71,6 +75,42 @@ condition = new EntityConditionList(exprList, EntityOperator.AND); tasks.addAll(delegator.findByCondition("WorkEffortAndTimeEntry", condition, null, null)); +// add fields for planned and actual hours. +newTasks = new LinkedList(); +t = tasks.iterator(); +while(t.hasNext()) { + newTask = FastMap.newInstance(); + task = t.next(); + newTask.putAll(task); + + // get estimated hours + plannedHours = new BigDecimal("0.00"); + workEffortSkillStandards = task.getRelated("WorkEffortSkillStandard"); + ss = workEffortSkillStandards.iterator(); + while(ss.hasNext()) { + workEffortSkillStandard = ss.next(); + Debug.logInfo("===========" + workEffortSkillStandard.getBigDecimal("estimatedDuration"),""); + if (UtilValidate.isNotEmpty(workEffortSkillStandard.get("estimatedDuration"))) { + plannedHours = plannedHours.add(workEffortSkillStandard.getBigDecimal("estimatedDuration")); + } + } + if(plannedHours.signum() != 0) newTask.put("plannedHours", plannedHours); + + // get the actual hours + actualHours = new BigDecimal("0.00"); + timeEntries = task.getRelated("TimeEntry"); + te = timeEntries.iterator(); + while(te.hasNext()) { + timeEntry = te.next(); + if (UtilValidate.isNotEmpty(timeEntry.get("hours"))) { + actualHours = actualHours.add(timeEntry.getBigDecimal("hours")); + } + } + if(actualHours.signum() != 0) newTask.put("actualHours", actualHours); + + newTasks.add(newTask); +} + // sort tasks -UtilMisc.sortMaps(tasks, UtilMisc.toList("workEffortName")); -context.put("tasks", tasks); +newTasks = UtilMisc.sortMaps(newTasks, UtilMisc.toList("workEffortName")); +context.put("tasks", newTasks); Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml?rev=598510&r1=598509&r2=598510&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml Mon Nov 26 19:35:55 2007 @@ -121,6 +121,7 @@ </condition> <widgets> <include-menu name="TaskTabBar" location="component://projectmgr/widget/Menus.xml"/> + <label style="head1" text="${uiLabelMap.ProjectMgrTaskCurrent}: ${workEffort.workEffortName}[${workEffort.workEffortId}]"/> </widgets> </section> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml?rev=598510&r1=598509&r2=598510&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml Mon Nov 26 19:35:55 2007 @@ -200,10 +200,10 @@ </entity-options> </drop-down> </field> - <field name="estimatedStartDate" title="${uiLabelMap.FormFieldTitle_estimatedStartDate}"><display description="${bsh:estimatedStartDate!=void?estimatedStartDate.toString().substring(0,10):"";}"/></field> - <field name="estimatedCompletionDate" title="${uiLabelMap.FormFieldTitle_estimatedCompletionDate}"><display description="${bsh:estimatedCompletionDate!=void?estimatedCompletionDate.toString().substring(0,10):"";}"/></field> - <field name="actualStartDate" title="${uiLabelMap.FormFieldTitle_actualStartDate}"><display description="${bsh:actualStartDate!=void?actualStartDate.toString().substring(0,10):"";}"/></field> - <field name="actualCompletionDate" title="${uiLabelMap.FormFieldTitle_actualCompletionDate}"><display description="${bsh:actualCompletionDate!=void?actualCompletionDate.toString().substring(0,10):"";}"/></field> + <field name="estimatedStartDate" title="${uiLabelMap.FormFieldTitle_estimatedStartDate}"><display type="date"/></field> + <field name="estimatedCompletionDate" title="${uiLabelMap.FormFieldTitle_estimatedCompletionDate}"><display type="date"/></field> + <field name="actualStartDate" title="${uiLabelMap.FormFieldTitle_actualStartDate}"><display type="date"/></field> + <field name="actualCompletionDate" title="${uiLabelMap.FormFieldTitle_actualCompletionDate}"><display type="date"/></field> <field name="submitButton" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field> </form> <form name="ListPhaseTaskInfo" type="list" list-name="phases"> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml?rev=598510&r1=598509&r2=598510&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml Mon Nov 26 19:35:55 2007 @@ -166,9 +166,14 @@ <field name="workEffortId" title="${uiLabelMap.ProjectMgrWorkEffortId}" widget-style="buttontext"> <hyperlink also-hidden="false" description="${workEffortName} [${workEffortId}]" target="EditTask?workEffortId=${workEffortId}"/> </field> - <field name="createdDate"><display/></field> - <field name="phaseId"><hyperlink target="FindPhase?workEffortIdFrom=${projectId}" description="${phaseName}[${phaseId}]"/></field> - <field name="projectId"><hyperlink target="EditProject?workEffortIdFrom=${projectId}" description="${projectName}[${projectId}]"/></field> + <field name="createdDate"><display type="date"/></field> + <field name="projectId"><hyperlink target="projectView?workEffortIdFrom=${projectId}" description="${projectName}[${projectId}]"/></field> + <field use-when="actualStartDate!=null" name="startDate" entry-name="actualStartDate" title="${uiLabelMap.WorkEffortStartDate}" parameter-name="actualStartDate"><display type="date"/></field> + <field use-when="actualStartDate==null" name="startDate" entry-name="estimatedStartDate" title="${uiLabelMap.WorkEffortStartDate}" parameter-name="estimatedStartDate"><display type="date"/></field> + <field use-when="actualCompletionDate!=null" name="completionDate" entry-name="actualCompletionDate" title="${uiLabelMap.WorkEffortCompletionDate}" parameter-name="actualCompletionDate"><display type="date"/></field> + <field use-when="actualCompletionDate==null" name="completionDate" entry-name="estimatedCompletionDate" title="${uiLabelMap.WorkEffortCompletionDate}" parameter-name="estimatedCompletionDate"><display type="date"/></field> + <field name="plannedHours"><display/></field> + <field name="actualHours"><display/></field> </form> <form name="ListChildEfforts" target="updateTaskListAndAssoc" title="" list-name="tasks" type="list" separate-columns="true" paginate-target="FindTaskList"> <row-actions> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml?rev=598510&r1=598509&r2=598510&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml Mon Nov 26 19:35:55 2007 @@ -79,7 +79,7 @@ </drop-down> </field> <field name="workEffortId"><drop-down allow-empty="false"> - <entity-options entity-name="ProjectPartyAndPhaseAndTask" description="${projectName}--${phaseName}--${taskName}"> + <entity-options entity-name="ProjectPartyAndPhaseAndTask" description="${projectName}--${phaseName}--${workEffortName}"> <entity-constraint name="partyId" env-name="userLogin.partyId"/> <entity-order-by field-name="projectName"/> <entity-order-by field-name="phaseName"/> |
Free forum by Nabble | Edit this page |