From a9c0d57fdde13093472b054d912a5225e78ae4b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Gonz=C3=A1lez=20Fern=C3=A1ndez?= Date: Wed, 16 Sep 2009 23:28:57 +0200 Subject: [PATCH] ItEr25S07CUAsignacionGrupoRecursosAPlanificacionItEr24S08: Removing specific resources --- .../web/planner/allocation/IResourceAllocationModel.java | 8 -------- .../web/planner/allocation/ResourceAllocationModel.java | 8 +++----- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/IResourceAllocationModel.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/IResourceAllocationModel.java index 09f178458..86fe27892 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/IResourceAllocationModel.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/IResourceAllocationModel.java @@ -50,14 +50,6 @@ public interface IResourceAllocationModel { */ Task getTask(); - /** - * Removes the {@link ResourceAllocation} from the current {@link Task}. - * - * @param resourceAllocation - * The object to be removed - */ - void removeResourceAllocation(ResourceAllocation resourceAllocation); - /** * Removes {@link SpecificResourceAllocation} from current allocations list * @param data diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/ResourceAllocationModel.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/ResourceAllocationModel.java index 6de199975..d4cb9be4e 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/ResourceAllocationModel.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/ResourceAllocationModel.java @@ -90,11 +90,6 @@ public class ResourceAllocationModel implements IResourceAllocationModel { return found; } - @Override - public void removeResourceAllocation(ResourceAllocation resourceAllocation) { - task.removeResourceAllocation(resourceAllocation); - } - @Override public Set getCriterions() { return (task != null) ? task.getHoursGroup().getCriterions() @@ -113,6 +108,9 @@ public class ResourceAllocationModel implements IResourceAllocationModel { public void removeSpecificResourceAllocation( SpecificAllocationDTO allocation) { currentAllocations.remove(allocation); + if (allocation.isModifying()) { + task.removeResourceAllocation(allocation.getOrigin()); + } } @Override