dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #09414
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2491: Added method to AggregatedDataValueService to get aggregatedvalue for list of periods; Sorted Orgu...
------------------------------------------------------------
revno: 2491
committer: Bharath <chbharathk@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2011-01-08 11:28:26 +0530
message:
Added method to AggregatedDataValueService to get aggregatedvalue for list of periods;Sorted OrgunitTree by name;Changed accordingly in orgunitprogress reports
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValueService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValueStore.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/aggregation/DefaultAggregatedDataValueService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/aggregation/jdbc/JdbcAggregatedDataValueStore.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java
local/in/dhis-in-api/src/main/java/org/hisp/dhis/reports/ReportService.java
local/in/dhis-in-services/dhis-in-service-reports/src/main/java/org/hisp/dhis/reports/DefaultReportService.java
local/in/dhis-in-services/dhis-in-service-reports/src/main/resources/META-INF/dhis/beans.xml
local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/linelisting/action/GenerateLinelistingReportAnalyserFormAction.java
local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/meta/action/GenerateMetaDataReportResultAction.java
local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/ouwiseprogress/action/GenerateOuWiseProgressReportResultAction.java
local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml
local/in/dhis-web-reports-national/src/main/resources/org/hisp/dhis/reports/i18n_module.properties
local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/linelstingReportAnalyserFront.vm
local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForLineListingReport.vm
local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/ouWiseProgressReportFront.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-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValueService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValueService.java 2011-01-08 01:23:07 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValueService.java 2011-01-08 05:58:26 +0000
@@ -76,6 +76,18 @@
Double getAggregatedValue( DataElement dataElement, DataElementCategoryOptionCombo categoryOptionCombo, Period period, OrganisationUnit organisationUnit );
/**
+ * Gets the aggregated value from the datamart table for the given parameters.
+ *
+ * @param dataElement The DataElement identifier.
+ * @param categoryOptionCombo The DataElementCategoryOptionCombo identifier.
+ * @param periods The collection of Periods.
+ * @param organisationUnit The OrganisationUnit identifier.
+ * @return the aggregated value.
+ */
+ Double getAggregatedValue( int dataElement, int categoryOptionCombo, String periodIds, int organisationUnit );
+
+
+ /**
* Gets a collection of AggregatedDataValues.
*
* @param dataElementId the DataElement identifier.
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValueStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValueStore.java 2011-01-08 01:23:07 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValueStore.java 2011-01-08 05:58:26 +0000
@@ -53,6 +53,17 @@
Double getAggregatedDataValue( DataElement dataElement, DimensionOption dimensionOption, Period period, OrganisationUnit organisationUnit );
/**
+ * Gets the aggregated value from the datamart table for the given parameters.
+ *
+ * @param dataElement The DataElement identifier.
+ * @param categoryOptionCombo The DataElementCategoryOptionCombo identifier.
+ * @param periods The collection of Periods.
+ * @param organisationUnit The OrganisationUnit identifier.
+ * @return the aggregated value.
+ */
+ Double getAggregatedDataValue( int dataElement, int categoryOptionCombo, String periodIds, int organisationUnit );
+
+ /**
* Gets a collection of AggregatedDataValues.
*
* @param dataElementId the DataElement identifier.
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/aggregation/DefaultAggregatedDataValueService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/aggregation/DefaultAggregatedDataValueService.java 2011-01-08 01:23:07 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/aggregation/DefaultAggregatedDataValueService.java 2011-01-08 05:58:26 +0000
@@ -53,6 +53,11 @@
return aggregatedDataValueStore.getAggregatedDataValue( dataElement.getId(), categoryOptionCombo.getId(), period.getId(), organisationUnit.getId() );
}
+ public Double getAggregatedValue( int dataElement, int categoryOptionCombo, String periodIds, int organisationUnit )
+ {
+ return aggregatedDataValueStore.getAggregatedDataValue( dataElement, categoryOptionCombo, periodIds, organisationUnit );
+ }
+
public Double getAggregatedValue( DataElement dataElement, DimensionOption dimensionOption, Period period, OrganisationUnit organisationUnit )
{
return aggregatedDataValueStore.getAggregatedDataValue( dataElement, dimensionOption, period, organisationUnit );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/aggregation/jdbc/JdbcAggregatedDataValueStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/aggregation/jdbc/JdbcAggregatedDataValueStore.java 2011-01-08 01:23:07 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/aggregation/jdbc/JdbcAggregatedDataValueStore.java 2011-01-08 05:58:26 +0000
@@ -90,6 +90,21 @@
return statementManager.getHolder().queryForDouble( sql );
}
+ public Double getAggregatedDataValue( int dataElement, int categoryOptionCombo, String periodIds, int organisationUnit )
+ {
+ //String periidIds = getCommaDelimitedString( getIdentifiers( Period.class, periods ) );
+
+ final String sql =
+ "SELECT SUM(value) " +
+ "FROM aggregateddatavalue " +
+ "WHERE dataelementid = " + dataElement + " " +
+ "AND categoryoptioncomboid = " + categoryOptionCombo + " " +
+ "AND periodid IN ( " + periodIds + " ) " +
+ "AND organisationunitid = " + organisationUnit;
+
+ return statementManager.getHolder().queryForDouble( sql );
+ }
+
public Double getAggregatedDataValue( DataElement dataElement, DimensionOption dimensionOption, Period period, OrganisationUnit organisationUnit )
{
if ( dimensionOption.getDimensionType().equals( DimensionType.CATEGORY ) )
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java 2010-12-13 17:03:08 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java 2011-01-08 05:58:26 +0000
@@ -41,6 +41,7 @@
import org.apache.log4j.Logger;
import org.hisp.dhis.hierarchy.HierarchyViolationException;
import org.hisp.dhis.organisationunit.comparator.OrganisationUnitLevelComparator;
+import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
import org.hisp.dhis.source.Source;
import org.hisp.dhis.source.SourceStore;
import org.hisp.dhis.system.util.AuditLogLevel;
@@ -229,7 +230,10 @@
level++;
}
- for ( OrganisationUnit child : parent.getChildren() )
+ List<OrganisationUnit> childList = new ArrayList<OrganisationUnit>( parent.getChildren() );
+ Collections.sort( childList, new OrganisationUnitNameComparator() );
+
+ for ( OrganisationUnit child : childList )
{
child.setLevel( level );
=== modified file 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/reports/ReportService.java'
--- local/in/dhis-in-api/src/main/java/org/hisp/dhis/reports/ReportService.java 2011-01-05 05:31:43 +0000
+++ local/in/dhis-in-api/src/main/java/org/hisp/dhis/reports/ReportService.java 2011-01-08 05:58:26 +0000
@@ -122,4 +122,6 @@
List<OrganisationUnit> getDataNotSentOrgUnits( DataSet dataSet, Period period, OrganisationUnit rootOrgunit );
String getResultSurveyValue( String formula, OrganisationUnit organisationUnit );
+
+ String getResultDataValueFromAggregateTable( String formula, String periodIds, OrganisationUnit organisationUnit , String reportModelTB );
}
=== modified file 'local/in/dhis-in-services/dhis-in-service-reports/src/main/java/org/hisp/dhis/reports/DefaultReportService.java'
--- local/in/dhis-in-services/dhis-in-service-reports/src/main/java/org/hisp/dhis/reports/DefaultReportService.java 2011-01-05 05:31:43 +0000
+++ local/in/dhis-in-services/dhis-in-service-reports/src/main/java/org/hisp/dhis/reports/DefaultReportService.java 2011-01-08 05:58:26 +0000
@@ -14,6 +14,7 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
+import org.hisp.dhis.aggregation.AggregatedDataValueService;
import org.hisp.dhis.aggregation.AggregationService;
import org.hisp.dhis.config.ConfigurationService;
import org.hisp.dhis.config.Configuration_IN;
@@ -148,6 +149,13 @@
this.surveyDataValueService = surveyDataValueService;
}
+ private AggregatedDataValueService aggregatedDataValueService;
+
+ public void setAggregatedDataValueService( AggregatedDataValueService aggregatedDataValueService )
+ {
+ this.aggregatedDataValueService = aggregatedDataValueService;
+ }
+
// -------------------------------------------------------------------------
// Report_in
// -------------------------------------------------------------------------
@@ -1607,13 +1615,13 @@
}
// -------------------------------------------------------------------------
- // Get Aggregated Result for dataelement expression from ReportTable
+ // Get Aggregated Result for dataelement expression from Aggregated Table
// -------------------------------------------------------------------------
- public String getResultDataValueFromReportTable( String formula, Date startDate, Date endDate, OrganisationUnit organisationUnit , String reportModelTB )
+ public String getResultDataValueFromAggregateTable( String formula, String periodIds, OrganisationUnit organisationUnit , String reportModelTB )
{
int deFlag1 = 0;
int isAggregated = 0;
-
+
try
{
Pattern pattern = Pattern.compile( "(\\[\\d+\\.\\d+\\])" );
@@ -1647,8 +1655,26 @@
}
if ( dataElement.getType().equalsIgnoreCase( "int" ) )
{
- Double aggregatedValue = aggregationService.getAggregatedDataValue( dataElement, optionCombo,
- startDate, endDate, organisationUnit );
+ //PeriodType dePeriodType = getDataElementPeriodType( dataElement );
+ //List<Period> periodList = new ArrayList<Period>( periodService.getPeriodsBetweenDates( dePeriodType, startDate, endDate ) );
+ //List<Period> periodList = new ArrayList<Period>( periodService.getPeriodsBetweenDates( startDate, endDate ) );
+
+ Double aggregatedValue = aggregatedDataValueService.getAggregatedValue( dataElement.getId(), optionCombo.getId(), periodIds, organisationUnit.getId() );
+
+ /*
+ for( Period period : periodList )
+ {
+ Double tempAggValue = aggregatedDataValueService.getAggregatedValue( dataElement, optionCombo, period, organisationUnit );
+ if( tempAggValue != null )
+ {
+ aggregatedValue += tempAggValue;
+ isAggregated = 1;
+ }
+ }
+
+ replaceString = String.valueOf( aggregatedValue );
+ */
+
if ( aggregatedValue == null )
{
replaceString = NULL_REPLACEMENT;
@@ -1659,24 +1685,33 @@
isAggregated = 1;
}
+
}
else
{
deFlag1 = 1;
- PeriodType dePeriodType = getDataElementPeriodType( dataElement );
+ //PeriodType dePeriodType = getDataElementPeriodType( dataElement );
//List<Period> periodList = new ArrayList<Period>( periodService.getIntersectingPeriodsByPeriodType( dePeriodType, startDate, endDate ) );
- List<Period> periodList = new ArrayList<Period>( periodService.getPeriodsBetweenDates( dePeriodType, startDate, endDate ) );
+ //periodList = new ArrayList<Period>( periodService.getPeriodsBetweenDates( dePeriodType, startDate, endDate ) );
+ //Period tempPeriod = new Period();
+
+
Period tempPeriod = new Period();
- if ( periodList == null || periodList.isEmpty() )
+ tempPeriod = periodService.getPeriod( Integer.parseInt( periodIds.split( "," )[0] ) );
+
+ //if ( periodList == null || periodList.isEmpty() )
+ if ( tempPeriod == null )
{
replaceString = "";
matcher.appendReplacement( buffer, replaceString );
continue;
}
+ /*
else
{
tempPeriod = (Period) periodList.get( 0 );
}
+ */
DataValue dataValue = dataValueService.getDataValue( organisationUnit, dataElement, tempPeriod,
optionCombo );
@@ -1766,14 +1801,4 @@
}
}
- Double getAggregatedDataValueFromReportTable( DataElement dataElement, DataElementCategoryOptionCombo optionCombo, Date startDate, Date endDate, OrganisationUnit organisationUnit )
- {
- Double aggValue = null;
- List<Period> periodList = new ArrayList<Period>( periodService.getPeriodsBetweenDates( startDate, endDate ) );
- Period tempPeriod = new Period();
-
-
-
- return aggValue;
- }
}
=== modified file 'local/in/dhis-in-services/dhis-in-service-reports/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-in-services/dhis-in-service-reports/src/main/resources/META-INF/dhis/beans.xml 2011-01-05 05:31:43 +0000
+++ local/in/dhis-in-services/dhis-in-service-reports/src/main/resources/META-INF/dhis/beans.xml 2011-01-08 05:58:26 +0000
@@ -29,6 +29,7 @@
<property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
<property name="surveyService" ref="org.hisp.dhis.survey.SurveyService" />
<property name="surveyDataValueService" ref="org.hisp.dhis.surveydatavalue.SurveyDataValueService" />
+ <property name="aggregatedDataValueService" ref="org.hisp.dhis.aggregation.AggregatedDataValueService" />
</bean>
<!-- DeletionHandlers -->
=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/linelisting/action/GenerateLinelistingReportAnalyserFormAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/linelisting/action/GenerateLinelistingReportAnalyserFormAction.java 2010-08-28 10:15:38 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/linelisting/action/GenerateLinelistingReportAnalyserFormAction.java 2011-01-08 05:58:26 +0000
@@ -70,8 +70,8 @@
public String execute()
throws Exception
{
-
reportTypeName = ReportType.RT_LINELIST;
+
/* Monthly Periods */
monthlyPeriodType = new MonthlyPeriodType();
@@ -87,6 +87,7 @@
}
}
+
Collections.sort( monthlyPeriods, new PeriodComparator() );
simpleDateFormat = new SimpleDateFormat( "MMM-yyyy" );
=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/meta/action/GenerateMetaDataReportResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/meta/action/GenerateMetaDataReportResultAction.java 2011-01-05 05:31:43 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/meta/action/GenerateMetaDataReportResultAction.java 2011-01-08 05:58:26 +0000
@@ -189,13 +189,6 @@
this.incID = incID;
}
- private List<OrganisationUnit> orgUnitList;
-
- public List<OrganisationUnit> getOrgUnitList()
- {
- return orgUnitList;
- }
-
private String raFolderName;
// -------------------------------------------------------------------------
@@ -943,9 +936,10 @@
throws Exception
{
OrganisationUnit rootOrgUnit = organisationUnitService.getRootOrganisationUnits().iterator().next();
- OrganisationUnitHierarchy organisationUnitHierarchy = organisationUnitService.getOrganisationUnitHierarchy();
+ //OrganisationUnitHierarchy organisationUnitHierarchy = organisationUnitService.getOrganisationUnitHierarchy();
//organisationUnitHierarchy.
+
//List<OrganisationUnit> OrganisitionUnitList = new ArrayList<OrganisationUnit>( getChildOrgUnitTree( rootOrgUnit ) );
List<OrganisationUnit> OrganisitionUnitList = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitWithChildren( rootOrgUnit.getId() ) );
=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/ouwiseprogress/action/GenerateOuWiseProgressReportResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/ouwiseprogress/action/GenerateOuWiseProgressReportResultAction.java 2011-01-05 05:31:43 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/ouwiseprogress/action/GenerateOuWiseProgressReportResultAction.java 2011-01-08 05:58:26 +0000
@@ -1,6 +1,9 @@
package org.hisp.dhis.reports.ouwiseprogress.action;
+import static org.hisp.dhis.system.util.ConversionUtils.getIdentifiers;
+import static org.hisp.dhis.system.util.TextUtils.getCommaDelimitedString;
+
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
@@ -17,7 +20,6 @@
import jxl.format.Alignment;
import jxl.format.Border;
import jxl.format.BorderLineStyle;
-import jxl.write.Blank;
import jxl.write.Label;
import jxl.write.Number;
import jxl.write.WritableCellFormat;
@@ -30,6 +32,8 @@
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.organisationunit.comparator.OrganisationUnitShortNameComparator;
+import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodService;
import org.hisp.dhis.reports.ReportService;
import org.hisp.dhis.reports.Report_in;
import org.hisp.dhis.reports.Report_inDesign;
@@ -56,6 +60,13 @@
this.reportService = reportService;
}
+ private PeriodService periodService;
+
+ public void setPeriodService( PeriodService periodService )
+ {
+ this.periodService = periodService;
+ }
+
private OrganisationUnitService organisationUnitService;
public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
@@ -116,6 +127,13 @@
this.ouIDTB = ouIDTB;
}
+ private String aggRadio;
+
+ public void setAggRadio( String aggRadio )
+ {
+ this.aggRadio = aggRadio;
+ }
+
private OrganisationUnit selectedOrgUnit;
private List<OrganisationUnit> orgUnitList;
@@ -143,7 +161,7 @@
// Initialization
raFolderName = reportService.getRAFolderName();
- simpleDateFormat = new SimpleDateFormat( "MMM-dd" );
+ simpleDateFormat = new SimpleDateFormat( "MMM-yy" );
SimpleDateFormat dayFormat = new SimpleDateFormat( "yyyy-MM-dd" );
// Getting Report Details
@@ -178,6 +196,10 @@
// Period Info
sDate = format.parseDate( startDate );
eDate = format.parseDate( endDate );
+
+ List<Period> periodList = new ArrayList<Period>( periodService.getPeriodsBetweenDates( sDate, eDate ) );
+
+ String periodids = getCommaDelimitedString( getIdentifiers(Period.class, periodList ));
// Getting DataValues
List<Report_inDesign> reportDesignList = reportService.getReportDesign( deCodesXMLFileName );
@@ -234,7 +256,14 @@
{
if ( sType.equalsIgnoreCase( "dataelement" ) )
{
- tempStr = reportService.getResultDataValue( deCodeString, sDate, eDate, currentOrgUnit, reportModelTB );
+ if( aggRadio.equalsIgnoreCase( "generateaggdata" ) )
+ {
+ tempStr = reportService.getResultDataValue( deCodeString, sDate, eDate, currentOrgUnit, reportModelTB );
+ }
+ else
+ {
+ tempStr = reportService.getResultDataValueFromAggregateTable( deCodeString, periodids, currentOrgUnit, reportModelTB );
+ }
}
}
@@ -270,8 +299,6 @@
wCellformat.setAlignment( Alignment.CENTRE );
wCellformat.setWrap( true );
- System.out.println( tempColNo + " : " + tempRowNo + " : " + tempStr );
-
try
{
sheet0.addCell( new Number( tempColNo, tempRowNo, Double.parseDouble( tempStr ), wCellformat ) );
=== modified file 'local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml 2011-01-05 05:31:43 +0000
+++ local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml 2011-01-08 05:58:26 +0000
@@ -450,6 +450,7 @@
<property name="statementManager" ref="statementManager" />
<property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
<property name="reportService" ref="org.hisp.dhis.reports.ReportService" />
+ <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
</bean>
<!-- Meta Data Reports -->
=== modified file 'local/in/dhis-web-reports-national/src/main/resources/org/hisp/dhis/reports/i18n_module.properties'
--- local/in/dhis-web-reports-national/src/main/resources/org/hisp/dhis/reports/i18n_module.properties 2011-01-05 05:31:43 +0000
+++ local/in/dhis-web-reports-national/src/main/resources/org/hisp/dhis/reports/i18n_module.properties 2011-01-08 05:58:26 +0000
@@ -14,6 +14,8 @@
selected_only = Selected Only
orgunitgrouptype = OrgUnitGroupType
year = Year
+use_existing_agg_data = Use Existing Aggregated Data
+generate_agg_data = Generate Aggregate Data
please_select_an_orgUnit= Please select an OrganisationUnit.
please_select_a_dataset= Please select a dataset.
=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/linelstingReportAnalyserFront.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/linelstingReportAnalyserFront.vm 2010-08-28 10:15:38 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/linelstingReportAnalyserFront.vm 2011-01-08 05:58:26 +0000
@@ -1,32 +1,26 @@
-
+
<script>
- //Global Variables
-
- var reportModels = new HashTable();
- var reportFileNames = new HashTable();
-
+
function formValidations()
- {
+ {
var reportListIndex = document.reportForm.reportList.selectedIndex;
var periodIndex = document.reportForm.availablePeriods.selectedIndex;
var orgunitIdValue = document.reportForm.ouIDTB.value;
-
- if(reportListIndex < 0 || document.reportForm.reportList.options[reportListIndex].text == null) {alert("Please Select Report"); return false;}
- else if(document.reportForm.availablePeriods.options[periodIndex].text == null || document.reportForm.availablePeriods.options[periodIndex].text== "") {alert("Please Select Period"); return false;}
- else if(orgunitIdValue == null || orgunitIdValue=="" || orgunitIdValue==" ") {alert("Please Select OrganisationUnit"); 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);
+
+ if( reportListIndex < 0 || document.reportForm.reportList.options[reportListIndex].text == null ) {alert("Please Select Report"); return false;}
+ else if( document.reportForm.availablePeriods.options[periodIndex].text == null || document.reportForm.availablePeriods.options[periodIndex].text== "" ) {alert("Please Select Period"); return false;}
+ else if( orgunitIdValue == null || orgunitIdValue=="" || orgunitIdValue==" " ) {alert("Please Select OrganisationUnit"); return false;}
return true;
- }
+ }
+
</script>
<h1>Linelisting Report Analyser</h1>
-<hr />
-<br />
-<form id="reportForm" name="reportForm" action="generateLinelistingReport.action" method="post" onsubmit="return formValidations()" target="_blank">
- <table align="center" style=" border-collapse: collapse; margin-top: 0;" cellpadding="0" cellspacing="0" width="730" border=0>
+<hr /><br />
+
+<form id="reportForm" name="reportForm" action="generateLinelistingReport.action" method="post" onsubmit="return formValidations()" target="_blank">
+ <table align="center" style=" border-collapse: collapse; margin-top: 0;" cellpadding="0" cellspacing="0" width="730" border=0>
<tr>
<td class="NormalB">
<select id="periodTypeId" name="periodTypeId" style="width:200px; display:none">
@@ -51,11 +45,11 @@
<tr>
<td> </td>
<td> </td>
- </tr>
+ </tr>
<tr>
<td class="NormalB">
OrganisationUnit : <br />
- <input type="text" name="ouNameTB" id="ouNameTB" size="20" disabled>
+ <input type="text" name="ouNameTB" id="ouNameTB" size="20" disabled>
</td>
<td class="NormalB">
<input type="submit" name="generate" value='Generate Report'/>
@@ -67,10 +61,7 @@
<input type="hidden" name="ouIDTB" id="ouIDTB">
<input type="hidden" name="ouLevelTB" id="ouLevelTB">
<input type="hidden" name="autogen" id="autogen" value="0" >
- <!-- <input type="hidden" name="reportModelTB" id="reportModelTB">
- <input type="hidden" name="reportFileNameTB" id="reportFileNameTB">
- <input type="hidden" name="reportListFileNameTB" id="reportListFileNameTB" value="linelistingReportsList.xml"> -->
- <input type="hidden" name="reportTypeNameTB" id="reportTypeNameTB" value="$reportTypeName">
+ <input type="hidden" name="reportTypeNameTB" id="reportTypeNameTB" value="$reportTypeName">
</td>
</tr>
</table>
=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForLineListingReport.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForLineListingReport.vm 2010-08-28 10:15:38 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForLineListingReport.vm 2011-01-08 05:58:26 +0000
@@ -7,28 +7,28 @@
</li>
</ul>
</ul>
+
<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
- <a href="index.action">
- <img src="images/goback.png" width="36" height="30" alt="$i18n.getString( "go_back" )"></a>
+ <a href="index.action"><img src="images/goback.png" width="36" height="30" alt="$i18n.getString( "go_back" )"></a>
</div>
+
#parse( "/dhis-web-commons/ouwt/orgunittree.vm" )
<!-- The script that registeres selctions in the orgunit tree -->
<script type="text/javascript">
-function orgUnitHasBeenSelected( orgUnitIds )
-{
- document.reportForm.ouIDTB.value = orgUnitIds;
-
- reportTypeName = document.reportForm.reportTypeNameTB.value;
-
- if(orgUnitIds != null && orgUnitIds != "" )
+ function orgUnitHasBeenSelected( orgUnitIds )
{
- getReports(orgUnitIds, reportTypeName)
+ document.reportForm.ouIDTB.value = orgUnitIds;
+
+ reportTypeName = document.reportForm.reportTypeNameTB.value;
+
+ if(orgUnitIds != null && orgUnitIds != "" )
+ {
+ getReports(orgUnitIds, reportTypeName);
+ }
}
-}
-selection.setListenerFunction( orgUnitHasBeenSelected );
+ selection.setListenerFunction( orgUnitHasBeenSelected );
</script>
-
=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/ouWiseProgressReportFront.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/ouWiseProgressReportFront.vm 2010-12-31 07:16:18 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/ouWiseProgressReportFront.vm 2011-01-08 05:58:26 +0000
@@ -78,10 +78,6 @@
</td>
<td> </td>
</tr>
- <tr>
- <td> </td>
- <td> </td>
- </tr>
<tr>
<td> </td>
<td> </td>
@@ -89,10 +85,16 @@
<tr>
<td> </td>
<td>
+ <input type="radio" id="aggRadio" name="aggRadio" value="useexistingaggdata" checked >
+ $i18n.getString( "use_existing_agg_data" )
+ <br/>
+ <input type="radio" id="aggRadio" name="aggRadio" value="generateaggdata" >
+ $i18n.getString( "generate_agg_data" )
+ <br/><br/>
<input type="submit" name="generate" style="width:200px" value="$i18n.getString( 'generate_report' )"/>
- <input type="hidden" name="ouIDTB" id="ouIDTB">
- <input type="hidden" name="autogen" id="autogen" value="0" >
- <input type="hidden" name="reportTypeNameTB" id="reportTypeNameTB" value="$reportTypeName">
+ <input type="hidden" name="ouIDTB" id="ouIDTB" />
+ <input type="hidden" name="autogen" id="autogen" value="0" />
+ <input type="hidden" name="reportTypeNameTB" id="reportTypeNameTB" value="$reportTypeName" />
</td>
</tr>
</table>