dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #06740
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1874: Fixed ChartGenerationAction in Dashboard to support AggregationServcie Changes; Minor bug fixes i...
------------------------------------------------------------
revno: 1874
committer: Bharath <chbharathk@xxxxxxxxx>
branch nick: trunk
timestamp: Fri 2010-07-23 18:35:37 +0530
message:
Fixed ChartGenerationAction in Dashboard to support AggregationServcie Changes; Minor bug fixes in reports & patient modules
modified:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addValidationCriteria.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateValidationCriteria.vm
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ga/action/charts/GenerateChartDataAction.java
local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml
local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/datasetlock/action/GenerateDataSetLockReportAnalyserFormAction.java
local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/dataSetLockReportAnalysisFront.vm
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addValidationCriteria.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addValidationCriteria.vm 2010-07-14 03:04:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addValidationCriteria.vm 2010-07-23 13:05:37 +0000
@@ -73,8 +73,7 @@
<!-- birthDate -->
<div id="birthDateDiv" style="display:none ">
- <input type="text" id="birthDateValue" name="birthDateValue" onChange="fillValue(this.value);"style="width: 6em">
- <img src="../images/calendar_icon.gif" width="16" height="16" id="birthDateValueButton" style="cursor: pointer;" title="$i18n.getString("date_selector")" onmouseover="this.style.background='orange';" onmouseout="this.style.background=''" alt="$i18n.getString( "date" )">
+ <input type="text" id="birthDateValue" name="birthDateValue" onChange="fillValue(this.value);"style="width: 6em">
<script type="text/javascript">
datePickerValid( 'birthDateValue' );
</script>
@@ -107,7 +106,7 @@
</tr>
<tr>
<td> </td>
- <td colspan="2"><input type="submit" value="$i18n.getString('save')" style="width:10em"> <input name="button" type="button" style="width:10em" onClick="validationCriteria.action" value="$i18n.getString('cancel')"></td>
+ <td colspan="2"><input type="submit" value="$i18n.getString('save')" style="width:10em"> <input name="button" type="button" style="width:10em" onClick="javascript:window.location.href = 'validationCriteria.action'" value="$i18n.getString('cancel')"></td>
</tr>
</table>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateValidationCriteria.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateValidationCriteria.vm 2010-07-14 03:04:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateValidationCriteria.vm 2010-07-23 13:05:37 +0000
@@ -69,8 +69,7 @@
<!-- birthDate -->
<div id="birthDateDiv" style="display:none ">
- <input type="text" id="birthDateValue" name="birthDateValue" onChange="fillValue(this.value);"style="width: 6em">
- <img src="../images/calendar_icon.gif" width="16" height="16" id="birthDateValueButton" style="cursor: pointer;" title="$i18n.getString("date_selector")" onmouseover="this.style.background='orange';" onmouseout="this.style.background=''" alt="$i18n.getString( "date" )">
+ <input type="text" id="birthDateValue" name="birthDateValue" onChange="fillValue(this.value);"style="width: 6em">
<script type="text/javascript">
datePickerValid( 'birthDateValue' );
</script>
=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ga/action/charts/GenerateChartDataAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ga/action/charts/GenerateChartDataAction.java 2010-07-06 09:34:47 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ga/action/charts/GenerateChartDataAction.java 2010-07-23 13:05:37 +0000
@@ -835,34 +835,32 @@
if ( ougSetCB == null )
{
- serviceValues[countForServiceList][countForPeriodList] = aggregationService
- .getAggregatedIndicatorValue( ind, p.getStartDate(), p.getEndDate(), selectedOrgUnit );
- numVal = aggregationService.getAggregatedNumeratorValue( ind, p.getStartDate(), p.getEndDate(),
- selectedOrgUnit );
- denVal = aggregationService.getAggregatedDenominatorValue( ind, p.getStartDate(), p
- .getEndDate(), selectedOrgUnit );
+ Double temp1 = aggregationService.getAggregatedIndicatorValue( ind, p.getStartDate(), p.getEndDate(), selectedOrgUnit );
+ if( temp1 == null ) temp1 = 0.0;
+ serviceValues[countForServiceList][countForPeriodList] = temp1;
+ Double temp2 = aggregationService.getAggregatedNumeratorValue( ind, p.getStartDate(), p.getEndDate(), selectedOrgUnit );
+ if( temp2 == null ) temp2 = 0.0;
+ numVal = temp2;
+ Double temp3 = aggregationService.getAggregatedDenominatorValue( ind, p.getStartDate(), p.getEndDate(), selectedOrgUnit );
+ if( temp3 == null ) temp3 = 0.0;
+ denVal = temp3;
}
else
{
double aggValue = 0.0;
- List<OrganisationUnit> orgUnits = new ArrayList<OrganisationUnit>( selectedOrgUnitGroup
- .getMembers() );
+ List<OrganisationUnit> orgUnits = new ArrayList<OrganisationUnit>( selectedOrgUnitGroup.getMembers() );
+
Iterator<OrganisationUnit> orgUnitsIterator = orgUnits.iterator();
while ( orgUnitsIterator.hasNext() )
{
OrganisationUnit ou = (OrganisationUnit) orgUnitsIterator.next();
- double tempd = aggregationService.getAggregatedIndicatorValue( ind, p.getStartDate(), p
- .getEndDate(), ou );
- double tempnum = aggregationService.getAggregatedNumeratorValue( ind, p.getStartDate(), p
- .getEndDate(), ou );
- double tempden = aggregationService.getAggregatedDenominatorValue( ind, p.getStartDate(), p
- .getEndDate(), ou );
- if ( tempd == -1 )
- tempd = 0.0;
- if ( tempnum == -1 )
- tempnum = 0.0;
- if ( tempden == -1 )
- tempden = 0.0;
+ Double tempd = aggregationService.getAggregatedIndicatorValue( ind, p.getStartDate(), p.getEndDate(), ou );
+ Double tempnum = aggregationService.getAggregatedNumeratorValue( ind, p.getStartDate(), p.getEndDate(), ou );
+ Double tempden = aggregationService.getAggregatedDenominatorValue( ind, p.getStartDate(), p.getEndDate(), ou );
+
+ if( tempd == null ) tempd = 0.0;
+ if( tempnum == null ) tempnum = 0.0;
+ if( tempden == null ) tempden = 0.0;
aggValue += tempd;
numVal += tempnum;
@@ -883,11 +881,11 @@
String values = selectedOrgUnit.getId() + ":"+ dElement.getId() + ":"+ decoc.getId() + ":" + p.getId();
selectedValues.add(values);
- if ( deSelection.equalsIgnoreCase( "optioncombo" ) )
+ if( deSelection.equalsIgnoreCase( "optioncombo" ) )
{
- if ( ougSetCB == null )
+ if( ougSetCB == null )
{
- if ( aggDataCB == null )
+ if( aggDataCB == null )
{
DataValue dv1 = dataValueService.getDataValue( selectedOrgUnit, dElement, p, decoc );
if ( dv1 != null )
@@ -898,9 +896,9 @@
}
else
{
- serviceValues[countForServiceList][countForPeriodList] = aggregationService
- .getAggregatedDataValue( dElement, decoc, p.getStartDate(), p.getEndDate(),
- selectedOrgUnit );
+ Double temp = aggregationService.getAggregatedDataValue( dElement, decoc, p.getStartDate(), p.getEndDate(), selectedOrgUnit );
+ if(temp == null ) temp = 0.0;
+ serviceValues[countForServiceList][countForPeriodList] = temp;
}
}
else
@@ -908,8 +906,8 @@
if ( aggDataCB == null )
{
double aggValue = 0.0;
- List<OrganisationUnit> orgUnits = new ArrayList<OrganisationUnit>( selectedOrgUnitGroup
- .getMembers() );
+ List<OrganisationUnit> orgUnits = new ArrayList<OrganisationUnit>( selectedOrgUnitGroup.getMembers() );
+
Iterator<OrganisationUnit> orgUnitsIterator = orgUnits.iterator();
while ( orgUnitsIterator.hasNext() )
{
@@ -928,16 +926,14 @@
else
{
double aggValue = 0.0;
- List<OrganisationUnit> orgUnits = new ArrayList<OrganisationUnit>( selectedOrgUnitGroup
- .getMembers() );
+ List<OrganisationUnit> orgUnits = new ArrayList<OrganisationUnit>( selectedOrgUnitGroup.getMembers() );
+
Iterator<OrganisationUnit> orgUnitsIterator = orgUnits.iterator();
while ( orgUnitsIterator.hasNext() )
{
OrganisationUnit ou = (OrganisationUnit) orgUnitsIterator.next();
- double tempd = aggregationService.getAggregatedDataValue( dElement, decoc, p
- .getStartDate(), p.getEndDate(), ou );
- if ( tempd == -1 )
- tempd = 0.0;
+ Double tempd = aggregationService.getAggregatedDataValue( dElement, decoc, p.getStartDate(), p.getEndDate(), ou );
+ if ( tempd == null ) tempd = 0.0;
aggValue += tempd;
}
serviceValues[countForServiceList][countForPeriodList] = aggValue;
@@ -956,15 +952,13 @@
Iterator<DataElementCategoryOptionCombo> optionComboIterator = optionCombos.iterator();
while ( optionComboIterator.hasNext() )
{
- DataElementCategoryOptionCombo decoc1 = (DataElementCategoryOptionCombo) optionComboIterator
- .next();
+ DataElementCategoryOptionCombo decoc1 = (DataElementCategoryOptionCombo) optionComboIterator.next();
if ( ougSetCB == null )
{
if ( aggDataCB == null )
{
- DataValue dv1 = dataValueService
- .getDataValue( selectedOrgUnit, dElement, p, decoc1 );
+ DataValue dv1 = dataValueService.getDataValue( selectedOrgUnit, dElement, p, decoc1 );
if ( dv1 != null )
aggDataValue = Double.parseDouble( dv1.getValue() );
else
@@ -972,21 +966,20 @@
}
else
{
- aggDataValue = aggregationService.getAggregatedDataValue( dElement, decoc1, p
- .getStartDate(), p.getEndDate(), selectedOrgUnit );
- // System.out.println("AggValue for DE : "+dElement.getName()+" Period: "+p.getStartDate()+" -- "+p.getEndDate()+" and OrgUnit : "+selectedOrgUnit.getName()+" is : "+aggDataValue);
+ Double temp = aggregationService.getAggregatedDataValue( dElement, decoc1, p.getStartDate(), p.getEndDate(), selectedOrgUnit );
+ if( temp == null ) temp = 0.0;
+ aggDataValue = temp;
}
-
}
else
{
- List<OrganisationUnit> orgUnits = new ArrayList<OrganisationUnit>( selectedOrgUnitGroup
- .getMembers() );
+ List<OrganisationUnit> orgUnits = new ArrayList<OrganisationUnit>( selectedOrgUnitGroup.getMembers() );
+
Iterator<OrganisationUnit> orgUnitsIterator = orgUnits.iterator();
while ( orgUnitsIterator.hasNext() )
{
OrganisationUnit ou = (OrganisationUnit) orgUnitsIterator.next();
- double tempd = 0.0;
+ Double tempd = 0.0;
if ( aggDataCB == null )
{
DataValue dv1 = dataValueService.getDataValue( ou, dElement, p, decoc1 );
@@ -998,13 +991,13 @@
tempd = aggregationService.getAggregatedDataValue( dElement, decoc1, p
.getStartDate(), p.getEndDate(), ou );
}
- if ( tempd == -1 )
+ if ( tempd == null )
tempd = 0.0;
aggDataValue += tempd;
}
}
- if ( aggDataValue == -1 )
- aggDataValue = 0.0;
+ //if ( aggDataValue == null )
+ // aggDataValue = 0.0;
serviceValues[countForServiceList][countForPeriodList] += aggDataValue;
}
}
@@ -1325,18 +1318,15 @@
while ( orgUnitsIterator.hasNext() )
{
OrganisationUnit ou = (OrganisationUnit) orgUnitsIterator.next();
- double tempd = aggregationService.getAggregatedIndicatorValue( ind, startPeriod
- .getStartDate(), endPeriod.getEndDate(), ou );
- double tempnum = aggregationService.getAggregatedNumeratorValue( ind, startPeriod
- .getStartDate(), endPeriod.getEndDate(), ou );
- double tempden = aggregationService.getAggregatedDenominatorValue( ind, startPeriod
- .getStartDate(), endPeriod.getEndDate(), ou );
- if ( tempd == -1 )
- tempd = 0.0;
- if ( tempnum == -1 )
- tempnum = 0.0;
- if ( tempden == -1 )
- tempden = 0.0;
+
+ Double tempd = aggregationService.getAggregatedIndicatorValue( ind, startPeriod.getStartDate(), endPeriod.getEndDate(), ou );
+ Double tempnum = aggregationService.getAggregatedNumeratorValue( ind, startPeriod.getStartDate(), endPeriod.getEndDate(), ou );
+ Double tempden = aggregationService.getAggregatedDenominatorValue( ind, startPeriod.getStartDate(), endPeriod.getEndDate(), ou );
+
+ if ( tempd == null ) tempd = 0.0;
+ if ( tempnum == null ) tempnum = 0.0;
+ if ( tempden == null ) tempden = 0.0;
+
aggValue += tempd;
numVal += numVal;
denVal += denVal;
@@ -1352,8 +1342,7 @@
else
{
- DataElementGroup deg = dataElementService
- .getDataElementGroupByName( "Annual State Baseline data (%)" );
+ DataElementGroup deg = dataElementService.getDataElementGroupByName( "Annual State Baseline data (%)" );
if ( deg != null && deg.getMembers().contains( dElement ) )
{
if ( facilityLB.equals( "children" ) )
@@ -1393,16 +1382,16 @@
}
else
{
- serviceValues[countForServiceList][countForChildOrgUnitList] = aggregationService
- .getAggregatedDataValue( dElement, decoc, startPeriod.getStartDate(), endPeriod
- .getEndDate(), childOrgUnit );
+ Double temp = aggregationService.getAggregatedDataValue( dElement, decoc, startPeriod.getStartDate(), endPeriod.getEndDate(), childOrgUnit );
+ if( temp == null ) temp = 0.0;
+ serviceValues[countForServiceList][countForChildOrgUnitList] = temp;
}
}
else
{
double aggValue = 0.0;
- List<OrganisationUnit> orgUnits = new ArrayList<OrganisationUnit>( childOrgUnitGroup
- .getMembers() );
+ List<OrganisationUnit> orgUnits = new ArrayList<OrganisationUnit>( childOrgUnitGroup.getMembers() );
+
Iterator<OrganisationUnit> orgUnitsIterator = orgUnits.iterator();
while ( orgUnitsIterator.hasNext() )
{
@@ -1423,12 +1412,13 @@
}
else
{
- tempd = aggregationService.getAggregatedDataValue( dElement, decoc, startPeriod
- .getStartDate(), endPeriod.getEndDate(), ou );
+ Double temp = aggregationService.getAggregatedDataValue( dElement, decoc, startPeriod.getStartDate(), endPeriod.getEndDate(), ou );
+ if( temp == null ) temp = 0.0;
+ tempd = temp;
}
- if ( tempd == -1 )
- tempd = 0.0;
+ //if ( tempd == -1 )
+ // tempd = 0.0;
aggValue += tempd;
}
serviceValues[countForServiceList][countForChildOrgUnitList] = aggValue;
@@ -1467,8 +1457,9 @@
}
else
{
- aggDataValue = aggregationService.getAggregatedDataValue( dElement, decoc1,
- startPeriod.getStartDate(), endPeriod.getEndDate(), childOrgUnit );
+ Double temp = aggregationService.getAggregatedDataValue( dElement, decoc1, startPeriod.getStartDate(), endPeriod.getEndDate(), childOrgUnit );
+ if( temp == null ) temp = 0.0;
+ aggDataValue = temp;
}
}
else
@@ -1496,17 +1487,18 @@
}
else
{
- tempd = aggregationService.getAggregatedDataValue( dElement, decoc1,
- startPeriod.getStartDate(), endPeriod.getEndDate(), ou );
+ Double temp = aggregationService.getAggregatedDataValue( dElement, decoc1, startPeriod.getStartDate(), endPeriod.getEndDate(), ou );
+ if( temp == null ) temp = 0.0;
+ tempd = temp;
}
- if ( tempd == -1 )
- tempd = 0.0;
+ //if ( tempd == -1 )
+ // tempd = 0.0;
aggDataValue += tempd;
}
}
- if ( aggDataValue == -1 )
- aggDataValue = 0.0;
+ //if ( aggDataValue == -1 )
+ // aggDataValue = 0.0;
serviceValues[countForServiceList][countForChildOrgUnitList] += aggDataValue;
}
}
=== modified file 'local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml 2010-07-06 09:34:47 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml 2010-07-23 13:05:37 +0000
@@ -52,33 +52,32 @@
<bean id="org.hisp.dhis.dashboard.ga.action.charts.GenerateChartDataAction"
class="org.hisp.dhis.dashboard.ga.action.charts.GenerateChartDataAction"
scope="prototype">
+ <property name="dataElementCategoryService">
+ <ref bean="org.hisp.dhis.dataelement.DataElementCategoryService"/>
+ </property>
+ <property name="organisationUnitService">
+ <ref bean="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
+ </property>
+ <property name="periodService">
+ <ref bean="org.hisp.dhis.period.PeriodService"/>
+ </property>
+ <property name="indicatorService">
+ <ref bean="org.hisp.dhis.indicator.IndicatorService"/>
+ </property>
+ <property name="dataElementService">
+ <ref bean="org.hisp.dhis.dataelement.DataElementService"/>
+ </property>
+ <property name="dashBoardService">
+ <ref bean="org.hisp.dhis.dashboard.util.DashBoardService"/>
+ </property>
+
<property name="aggregationService">
<ref bean="org.hisp.dhis.aggregation.AggregationService"/>
</property>
- <property name="dataElementCategoryService">
- <ref
- bean="org.hisp.dhis.dataelement.DataElementCategoryService"/>
- </property>
- <property name="dashBoardService">
- <ref bean="org.hisp.dhis.dashboard.util.DashBoardService"/>
- </property>
- <property name="dataElementService">
- <ref bean="org.hisp.dhis.dataelement.DataElementService"/>
- </property>
- <property name="indicatorService">
- <ref bean="org.hisp.dhis.indicator.IndicatorService"/>
- </property>
- <property name="periodService">
- <ref bean="org.hisp.dhis.period.PeriodService"/>
- </property>
- <property name="organisationUnitService">
- <ref bean="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
- </property>
<property name="statementManager" ref="statementManager"/>
<property name="organisationUnitGroupService">
- <ref
- bean="org.hisp.dhis.organisationunit.OrganisationUnitGroupService"/>
+ <ref bean="org.hisp.dhis.organisationunit.OrganisationUnitGroupService"/>
</property>
<property name="dataValueService">
<ref bean="org.hisp.dhis.datavalue.DataValueService"/>
=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/datasetlock/action/GenerateDataSetLockReportAnalyserFormAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/datasetlock/action/GenerateDataSetLockReportAnalyserFormAction.java 2010-07-19 08:20:14 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/datasetlock/action/GenerateDataSetLockReportAnalyserFormAction.java 2010-07-23 13:05:37 +0000
@@ -22,18 +22,6 @@
this.periodService = periodService;
}
- private OrganisationUnitService organisationUnitService;
-
- public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
- {
- this.organisationUnitService = organisationUnitService;
- }
-
- public OrganisationUnitService getOrganisationUnitService()
- {
- return organisationUnitService;
- }
-
// -------------------------------------------------------------------------
// Constants
// -------------------------------------------------------------------------
@@ -47,19 +35,6 @@
// -------------------------------------------------------------------------
// Properties
// -------------------------------------------------------------------------
- private Collection<OrganisationUnit> organisationUnits;
-
- public Collection<OrganisationUnit> getOrganisationUnits()
- {
- return organisationUnits;
- }
-
- private Collection<Period> periods = new ArrayList<Period>();
-
- public Collection<Period> getPeriods()
- {
- return periods;
- }
private Collection<PeriodType> periodTypes;
=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/dataSetLockReportAnalysisFront.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/dataSetLockReportAnalysisFront.vm 2010-07-19 08:20:14 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/dataSetLockReportAnalysisFront.vm 2010-07-23 13:05:37 +0000
@@ -1,198 +1,140 @@
-<html>
- <head>
- <title>DataSet Lock Reports</title>
-
- <script>
- //Global Variables
-
- var reportModels = new HashTable();
- var reportFileNames = new HashTable();
-
- // OrganisationUnit ids and its Names
- ##var orgUnits = new HashTable();
- ##foreach($orgUnit in $organisationUnits)
- ## var orgUnitId = ""+$orgUnit.getId();
- ## orgUnits.put(orgUnitId,"$orgUnit.getShortName()");
- ##end
-
- // OrganisationUnit ids and its Level
- ##var orgUnitLevels = new HashTable();
- ##foreach($orgUnit in $organisationUnits)
- ## var orgUnitId = ""+$orgUnit.getId();
- ## orgUnitLevels.put(orgUnitId,"$organisationUnitService.getLevelOfOrganisationUnit( $orgUnit )");
- ##end
-
- function formValidations()
- {
- var reportListIndex = document.reportForm.reportList.selectedIndex;
- var periodIndex = document.reportForm.availablePeriods.selectedIndex;
- var orgunitIdValue = document.reportForm.ouIDTB.value;
- // var periodTypeIndex = document.reportFrom.periodTypeId.selectedIndex;
-
-
- //if(document.reportForm.periodTypeId.options[])
-
- if(document.reportForm.availablePeriods.options[periodIndex].text == null || document.reportForm.availablePeriods.options[periodIndex].text== "")
- {
- //document.reportForm.generate.disabled=true;
- alert("Please Select Period");
- return false;
- }
- else if(orgunitIdValue == null || orgunitIdValue=="" || orgunitIdValue==" ") {alert("Please Select OrganisationUnit"); return false;}
-
- else if(reportListIndex < 0 || document.reportForm.reportList.options[reportListIndex].text == null) {alert("Please Select Report"); 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);
-
- return true;
- }
- </script>
- </head>
-
- <script type="text/javascript">
- var i18n_select_oug_Unit = '$encoder.jsEscape( $i18n.getString( "select_oug_Unit" ) , "'")';
- var i18n_select_period_id = '$encoder.jsEscape( $i18n.getString( "select_period_id" ) , "'")';
- var i18n_select_data_set = '$encoder.jsEscape( $i18n.getString( "select_dataset" ) , "'")';
-
- function formValidations1()
- {
- if( document.reportForm.ouIDTB.value =="")
- {
- alert(i18n_select_oug_Unit)
- return false;
- }
-
-
- var periodIdOptions = document.getElementById("periodIds").options;
-
- if(periodIdOptions.length>0)
- {
- var i;
- for( i=0; i < periodIdOptions.length ; i++)
- {
- if(periodIdOptions[i].selected==true)
- break;
- }
- if(i==periodIdOptions.length)
- {
- alert(i18n_select_period_id);
- return false;
- }
- }
- else
- {
- alert(i18n_select_period_id);
- return false;
- }
-
- if(!document.getElementById("dataSets").options.length>0)
- {
- alert(i18n_select_data_set);
- return false;
- }
-
- return true;
- }
- </script>
-
-
-
- <body>
- <h1>DataSet Lock Reports Analyser</h1>
- <hr />
- <br />
- <form id="reportForm" name="reportForm" action="generateDataSetLockReportResult.action" method="post" onsubmit="return formValidations1()" target="_blank">
- <table style=" border-collapse: collapse; margin-top: 0;" cellpadding="0" cellspacing="0" border=0>
-
- <tr>
- <th>$i18n.getString( "period_type" )</th>
- <td style="min-width: 325px"> </td>
- <td class="NormalB"> OrganisationUnit :</td>
-
- </tr>
- <tr>
- <td valign="top">
- <select id="periodTypeId" name="periodTypeId" style="min-width:325px" onchange="getAllPeriods()">
- <option value="null">[ $i18n.getString( "select_period_type_all" ) ]</option>
- #foreach ( $type in $periodTypes )
- <option value="$type.name"#if( $currentPeriodTypeId == $type.name ) selected="selected"#end>$type.name</option>
- #end
- </select>
- </td>
- <td style="min-width: 125px"> </td>
- <td class="NormalB">
- <input type="text" name="ouNameTB" id="ouNameTB" size="20" disabled>
- </td>
- </tr>
- <tr>
- <td> </td>
- <td style="min-width: 125px"> </td>
- <td> </td>
-
- </tr>
- <tr>
- <td> </td>
- <td style="min-width: 125px"> </td>
- <td> </td>
- </tr>
- <tr>
- <th>$i18n.getString( "available_periods" )</th>
- <td style="min-width: 125px"> </td>
- <th>$i18n.getString( "datasets" )</th>
-
- </tr>
- <tr>
- <td valign="top">
- <select id="periodIds" name="periodIds" style="min-width:325px; max-height: 100px;" disabled="true" multiple="multiple">
- <!--<option value="null">[ $i18n.getString( "select_period_all" ) ]</option> -->
- </select>
- </td>
- <td style="min-width: 125px"> </td>
- <!-- DataSets -->
- <td valign="top">
- <select id="dataSets" name="dataSets" style="min-width:325px">
- </select>
- </td>
- </tr>
- <tr>
- <td> </td>
- <td style="min-width: 125px"> </td>
- <td> </td>
- </tr>
- <tr>
- <td> </td>
- <td style="min-width: 125px"> </td>
- <td> </td>
- </tr>
-
+<script>
+
+ //Global Variables
+
+ var reportModels = new HashTable();
+ var reportFileNames = new HashTable();
+
+ var i18n_select_oug_Unit = '$encoder.jsEscape( $i18n.getString( "select_oug_Unit" ) , "'")';
+ var i18n_select_period_id = '$encoder.jsEscape( $i18n.getString( "select_period_id" ) , "'")';
+ var i18n_select_data_set = '$encoder.jsEscape( $i18n.getString( "select_dataset" ) , "'")';
+
+
+ function formValidations()
+ {
+ if( document.reportForm.ouIDTB.value == "" )
+ {
+ alert(i18n_select_oug_Unit)
+ return false;
+ }
+
+ var periodIdOptions = document.getElementById("periodIds").options;
+
+ if( periodIdOptions.length > 0 )
+ {
+ var i;
+ for( i=0; i < periodIdOptions.length ; i++)
+ {
+ if( periodIdOptions[i].selected == true ) break;
+ }
- <tr>
- <td> </td>
- <td style="min-width: 125px"> </td>
- <td> </td>
- </tr>
- <tr>
- <td> </td>
- <td style="min-width: 125px"> </td>
- <td> </td>
- </tr>
-
- <br><br>
- <tr>
- <td>
- <input type="submit" id= "generate" name="generate" value="Generate Report" disabled>
- </td>
- <td style="min-width: 125px"> </td>
- <td> </td>
- </tr>
- <input type="hidden" name="autogen" id="autogen" value="0" >
- <input type="hidden" name="ouIDTB" id="ouIDTB">
-
- </td>
- </tr>
- </table>
- </form>
- </body>
- </html>
\ No newline at end of file
+ if( i == periodIdOptions.length )
+ {
+ alert(i18n_select_period_id);
+ return false;
+ }
+ }
+ else
+ {
+ alert(i18n_select_period_id);
+ return false;
+ }
+
+ if( !document.getElementById("dataSets").options.length > 0 )
+ {
+ alert(i18n_select_data_set);
+ return false;
+ }
+
+ return true;
+ }
+
+</script>
+
+<body>
+ <h1>DataSet Lock Reports Analyser</h1>
+ <hr /><br />
+
+ <form id="reportForm" name="reportForm" action="generateDataSetLockReportResult.action" method="post" onsubmit="return formValidations()" target="_blank">
+
+ <table style=" border-collapse: collapse; margin-top: 0;" cellpadding="0" cellspacing="0" border=0>
+ <tr>
+ <th>$i18n.getString( "period_type" )</th>
+ <td style="min-width: 50px"> </td>
+ <th>OrganisationUnit</th>
+ </tr>
+ <tr>
+ <td valign="top">
+ <select id="periodTypeId" name="periodTypeId" style="min-width:325px" onchange="getAllPeriods()">
+ <option value="null">[ $i18n.getString( "select_period_type_all" ) ]</option>
+ #foreach ( $type in $periodTypes )
+ <option value="$type.name">$type.name</option>
+ #end
+ </select>
+ </td>
+ <td style="min-width: 50px"> </td>
+ <td class="NormalB">
+ <input type="text" name="ouNameTB" id="ouNameTB" style="min-width:325px" readonly="readonly">
+ </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td style="min-width: 50px"> </td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td style="min-width: 50px"> </td>
+ <td> </td>
+ </tr>
+ <tr>
+ <th>$i18n.getString( "available_periods" )</th>
+ <td style="min-width: 50px"> </td>
+ <th>$i18n.getString( "datasets" )</th>
+ </tr>
+ <tr>
+ <td valign="top">
+ <select id="periodIds" name="periodIds" style="min-width:325px; max-height: 100px;" disabled="true" multiple="multiple">
+ </select>
+ </td>
+ <td style="min-width: 50px"> </td>
+ <td valign="top">
+ <select id="dataSets" name="dataSets" style="min-width:325px">
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td style="min-width: 50px"> </td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td style="min-width: 50px"> </td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td style="min-width: 50px"> </td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td style="min-width: 50px"> </td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>
+ <input type="submit" id= "generate" name="generate" value="Generate Report" disabled>
+ </td>
+ <td style="min-width: 50px"> </td>
+ <td> </td>
+ </tr>
+ </table>
+
+ <input type="hidden" name="autogen" id="autogen" value="0" >
+ <input type="hidden" name="ouIDTB" id="ouIDTB">
+
+ </form>
+</body>