Author: hansbak
Date: Fri Oct 31 19:53:39 2008
New Revision: 709624
URL:
http://svn.apache.org/viewvc?rev=709624&view=revLog:
show completion percentage in gantt chart
Modified:
ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/GanttChart.groovy
Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/GanttChart.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/GanttChart.groovy?rev=709624&r1=709623&r2=709624&view=diff==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/GanttChart.groovy (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/GanttChart.groovy Fri Oct 31 19:53:39 2008
@@ -74,6 +74,15 @@
taskInfo.resource = taskInfo.actualHours + " Hrs";
}
double duration = resultTaskInfo.plannedHours;
+ if (taskInfo.currentStatusId == "PTS_COMPLETED") {
+ taskInfo.completion = 100;
+ }else{
+ if (taskInfo.actualHours) {
+ taskInfo.completion = taskInfo.actualHours*100/taskInfo.plannedHours;
+ } else {
+ taskInfo.completion = 0;
+ }
+ }
if (!taskInfo.estimatedStartDate && taskInfo.actualStartDate) {
taskInfo.estimatedStartDate = taskInfo.actualStartDate;
}
@@ -91,11 +100,6 @@
taskInfo.estimatedStartDate = UtilDateTime.toDateString(taskInfo.estimatedStartDate, "MM/dd/yyyy");
taskInfo.estimatedCompletionDate = UtilDateTime.toDateString(taskInfo.estimatedCompletionDate, "MM/dd/yyyy");
taskInfo.workEffortTypeId = "TASK";
- if (taskInfo.currentStatusId == "PTS_COMPLETED") {
- taskInfo.completion = 100;
- }else{
- taskInfo.completion = 0;
- }
if (security.hasEntityPermission("PROJECTMGR", "_READ", session) || security.hasEntityPermission("PROJECTMGR", "_ADMIN", session)) {
taskInfo.url = "/projectmgr/control/taskView?workEffortId="+task.workEffortId;
} else {