<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html-el" %>
<%@ taglib uri="/tags/struts-bean-el" prefix="bean-el" %>
<%@ taglib uri="/tags/displaytag" prefix="display" %>
<%@ taglib uri="/tags/esr-core" prefix="esrcore" %>
<%@ taglib uri="/tags/valuelist" prefix="vlh" %>
<%@ taglib uri="/tags/fw" prefix="fw" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/tags/authz" prefix="auth" %>
<%@ page import="gov.va.med.esr.common.model.lookup.HandBookMailStatusType" %>

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShell">
<html-el:form action="/handbookDetail" method="post">
  <%@ include file="/admin/csrfgentoken.jsp" %>
<html-el:hidden property="selectedCommsLogId" />
  <tr>
    <td>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTable">
        <tr>
          <td>
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTableHead">
              <tr>
                <td class="moduleBlueBox"><img alt=""  src="../images/spacer.gif" width="25" height="17"/></td>
                <td nowrap style="padding-left: 7">Add Comments</td>
                <td width="100%"><img alt=""  src="../images/spacer.gif"></td>
              </tr>
             </table>
          </td>
        </tr>
        <tr>
          <td>
            <table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" class="moduleShellTableBody">

              <c:set var="REJECT_AT_HEC"><%= HandBookMailStatusType.REJECT_AT_HEC.getName() %></c:set>
              <c:set var="RETURN_BY_POST_OFFICE"><%= HandBookMailStatusType.RETURN_BY_POST_OFFICE.getName() %></c:set>
              <c:set var="CANCEL_BY_HEC"><%= HandBookMailStatusType.CANCEL_BY_HEC.getName() %></c:set>
              <c:set var="SEND_TO_CMS"><%= HandBookMailStatusType.SEND_TO_CMS.getName() %></c:set>
              <c:set var="SENT_TO_CMS"><%= HandBookMailStatusType.SENT_TO_CMS.getName() %></c:set>
              <c:set var="REJECTED_ADDRESS_BY_CMS"><%= HandBookMailStatusType.REJECTED_ADDRESS_BY_CMS.getName() %></c:set>
              <c:set var="ERROR_BY_CMS"><%= HandBookMailStatusType.ERROR_BY_CMS.getName() %></c:set>
              <c:set var="MAILED_BY_CMS"><%= HandBookMailStatusType.MAILED_BY_CMS.getName() %></c:set>
              <c:set var="ONLINE"><%= HandBookMailStatusType.ONLINE.getName() %></c:set>

              <c:set var="currentStatus" value="${commsLogForm.selectedHandbookLog.handBookMailStatus.statusType.code }" />

              <tr><td colspan="2"><img alt="" src="../images/spacer.gif" width="1" height="10"></td></tr>
              <c:if test="${currentStatus == SEND_TO_CMS}">
              <tr>
                <th class="moduleLabel"><fw:label forId="cancelMailingId" property="cancelMailing">Cancel Mailing:</fw:label></th>                
                <td class="moduleValue"><html-el:checkbox title="Cancel Mailing" property="cancelMailing" styleId="cancelMailingId"/>Cancel</td>
              </tr>
              </c:if>

              <tr>
                <th width="10%" class="moduleLabel" valign="top"><fw:label property="newComment" forId="txtNewComment">Comments:</fw:label></th>
                <td width="90%" class="moduleValue"><textarea title="Comments" wrap="hard" name="newComment" id="txtNewComment" cols="90" rows="8"/><c:out value="${commsLogForm.newComment}"/></textarea></td>
              </tr>
              <tr><td colspan="2">&nbsp;</td></tr>
              <tr>
                <td colspan="2" class="moduleValueButton">
                  <table width="100%" border="0" align="center" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="45%"><img alt=""  src="../images/spacer.gif"/></td>
                      <td><img alt=""  src="../images/buttonEndLeft.gif"/></td>
                      <td><html-el:submit property="methodName" style="width:50; vertical-align: top;" styleClass="buttonText"><bean-el:message key="button.update"/></html-el:submit></td>
                      <td><img alt=""  src="../images/buttonEndRight.gif"/></td>
                      <td width="1%"><img alt=""  src="../images/spacer.gif"/></td>
                      <td><img alt=""  src="../images/buttonEndLeft.gif"/></td>
                      <td><html-el:submit property="methodName" style="width:50; vertical-align: top;" styleClass="buttonText"><bean-el:message key="button.cancel"/></html-el:submit></td>
                      <td><img alt=""  src="../images/buttonEndRight.gif"/></td>
                      <td width="45%"><img alt=""  src="../images/spacer.gif"/></td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</html-el:form>
</table>
<br>


<table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShell">
<tr>
 <td>
   <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTable">
    <tr>
     <td>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTableHead">
       <tr>
         <td class="moduleBlueBox"><img alt=""  src="../images/spacer.gif" width="25" height="15"/></td>
         <th nowrap style="padding-left: 7">
         <esrcore:displayValue name="commsLogForm" property="selectedFormNumber" nullText=""/> -
         <esrcore:displayValue name="commsLogForm" property="selectedFormName" nullText=""/></th>
         <td width="100%"><img alt=""  src="../images/spacer.gif"></td>
       </tr>
      </table>
     </td>
    </tr>
    <tr>
     <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" class="moduleShellTableBody">

		<tr valign="top">
		  <th class="moduleLabel"><div align="left">ID Number:</div></th>
		  <td class="moduleValue"><div align="left"><esrcore:displayValue name="commsLogForm" property="selectedHandbookLog.id" nullText=""/></div></td>
		  <th class="moduleLabel"></th>
		  <td class="moduleValue"></td>
		</tr>
		<tr valign="top">
		  <th width="172" class="moduleLabel"><div align="left">Communication Status:</div></th>
		  <td width="178" class="moduleValue"><div align="left"><esrcore:displayValue name="commsLogForm" property="selectedHandbookLog.handBookMailStatus.statusType.description" nullText=""/></div></td>
		  <th width="171" class="moduleLabel"><div align="left">Status Date/Time:</div></th>
		  <td class="moduleValue"><div align="left"><esrcore:displayDate name="commsLogForm" dateProperty="selectedHandbookLog.handBookMailStatus.modifiedOn" format="MM/dd/yyyy h:mm:ss a"/></div></td>
		</tr>
		<tr valign="top">
		  <th class="moduleLabel"><div align="left">Date Mailed:</div></th>
		  <td class="moduleValue"><div align="left"><esrcore:displayDate name="commsLogForm" dateProperty="selectedHandbookLog.handBookMailStatus.sentToUPSDate" format="MM/dd/yyyy"/></div></td>
		  <th class="moduleLabel"></th>
		  <td class="moduleValue"></td>
		</tr>

		<c:if test="${currentStatus == REJECT_AT_HEC || currentStatus == ERROR_BY_CMS || currentStatus == RETURN_BY_POST_OFFICE || currentStatus == CANCEL_BY_HEC || currentStatus == REJECTED_ADDRESS_BY_CMS}">
		  <tr valign="top">
		      <th class="moduleLabel"><div align="left">Reject Reason:</div></th>
			  <td class="moduleValue">
			  		<div align="left"><esrcore:displayValue name="commsLogForm" property="selectedHandbookLog.handBookMailStatus.rejectReasonType.description" nullText=""/>
			  			<c:if test="${commsLogForm.selectedHandbookLog.handBookMailStatus.errorText != null}">
				  			<br/>
				  			<esrcore:displayValue name="commsLogForm" property="selectedHandbookLog.handBookMailStatus.errorText" nullText=""/>
			  			</c:if>
			  		</div>
			  </td>
			  <th class="moduleLabel"></th>
			  <td class="moduleValue"></td>
		  </tr>
		</c:if>

		<tr valign="top">
		  <th class="moduleLabel"><div align="left">Mailing Address:</div></th>
		  <td class="moduleValue"><div align="left"><esrcore:displayValue name="commsLogForm" property="selectedHandbookLog.address"/></div></td>  
		  <th class="moduleLabel"></th>
		  <td class="moduleValue"></td>
		</tr>
	</table>
	<!-- module shell table body-->
	</td>
</tr>

</table>
<!-- module shell table  -->
</td>
</tr>
</table>
<!-- module shell -->

<br>

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShell">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTable">
<tr>
  <td>
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTableHead">
      <tr>
        <td class="moduleBlueBox">&nbsp;</td>
        <td width="80%" class="moduleHeadline">Comments</td>
        <td width="18%" class="moduleHeadline">&nbsp;</td>
      </tr>
    </table>
  </td>
</tr>
<tr>
  <td>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="moduleShellTableBody">
      <c:choose>
        <c:when test="${vlhCommentList.valueListInfo.totalNumberOfEntries == 0}">
          <tr>
            <td class="darkValue" style="padding:10 0 10 10; text-align: left"><bean-el:message key="label.noDataAvailable"/></td>
          </tr>
        </c:when>
        <c:otherwise>
          <tr valign="top">
            <td vAlign="top" align="center">
              <div id="handbookComments" style="border-width:0px;">
                <table id="handbookCommentsResult" align="center" width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleTable" role="presentation">
                  <vlh:root id="handbookCommentsTableId" value="vlhCommentList" url="?" includeParameters="*" configName="valueListConfigBeanLookAndFeel">
                    <vlh:addParam name="checkboxName" value="Select" temp="false"/>
                    <tr>
                      <td colspan="5">
                        <table class="pagelinks">
                          <tr>
                            <td width="45%"><img alt=""  src="../images/spacer.gif"></td>
                            <td width="5%" nowrap="true">
				                          <span class="pagebanner"><c:out value="${vlhCommentList.valueListInfo.totalNumberOfEntries}"/> Total
				                          - Page (<c:out value="${vlhCommentList.valueListInfo.pagingPage}"/> of <c:out value="${vlhCommentList.valueListInfo.totalNumberOfPages}"/>).
				                          &nbsp;</span>
                            </td>
                            <td width="5%">
                              <c:choose>
                                <c:when test="${vlhCommentList.valueListInfo.totalNumberOfPages > 1}">
                                  <vlh:paging attributes="class=\"pagelinks\"" pages="10"><c:out value="${pagefutureEGTSettingsTableId}"/>&nbsp;</vlh:paging>
                                </c:when>
                                <c:otherwise>
                                  &nbsp;
                                </c:otherwise>
                              </c:choose>
                            </td>
                            <td width="45%"><img alt=""  src="../images/spacer.gif"></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                    <tr vAlign="top">
                      <td vAlign="top" align="center">
                        <table summary="List of Veteran Health Benefits Handbook Details" rules="all" class="TableDisplay">
                          <tr>
                            <vlh:row bean="commentLog">
                              <vlh:column titleKey="table.commentDate" property="modifiedOn" sortable="asc" attributes="width='200' align=\"left\" scope='col'" default="">
                                <vlh:attribute name="scope">row</vlh:attribute>
                                <esrcore:displayDate name="commentLog" dateProperty="modifiedOn" format="MM/dd/yyyy h:mm:ss a"/>
                              </vlh:column>
                              <vlh:column titleKey="table.commentBy" property="modifiedBy.name" sortable="asc" attributes="align=\"left\" scope='col'" default="">
                                <esrcore:displayValue name="commentLog" property="modifiedBy.name" nullText=""/>
                              </vlh:column>
                              <vlh:column titleKey="table.comment" property="actionComment" sortable="asc" attributes="align=\"left\" scope='col'" default="">
                                <esrcore:displayValue name="commentLog" property="actionComment" nullText=""/>
                              </vlh:column>
                            </vlh:row>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </vlh:root>
                </table>
              </div>
            </td>
          </tr>
        </c:otherwise>
      </c:choose>

    </table>
    <!-- module shell table body-->
  </td>
</tr>

</table>
<!-- module shell table  -->
</td>
</tr>
</table>
<!-- module shell -->
<br/>

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShell">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTable">
<tr>
  <td>
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTableHead">
      <tr>
        <td class="moduleBlueBox">&nbsp;</td>
        <td width="80%" class="moduleHeadline">Status History</td>
        <td width="18%" class="moduleHeadline">&nbsp;</td>
      </tr>
    </table>
  </td>
</tr>
<tr>
  <td>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="moduleShellTableBody">
        <tr valign="top">
          <td vAlign="top" align="center">
            <div id="handbookStatus" style="border-width:0px;">
              <table id="handbookStatusResult" align="center" width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleTable" role="presentation">
                <vlh:root id="handbookStatusTableId" value="vlhStatusList" url="?" includeParameters="*" configName="valueListConfigBeanLookAndFeel">
                  <vlh:addParam name="checkboxName" value="Select" temp="false"/>
                  <tr>
                    <td colspan="5">
                      <table class="pagelinks">
                        <tr>
                          <td width="45%"><img alt=""  src="../images/spacer.gif"></td>
                          <td width="5%" nowrap="true">
		                          <span class="pagebanner"><c:out value="${vlhStatusList.valueListInfo.totalNumberOfEntries}"/> Total
		                          - Page (<c:out value="${vlhStatusList.valueListInfo.pagingPage}"/> of <c:out value="${vlhStatusList.valueListInfo.totalNumberOfPages}"/>).
		                          &nbsp;</span>
                          </td>
                          <td width="5%">
                            <c:choose>
                              <c:when test="${vlhStatusList.valueListInfo.totalNumberOfPages > 1}">
                                <vlh:paging attributes="class=\"pagelinks\"" pages="10"><c:out value="${pagefutureEGTSettingsTableId}"/>&nbsp;</vlh:paging>
                              </c:when>
                              <c:otherwise>
                                &nbsp;
                              </c:otherwise>
                            </c:choose>
                          </td>
                          <td width="45%"><img alt=""  src="../images/spacer.gif"></td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                  <tr vAlign="top">
                    <td vAlign="top" align="center">
                      <table summary="List of Status Dates and Descriptions" rules="all" class="TableDisplay">
                        <tr>
                          <vlh:row bean="statusLog">
                            <vlh:column titleKey="table.statusDate" property="modifiedOn" sortable="asc" attributes="width='200' align=\"left\" scope='col'" default="">
                              <vlh:attribute name="scope">row</vlh:attribute>
                              <esrcore:displayDate name="statusLog" dateProperty="modifiedOn" format="MM/dd/yyyy h:mm:ss a"/>
                            </vlh:column>
                            <vlh:column titleKey="table.status" property="statusType.description" sortable="asc" attributes="align=\"left\" scope='col'" default="">
                              <esrcore:displayValue name="statusLog" property="statusType.description" nullText=""/>
                            </vlh:column>
                          </vlh:row>
                        </tr>
                      </table>
                    </td>
                  </tr>
                </vlh:root>
              </table>
            </div>
          </td>
        </tr>

    </table>
    <!-- module shell table body-->
  </td>
</tr>

</table>
<!-- module shell table  -->
</td>
</tr>
</table>
<!-- module shell -->


