Add method to retrieve theoretical progress.

FEA: ItEr75S27PerProjectDashboard
This commit is contained in:
Nacho Barrientos 2011-11-14 17:43:07 +01:00 committed by Manuel Rego Casasnovas
parent c80e174c5d
commit eed5bfe2ea
2 changed files with 8 additions and 1 deletions

View file

@ -72,7 +72,8 @@ public class DashboardController extends GenericForwardComposer {
String out = dashboardModel.getPercentageOfFinishedTasks().toString() + " " +
dashboardModel.getPercentageOfInProgressTasks() + " " +
dashboardModel.getPercentageOfReadyToStartTasks() + " " +
dashboardModel.getPercentageOfBlockedTasks();
dashboardModel.getPercentageOfBlockedTasks() + "\n" +
dashboardModel.getTheoreticalAdvancePercentageByHoursUntilNow();
return out;
}

View file

@ -21,6 +21,7 @@ package org.libreplan.web.dashboard;
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.Date;
import java.util.EnumMap;
import java.util.Map;
@ -70,6 +71,11 @@ public class DashboardModel {
return taskStatusStats.get(TaskStatusEnum.BLOCKED);
}
public BigDecimal getTheoreticalAdvancePercentageByHoursUntilNow(){
BigDecimal ratio = getRootTask().getTheoreticalAdvancePercentageUntilDate(new Date());
return ratio.multiply(BigDecimal.TEN).multiply(BigDecimal.TEN);
}
private void calculateTaskStatusStatistics() {
AccumulateTasksStatusVisitor visitor = new AccumulateTasksStatusVisitor();
TaskElement rootTask = getRootTask();