Bug #1380: Don't allow ASAP constraint for tasks in projects where init date is

not set.

FEA: ItEr76S04BugFixing
This commit is contained in:
Jacobo Aragunde Pérez 2012-02-23 17:29:27 +01:00
parent 998e469063
commit 65edd863f0

View file

@ -143,8 +143,12 @@ public class TaskPropertiesController extends GenericForwardComposer {
private void setItemsStartConstraintTypesCombo(Order order) {
startConstraintTypes.getChildren().clear();
for (PositionConstraintType type : PositionConstraintType.values()) {
if (type != PositionConstraintType.AS_LATE_AS_POSSIBLE
|| order.getDeadline() != null) {
if ((type != PositionConstraintType.AS_LATE_AS_POSSIBLE &&
type != PositionConstraintType.AS_SOON_AS_POSSIBLE) ||
(type == PositionConstraintType.AS_LATE_AS_POSSIBLE &&
order.getDeadline() != null) ||
(type == PositionConstraintType.AS_SOON_AS_POSSIBLE &&
order.getInitDate() != null)) {
Comboitem comboitem = new Comboitem(_(type.getName()));
comboitem.setValue(type);
startConstraintTypes.appendChild(comboitem);