<%@ taglib uri="/tags/struts-bean-el" prefix="bean-el" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html-el" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/tags/fw" prefix="fw" %>
<%@ taglib uri="/tags/esr-core" prefix="esrcore" %>
<%@ page import='gov.va.med.esr.ui.report.action.ReportConstants' %>

    <c:set var="availableText"><bean-el:message key="label.available" /></c:set>
    <c:set var="selectedText"><bean-el:message key="label.selected" /></c:set>
    <c:set var="ALL"><%=ReportConstants.ALL%></c:set>

    <c:set var="selectedReportUsers" value="${reportInfoForm.reportUser}" />
    <esrcore:setLookup var="reportUserSource" className="gov.va.med.esr.common.model.security.ESRUserPrincipalImpl" removeCollection="selectedReportUsers" />
    <esrcore:setLookup var="reportUserTarget" className="gov.va.med.esr.common.model.security.ESRUserPrincipalImpl" removeCollection="reportUserSource" />

    <tr id="reportUserId">
     <td colspan="3" align="center">
       <table border="0" cellpadding="0" cellspacing="0">
		    <tr>
		    	<td class="moduleLabel"><br><fw:label required="true" property="reportUser" forId="reportUserSource"><bean-el:message key="label.report.user" />:</fw:label></td>
		    	<td colspan="2">&nbsp;</td>
		    </tr>
        <tr>
          <td class="moduleValue"><bean-el:message key="label.available" /></td>
          <td class="moduleValue">&nbsp;</td>
          <td class="moduleValue"><bean-el:message key="label.selected" /></td>
        </tr>
		    <tr>
		    	<td class="moduleLabel">
			    <html-el:select title="${availableText}" styleId="reportUserSource" styleClass="moduleEdit" style="width:400px;" property="dummySelect" multiple="true" size="8">
			    	<c:if test="${reportInfoForm.allReportUserSelected == false}">
				    <html-el:option styleClass="moduleEdit" value="${ALL}"><bean-el:message key="label.report.allUsers" /></html-el:option>
				</c:if>
				<esrcore:options styleClass="moduleEdit" collection="reportUserSource" property="code" labelProperty="description"/>
			    </html-el:select>
		    	</td>
		    	<td class="moduleValue">
		    	    <input title="<bean-el:message key="label.addSelections" />" name="button" onclick="addSelectedItems('reportUserSource','reportUserTarget')" type="button" value="<bean-el:message key="button.rightArrow" />"><br>
		    	    <input title="<bean-el:message key="label.removeSelections" />" name="button" onclick="addSelectedItems('reportUserTarget','reportUserSource')" type="button" value="<bean-el:message key="button.leftArrow" />">
		    	</td>
		   	<td class="moduleValue">
		   	    <html-el:select title="${selectedText}" styleId="reportUserTarget" styleClass="moduleEdit" style="width:400px;" property="reportUser" multiple="true" size="8">
		   	    	<c:if test="${reportInfoForm.allReportUserSelected == true}">
			    	    <html-el:option styleClass="moduleEdit" value="${ALL}"><bean-el:message key="label.report.allUsers" /></html-el:option>
				</c:if>
		   		<esrcore:options styleClass="moduleEdit" collection="reportUserTarget" property="code" labelProperty="description"/>
		   	    </html-el:select>
		   	</td>
		    </tr>

       </table>
     </td>
    </tr>
