Commit bd5b68ad authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

1. Enabling sharing group does not select an option by default. JM-229

2. Added check to ensure that a display name is entered.
3. Added new resource bundles.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1251 b35dd754-fafc-0310-a699-88a17e54d16e
parent 851e4786
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
<%@ page import="java.text.DateFormat, <%@ page import="java.text.DateFormat,
java.util.*, java.util.*,
org.jivesoftware.util.ParamUtils,
org.jivesoftware.admin.*, org.jivesoftware.admin.*,
org.xmpp.packet.JID, org.xmpp.packet.JID,
org.jivesoftware.messenger.group.GroupManager, org.jivesoftware.messenger.group.GroupManager,
...@@ -22,7 +21,7 @@ ...@@ -22,7 +21,7 @@
org.jivesoftware.messenger.user.UserNotFoundException, org.jivesoftware.messenger.user.UserNotFoundException,
org.jivesoftware.stringprep.Stringprep, org.jivesoftware.stringprep.Stringprep,
java.io.UnsupportedEncodingException, java.io.UnsupportedEncodingException,
org.jivesoftware.util.LocaleUtils" org.jivesoftware.util.*"
%> %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%> <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
...@@ -46,9 +45,6 @@ ...@@ -46,9 +45,6 @@
boolean edit = ParamUtils.getBooleanParameter(request, "edit", false); boolean edit = ParamUtils.getBooleanParameter(request, "edit", false);
String newName = ParamUtils.getParameter(request, "newName"); String newName = ParamUtils.getParameter(request, "newName");
String newDescription = ParamUtils.getParameter(request, "newDescription"); String newDescription = ParamUtils.getParameter(request, "newDescription");
String newShowInRosterType = ParamUtils.getParameter(request, "newShow");
boolean newShowInRoster = "onlyGroup".equals(newShowInRosterType) || "everybody".equals(newShowInRosterType);
String newDisplayName = ParamUtils.getParameter(request, "newDisplay");
boolean groupInfoChanged = ParamUtils.getBooleanParameter(request, "groupChanged", false); boolean groupInfoChanged = ParamUtils.getBooleanParameter(request, "groupChanged", false);
boolean enableRosterGroups = ParamUtils.getBooleanParameter(request,"enableRosterGroups"); boolean enableRosterGroups = ParamUtils.getBooleanParameter(request,"enableRosterGroups");
...@@ -68,8 +64,8 @@ ...@@ -68,8 +64,8 @@
} }
if (newName != null && newName.length() > 0) { if (newName != null && newName.length() > 0) {
if (newShowInRoster && (newDisplayName == null || newDisplayName.length() == 0)) { if (enableRosterGroups && (groupDisplayName == null || groupDisplayName.trim().length() == 0)) {
errors.put("display", ""); errors.put("groupDisplayName", "");
} }
if (errors.isEmpty()) { if (errors.isEmpty()) {
group.setName(newName); group.setName(newName);
...@@ -103,6 +99,7 @@ ...@@ -103,6 +99,7 @@
else { else {
// Continue editing since there are some errors // Continue editing since there are some errors
edit = true; edit = true;
update = false;
} }
} }
...@@ -151,11 +148,11 @@ ...@@ -151,11 +148,11 @@
count++; count++;
} }
catch (IllegalArgumentException unfe) { catch (IllegalArgumentException unfe) {
errorBuf.append("<br>"+username + " is not a registered user."); errorBuf.append("<br>" + LocaleUtils.getLocalizedString("group.edit.inexistent_user", JiveGlobals.getLocale(), Arrays.asList(username)));
} }
} }
else { else {
errorBuf.append("<br>"+username+" is already in group."); errorBuf.append("<br>" + LocaleUtils.getLocalizedString("group.edit.already_user", JiveGlobals.getLocale(), Arrays.asList(username)));
} }
} }
if (count > 0) { if (count > 0) {
...@@ -352,6 +349,12 @@ ...@@ -352,6 +349,12 @@
<td width="99%"> <td width="99%">
<input type="text" name="groupDisplayName" size="30" maxlength="100" value="<%= (groupDisplayName != null ? groupDisplayName : "") %>" <input type="text" name="groupDisplayName" size="30" maxlength="100" value="<%= (groupDisplayName != null ? groupDisplayName : "") %>"
onclick="this.form.enableRosterGroups[1].checked=true;"> onclick="this.form.enableRosterGroups[1].checked=true;">
<% if (errors.get("groupDisplayName") != null) { %>
<span class="jive-error-text"><fmt:message key="group.create.enter_a_group_name" /></span>
<% } %>
</td> </td>
</tr> </tr>
</tbody> </tbody>
...@@ -363,7 +366,7 @@ ...@@ -363,7 +366,7 @@
<td width="1%" nowrap> <td width="1%" nowrap>
<input type="radio" name="showGroup" value="everybody" id="rb002" <input type="radio" name="showGroup" value="everybody" id="rb002"
onclick="this.form.enableRosterGroups[1].checked=true;" onclick="this.form.enableRosterGroups[1].checked=true;"
<%= ("everybody".equals(showGroup) ? "checked" : "") %>> <%= ("everybody".equals(showGroup) || "nobody".equals(showGroup) ? "checked" : "") %>>
</td> </td>
<td width="99%"> <td width="99%">
<label for="rb002"><fmt:message key="group.edit.show_groups_in_all_user" /></label> <label for="rb002"><fmt:message key="group.edit.show_groups_in_all_user" /></label>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment