<%@ 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" %>

<c:set var="mmddyyyyText" scope="page"><bean-el:message key="label.mmddyyyy"/></c:set>

<c:choose>
  <c:when test="${pageName == 'updatePHRegistry'}">
    <tr>
	<td class="moduleLabel"><bean-el:message key="label.required.prefix" />&nbsp;<bean-el:message key="label.ph.indicator" />:</td>
	<td class="moduleValue">
		<c:forEach var="item" items="${yesNoList}">
		<c:set var="indicatorText"><bean-el:message key="label.required" />,&nbsp;<bean-el:message key="label.ph.indicator" />&nbsp;(<bean-el:message key="${item.label}" />)</c:set>
			<html-el:radio title="${indicatorText}" property="purpleHeartIndicator" styleId="purpleHeartIndicatorId_${item.value}" value="${item.value}" disabled="${readOnlyRegistry}" />
			<fw:label property="purpleHeartIndicator" forId="purpleHeartIndicatorId_${item.value}"><bean-el:message key="${item.label}" />&nbsp;&nbsp;</fw:label>
		</c:forEach>
	</td>
    </tr>
  </c:when>
  <c:otherwise>
	<html-el:hidden property="purpleHeartIndicator" value="y"/>
  </c:otherwise>
</c:choose>

<%@ include file="registryCommonFields.jsp" %>
<tr><td colspan="2">&nbsp;</td></tr>
<tr>
	<td class="moduleLabel"><fw:label required="true" property="purpleHeartStatus" forId="purpleHeartStatusId"><bean-el:message key="label.ph.status" />:</fw:label></td>
	<td class="moduleValue">
	<c:set var="statusText"><bean-el:message key="label.required" />,&nbsp;<bean-el:message key="label.ph.status" /></c:set>
		<html-el:select title="${statusText}" styleClass="moduleEdit" property="purpleHeartStatus" styleId="purpleHeartStatusId" disabled="${readOnlyRegistry}">
			<html-el:option styleClass="moduleEdit" value=""><bean-el:message key="label.select" /></html-el:option>
			<esrcore:options styleClass="moduleEdit" collection="gov.va.med.esr.common.model.lookup.DecorationStatus" property="code" labelProperty="description"/>
		</html-el:select>
	</td>
</tr>
<c:if test="${pageName == 'updatePHRegistry'}">
    <tr>
	<td class="moduleLabel"><bean-el:message key="label.ph.statusUpdateDate" />:</td>
	<c:set var="statusUpdateDateText"><bean-el:message key="label.ph.statusUpdateDate" /></c:set>
	<td title="<c:out value="${statusUpdateDateText}"/>" class="moduleValue"><html-el:text property="statusUpdateDate" styleClass="moduleEdit" style="{display:none;}" size="20" maxlength="20"/><c:out value="${registryPHInfoForm.statusUpdateDate}"/></td>
    </tr>
</c:if>
<tr>
	<td class="moduleLabel"><fw:label property="rejectedRemarks" forId="rejectedRemarksId"><bean-el:message key="label.ph.rejectedRemarks" />:</fw:label></td>
	<td class="moduleValue">
	<c:set var="rejectedRemarksText"><bean-el:message key="label.ph.rejectedRemarks" /></c:set>
		<html-el:select title="${rejectedRemarksText}" styleClass="moduleEdit" styleId="rejectedRemarksId" property="rejectedRemarks" disabled="${readOnlyRegistry}">
			<html-el:option styleClass="moduleEdit" value=""><bean-el:message key="label.select" /></html-el:option>
			<esrcore:options styleClass="moduleEdit" collection="gov.va.med.esr.common.model.lookup.RejectionRemark" property="code" labelProperty="description"/>
		</html-el:select>
	</td>
</tr>
<tr>
	<td class="moduleLabel"><fw:label property="purpleHeartSiteNumber" forId="purpleHeartSiteNumberId"><bean-el:message key="label.ph.siteNumber" />:</fw:label></td>
	<td class="moduleValue">
	<c:set var="siteNumberText"><bean-el:message key="label.ph.siteNumber" /></c:set>
		<html-el:select title="${siteNumberText}" styleClass="moduleEdit" property="purpleHeartSiteNumber" styleId="purpleHeartSiteNumberId" disabled="${readOnlyRegistry}">
			<html-el:option styleClass="moduleEdit" value=""><bean-el:message key="label.select" /></html-el:option>
			<esrcore:options styleClass="moduleEdit" collection="gov.va.med.esr.common.model.lookup.VAFacility" property="code" labelProperty="description"/>
		</html-el:select>
	</td>
</tr>
<tr>
    	<td class="moduleLabel"><fw:label required="true" property="assignedLAS" forId="assignedLASId"><bean-el:message key="label.registry.assingedLAS" />:</fw:label></td>
    	<td class="moduleValue">
    	<c:set var="assingedLASText"><bean-el:message key="label.required" />,&nbsp;<bean-el:message key="label.registry.assingedLAS" /></c:set>
    	    <html-el:select title="${assingedLASText}" styleClass="moduleEdit" property="assignedLAS" styleId="assignedLASId" disabled="${readOnlyRegistry}">
		<html-el:option styleClass="moduleEdit" value=""><bean-el:message key="label.select" /></html-el:option>
		<esrcore:options styleClass="moduleEdit" collection="gov.va.med.esr.ui.common.beans.PHProcessUser" property="code" labelProperty="description"/>
	    </html-el:select>
    	</td>
</tr>
<tr>
	<td class="moduleLabel" colspan="2">
	    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="moduleShellTableHead">
		<tr>
			<td class="moduleBrownBox"><img alt=""  src="../images/spacer.gif" width="28" height="23"/></td>
			<td nowrap width="100%">&nbsp;<bean-el:message key="label.ph.document" /></td>
			<c:if test="${pageName == 'updatePHRegistry' && readOnlyRegistry == false}">
			    <td nowrap>
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
				    <tr>
				    	<td width="100%"><img alt=""  src="../images/spacer.gif" width="1" height="1" /></td>
					<td><img alt=""  src="../images/buttonEndLeft.gif" width="12" height="21" /></td>
					<td class="buttonText"><html-el:submit property="methodName" styleClass="buttonText" style="width:120; vertical-align: top;"><bean-el:message key="button.addDocument" /></html-el:submit></td>
					<td><img alt=""  src="../images/buttonEndRight.gif" width="12" height="21" /></td>
					<td>&nbsp;</td>
				    </tr>
    				</table>
			    </td>
			</c:if>
		</tr>
	    </table>
	</td></tr>
</tr>
<c:set var="rowColor" value="light"/>
<c:forEach var="item" items="${registryPHInfoForm.documentIdList}" varStatus="status">
    <c:choose>
	<c:when test="${rowColor == 'light'}">
	    <c:set var="rowColor" value="dark"/>
	    <c:set var="rowLabelColor" value="darkLabel"/>
	    <c:set var="rowValueColor" value="darkValue"/>
	</c:when>
	<c:otherwise>
	    <c:set var="rowColor" value="light"/>
	    <c:set var="rowLabelColor" value="label"/>
	    <c:set var="rowValueColor" value="value"/>
	</c:otherwise>
    </c:choose>
    <c:set var="counter" value="${status.count - 1}" />
    <c:set var="documentId" value="${item}" />
    <html-el:hidden property="documentId[${counter}]" />
    <c:set var="hashCode" value="${registryPHInfoForm.documentHashCodeList[counter]}" />

    <tr><td class="<c:out value="${rowValueColor}" />" colspan="2"><img alt=""  src="../images/spacer.gif" width="28" height="5"/></td></tr>
    <tr>
	<td class="<c:out value="${rowLabelColor}" />"><fw:label required="true" property="documentType[${counter}],documentType_${hashCode}" forId="documentType[${counter}]_id"><bean-el:message key="label.registry.documentType" />:</fw:label></td>
	<td class="<c:out value="${rowValueColor}" />">
	<c:set var="documentTypeText"><bean-el:message key="label.required" />,&nbsp;<bean-el:message key="label.registry.documentType" />&nbsp;<c:out value="${counter+1}" /></c:set>
	    <html-el:select title="${documentTypeText}" styleClass="moduleEdit" property="documentType[${counter}]" styleId="documentType[${counter}]_id" disabled="${readOnlyRegistry}">
		<html-el:option styleClass="moduleEdit" value=""><bean-el:message key="label.select" /></html-el:option>
		<esrcore:options styleClass="moduleEdit" collection="gov.va.med.esr.common.model.lookup.PHDocumentType" property="code" labelProperty="description"/>
	    </html-el:select>
	</td>
    </tr>
    <tr>
    	<td class="<c:out value="${rowLabelColor}" />"><fw:label required="true" property="dataSource[${counter}],dataSource_${hashCode}" forId="dataSource[${counter}]_id"><bean-el:message key="label.registry.dataSource" />:</fw:label></td>
    	<td class="<c:out value="${rowValueColor}" />">
    	<c:set var="dataSourceText"><bean-el:message key="label.required" />,&nbsp;<bean-el:message key="label.registry.dataSource" />&nbsp;<c:out value="${counter+1}" /></c:set>
    	    <html-el:select title="${dataSourceText}" styleClass="moduleEdit" styleId="dataSource[${counter}]_id" property="dataSource[${counter}]" disabled="${readOnlyRegistry}">
    		<html-el:option styleClass="moduleEdit" value=""><bean-el:message key="label.select" /></html-el:option>
    		<esrcore:options styleClass="moduleEdit" collection="gov.va.med.esr.common.model.lookup.PHDataSource" property="code" labelProperty="description"/>
    	    </html-el:select>
    	</td>
    </tr>
    <tr>
	<td class="<c:out value="${rowLabelColor}" />"><fw:label property="documentReceivedDate[${counter}],documentReceivedDate_${hashCode}" forId="documentReceivedDate[${counter}]_id"><bean-el:message key="label.registry.documentReceivedDate" />:</fw:label></td>
	<c:set var="documentReceivedDateText"><bean-el:message key="label.registry.documentReceivedDate" />&nbsp;<c:out value="${counter+1}" />, &nbsp;<c:out value="${mmddyyyyText}" /> </c:set>
	<td class="<c:out value="${rowValueColor}" />"><html-el:text title="${documentReceivedDateText}" property="documentReceivedDate[${counter}]" styleId="documentReceivedDate[${counter}]_id" styleClass="moduleEdit" size="10" maxlength="10" readOnly="${readOnlyRegistry}"/>&nbsp;<bean-el:message key="label.mmddyyyy" /></td>
    </tr>

  <c:choose>
    <c:when test="${empty documentId}">
    	<tr>
    		<td class="<c:out value="${rowValueColor}" />" colspan="2"><html-el:hidden property="documentLogInDate[${counter}]"/></td>
    	</tr>
    	<tr>
    		<td class="<c:out value="${rowValueColor}" />" colspan="2"><html-el:hidden property="documentLoggedInBy[${counter}]"/></td>
    	</tr>
    </c:when>
    <c:otherwise>
	<tr>
		<td class="<c:out value="${rowLabelColor}" />"><bean-el:message key="label.registry.documentLogInDate" />:</td>
		<c:set var="documentLogInDateText"><bean-el:message key="label.registry.documentLogInDate" /></c:set>
		<td title="<c:out value="${documentLogInDateText} ${counter+1}"/>" class="<c:out value="${rowValueColor}" />"><html-el:hidden property="documentLogInDate[${counter}]"/><c:out value="${registryPHInfoForm.documentLogInDateList[counter]}"/></td>
	</tr>
	<tr>
		<td class="<c:out value="${rowLabelColor}" />"><bean-el:message key="label.registry.documentLoggedInBy" />:</td>
		<c:set var="documentLoggedInByText"><bean-el:message key="label.registry.documentLoggedInBy" /></c:set>
		<td title="<c:out value="${documentLoggedInByText} ${counter+1}"/>"  class="<c:out value="${rowValueColor}" />">
			<html-el:hidden property="documentLoggedInBy[${counter}]"/>			
			<c:set var="documentLoggedInBy" value="${registryPHInfoForm.documentLoggedInByList[counter]}"/>
			<esrcore:displayLookupValue lookupType="gov.va.med.esr.common.model.security.ESRUserPrincipalImpl" name="documentLoggedInBy" />
		</td>
	</tr>
    </c:otherwise>
  </c:choose>

    <tr>
    	<td class="<c:out value="${rowLabelColor}" />"><bean-el:message key="label.required.prefix" />&nbsp;<bean-el:message key="label.registry.documentAcceptable" />:</td>
    	<td class="<c:out value="${rowValueColor}" />">
    		<!-- <input type="radio" id="documentAcceptable[${counter}]_none" name="documentAcceptable[<c:out value="${counter}]"/>" value="" style="{display:none;}" checked="checked"><fw:label property="documentAcceptable[${counter}],documentAcceptable_${hashCode}" forId="documentAcceptable[${counter}]_none"><span style="display:none">none</span></fw:label> -->
    		<c:forEach var="item" items="${yesNoList}">
    		<c:set var="documentAcceptableText"><bean-el:message key="label.required" />,&nbsp;<bean-el:message key="label.registry.documentAcceptable" />&nbsp;<c:out value="${counter+1}" />, &nbsp;<bean-el:message key="${item.label}" /> </c:set>
    			<html-el:radio title="${documentAcceptableText}" property="documentAcceptable[${counter}]" value="${item.value}" disabled="${readOnlyRegistry}" styleId="docAcceptable[${counter}]_${item.value}"/>
    			<fw:label property="documentAcceptable[${counter}],documentAcceptable_${hashCode}" forId="docAcceptable[${counter}]_${item.value}"><bean-el:message key="${item.label}" />&nbsp;&nbsp;</fw:label>
    		</c:forEach>

    	</td>
    </tr>
    <tr>
    	<td class="<c:out value="${rowLabelColor}" />" valign="top"><fw:label property="unacceptableRemark[${counter}],unacceptableRemark_${hashCode}" forId="unacceptableRemark[${counter}]_id"><bean-el:message key="label.registry.unacceptableRemark" />:</fw:label></td>
    	<c:set var="unacceptableRemarkText">&nbsp;<bean-el:message key="label.registry.unacceptableRemark" />&nbsp;<c:out value="${counter+1}" /> </c:set>
    	<td class="<c:out value="${rowValueColor}" />"><html-el:textarea title="${unacceptableRemarkText}"property="unacceptableRemark[${counter}]" styleClass="moduleEdit" styleId="unacceptableRemark[${counter}]_id" cols="60" rows="3" readOnly="${readOnlyRegistry}"/></td>
    </tr>
    <tr><td class="<c:out value="${rowValueColor}" />" colspan="2"><img alt=""  src="../images/spacer.gif" width="28" height="5"/></td></tr>
</c:forEach>
<c:if test="${pageName == 'updatePHRegistry'}">
    <tr><td colspan="2">&nbsp;</td></tr>
    <tr>
	<td class="moduleLabel"><bean-el:message key="label.updatedBy" />:</td>
	<c:set var="updatedByText"><bean-el:message key="label.updatedBy" /></c:set>
	<td title="<c:out value="${updatedByText}"/>" class="moduleValue"><html-el:hidden property="updatedBy"/>
		<esrcore:displayLookupValue lookupType="gov.va.med.esr.common.model.security.ESRUserPrincipalImpl" name="registryPHInfoForm" property="updatedBy" />
	</td>
    </tr>
    <tr>
	<td class="moduleLabel"><bean-el:message key="label.updateDateTime" />:</td>
	<c:set var="updateDateTimeText"><bean-el:message key="label.updateDateTime" /></c:set>
	<td title="<c:out value="${updateDateTimeText}"/>" class="moduleValue"><html-el:hidden property="updatedDate"/><c:out value="${registryPHInfoForm.updatedDate}"/></td>
    </tr>
</c:if>
