<%@ taglib uri="/tags/struts-bean-el" prefix="bean-el" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html-el" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/tags/fw" prefix="fw" %>
<%@ taglib uri="/tags/authz" prefix="auth" %>
<%@ page import='gov.va.med.esr.common.model.lookup.Capability' %>

<c:set var="recordLocked" scope="page"><bean-el:message key="label.recordLocked"/></c:set>
<c:set var="contextPath" scope="page"><%=request.getContextPath()%></c:set>

<c:if test="${veteranHeaderBean != null && veteranHeaderBean.anyDataPresent == 'true'}">
  <table class="conPanelHeadTable" style="border: 1px solid #000000;" id="tableVeteranHeader" cellSpacing="0" cellPadding="0" width="100%" border="0">
    <c:if test="${veteranHeaderBean.sensitiveRecord == 'true'}">
    <tr>
      <td>
        <table cellSpacing="0" cellPadding="0" width="100%" border="0">
          <tr>
              <td width="1%" nowrap class="sensitiveHeader" style="padding: 3"><bean-el:message key="header.sensitiveRecord"/></td>
          </tr>
        </table>
      </td>
    </tr>
    </c:if>
    <c:if test="${veteranHeaderBean.line1DataPresent == 'true'}">
    <tr>
      <td>
        <table cellSpacing="0" cellPadding="0" width="100%" border="0">
          <tr>
			<auth:authorize ifAnyGranted="<%=Capability.MERGE_VETERAN%>">  
            <c:if test="${veteranHeaderBean.dataMergePending == 'true'}">
              <td width="1%" nowrap class="conPanelHeadCenter" style="text-align:center; padding: 0px 4px 0px 0px">
                <a href="/esr/person/personMergeWorklist.do?methodName=SELECT+PERSON&amp;selectedPersonMergeInfoId=<c:out value="${veteranHeaderBean.mergInfoID}"/>">  <bean-el:message key="header.dataMergePending"/> </a>
              </td>
            </c:if>
			</auth:authorize>	
			  
			<auth:authorize ifAnyGranted="<%=Capability.MANAGE_WORKLIST%>">				
            <c:if test="${veteranHeaderBean.openCases == 'true'}">
              <td width="1%" nowrap class="conPanelHeadCenter" style="text-align:center; padding: 0px 4px 0px 0px">
                <html-el:link forward="viewOpenItems.display"><bean-el:message key="link.name.openWorkItems"/></html-el:link>
              </td>
            </c:if>
			</auth:authorize>  
				
            <c:if test="${veteranHeaderBean.personLockReason != null}">
              <td width="1%" nowrap style="text-align:center; padding: 4px 4px 0px 4px">
                <html-el:img alt="${recordLocked}" style="vertical-align: middle;" border="0" src="${contextPath}/images/lock.gif" width="12" height="15"/>
                <span class="conPanelHeadLabelRight" style="padding: 0px 0px 0px 0px"><bean-el:message key="header.lockReason"/>:</span>
                <span class="conPanelHeadCenter" style="padding: 0px 4px 0px 0px"><c:out value="${veteranHeaderBean.personLockReason}"/></span>
              </td>
            </c:if>
          </tr>
        </table>
      </td>
    </tr>
    </c:if>
    <c:if test="${veteranHeaderBean.line2DataPresent == 'true'}">
    <tr>
      <td>
        <table cellSpacing="0" cellPadding="0" width="100%" border="0">
          <tr>
            <c:if test="${veteranHeaderBean.memberId != null}">
              <td width="1%" nowrap style="text-align:center">
                <span class="conPanelHeadLabelRight" style="padding: 3px 0px 3px 4px"><bean-el:message key="header.memberId"/>:</span>
                <span class="conPanelHeadCenter" style="padding: 3px 4px 3px 0px"><c:out value="${veteranHeaderBean.memberId}"/></span>
              </td>
            </c:if>
            <c:if test="${veteranHeaderBean.name != null}">
              <td width="1%" nowrap style="text-align:center">
                <span class="conPanelHeadLabelRight" style="padding: 3px 0px 3px 4px"><bean-el:message key="header.name"/>:</span>
                <span class="conPanelHeadCenter" style="padding: 3px 4px 3px 0px"><c:out value="${veteranHeaderBean.name}"/></span>
              </td>
            </c:if>
            <c:if test="${veteranHeaderBean.ssn != null}">
              <td width="1%" nowrap style="text-align:center">
                <span class="conPanelHeadLabelRight" style="padding: 3px 0px 3px 4px"><bean-el:message key="header.ssn"/>:</span>
                <span class="conPanelHeadCenter" style="padding: 3px 4px 3px 0px"><c:out value="${veteranHeaderBean.ssn}"/></span>
              </td>
            </c:if>
            <c:if test="${veteranHeaderBean.dob != null}">
              <td width="1%" nowrap style="text-align:center">
                <span class="conPanelHeadLabelRight" style="padding: 3px 0px 3px 4px"><bean-el:message key="header.dob"/>:</span>
                <span class="conPanelHeadCenter" style="padding: 3px 4px 3px 0px"><c:out value="${veteranHeaderBean.dob}"/></span>
              </td>
            </c:if>
            <c:if test="${veteranHeaderBean.dod != null}">
              <td width="1%" nowrap style="text-align:center">
                <span class="conPanelHeadLabelRight" style="padding: 3px 0px 3px 4px"><bean-el:message key="header.dod"/>:</span>
                <span class="conPanelHeadCenter" style="padding: 3px 4px 3px 0px"><c:out value="${veteranHeaderBean.dod}"/></span>
              </td>
            </c:if>
            <c:if test="${veteranHeaderBean.status != null}">
              <td width="1%" nowrap style="text-align:center">
                <span class="conPanelHeadLabelRight" style="padding: 3px 0px 3px 4px"><bean-el:message key="header.enrollmentStatus"/>:</span>
                <span class="conPanelHeadCenter" style="padding: 3px 4px 3px 0px"><c:out value="${veteranHeaderBean.status}"/></span>
              </td>
            </c:if>
          </tr>
        </table>
      </td>
    </tr>
    </c:if>
  </table>
</c:if>

