=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetOrganisationUnitsAction.java' --- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetOrganisationUnitsAction.java 2011-10-14 09:32:58 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetOrganisationUnitsAction.java 2011-10-24 11:36:21 +0000 @@ -31,10 +31,9 @@ import java.util.Collections; import java.util.List; +import org.hisp.dhis.light.dataentry.utils.SectionFormUtils; import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator; -import org.hisp.dhis.system.filter.OrganisationUnitWithDataSetsFilter; -import org.hisp.dhis.system.util.FilterUtils; import org.hisp.dhis.user.CurrentUserService; import org.hisp.dhis.user.User; @@ -57,6 +56,18 @@ this.currentUserService = currentUserService; } + private SectionFormUtils sectionFormUtils; + + public void setSectionFormUtils( SectionFormUtils sectionFormUtils ) + { + this.sectionFormUtils = sectionFormUtils; + } + + public SectionFormUtils getSectionFormUtils() + { + return sectionFormUtils; + } + // ------------------------------------------------------------------------- // Input & Output // ------------------------------------------------------------------------- @@ -81,7 +92,7 @@ { organisationUnits = new ArrayList( user.getOrganisationUnits() ); Collections.sort( organisationUnits, new OrganisationUnitNameComparator() ); - FilterUtils.filter( organisationUnits, new OrganisationUnitWithDataSetsFilter() ); + organisationUnits = sectionFormUtils.organisationUnitWithDataSetsFilter( organisationUnits ); } return SUCCESS; === modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/utils/SectionFormUtils.java' --- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/utils/SectionFormUtils.java 2011-10-04 11:18:18 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/utils/SectionFormUtils.java 2011-10-24 11:36:21 +0000 @@ -49,6 +49,8 @@ import org.hisp.dhis.options.SystemSettingManager; import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.period.Period; +import org.hisp.dhis.system.filter.OrganisationUnitWithDataSetsFilter; +import org.hisp.dhis.system.util.FilterUtils; import org.hisp.dhis.system.util.ListUtils; import org.hisp.dhis.validation.ValidationResult; import org.hisp.dhis.validation.ValidationRule; @@ -205,6 +207,14 @@ return dataValueMap; } + public List organisationUnitWithDataSetsFilter( Collection organisationUnits ) + { + List ous = new ArrayList( organisationUnits ); + FilterUtils.filter( ous, new OrganisationUnitWithDataSetsFilter() ); + + return ous; + } + // ------------------------------------------------------------------------- // Static Utils // ------------------------------------------------------------------------- === modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2011-10-14 10:44:57 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2011-10-24 11:36:21 +0000 @@ -20,6 +20,7 @@ + === modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectOrganisationUnit.vm' --- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectOrganisationUnit.vm 2011-10-14 13:06:43 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectOrganisationUnit.vm 2011-10-24 11:36:21 +0000 @@ -5,6 +5,11 @@