From 33881786b053dce13c0641c7a234ddb7c0e6f6d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacobo=20Aragunde=20P=C3=A9rez?= Date: Thu, 23 Feb 2012 17:29:27 +0100 Subject: [PATCH] Bug #1380: Don't allow ASAP constraint for tasks in projects where init date is not set. FEA: ItEr76S04BugFixing --- .../web/planner/taskedition/TaskPropertiesController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/planner/taskedition/TaskPropertiesController.java b/libreplan-webapp/src/main/java/org/libreplan/web/planner/taskedition/TaskPropertiesController.java index 63743d0cf..da83b74a8 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/planner/taskedition/TaskPropertiesController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/planner/taskedition/TaskPropertiesController.java @@ -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);