ItEr42S14CUAsignarUsuarioAProxectoTraballoItEr41S17: Modified the behaviour of the informative message about repeated authorizations

Now the message is only shown when all the checked authorizations were
already present.
This commit is contained in:
Jacobo Aragunde Pérez 2010-01-04 17:25:14 +01:00 committed by Javier Moran Rua
parent 6246159b8c
commit ab1c86f867

View file

@ -97,10 +97,10 @@ public class OrderAuthorizationController extends GenericForwardComposer{
List<OrderAuthorizationType> result =
orderAuthorizationModel.addUserOrderAuthorization(
(User)comboItem.getValue(), authorizations);
if(result != null) {
if(result != null && result.size()==authorizations.size()) {
messagesForUser.showMessage(Level.WARNING,
_("Cannot add some authorizations for user {0}. " +
"Probably they are already present.",
_("Could not add those authorizations to user {0} " +
"because they were already present.",
((User)comboItem.getValue()).getLoginName()));
}
}
@ -108,10 +108,10 @@ public class OrderAuthorizationController extends GenericForwardComposer{
List<OrderAuthorizationType> result =
orderAuthorizationModel.addProfileOrderAuthorization(
(Profile)comboItem.getValue(), authorizations);
if(result != null) {
if(result != null && result.size()==authorizations.size()) {
messagesForUser.showMessage(Level.WARNING,
_("Cannot add some authorizations for profile {0}. " +
"Probably they are already present.",
_("Could not add those authorizations to profile {0} " +
"because they were already present.",
((Profile)comboItem.getValue()).getProfileName()));
}
}