=== added file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/advance/action/SelectAdvancedExportFormAction.java' --- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/advance/action/SelectAdvancedExportFormAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/export/advance/action/SelectAdvancedExportFormAction.java 2009-10-09 06:06:43 +0000 @@ -0,0 +1,121 @@ +package org.hisp.dhis.reportexcel.export.advance.action; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.List; + +import org.hisp.dhis.organisationunit.OrganisationUnitGroup; +import org.hisp.dhis.organisationunit.OrganisationUnitGroupService; +import org.hisp.dhis.organisationunit.comparator.OrganisationUnitGroupNameComparator; +import org.hisp.dhis.period.MonthlyPeriodType; +import org.hisp.dhis.period.Period; +import org.hisp.dhis.period.PeriodService; +import org.hisp.dhis.period.PeriodType; +import org.hisp.dhis.period.comparator.PeriodComparator; +import org.hisp.dhis.report.ReportService; +import org.hisp.dhis.reportexcel.ReportExcelService; +import org.hisp.dhis.reportexcel.export.action.SelectionManager; +import org.hisp.dhis.reportexcel.utils.DateUtils; + +import com.opensymphony.xwork2.Action; + +public class SelectAdvancedExportFormAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private OrganisationUnitGroupService organisationUnitGroupService; + + private PeriodService periodService; + + private SelectionManager selectionManager; + + private ReportExcelService reportService; + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private List organisationUnitGroups = new ArrayList(); + + private List periods; + + private List reportGroups; + + // ------------------------------------------------------------------------- + // Getters && Setters + // ------------------------------------------------------------------------- + + public void setReportService( ReportExcelService reportService ) + { + this.reportService = reportService; + } + + public List getOrganisationUnitGroups() + { + return organisationUnitGroups; + } + + public void setOrganisationUnitGroupService( OrganisationUnitGroupService organisationUnitGroupService ) + { + this.organisationUnitGroupService = organisationUnitGroupService; + } + + public List getPeriods() + { + return periods; + } + + public void setPeriodService( PeriodService periodService ) + { + this.periodService = periodService; + } + + public void setSelectionManager( SelectionManager selectionManager ) + { + this.selectionManager = selectionManager; + } + + public List getReportGroups() + { + return reportGroups; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + + public String execute() + throws Exception + { + // Report groups list + reportGroups = new ArrayList( reportService.getReportExcelGroups() ); + + // Periods list + PeriodType periodType = periodService.getPeriodTypeByClass( MonthlyPeriodType.class ); + + Date firstDateOfThisYear = DateUtils.getFirstDayOfYear( DateUtils.getCurrentYear() ); + + Date endDateOfThisMonth = DateUtils.getEndDate( DateUtils.getCurrentMonth(), DateUtils.getCurrentYear() ); + + periods = new ArrayList( periodService.getIntersectingPeriodsByPeriodType( periodType, + firstDateOfThisYear, endDateOfThisMonth ) ); + + Collections.sort( periods, new PeriodComparator() ); + + selectionManager.setSeletedYear( DateUtils.getCurrentYear() ); + + // Organisation groups list + organisationUnitGroups = new ArrayList( organisationUnitGroupService + .getAllOrganisationUnitGroups() ); + + Collections.sort( organisationUnitGroups, new OrganisationUnitGroupNameComparator() ); + + return SUCCESS; + } + +} === modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml 2009-10-09 01:47:46 +0000 +++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/resources/META-INF/dhis/beans.xml 2009-10-09 06:06:43 +0000 @@ -686,12 +686,21 @@ + + + + + + + + + - - - /dhis-web-excel-reporting/responseOrganisationUnitGroupObjects.vm - - - /dhis-web-excel-reporting/responseError.vm - - + + /main.vm + /dhis-web-excel-reporting/advancedReport.vm + /dhis-web-excel-reporting/menu.vm + 250 + ../dhis-web-commons/ouwt/ouwt.js,javascript/export.js,javascript/commons.js,javascript/preview.js + + @@ -678,10 +678,10 @@ - /main.vm - /dhis-web-excel-reporting/individualReportExcel.vm - /dhis-web-excel-reporting/menuWithTree.vm - 220 + /main.vm + /dhis-web-excel-reporting/individualReportExcel.vm + /dhis-web-excel-reporting/menuWithTree.vm + 220 javascript/individual.js, javascript/commons.js, ../dhis-web-commons/ouwt/ouwt.js, @@ -705,11 +705,11 @@ /dhis-web-excel-reporting/responseSuccess.vm - - - /dhis-web-excel-reporting/responseSuccess.vm - + + + /dhis-web-excel-reporting/responseSuccess.vm + === added file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/advancedReport.vm' --- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/advancedReport.vm 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/advancedReport.vm 2009-10-09 06:06:43 +0000 @@ -0,0 +1,70 @@ +

$i18n.getString( "generate_report" )

+ + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
$i18n.getString('choose_orgunit_group')*
+
+ +
+
+ +
+ + + + +
+
+

+ +

+ + + + \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/export.js' --- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/export.js 2009-10-07 05:38:43 +0000 +++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/export.js 2009-10-09 06:06:43 +0000 @@ -50,11 +50,11 @@ function generateReportExcel() { - if(byId('advancedCheck').checked){ - - generateAdvancedReportExcel(); - - }else{ + //if(byId('advancedCheck').checked){ + + //generateAdvancedReportExcel(); + + //}else{ $("#loading").showAtCenter( true ); $.post("generateReportExcel.action",{ reportId:$('#report').val(), @@ -64,7 +64,7 @@ deleteDivEffect(); $("#loading").hide(); },'xml'); - } + //} } function generateAdvancedReportExcel() { @@ -82,40 +82,6 @@ } -function openGenerateAdvance() { - - if(byId('advancedCheck').checked) - { - var availableList = byId('availableOrgunitGroups'); - - if(availableList.options.length == 0){ - - $.get("organisationUnitGroupList.action", - {}, - function (data){ - - var xmlObject = data.getElementsByTagName('organisationUnitGroups')[0]; - var availableObjectList = xmlObject.getElementsByTagName('organisationUnitGroup'); - - for(var i=0;i$i18n.getString( "generate_report" )