=== modified file 'local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/de/action/LoadDataSetsAction.java' --- local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/de/action/LoadDataSetsAction.java 2012-05-10 16:18:43 +0000 +++ local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/de/action/LoadDataSetsAction.java 2012-05-11 08:28:02 +0000 @@ -34,6 +34,8 @@ import org.hisp.dhis.dataset.DataSetService; import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager; +import org.hisp.dhis.user.CurrentUserService; +import org.hisp.dhis.user.UserAuthorityGroup; import com.opensymphony.xwork2.Action; @@ -63,6 +65,13 @@ this.dataSetService = dataSetService; } + private CurrentUserService currentUserService; + + public void setCurrentUserService( CurrentUserService currentUserService ) + { + this.currentUserService = currentUserService; + } + // ------------------------------------------------------------------------- // Output // ------------------------------------------------------------------------- @@ -85,6 +94,13 @@ sources.add( selectionManager.getSelectedOrganisationUnit() ); dataSets = dataSetService.getDataSetsBySources( sources ); + + Collection authorityGroups = currentUserService.getCurrentUser().getUserCredentials().getUserAuthorityGroups(); + + for( UserAuthorityGroup UserAuthorityGroup : authorityGroups ) + { + dataSets.retainAll( UserAuthorityGroup.getDataSets() ); + } return SUCCESS; } === modified file 'local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/de/action/LoadDepartmentsAction.java' --- local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/de/action/LoadDepartmentsAction.java 2012-05-10 16:18:43 +0000 +++ local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/de/action/LoadDepartmentsAction.java 2012-05-11 08:28:02 +0000 @@ -124,7 +124,6 @@ { departmentInOrgunit.addAll( association.getCategoryOption().getCategoryOptionCombos() ); } - System.out.println("\n\n === \n departmentInOrgunit : " + departmentInOrgunit ); DataSet dataSet = dataSetService.getDataSet( dataSetId ); String description = dataSet.getDescription(); @@ -132,14 +131,13 @@ { Collection dataSets = localDataSetService.getDataSetsByDescription( description ); dataSets.remove( dataSet ); -System.out.println("\n\n dataSets : " + dataSets ); + for ( DataSet relativedataSet : dataSets ) { if ( relativedataSet.getDataEntryForm() != null ) { DataElementCategoryOptionCombo optionCombo = localDataSetService.getDepartmentByDataSet( relativedataSet ); -System.out.println("\n\n optionCombo : " + optionCombo ); -System.out.println("\n\n departmentInOrgunit.contains( optionCombo ) : " + departmentInOrgunit.contains( optionCombo ) ); + if( departmentInOrgunit.contains( optionCombo ) ) { mapDataSets.put( relativedataSet.getId(), optionCombo.getName() ); === modified file 'local/vn/dhis-web-dataentry-hospital/src/main/resources/META-INF/dhis/beans.xml' --- local/vn/dhis-web-dataentry-hospital/src/main/resources/META-INF/dhis/beans.xml 2012-05-10 16:18:43 +0000 +++ local/vn/dhis-web-dataentry-hospital/src/main/resources/META-INF/dhis/beans.xml 2012-05-11 08:28:02 +0000 @@ -140,6 +140,7 @@ +