<%@ 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:if test="${reportParamConfig[letterFileParam] != null}"-->
    <esrcore:setLookup var="ReportLetterFileList" className="gov.va.med.esr.common.model.lookup.ReportLetterFile" />
    <tr><td colspan="3">&nbsp;</td></tr>
    <tr id="letterFileId">
      <td class="moduleLabel" style="vertical-align: top"><fw:label required="true" property="letterFile"><bean-el:message key="label.report.letterFile" />:</fw:label></td>
      <td class="moduleValue" colspan="2">
        <table border="0" cellpadding="0" cellspacing="0">
        <c:set var="letterFileAllText"><bean-el:message key="label.required" />,&nbsp;<bean-el:message key="label.report.letterFile"/></c:set>
      <tr><td><html-el:multibox title="${letterFileAllText}"  property="letterFile" value="${ALL}" onclick="checkAll(this), selectLetterFile()" /></td><td colspan="2" class="moduleValue"><bean-el:message key="label.report.allLetterFiles" /></td></tr>
      <c:forEach var="item" items="${ReportLetterFileList}">
          <c:if test="${item.code == 2 || item.code == 3}">
          <c:set var="letterFileText"><bean-el:message key="label.required" />,&nbsp;<bean-el:message key="label.report.letterFile"/>&nbsp;(<c:out value="${item.description}" />)</c:set>
    <tr><td width="1%">&nbsp;&nbsp;</td><td><html-el:multibox title="${letterFileText}"  property="letterFile" onclick="selectLetterFile()" value="${item.code}" /></td><td class="moduleValue" width="99%"><c:out value="${item.description}" /></td></tr>
          </c:if>
      </c:forEach>
    </table>
      </td>
    </tr>
	<!--/c:if-->

   <tr id="selectLetterFileParam">
	    	<td class="moduleLabel" style="vertical-align: top"><fw:label required="true" property="letterRejectErrorReason"><bean-el:message key="label.report.letterRejectErrorReason" />:</fw:label></td>
	    	<td colspan="2">&nbsp;</td>
   </tr>

<c:set var="selectedLetterRejectReason" value="${reportInfoForm.letterRejectReason}" />
<esrcore:setLookup var="letterRejectReasonSource" className="gov.va.med.esr.common.model.lookup.ComAACRejectReasonType" removeCollection="selectedLetterRejectReason" />
<esrcore:setLookup var="letterRejectReasonTarget" className="gov.va.med.esr.common.model.lookup.ComAACRejectReasonType" removeCollection="letterRejectReasonSource" />
<tr id="selectLetterFileParamReason">
  <td colspan="3" align="center">
    <table border="0" cellpadding="0" cellspacing="0">
      <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="letterRejectReasonSource" styleClass="moduleEdit" style="width: 320px" property="dummySelect" multiple="true" size="8">
            <c:if test="${reportInfoForm.allLetterRejectReasonSelected == false}">
              <html-el:option styleClass="moduleEdit" value="${ALL}"><bean-el:message key="label.report.allLetterRejectReasons" /></html-el:option>
          </c:if>
          <esrcore:options styleClass="moduleEdit" collection="letterRejectReasonSource" property="code" labelProperty="description"/>
            </html-el:select>
        </td>
        <td class="moduleValue">
            <input title="<bean-el:message key="label.addSelections" />" name="button" onclick="addSelectedItems('letterRejectReasonSource','letterRejectReasonTarget')" type="button" value="<bean-el:message key="button.rightArrow" />"><br>
            <input title="<bean-el:message key="label.removeSelections" />" name="button" onclick="addSelectedItems('letterRejectReasonTarget','letterRejectReasonSource')" type="button" value="<bean-el:message key="button.leftArrow" />">
        </td>
        <td class="moduleValue">
            <html-el:select title="${selectedText}" styleId="letterRejectReasonTarget" styleClass="moduleEdit" style="width: 320px" property="letterRejectReason" multiple="true" size="8">
          <c:if test="${reportInfoForm.allLetterRejectReasonSelected == true}">
              <html-el:option styleClass="moduleEdit" value="${ALL}"><bean-el:message key="label.report.allLetterRejectReasons" /></html-el:option>
          </c:if>
          <esrcore:options styleClass="moduleEdit" collection="letterRejectReasonTarget" property="code" labelProperty="description"/>
            </html-el:select>

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

<c:set var="selectedLetterErrorReason" value="${reportInfoForm.letterErrorType}" />
<esrcore:setLookup var="letterErrorReasonSource" className="gov.va.med.esr.common.model.lookup.ComAACErrorType" removeCollection="selectedLetterErrorReason" />
<esrcore:setLookup var="letterErrorReasonTarget" className="gov.va.med.esr.common.model.lookup.ComAACErrorType" removeCollection="letterErrorReasonSource" />
<tr id="selectLetterFileParamError">
  <td colspan="3" align="center">
    <table border="0" cellpadding="0" cellspacing="0">
      <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="letterErrorReasonSource" styleClass="moduleEdit" style="width: 320px" property="dummySelect" multiple="true" size="8">
            <c:if test="${reportInfoForm.allLetterErrorTypeSelected == false}">
              <html-el:option styleClass="moduleEdit" value="${ALL}"><bean-el:message key="label.report.allLetterErrorTypes" /></html-el:option>
          </c:if>
          <esrcore:options styleClass="moduleEdit" collection="letterErrorReasonSource" property="code" labelProperty="description"/>
            </html-el:select>
        </td>
        <td class="moduleValue">
            <input title="<bean-el:message key="label.addSelections" />" name="button" onclick="addSelectedItems('letterErrorReasonSource','letterErrorReasonTarget')" type="button" value="<bean-el:message key="button.rightArrow" />"><br>
            <input title="<bean-el:message key="label.removeSelections" />" name="button" onclick="addSelectedItems('letterErrorReasonTarget','letterErrorReasonSource')" type="button" value="<bean-el:message key="button.leftArrow" />">
        </td>
        <td class="moduleValue">
            <html-el:select title="${selectedText}" styleId="letterErrorReasonTarget" styleClass="moduleEdit" style="width: 320px" property="letterErrorType" multiple="true" size="8">
          <c:if test="${reportInfoForm.allLetterErrorTypeSelected == true}">
              <html-el:option styleClass="moduleEdit" value="${ALL}"><bean-el:message key="label.report.allLetterErrorTypes" /></html-el:option>
          </c:if>
          <esrcore:options styleClass="moduleEdit" collection="letterErrorReasonTarget" property="code" labelProperty="description"/>
            </html-el:select>

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

<c:set var="selectedLetterRejectErrorReason" value="${reportInfoForm.letterRejectErrorReason}" />
<esrcore:setLookup var="letterRejectErrorReasonSource" className="gov.va.med.esr.ui.common.beans.ComAACLetterRejectErrorType" removeCollection="selectedLetterRejectErrorReason" />
<esrcore:setLookup var="letterRejectErrorReasonTarget" className="gov.va.med.esr.ui.common.beans.ComAACLetterRejectErrorType" removeCollection="letterRejectErrorReasonSource" />
<tr id="selectLetterFileParamReasonError">
  <td colspan="3" align="center">
    <table border="0" cellpadding="0" cellspacing="0">
      <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="letterRejectErrorReasonSource" styleClass="moduleEdit" style="width: 320px" property="dummySelect" multiple="true" size="8">
            <c:if test="${reportInfoForm.allLetterRejectErrorReasonSelected == false}">
              <html-el:option styleClass="moduleEdit" value="${ALL}"><bean-el:message key="label.report.allLetterRejectErrorReasons" /></html-el:option>
          </c:if>
          <esrcore:options styleClass="moduleEdit" collection="letterRejectErrorReasonSource" property="code" labelProperty="description"/>
            </html-el:select>
        </td>
        <td class="moduleValue">
            <input title="<bean-el:message key="label.addSelections" />" name="button" onclick="addSelectedItems('letterRejectErrorReasonSource','letterRejectErrorReasonTarget')" type="button" value="<bean-el:message key="button.rightArrow" />"><br>
            <input title="<bean-el:message key="label.removeSelections" />" name="button" onclick="addSelectedItems('letterRejectErrorReasonTarget','letterRejectErrorReasonSource')" type="button" value="<bean-el:message key="button.leftArrow" />">
        </td>
        <td class="moduleValue">
            <html-el:select title="${selectedText}" styleId="letterRejectErrorReasonTarget" styleClass="moduleEdit" style="width: 320px" property="letterRejectErrorReason" multiple="true" size="8">
          <c:if test="${reportInfoForm.allLetterRejectErrorReasonSelected == true}">
              <html-el:option styleClass="moduleEdit" value="${ALL}"><bean-el:message key="label.report.allLetterRejectErrorReasons" /></html-el:option>
          </c:if>
          <esrcore:options styleClass="moduleEdit" collection="letterRejectErrorReasonTarget" property="code" labelProperty="description"/>
            </html-el:select>
        </td>
      </tr>
    </table>
  </td>
</tr>
