[Bug #670] Compare sumOfHoursAllocated with 0 to know if there were any assigments in TaskElement.getAssignedStatus().

With this change, ResourceAllocations aren't loaded anymore in
simplified calculation.

FEA: ItEr61S05BugFixing
This commit is contained in:
Jacobo Aragunde Pérez 2010-10-07 19:54:20 +02:00
parent 1161a3181f
commit 7c2fcf7858

View file

@ -542,15 +542,15 @@ public abstract class TaskElement extends BaseEntity {
}
public String getAssignedStatus() {
if(isSimplifiedAssignedStatusCalculationEnabled()) {
if (getSatisfiedResourceAllocations().isEmpty()) {
return "unassigned";
}
return "assigned";
}
if (getSatisfiedResourceAllocations().isEmpty()) {
if (getSumOfHoursAllocated() == 0) {
return "unassigned";
}
if(isSimplifiedAssignedStatusCalculationEnabled()) {
//simplified calculation has only two states:
//unassigned, which was checked previously, and
//assigned otherwise
return "assigned";
}
for (ResourceAllocation<?> resourceAllocation : getSatisfiedResourceAllocations()) {
final ResourcesPerDay resourcesPerDay = resourceAllocation.getResourcesPerDay();
if (resourcesPerDay != null && resourcesPerDay.isZero()) {