=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2011-10-12 12:42:13 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2011-10-27 12:08:07 +0000 @@ -233,7 +233,6 @@ executeSql( "ALTER TABLE reporttable DROP COLUMN last3months" ); executeSql( "ALTER TABLE reporttable DROP COLUMN last6months" ); executeSql( "ALTER TABLE reporttable DROP COLUMN last9months" ); - executeSql( "ALTER TABLE reporttable DROP COLUMN last12months" ); executeSql( "ALTER TABLE reporttable DROP COLUMN sofarthisyear" ); executeSql( "ALTER TABLE reporttable DROP COLUMN sofarthisfinancialyear" ); executeSql( "ALTER TABLE reporttable DROP COLUMN last3to6months" ); === modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java' --- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java 2011-10-22 08:41:00 +0000 +++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java 2011-10-27 12:46:11 +0000 @@ -260,21 +260,19 @@ clock.logTime( "Dropped potential indexes" ); // --------------------------------------------------------------------- - // Delete existing aggregated data + // Delete existing aggregated datavalues // --------------------------------------------------------------------- if ( completeExport ) { aggregatedDataValueService.deleteAggregatedDataValues( periodIds ); - aggregatedDataValueService.deleteAggregatedIndicatorValues( periodIds ); } else { aggregatedDataValueService.deleteAggregatedDataValues( dataElementIds, periodIds, organisationUnitIds ); - aggregatedDataValueService.deleteAggregatedIndicatorValues( indicatorIds, periodIds, organisationUnitIds ); } - clock.logTime( "Deleted existing aggregated data" ); + clock.logTime( "Deleted existing aggregated datavalues" ); // --------------------------------------------------------------------- // Export data element values @@ -305,6 +303,21 @@ crossTabService.dropCrossTabTable( key ); clock.logTime( "Dropped crosstab table" ); + + // --------------------------------------------------------------------- + // Delete existing aggregated indicatorvalues + // --------------------------------------------------------------------- + + if ( completeExport ) + { + aggregatedDataValueService.deleteAggregatedIndicatorValues( periodIds ); + } + else + { + aggregatedDataValueService.deleteAggregatedIndicatorValues( indicatorIds, periodIds, organisationUnitIds ); + } + + clock.logTime( "Deleted existing aggregated indicatorvalues" ); // --------------------------------------------------------------------- // Export indicator values === modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml' --- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml 2011-09-16 09:29:21 +0000 +++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml 2011-10-27 12:08:07 +0000 @@ -78,6 +78,9 @@ + + + === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js 2011-10-06 15:39:08 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js 2011-10-27 12:08:07 +0000 @@ -1394,7 +1394,10 @@ isChecked( "thisYear" ) || isChecked( "monthsLastYear" ) || isChecked( "quartersLastYear" ) || - isChecked( "lastYear" ) ) + isChecked( "lastYear" ) || + isChecked( "last5Years" ) || + isChecked( "last12Months" ) || + isChecked( "last4Quarters" ) ) { return true; } === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/SaveTableAction.java' --- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/SaveTableAction.java 2011-10-23 12:03:50 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/SaveTableAction.java 2011-10-27 12:08:07 +0000 @@ -270,12 +270,33 @@ this.quartersLastYear = quartersLastYear; } + private boolean last5years; + + public void setLast5years( boolean last5years ) + { + this.last5years = last5years; + } + private boolean lastYear; public void setLastYear( boolean lastYear ) { this.lastYear = lastYear; } + + private boolean last12Months; + + public void setLast12Months( boolean last12Months ) + { + this.last12Months = last12Months; + } + + private boolean last4Quarters; + + public void setLast4Quarters( boolean last4Quarters ) + { + this.last4Quarters = last4Quarters; + } private boolean paramReportingMonth; @@ -364,7 +385,8 @@ RelativePeriods relatives = new RelativePeriods( reportingMonth, reportingBimonth, reportingQuarter, monthsThisYear, quartersThisYear, thisYear, - monthsLastYear, quartersLastYear, lastYear, false, false, false ); + monthsLastYear, quartersLastYear, lastYear, + last5years, last12Months, last4Quarters ); ReportParams reportParams = new ReportParams(); === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties 2011-10-20 11:23:55 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties 2011-10-27 12:08:07 +0000 @@ -401,4 +401,7 @@ reporting_bimonth = Reporting bimonth reporting_quarter = Reporting quarter include_organisation_unit_group_sets = Include org unit group sets param -reporting_period = Reporting period \ No newline at end of file +reporting_period = Reporting period +last_5_years = Last 5 years +last_12_months = Last 12 months +last_4_quarters = Last 4 quarters \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addTableForm.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addTableForm.vm 2011-09-16 09:29:21 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addTableForm.vm 2011-10-27 12:08:07 +0000 @@ -426,7 +426,14 @@ $i18n.getString( "quarters_last_year" ) $i18n.getString( "last_year" ) - + + + $i18n.getString( "last_5_years" ) + + $i18n.getString( "last_12_months" ) + + $i18n.getString( "last_4_quarters" ) + @@ -449,11 +456,8 @@ $i18n.getString( "leaf_parent_organisation_unit" ) $i18n.getString( "grand_parent_organisation_unit" ) - - - - - + + $i18n.getString( "parent_organisation_unit" ) $i18n.getString( "organisation_unit" )