Commit 8bd7d1d2 authored by Ryan Graham's avatar Ryan Graham Committed by ryang

added a fix to prevent all the checkboxes from becoming selected after...

added a fix to prevent all the checkboxes from becoming selected after searching via the Admin Console.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1489 b35dd754-fafc-0310-a699-88a17e54d16e
parent 69764da7
...@@ -44,6 +44,11 @@ ...@@ -44,6 +44,11 @@
Search Plugin Changelog Search Plugin Changelog
</h1> </h1>
<p><b>1.1.1</b> -- In progress</b></p>
<ul>
<li>Added a fix to prevent all the checkboxes from becoming selected after searching via the Admin Console.
</ul>
<p><b>1.1</b> -- May 17, 2005</b></p> <p><b>1.1</b> -- May 17, 2005</b></p>
<ul> <ul>
<li>Added a page to the Admin Console to allow the enabling/disabling of the search service and to change the service name. <li>Added a page to the Admin Console to allow the enabling/disabling of the search service and to change the service name.
......
...@@ -11,13 +11,13 @@ ...@@ -11,13 +11,13 @@
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager"/> <jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager"/>
<% webManager.init(request, response, session, application, out); %> <% webManager.init(request, response, session, application, out);
<%
String criteria = ParamUtils.getParameter(request, "criteria"); String criteria = ParamUtils.getParameter(request, "criteria");
UserManager userManager = webManager.getUserManager(); UserManager userManager = webManager.getUserManager();
Set<String> searchFields = userManager.getSearchFields(); Set<String> searchFields = userManager.getSearchFields();
List<String> selectedFields = new ArrayList<String>();
List<User> users = new ArrayList<User>(); List<User> users = new ArrayList<User>();
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
boolean searchValue = ParamUtils.getBooleanParameter(request, searchField, false); boolean searchValue = ParamUtils.getBooleanParameter(request, searchField, false);
if (searchValue) { if (searchValue) {
selectedFields.add(searchField);
Collection<User> foundUsers = userManager.findUsers(new HashSet<String>(Arrays.asList(searchField)), criteria); Collection<User> foundUsers = userManager.findUsers(new HashSet<String>(Arrays.asList(searchField)), criteria);
// Filter out all duplicate users. // Filter out all duplicate users.
...@@ -72,7 +73,15 @@ ...@@ -72,7 +73,15 @@
<tr class="c1"> <tr class="c1">
<td width="1%" nowrap><%=searchField %>:</td> <td width="1%" nowrap><%=searchField %>:</td>
<td class="c2"> <td class="c2">
<input type="checkbox" checked="checked" name="<%=searchField %>"/> <% if (criteria == null) { %>
<input type="checkbox" checked name="<%=searchField %>"/>
<% } else { %>
<input type="checkbox" <%=selectedFields.contains(searchField) ? "checked" : "" %> name="<%=searchField %>"/>
<% } %>
</td> </td>
</tr> </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