<%@ taglib uri="/tags/esr-core" prefix="esrcore" %>
<%@ taglib uri="/tags/fw" prefix="fw" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html-el" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean-el" prefix="bean-el" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/tags/valuelist" prefix="vlh" %>

<c:set var="sensitiveRecordText" scope="page"><bean-el:message key="label.person.sensitiveRecord"/></c:set>

<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="60%" class="moduleHeadline">Veteran Merge Search Result</td>
				<td width="38%" class="moduleHeadline" style="text-align: right">
					<span><bean:message key="text.sensitive"/>&nbsp;<html-el:img alt="${sensitiveRecordText}"  src="../images/redDot.gif"/>&nbsp;</span></td>
             </tr>
            </table>
          </td>
        </tr>
        <tr width="100%">
          <td vAlign="top" align="center">
            <div id="ucPersonSearch_pnlResults" style="border-width:0px;">
              <table id="tableResult" align="center" width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleTable" role="presentation">
                <vlh:root id="personMergeWorklistSearchTableId" value="vlhlist" 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="${vlhlist.valueListInfo.totalNumberOfEntries}"/> Total
                            - Page (<c:out value="${vlhlist.valueListInfo.pagingPage}"/> of <c:out value="${vlhlist.valueListInfo.totalNumberOfPages}"/>).
                            &nbsp;</span>
                          </td>
                          <td width="5%">
                        <c:choose>
                        <c:when test="${vlhlist.valueListInfo.totalNumberOfPages > 1}">
                          <vlh:paging attributes="class=\"pagelinks\"" pages="10"><c:out value="${pagepersonSearchTableId}"/>&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 Person Merge Info" rules="all" class="TableDisplay">
                      <tr>
                        <vlh:row bean="personMergeInfo">
                        <vlh:column title="SSN" property="primaryPerson.officialSsn" attributes="class='valuelistRow1' align=\"left\" scope='col'" default="">
                        	<vlh:attribute name="scope">row</vlh:attribute>
                        <c:choose>
					      <c:when test="${personMergeInfo.primaryPerson.officialSsn == null}">
					         Failed to get <br>Identity Traits
					       </c:when>
					      <c:otherwise>
						      <esrcore:displayValue name="personMergeInfo" property="deprecatedPerson.officialSsn"/><br>
	                          <esrcore:displayValue name="personMergeInfo" property="primaryPerson.officialSsn"/>
					      	
					      </c:otherwise>
						</c:choose>      	
                        </vlh:column>

                        <vlh:column title="Last Name" property="primaryPerson.legalName.familyName" attributes="class='valuelistRow1' align=\"left\" scope='col'" default="">
                          <esrcore:displayValue name="personMergeInfo" property="deprecatedPerson.legalName.familyName"/><br>
                          <esrcore:displayValue name="personMergeInfo" property="primaryPerson.legalName.familyName"/>
                        </vlh:column>

                        <vlh:column title="First Name" property="primaryPerson.legalName.givenName" attributes="class='valuelistRow1' align=\"left\" scope='col'" default="">
                          <esrcore:displayValue name="personMergeInfo" property="deprecatedPerson.legalName.givenName"/><br>
                          <esrcore:displayValue name="personMergeInfo" property="primaryPerson.legalName.givenName"/>
                        </vlh:column>

                        <vlh:column title="Middle Name" property="primaryPerson.legalName.middleName" attributes="class='valuelistRow1' align=\"left\" scope='col'" default="">
                          <esrcore:displayValue name="personMergeInfo" property="deprecatedPerson.legalName.middleName"/><br>
                          <esrcore:displayValue name="personMergeInfo" property="primaryPerson.legalName.middleName"/>
                        </vlh:column>

		    <vlh:column title="SR" property="primaryPerson.sensitiveRecord" attributes="class='valuelistRow1' align=\"left\" scope='col'" default="">
                            <c:choose>
                            <c:when test="${deprecatedPerson.sensitiveRecord == 'true'}">
                              <html-el:img alt="${sensitiveRecordText}"  src="../images/redDot.gif"/>
                            </c:when>
                            <c:otherwise>
                              <span>&nbsp;</span>
                            </c:otherwise>
                            </c:choose>
			<br/>
			<c:choose>
                            <c:when test="${primaryPerson.sensitiveRecord == 'true'}">
                              <html-el:img alt="${sensitiveRecordText}"  src="../images/redDot.gif"/>
                            </c:when>
                            <c:otherwise>
                              <span>&nbsp;</span>
                            </c:otherwise>
                            </c:choose>
                          </vlh:column>
			  
		    <vlh:column title="Locked Reason" property="primaryPerson.personLockedReason" attributes="class='valuelistRow1' align=\"left\" scope='col'" default="">
                          <esrcore:displayValue name="personMergeInfo" property="deprecatedPerson.personLockedReason"/><br>
                          <esrcore:displayValue name="personMergeInfo" property="primaryPerson.personLockedReason"/>
                        </vlh:column>

                        <vlh:column title="Date of Birth" property="primaryPerson.birthRecord.birthDate" attributes="class='valuelistRow1' align=\"left\" scope='col'" default="">
                          <esrcore:displayDate name="personMergeInfo" dateProperty="deprecatedPerson.birthRecord.birthDate"/><br>
                          <esrcore:displayDate name="personMergeInfo" dateProperty="primaryPerson.birthRecord.birthDate"/>
                        </vlh:column>
			
                        <vlh:column title="Merge Status" property="mergeInProgress" attributes="class='valuelistRow1' align=\"left\" scope='col'" default="">
                          <c:if test="${performMerge}">
                          <a href="/esr/person/personMergeWorklist.do?methodName=SELECT+PERSON&amp;selectedPersonMergeInfoId=<c:out value="${personMergeInfo.entityKey.keyValueAsString}"/>">
                          </c:if>
                            <c:choose>
                            <c:when test="${personMergeInfo.mergeInProgress == 'true'}">
                              <bean-el:message key="label.person.mergeInProgress"/>
                            </c:when>
                            <c:otherwise>
                              <bean-el:message key="label.person.mergeNotStarted"/>
                            </c:otherwise>
                            </c:choose>
                          <c:if test="${performMerge}">
                          </a>
                          </c:if>
                        </vlh:column>
                      </vlh:row>
                      </tr>
                    </table>
                  </td>
                </tr>
                </vlh:root>
              </table>
            </div>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
