From ab1c86f867b280f283312abbc68fc10bada60958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacobo=20Aragunde=20P=C3=A9rez?= Date: Mon, 4 Jan 2010 17:25:14 +0100 Subject: [PATCH] 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. --- .../web/users/OrderAuthorizationController.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/users/OrderAuthorizationController.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/users/OrderAuthorizationController.java index 7a7767459..ed12779f4 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/users/OrderAuthorizationController.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/users/OrderAuthorizationController.java @@ -97,10 +97,10 @@ public class OrderAuthorizationController extends GenericForwardComposer{ List 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 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())); } }