=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/ReportSelectAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/ReportSelectAction.java 2011-07-15 08:07:54 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/ReportSelectAction.java 2012-02-25 12:24:41 +0000 @@ -27,7 +27,12 @@ package org.hisp.dhis.caseentry.action.report; +import java.util.Collection; + +import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager; +import org.hisp.dhis.program.Program; +import org.hisp.dhis.program.ProgramService; import com.opensymphony.xwork2.Action; @@ -41,7 +46,7 @@ // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- - + private OrganisationUnitSelectionManager selectionManager; public void setSelectionManager( OrganisationUnitSelectionManager selectionManager ) @@ -49,13 +54,42 @@ this.selectionManager = selectionManager; } + private ProgramService programService; + + public void setProgramService( ProgramService programService ) + { + this.programService = programService; + } + + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private OrganisationUnit orgunit; + + public OrganisationUnit getOrgunit() + { + return orgunit; + } + + private Collection programs; + + public Collection getPrograms() + { + return programs; + } + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- public String execute() { - selectionManager.clearSelectedOrganisationUnits(); + orgunit = selectionManager.getSelectedOrganisationUnit(); + + programs = programService.getPrograms( orgunit ); + + programs.retainAll( programService.getPrograms( true, false ) ); return SUCCESS; } === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-02-11 13:58:02 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-02-25 12:24:41 +0000 @@ -234,6 +234,8 @@ scope="prototype"> + - + - + @@ -47,7 +51,7 @@ - +