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

Fixed minor problems. JM-141


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@914 b35dd754-fafc-0310-a699-88a17e54d16e
parent b989cb86
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
if (groupDisplayName == null) { if (groupDisplayName == null) {
errors.put("groupDisplayName", ""); errors.put("groupDisplayName", "");
} }
if ("spefgroups".equals(showGroup) && groupNames == null) { if ("spefgroups".equals(showGroup) && (groupNames == null || groupNames.length == 0)) {
errors.put("groupNames",""); errors.put("groupNames","");
} }
} }
...@@ -273,6 +273,12 @@ Use the form below to create a group. ...@@ -273,6 +273,12 @@ Use the form below to create a group.
<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">Enter a Group Display Name.</span>
<% } %>
</td> </td>
</tr> </tr>
</tbody> </tbody>
...@@ -295,7 +301,7 @@ Use the form below to create a group. ...@@ -295,7 +301,7 @@ Use the form below to create a group.
<td width="1%" nowrap> <td width="1%" nowrap>
<input type="radio" name="showGroup" value="onlyGroup" id="rb001" <input type="radio" name="showGroup" value="onlyGroup" id="rb001"
onclick="this.form.enableRosterGroups[1].checked=true;" onclick="this.form.enableRosterGroups[1].checked=true;"
<%= ("onlyGroup".equals(showGroup) ? "checked" : "") %>> <%= ("onlyGroup".equals(showGroup) && (groupNames == null || groupNames.length == 0) ? "checked" : "") %>>
</td> </td>
<td width="99%"> <td width="99%">
<label for="rb001" <label for="rb001"
......
...@@ -62,30 +62,25 @@ import="java.text.DateFormat, ...@@ -62,30 +62,25 @@ import="java.text.DateFormat,
group.setName(newName); group.setName(newName);
group.setDescription(newDescription); group.setDescription(newDescription);
if (enableRosterGroups) { if (enableRosterGroups) {
boolean shizzledizzle = false;
if ("spefgroups".equals(showGroup)) { if ("spefgroups".equals(showGroup)) {
showGroup = "onlyGroup"; showGroup = "onlyGroup";
shizzledizzle = true; }
else {
groupNames = new String[] {};
} }
group.getProperties().put("sharedRoster.showInRoster", showGroup); group.getProperties().put("sharedRoster.showInRoster", showGroup);
if (groupDisplayName != null) { if (groupDisplayName != null) {
group.getProperties().put("sharedRoster.displayName", groupDisplayName); group.getProperties().put("sharedRoster.displayName", groupDisplayName);
} }
if (shizzledizzle) {
group.getProperties().put("sharedRoster.groupList", toList(groupNames)); group.getProperties().put("sharedRoster.groupList", toList(groupNames));
} }
}
else { else {
group.getProperties().put("sharedRoster.showInRoster", "nobody"); group.getProperties().put("sharedRoster.showInRoster", "nobody");
group.getProperties().put("sharedRoster.displayName", ""); group.getProperties().put("sharedRoster.displayName", "");
group.getProperties().put("sharedRoster.groupList", ""); group.getProperties().put("sharedRoster.groupList", "");
} }
groupName = newName; groupName = newName;
groupInfoChanged = true; groupInfoChanged = true;
// Get admin list and compare it the admin posted list. // Get admin list and compare it the admin posted list.
...@@ -183,7 +178,7 @@ import="java.text.DateFormat, ...@@ -183,7 +178,7 @@ import="java.text.DateFormat,
if (errors.size() == 0) { if (errors.size() == 0) {
enableRosterGroups = !"nobody".equals(group.getProperties().get("sharedRoster.showInRoster")); enableRosterGroups = !"nobody".equals(group.getProperties().get("sharedRoster.showInRoster"));
showGroup = group.getProperties().get("sharedRoster.showInRoster"); showGroup = group.getProperties().get("sharedRoster.showInRoster");
if (!"onlyGroup".equals(showGroup)) { if ("onlyGroup".equals(showGroup)) {
String glist = group.getProperties().get("sharedRoster.groupList"); String glist = group.getProperties().get("sharedRoster.groupList");
List l = new ArrayList(); List l = new ArrayList();
if (glist != null) { if (glist != null) {
...@@ -390,7 +385,7 @@ import="java.text.DateFormat, ...@@ -390,7 +385,7 @@ import="java.text.DateFormat,
<td width="1%" nowrap> <td width="1%" nowrap>
<input type="radio" name="showGroup" value="onlyGroup" id="rb001" <input type="radio" name="showGroup" value="onlyGroup" id="rb001"
onclick="this.form.enableRosterGroups[1].checked=true;" onclick="this.form.enableRosterGroups[1].checked=true;"
<%= ("onlyGroup".equals(showGroup) ? "checked" : "") %>> <%= ("onlyGroup".equals(showGroup) && (groupNames == null || groupNames.length == 0) ? "checked" : "") %>>
</td> </td>
<td width="99%"> <td width="99%">
<label for="rb001" <label for="rb001"
......
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