From 90d869d6ddce4d95b5a76d61e9493b82e7d4f752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Gonz=C3=A1lez=20Fern=C3=A1ndez?= Date: Mon, 20 Sep 2010 21:57:32 +0200 Subject: [PATCH] Do not call deprecated method FEA: ItEr60S04ValidacionEProbasFuncionaisItEr59S04 --- .../web/planner/allocation/AllocationRowsHandler.java | 6 ++++-- .../web/planner/allocation/FormBinder.java | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationRowsHandler.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationRowsHandler.java index a4e460921..48931eb23 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationRowsHandler.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationRowsHandler.java @@ -94,7 +94,8 @@ public class AllocationRowsHandler { Collection criteria, Collection resourcesMatched, Integer hours) { if (resourcesMatched.isEmpty()) { - formBinder.markNoResourcesMatchedByCriterions(criteria); + formBinder.markNoResourcesMatchedByCriterions(resourceType, + criteria); } else { GenericAllocationRow genericAllocationRow = GenericAllocationRow .create(resourceType, criteria, resourcesMatched); @@ -102,7 +103,8 @@ public class AllocationRowsHandler { genericAllocationRow.setHoursToInput(hours); } if (alreadyExistsAllocationFor(criteria)) { - formBinder.markThereisAlreadyAssignmentWith(criteria); + formBinder.markThereisAlreadyAssignmentWith(resourceType, + criteria); } else { currentRows.add(genericAllocationRow); formBinder.newAllocationAdded(); 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 e062654c8..4f6ee6ee6 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 @@ -39,6 +39,7 @@ import org.navalplanner.business.planner.entities.AggregateOfResourceAllocations import org.navalplanner.business.planner.entities.CalculatedValue; import org.navalplanner.business.resources.entities.Criterion; import org.navalplanner.business.resources.entities.Resource; +import org.navalplanner.business.resources.entities.ResourceEnum; import org.navalplanner.business.scenarios.entities.Scenario; import org.navalplanner.business.workingday.ResourcesPerDay; import org.navalplanner.web.common.IMessagesForUser; @@ -492,21 +493,22 @@ public class FormBinder { return resourcesDescriptions; } - public void markNoResourcesMatchedByCriterions( + public void markNoResourcesMatchedByCriterions(ResourceEnum resourceType, Collection criterions) { messagesForUser .showMessage( Level.ERROR, _( "there are no resources for required criteria: {0}. So the generic allocation can't be added", - Criterion.getCaptionFor(criterions))); + Criterion.getCaptionFor(resourceType, + criterions))); } - public void markThereisAlreadyAssignmentWith( + public void markThereisAlreadyAssignmentWith(ResourceEnum resourceType, Collection criterions) { messagesForUser.showMessage(Level.ERROR, _( "already exists an allocation for criteria {0}", - Criterion.getCaptionFor(criterions))); + Criterion.getCaptionFor(resourceType, criterions))); } public void markEndDateMustBeAfterStartDate() {