Author: phuong_vu
Date: 2010-08-24 04:20:30 -0400 (Tue, 24 Aug 2010)
New Revision: 3902
Modified:
portal/branches/branched-r3845/component/web/controller/src/main/java/org/exoplatform/web/application/ApplicationMessage.java
portal/branches/branched-r3845/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupMembershipForm.java
portal/branches/branched-r3845/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl
Log:
GTNPORTAL-1240 Show message wrong when input invalid username into group
Modified:
portal/branches/branched-r3845/component/web/controller/src/main/java/org/exoplatform/web/application/ApplicationMessage.java
===================================================================
---
portal/branches/branched-r3845/component/web/controller/src/main/java/org/exoplatform/web/application/ApplicationMessage.java 2010-08-24
07:54:21 UTC (rev 3901)
+++
portal/branches/branched-r3845/component/web/controller/src/main/java/org/exoplatform/web/application/ApplicationMessage.java 2010-08-24
08:20:30 UTC (rev 3902)
@@ -36,6 +36,8 @@
private String messageKey_;
private Object[] messageArgs_;
+
+ private boolean argsLocalized = true;
public ApplicationMessage(String key, Object[] args)
{
@@ -69,4 +71,14 @@
this.type_ = type;
}
+ public void setArgsLocalized(boolean argsLocalized)
+ {
+ this.argsLocalized = argsLocalized;
+ }
+
+ public boolean isArgsLocalized()
+ {
+ return argsLocalized;
+ }
+
}
Modified:
portal/branches/branched-r3845/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupMembershipForm.java
===================================================================
---
portal/branches/branched-r3845/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupMembershipForm.java 2010-08-24
07:54:21 UTC (rev 3901)
+++
portal/branches/branched-r3845/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupMembershipForm.java 2010-08-24
08:20:30 UTC (rev 3902)
@@ -233,8 +233,10 @@
}
if (check)
{
- uiApp.addMessage(new
ApplicationMessage("UIGroupMembershipForm.msg.user-not-exist",
- new String[]{listNotExist}));
+ ApplicationMessage msg = new
ApplicationMessage("UIGroupMembershipForm.msg.user-not-exist",
+ new String[]{listNotExist});
+ msg.setArgsLocalized(false);
+ uiApp.addMessage(msg);
return;
}
Modified:
portal/branches/branched-r3845/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl
===================================================================
---
portal/branches/branched-r3845/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl 2010-08-24
07:54:21 UTC (rev 3901)
+++
portal/branches/branched-r3845/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl 2010-08-24
08:20:30 UTC (rev 3902)
@@ -59,9 +59,15 @@
String msgValue = _ctx.appRes(mess.messageKey);
Object[] msgArguments = mess.getMessageAruments();
if(msgArguments != null && msgArguments.length > 0) {
- for(i in 0..msgArguments.length-1){
- msgValue = msgValue.replace("{" + i + "}",
_ctx.appRes(msgArguments [i]));
- }
+ if (mess.isArgsLocalized()) {
+ for(i in 0..msgArguments.length-1) {
+ msgValue = msgValue.replace("{" + i + "}",
_ctx.appRes(msgArguments [i]));
+ }
+ } else {
+ for(i in 0..msgArguments.length-1) {
+ msgValue = msgValue.replace("{" + i + "}", msgArguments [i]);
+ }
+ }
}
println msgValue;
println " </div>";
Show replies by date