Commit 66eb8709 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

Committing more updates for user roster viewer.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@8747 b35dd754-fafc-0310-a699-88a17e54d16e
parent 74614cdb
......@@ -219,6 +219,7 @@
## Added key: 'user.roster.add.required'
## Added key: 'user.roster.item.settings'
## Added key: 'user.roster.add.illegal_jid'
## Added key: 'user.roster.shared_groups'
# Openfire
......@@ -1915,7 +1916,9 @@ user.roster.info=Below is the list of roster items for user {0}.
user.roster.jid=JID
user.roster.nickname=Nickname
user.roster.groups=Groups
user.roster.shared_groups=Shared Groups
user.roster.subscription=Subscription
user.roster.cant_delete=This roster item is a member of a shared group and can not be deleted via this interface.
user.roster.total_items=Total Items
user.roster.sorted=Sorted by JID
user.roster.items_per_page=Items per page
......
......@@ -16,6 +16,8 @@
<%@ page import="org.jivesoftware.openfire.roster.RosterItem" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="org.jivesoftware.openfire.group.Group" %>
<%@ page import="java.util.Collection" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
......@@ -124,6 +126,29 @@
%>">
</td>
</tr>
<tr>
<td class="c1">
<fmt:message key="user.roster.shared_groups" />:
</td>
<td>
<%
Collection<Group> sharedGroups = item.getSharedGroups();
if (!sharedGroups.isEmpty()) {
int count = 0;
for (Group group : sharedGroups) {
if (count != 0) {
out.print(",");
}
out.print(group.getName());
count++;
}
}
else {
out.print("<i>None</i>");
}
%>
</td>
</tr>
<tr>
<td class="c1">
<fmt:message key="user.roster.subscription" />:
......
......@@ -17,6 +17,7 @@
<%@ page import="org.jivesoftware.openfire.roster.RosterItem" %>
<%@ page import="org.jivesoftware.util.LocaleUtils" %>
<%@ page import="java.util.*" %>
<%@ page import="org.jivesoftware.openfire.group.Group" %>
<%!
final int DEFAULT_RANGE = 15;
......@@ -30,7 +31,7 @@
<%
class RosterItemComparator implements Comparator<RosterItem> {
public int compare(RosterItem itemA, RosterItem itemB) {
return itemA.getJid().compareTo(itemB.getJid());
return itemA.getJid().toBareJID().compareTo(itemB.getJid().toBareJID());
}
}
%>
......@@ -249,13 +250,8 @@
<td>
<%
List<String> groups = rosterItem.getGroups();
if (groups.isEmpty()) {
%>
<i>None</i>
<%
}
else {
int count = 0;
int count = 0;
if (!groups.isEmpty()) {
for (String group : groups) {
if (count != 0) {
out.print(", ");
......@@ -264,6 +260,21 @@
count++;
}
}
Collection<Group> sharedGroups = rosterItem.getSharedGroups();
if (!sharedGroups.isEmpty()) {
for (Group group : sharedGroups) {
if (count != 0) {
out.print(", ");
}
out.print("<i>"+group.getName()+"</i>");
count++;
}
}
if (count == 0) {
%>
<i>None</i>
<%
}
%>
</td>
<td>
......@@ -275,9 +286,13 @@
><img src="images/edit-16x16.gif" width="16" height="16" border="0" alt="<fmt:message key="global.click_edit" />"></a>
</td>
<td width="1%" align="center" style="border-right:1px #ccc solid;">
<% if (sharedGroups.isEmpty()) { %>
<a href="user-roster-delete.jsp?username=<%= URLEncoder.encode(username, "UTF-8") %>&jid=<%= URLEncoder.encode(rosterItem.getJid().toString(), "UTF-8") %>"
title="<fmt:message key="global.click_delete" />"
><img src="images/delete-16x16.gif" width="16" height="16" border="0" alt="<fmt:message key="global.click_delete" />"></a>
<% } else { %>
<img onclick='alert("<fmt:message key="user.roster.cant_delete" />")' src="images/forbidden-16x16.gif" width="16" height="16" border="0" alt="">
<% } %>
</td>
</tr>
<%
......
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