Bug #1343: Mark closed projects with a special class in the gantt.

This is a step previous to show these kind of tasks in a different way.

FEA: ItEr76S04BugFixing
This commit is contained in:
Jacobo Aragunde Pérez 2012-02-03 13:23:53 +01:00
parent b98926549a
commit 39f1f63935
6 changed files with 33 additions and 0 deletions

View file

@ -222,6 +222,9 @@ public class TaskComponent extends Div implements AfterCompose {
cssClass += task.isLimitingAndHasDayAssignments() ? " limiting-assigned "
: " limiting-unassigned ";
}
if (task.belongsClosedProject()) {
cssClass += " project-closed ";
}
return cssClass;
}

View file

@ -279,4 +279,9 @@ public class DefaultFundamentalProperties implements ITaskFundamentalProperties
return false;
}
@Override
public boolean belongsClosedProject() {
return false;
}
}

View file

@ -116,4 +116,6 @@ public interface ITaskFundamentalProperties {
boolean isManualAnyAllocation();
public boolean belongsClosedProject();
}

View file

@ -488,4 +488,8 @@ public abstract class Task implements ITaskFundamentalProperties {
return fundamentalProperties.isManualAnyAllocation();
}
public boolean belongsClosedProject() {
return fundamentalProperties.belongsClosedProject();
}
}

View file

@ -30,6 +30,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@ -46,6 +47,7 @@ import org.libreplan.business.common.BaseEntity;
import org.libreplan.business.common.entities.ProgressType;
import org.libreplan.business.orders.entities.Order;
import org.libreplan.business.orders.entities.OrderElement;
import org.libreplan.business.orders.entities.OrderStatusEnum;
import org.libreplan.business.orders.entities.TaskSource;
import org.libreplan.business.planner.entities.Dependency.Type;
import org.libreplan.business.resources.daos.IResourcesSearcher;
@ -626,6 +628,18 @@ public abstract class TaskElement extends BaseEntity {
return "assigned";
}
public Boolean belongsClosedProject() {
EnumSet<OrderStatusEnum> CLOSED = EnumSet.of(OrderStatusEnum.CANCELLED,
OrderStatusEnum.FINISHED, OrderStatusEnum.STORED);
Order order = getOrderElement().getOrder();
if(CLOSED.contains(order.getState())) {
return true;
}
return false;
}
public abstract boolean hasLimitedResourceAllocation();
public void removePredecessorsDayAssignmentsFor(Scenario scenario) {

View file

@ -1130,6 +1130,11 @@ public class TaskElementAdapter {
&& ((Task) taskElement).isManualAnyAllocation();
}
@Override
public boolean belongsClosedProject() {
return taskElement.belongsClosedProject();
}
}
@Override