<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--  $Id$  -->
<!--                                                                  -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

	<xsl:template name="createRun">
    <form action="/rps/distributor_royalty" name="createRun" id="createRun" method="post">
    	<input type="hidden" name="formSubmit" value="1" />
    	<input type="hidden" name="c" value="create" />
    	<xsl:call-template name="createRunForm" />
    </form>	
	</xsl:template>

  <xsl:template name="createRunForm">
    <div class="section">
			<xsl:call-template name="successMessageGeneral">
				<xsl:with-param name="successMessage">Royalty run has been created successfully!</xsl:with-param>
			</xsl:call-template>
			<p class="formHeader">Use the fields below to create a new royalty run.</p>
    	<hr />
    	<xsl:call-template name="errorMessageGeneral" />
    	<table class="singleColumn">
    		<tr>
    			<td class="leftCol"><label for="Form_PayorID">*Payor:</label></td>
    			<td>
						<xsl:call-template name="inlineError">
							<xsl:with-param name="path">Form/PayorID</xsl:with-param>
							<xsl:with-param name="displayName">Payor</xsl:with-param>
						</xsl:call-template>	    			
    				<select name="Form_PayorID" id="Form_PayorID">
							<option value="">Choose...</option>	
							<xsl:for-each select="Form/PayorList/Payor">
								<option value="{PayorID}">
									<xsl:if test="PayorID = /Root/Form/PayorID">
										<xsl:attribute name="selected">selected</xsl:attribute>
									</xsl:if>
									<xsl:value-of select="Name" />
								</option>
							</xsl:for-each>
    				</select>
    				<xsl:if test="Form/PayorID/@required = 1">
    					<script type="text/javascript">
								requireField('Form_PayorID','Payor must be selected.<br />');
							</script>
						</xsl:if>
    			</td>
    		</tr>
   			<tr>
    			<td class="leftCol"><label for="Form_Label">*Label:</label></td>
    			<td>
						<xsl:call-template name="inlineError">
							<xsl:with-param name="path">Form/Label</xsl:with-param>
							<xsl:with-param name="displayName">Label</xsl:with-param>
						</xsl:call-template>	    			
    				<input name="Form_Label" id="Form_Label" type="text" value="{Form/Label}" maxlength="{@maxlength}" />
    				<xsl:if test="Form/Label/@required = 1">
    					<script type="text/javascript">
								requireField('Form_Label','Label cannot be blank.<br />');
							</script>
						</xsl:if>
    			</td>
    		</tr>
   			<tr>
    			<td class="leftCol"><label for="Form_LogLevel">Log Level:</label></td>
    			<td>
						<xsl:call-template name="inlineError">
							<xsl:with-param name="path">Form/LogLevel</xsl:with-param>
							<xsl:with-param name="displayName">Log Level</xsl:with-param>
						</xsl:call-template>	    			
    				<select name="Form_LogLevel" id="Form_LogLevel">
    				
    					<option value="1">
								<xsl:if test="Form/LogLevel = 1">
									<xsl:attribute name="selected">selected</xsl:attribute>
								</xsl:if>
								1
							</option>
    					<option value="2">
								<xsl:if test="Form/LogLevel = 2">
									<xsl:attribute name="selected">selected</xsl:attribute>
								</xsl:if>
								2
							</option>
    					<option value="3">
								<xsl:if test="Form/LogLevel = 3">
									<xsl:attribute name="selected">selected</xsl:attribute>
								</xsl:if>
								3
							</option>
    					<option value="4">
								<xsl:if test="Form/LogLevel = 4">
									<xsl:attribute name="selected">selected</xsl:attribute>
								</xsl:if>
								4
							</option>
							
    				</select>
    				
						<xsl:call-template name="helpIcon">
							<xsl:with-param name="tip">Changing this value will affect the amount of logging that is done&lt;br&gt;for this run.  Please do not modify unless necessary.</xsl:with-param>
						</xsl:call-template>
    			</td>
    		</tr>
    		<!--
				<tr>
					<td class="leftCol"><label for="Form_StartDate">*Start Date:</label></td>
          <td>
            <xsl:call-template name="inlineError">
              <xsl:with-param name="path">Form/StartDate</xsl:with-param>
              <xsl:with-param name="displayName">Start Date</xsl:with-param>
            </xsl:call-template>
            <input type="text" class="dateField" name="Form_StartDate" id="Form_StartDate" value="{Form/StartDate}" />
            <a title="Select Start Date">
            	<img src="/production/images/icons/office/Calendar-(16x16).gif" height="16" width="16" class="calendarIcon" id="calendarIconStartDate"/>
            </a>
						<xsl:call-template name="calendar">
							<xsl:with-param name="fieldID">Form_StartDate</xsl:with-param>
							<xsl:with-param name="buttonID">calendarIconStartDate</xsl:with-param>
						</xsl:call-template>                
          </td>
        </tr> 
				<tr>
					<td class="leftCol"><label for="Form_StartDate">*End Date:</label></td>
          <td>
            <xsl:call-template name="inlineError">
              <xsl:with-param name="path">Form/EndDate</xsl:with-param>
              <xsl:with-param name="displayName">End Date</xsl:with-param>
            </xsl:call-template>
            <input type="text" class="dateField" name="Form_EndDate" id="Form_EndDate" value="{Form/EndDate}" />
            <a title="Select End Date">
            	<img src="/production/images/icons/office/Calendar-(16x16).gif" height="16" width="16" class="calendarIcon" id="calendarIconEndDate"/>
            </a>
						<xsl:call-template name="calendar">
							<xsl:with-param name="fieldID">Form_EndDate</xsl:with-param>
							<xsl:with-param name="buttonID">calendarIconEndDate</xsl:with-param>
						</xsl:call-template>                
          </td>
        </tr> 
        -->
				<tr>
					<td colspan="2">
						<br />*Required field
					</td>
				</tr>   		
    	</table>
    </div>
		<xsl:call-template name="buttons" />
  </xsl:template>

</xsl:stylesheet>

