<%@ 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" %>
<%@ page import='gov.va.med.esr.ui.report.action.ReportConstants' %>
<%@ page import='gov.va.med.esr.ui.report.action.ReportScheduleInfoForm' %>
<%@ page import='gov.va.med.esr.common.model.lookup.ReportPeriodType' %>
 
 <c:set var="TAB_NAME_SCHEDULED_REPORTS"><%=ReportConstants.TAB_NAME_SCHEDULED_REPORTS%></c:set>

  <c:set var="reportPeriodTypeAllFiscalYears"><%=ReportPeriodType.CODE_ALL_FISCAL_YEARS.getName()%></c:set>
  <c:set var="reportPeriodTypeFiscalYear"><%=ReportPeriodType.CODE_FISCAL_YEAR.getName()%></c:set>
  <c:set var="reportPeriodTypeQuarterly"><%=ReportPeriodType.CODE_QUARTERLY.getName()%></c:set>
  <c:set var="reportPeriodTypeDateRange"><%=ReportPeriodType.CODE_DATE_RANGE.getName()%></c:set>
  <c:set var="reportPeriodYearsList" value="${reportInfoForm.qm10FiscalYears}" />
  <tr id="spaceReportPeriodDateRange"><td colspan="3">&nbsp;</td></tr>
  <c:choose>
    <c:when test="${tabName == TAB_NAME_SCHEDULED_REPORTS}">
	  <tr id="reportPeriodDateRange">
	    <td class="moduleLabel" style="vertical-align: middle"><bean-el:message key="label.required.prefix" />&nbsp;<bean-el:message key="label.report.reportPeriod" />:</td>
	    <td class="moduleValue" style="vertical-align: middle" colspan="2">
		<table border="0" cellpadding="0" cellspacing="0">
		      <tr>
			<c:set var="dateRangeText"><bean-el:message key="label.required" />,&nbsp;<bean-el:message key="label.report.reportPeriod"/>&nbsp;(<esrcore:displayLookupValue lookupType="gov.va.med.esr.common.model.lookup.ReportPeriodType" name="reportPeriodTypeDateRange" />)</c:set>
			<td class="moduleValue" nowrap><html-el:hidden property="reportPeriodType" value="${reportPeriodTypeDateRange}" /><esrcore:displayLookupValue lookupType="gov.va.med.esr.common.model.lookup.ReportPeriodType" name="reportPeriodTypeDateRange" />:</td>
			<c:set var="dateRangeFromText"><bean-el:message key="label.required" />,&nbsp;<bean-el:message key="label.report.reportPeriod"/>,&nbsp;<esrcore:displayLookupValue lookupType="gov.va.med.esr.common.model.lookup.ReportPeriodType" name="reportPeriodTypeDateRange" />,&nbsp;<bean-el:message key="label.report.from" /></c:set>
			<td class="moduleValue" nowrap><fw:label property="reportPeriodStartDate" forId="reportPeriodStartDateId"><bean-el:message key="label.report.from" /></fw:label>&nbsp;<html-el:text title="${dateRangeFromText}" styleClass="moduleEdit" property="reportPeriodStartDate" styleId="reportPeriodStartDateId" size="10" maxlength="10" /></td>
			<c:set var="dateRangeToText"><bean-el:message key="label.required" />,&nbsp;<bean-el:message key="label.report.reportPeriod"/>,&nbsp;<esrcore:displayLookupValue lookupType="gov.va.med.esr.common.model.lookup.ReportPeriodType" name="reportPeriodTypeDateRange" />,&nbsp;<bean-el:message key="label.report.to" /></c:set>
			<td class="moduleValue" nowrap><fw:label property="reportPeriodEndDate" forId="reportPeriodEndDateId"><bean-el:message key="label.report.to" /></fw:label>&nbsp;<html-el:text title="${dateRangeToText}" styleClass="moduleEdit" property="reportPeriodEndDate" styleId="reportPeriodEndDateId" size="10" maxlength="10" /></td>
		      </tr>
		  </table>
	    </td>
	  </tr>
    </c:when>
    <c:otherwise>
	  <tr>
	    <td class="moduleLabel" style="vertical-align: top"><bean-el:message key="label.required.prefix" />&nbsp;<bean-el:message key="label.report.reportPeriod" />:</td>
	    <td class="moduleValue" style="vertical-align: top" colspan="2">
		  <table id="reportPeriodTypeAllFiscalYearsId" border="0" cellpadding="0" cellspacing="0">
		    <tr>
		      <c:set var="allFiscalYearsText"><bean-el:message key="label.required" />,&nbsp;<bean-el:message key="label.report.reportPeriod"/>&nbsp;(<esrcore:displayLookupValue lookupType="gov.va.med.esr.common.model.lookup.ReportPeriodType" name="reportPeriodTypeAllFiscalYears" />)</c:set>
			  <td class="moduleValue" nowrap><html-el:radio styleId="AllFiscalYearsId" title="${allFiscalYearsText}" property="reportPeriodType" value="${reportPeriodTypeAllFiscalYears}" />
			  <fw:label property="reportPeriodType" forId="AllFiscalYearsId" ><esrcore:displayLookupValue lookupType="gov.va.med.esr.common.model.lookup.ReportPeriodType" name="reportPeriodTypeAllFiscalYears" /></fw:label></td>
			  <c:set var="asOfDate"><bean-el:message key="label.required" />,&nbsp;<bean-el:message key="label.report.reportPeriod"/>,&nbsp;<esrcore:displayLookupValue lookupType="gov.va.med.esr.common.model.lookup.ReportPeriodType" name="reportPeriodTypeDateRange" />,&nbsp;<bean-el:message key="label.report.to" /></c:set>
			  <td class="moduleValue" nowrap><fw:label property="asOfDate" forId="asOfDateId"><span style="display:none">asOfDateId</span></fw:label>&nbsp;<html-el:text title="${asOfDate}" styleClass="moduleEdit" property="asOfDate" styleId="asOfDateId" size="10" maxlength="10" /></td>
		    </tr>
		  </table>
		  <table id="reportPeriodTypeFiscalYearId" border="0" cellpadding="0" cellspacing="0">
		    <tr>
		      <c:set var="fisicalYearText"><bean-el:message key="label.required" />,&nbsp;<bean-el:message key="label.report.reportPeriod"/>&nbsp;(<esrcore:displayLookupValue lookupType="gov.va.med.esr.common.model.lookup.ReportPeriodType" name="reportPeriodTypeFiscalYear" />)</c:set>
			  <td class="moduleValue" nowrap><html-el:radio styleId="FiscalYearId" title="${fisicalYearText}" property="reportPeriodType" value="${reportPeriodTypeFiscalYear}" />
			  <fw:label property="reportPeriodType" forId="FiscalYearId" ><esrcore:displayLookupValue lookupType="gov.va.med.esr.common.model.lookup.ReportPeriodType" name="reportPeriodTypeFiscalYear" />:</fw:label></td>
			  <td class="moduleValue" colspan="2" nowrap>
			    <fw:label property="reportPeriodType" forId="reportPeriodYearSel" ><span style="display:none">reportPeriodYearSel</span></fw:label>
			    <html-el:select title="${fisicalYearText}" styleClass="moduleEdit" styleId="reportPeriodYearSel" property="reportPeriodYear">
				<esrcore:options styleClass="moduleEdit" collection="reportPeriodYearsList" property="label" labelProperty="value"/>
			    </html-el:select>
			  </td>
		    </tr>
		  </table>
		  <table id="reportPeriodTypeQuarterlyId" border="0" cellpadding="0" cellspacing="0">
		    <tr>
		      <c:set var="quarterlyText"><bean-el:message key="label.required" />,&nbsp;<bean-el:message key="label.report.reportPeriod"/>&nbsp;(<esrcore:displayLookupValue lookupType="gov.va.med.esr.common.model.lookup.ReportPeriodType" name="reportPeriodTypeQuarterly" />)</c:set>
			  <td class="moduleValue" nowrap><html-el:radio styleId="QuarterlyId" title="${quarterlyText}" property="reportPeriodType" value="${reportPeriodTypeQuarterly}" />
			  <fw:label property="reportPeriodType" forId="QuarterlyId" ><esrcore:displayLookupValue lookupType="gov.va.med.esr.common.model.lookup.ReportPeriodType" name="reportPeriodTypeQuarterly" />:</fw:label></td>
			  <td class="moduleValue" nowrap>
			    <fw:label property="reportPeriodType" forId="reportQuarterlyTextSel" ><span style="display:none">reportQuarterlyTextSel</span></fw:label>
			    <html-el:select title="${quarterlyText}" styleClass="moduleEdit" styleId="reportQuarterlyTextSel" property="reportPeriodQuarterYear">
				<esrcore:options styleClass="moduleEdit" collection="reportPeriodYearsList" property="label" labelProperty="value"/>
			    </html-el:select>
			  </td>
			  <td class="moduleValue">
			  <c:set var="reportPeriodText"><bean-el:message key="label.required" />,&nbsp;<bean-el:message key="label.report.reportPeriod"/>&nbsp;(<bean-el:message key="label.report.quarter" />)</c:set>
			    <bean-el:message key="label.report.quarter" />
			    <html-el:select title="${reportPeriodText}" styleClass="moduleEdit" property="reportPeriodQuarter">
				<esrcore:options styleClass="moduleEdit" collection="gov.va.med.esr.common.model.lookup.Quarter" property="code" labelProperty="description"/>
			    </html-el:select>
			  </td>				
		    </tr>
		  </table>
		  <table id="reportPeriodTypeDateRangeId" border="0" cellpadding="0" cellspacing="0">
		    <tr>
			  <c:set var="dateRangeText"><bean-el:message key="label.required" />,&nbsp;<bean-el:message key="label.report.reportPeriod"/>&nbsp;(<esrcore:displayLookupValue lookupType="gov.va.med.esr.common.model.lookup.ReportPeriodType" name="reportPeriodTypeDateRange" />)</c:set>
			  <td class="moduleValue" nowrap><html-el:radio styleId="DateRangeId" title="${dateRangeText}" property="reportPeriodType" value="${reportPeriodTypeDateRange}" />
			  <fw:label property="reportPeriodType" forId="DateRangeId" ><esrcore:displayLookupValue lookupType="gov.va.med.esr.common.model.lookup.ReportPeriodType" name="reportPeriodTypeDateRange" />:</fw:label></td>
			  <c:set var="dateRangeFromText"><bean-el:message key="label.required" />,&nbsp;<bean-el:message key="label.report.reportPeriod"/>,&nbsp;<esrcore:displayLookupValue lookupType="gov.va.med.esr.common.model.lookup.ReportPeriodType" name="reportPeriodTypeDateRange" />,&nbsp;<bean-el:message key="label.report.from" /></c:set>
			  <td class="moduleValue" nowrap><fw:label property="reportPeriodStartDate" forId="reportPeriodStartDateId" ><bean-el:message key="label.report.from" /></fw:label>&nbsp;<html-el:text title="${dateRangeFromText}" styleId="reportPeriodStartDateId" styleClass="moduleEdit" property="reportPeriodStartDate" size="10" maxlength="10" /></td>
			  <c:set var="dateRangeToText"><bean-el:message key="label.required" />,&nbsp;<bean-el:message key="label.report.reportPeriod"/>,&nbsp;<esrcore:displayLookupValue lookupType="gov.va.med.esr.common.model.lookup.ReportPeriodType" name="reportPeriodTypeDateRange" />,&nbsp;<bean-el:message key="label.report.to" /></c:set>
			  <td class="moduleValue" nowrap><fw:label property="reportPeriodEndDate" forId="reportPeriodEndDateId"><bean-el:message key="label.report.to" /></fw:label>&nbsp;<html-el:text title="${dateRangeToText}" styleId="reportPeriodEndDateId" styleClass="moduleEdit" property="reportPeriodEndDate" size="10" maxlength="10" /></td>
		    </tr>
		  </table>
	    </td>
	  </tr>
    </c:otherwise>
  </c:choose>

