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() {