<%@ 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/authz" prefix="auth" %>
<%@ page import='gov.va.med.esr.common.model.lookup.Capability' %>

<c:set var="readOnlyRegistry" value="true"/>
<auth:authorize ifAnyGranted="<%=Capability.EDIT_SHAD_REGISTRY.getName()%>">
	<c:set var="readOnlyRegistry" value="false"/>
</auth:authorize>

    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShell">
<html-el:form action="/updateSHADRegistry" method="post">
    <%@ include file="/admin/csrfgentoken.jsp" %>
      <tr><td width="100%">
    	<table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTableBody">
	   <tr>
	     <td>
	         <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTableHead">
	           <tr>
	        	<td class="moduleBlueBox"><img alt=""  src="../images/spacer.gif" width="28" height="23"/></td>
	 	    	<td width="75%" class="moduleHeadline">
			  <c:choose>
			    <c:when test="${readOnlyRegistry == true}">View SHAD Registry</c:when>
			    <c:otherwise><bean-el:message key="title.registry.shad.update" /></c:otherwise>
			  </c:choose>
	 	    	<td nowrap>
			    <table width="100%" border="0" cellspacing="0" cellpadding="0">
			      <tr>
				<c:if test="${not readOnlyRegistry}">
				  <td><img alt=""  src="../images/buttonEndLeft.gif" width="12" height="21" /></td>
				  <td class="buttonText"><html-el:submit property="methodName" styleClass="buttonText" style="width:235; vertical-align: top;"><bean-el:message key="button.addMilitaryServiceNumber"/></html-el:submit></td>
				  <td><img alt=""  src="../images/buttonEndRight.gif" width="12" height="21" /></td>
				</c:if>
				<td>&nbsp;</td>
			      </tr>
			    </table>
	 	    	</td>
	 	    	<td nowrap class="moduleBlueLink" style="padding: 1 8 1 8">
	 	    		<html-el:link action="/shadRegistryHistory?methodName=DISPLAY&amp;history=viewHistoricalSHADRegistry&amp;return=return" paramId="entityId" paramName="registrySHADInfoForm" paramProperty="registryId"><bean-el:message key="history.viewHistory"/></html-el:link>
	 	    	</td>
	           </tr>
	         </table>
	     </td>
	    </tr>

	    <tr><td class="moduleValue">
		<html-el:hidden property="registryId" />
		<table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTableBody">
            <tr>
                <td colspan="2">
                  <%@ include file="/tiles/common/instructionalText.jsp" %>
                </td>
            </tr>
		  <%@ include file="registrySHADFields.jsp" %>
		  <tr><td class="moduleValue" colspan="2">&nbsp;</td></tr>
		  <tr><td class="moduleValue" align="center" colspan="2">
			  <%@ include file="registryUpdateButtons.jsp" %>
		  </td></tr>
		</table>
	       </td></tr>
	</table>
      </td></tr>
</html-el:form>
    </table>
