Do not call deprecated method

FEA: ItEr60S04ValidacionEProbasFuncionaisItEr59S04
This commit is contained in:
Óscar González Fernández 2010-09-20 21:57:32 +02:00
parent 020f7f7f6b
commit 90d869d6dd
2 changed files with 10 additions and 6 deletions

View file

@ -94,7 +94,8 @@ public class AllocationRowsHandler {
Collection<? extends Criterion> criteria,
Collection<? extends Resource> 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();

View file

@ -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<? extends Criterion> 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<? extends Criterion> criterions) {
messagesForUser.showMessage(Level.ERROR, _(
"already exists an allocation for criteria {0}",
Criterion.getCaptionFor(criterions)));
Criterion.getCaptionFor(resourceType, criterions)));
}
public void markEndDateMustBeAfterStartDate() {