From 855f75c7566495bc114bc3c81ef2b557ed98f992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Gonz=C3=A1lez=20Fern=C3=A1ndez?= Date: Fri, 16 Oct 2009 03:03:45 +0200 Subject: [PATCH] Fixing bug. When the allocations is empty, it does not go directly to advance allocation. --- .../org/navalplanner/web/planner/allocation/FormBinder.java | 2 +- .../web/planner/allocation/ResourceAllocationController.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/FormBinder.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/FormBinder.java index b45be80e7..cb6f1b3f8 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/FormBinder.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/FormBinder.java @@ -169,7 +169,7 @@ class FormBinder { this.taskElapsedDays.setDisabled(true); } - private void doApply() { + void doApply() { lastAllocation = resourceAllocationsBeingEdited.doAllocation(); aggregate = lastAllocation .getAggregate(); diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/ResourceAllocationController.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/ResourceAllocationController.java index 8e6718cab..c6a225862 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/ResourceAllocationController.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/ResourceAllocationController.java @@ -332,6 +332,10 @@ public class ResourceAllocationController extends GenericForwardComposer { public void advanceAllocation() { AllocationResult allocationResult = formBinder.getLastAllocation(); + if (allocationResult.getAggregate().isEmpty()) { + formBinder.doApply(); + allocationResult = formBinder.getLastAllocation(); + } switcher.goToAdvancedAllocation(allocationResult, createResultReceiver(allocationResult)); window.setVisible(false);