=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/portalReportForm.vm' --- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/portalReportForm.vm 2010-07-06 09:34:47 +0000 +++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/portalReportForm.vm 2010-08-09 10:33:31 +0000 @@ -27,23 +27,49 @@ var orgUnitId = ""+$orgUnit.getId(); orgUnitLevels.put(orgUnitId,"$organisationUnitService.getLevelOfOrganisationUnit( $orgUnit )"); #end - + + function showOrHideDates() + { + var includePeriodChecked = document.getElementById( "includePeriod" ).checked + if(includePeriodChecked==true) + { + jQuery("#lblStartDate").show(); + jQuery("#startDate").show(); + jQuery("#getStartDate").show(); + jQuery("#lblEndDate").show(); + jQuery("#endDate").show(); + jQuery("#getEndDate").show(); + } + else + { + jQuery("#lblStartDate").hide(); + jQuery("#startDate").hide(); + jQuery("#getStartDate").hide(); + jQuery("#lblEndDate").hide(); + jQuery("#endDate").hide(); + jQuery("#getEndDate").hide(); + } + } function formValidations() - { + { + var includePeriodChecked = document.getElementById( "includePeriod" ).checked var reportListIndex = document.reportForm.reportList.selectedIndex; var orgunitIdValue = document.reportForm.ouIDTB.value; var startDateValue = document.reportForm.startDate.value; - var endDateValue = document.reportForm.endDate.value; + var endDateValue = document.reportForm.endDate.value; if(reportListIndex < 0 || document.reportForm.reportList.options[reportListIndex].text == null) {alert("Please Select Report"); return false;} - else if(orgunitIdValue == null || orgunitIdValue == "") {alert("Please Select OrganisationUnit"); return false;} - else if(startDateValue == null || startDateValue== "" || endDateValue == null || endDateValue=="") {alert("Please Select Start Date And End Date"); return false;} - else if(startDateValue > endDateValue) {alert("Starte Date Is Greater Than End Date"); return false;} - - document.reportForm.reportModelTB.value = reportModels.get(document.reportForm.reportList.options[reportListIndex].value); - document.reportForm.reportFileNameTB.value = reportFileNames.get(document.reportForm.reportList.options[reportListIndex].value); - - document.reportForm.reportLevelTB.value = reportLevels.get(document.reportForm.reportList.options[reportListIndex].value); + else if(orgunitIdValue == null || orgunitIdValue == "") {alert("Please Select OrganisationUnit"); return false;} + else if(includePeriodChecked==true) + { + if(startDateValue == null || startDateValue== "" || endDateValue == null || endDateValue=="") + { alert("Please Select Start Date And End Date"); return false;} + else if(startDateValue > endDateValue) + { alert("Start Date Is Greater Than End Date"); return false;} + } + document.reportForm.reportModelTB.value = reportModels.get(document.reportForm.reportList.options[reportListIndex].value); + document.reportForm.reportFileNameTB.value = reportFileNames.get(document.reportForm.reportList.options[reportListIndex].value); + document.reportForm.reportLevelTB.value = reportLevels.get(document.reportForm.reportList.options[reportListIndex].value); return true; } @@ -53,6 +79,9 @@
+ + +
Report With Specified Period
Reports :
@@ -72,12 +101,12 @@
-
+
-
+