=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java 2013-12-13 16:50:58 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java 2014-03-14 10:15:34 +0000 @@ -177,6 +177,15 @@ List getByUid( Collection uids ); /** + * Retrieves a list of objects referenced by the given List of uids. + * Bypasses the ACL system. + * + * @param uids a List of uids. + * @return a list of objects. + */ + List getByUidNoAcl( Collection uids ); + + /** * Returns all objects that are equal to or newer than given date. * * @param created Date to compare with. === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java 2014-01-02 13:36:45 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java 2014-03-14 10:15:34 +0000 @@ -244,6 +244,14 @@ List getDataSetsByUid( Collection uids ); /** + * Returns a list of data sets with the given uids. Bypasses the ACL system. + * + * @param uids the collection of uids. + * @return a list of data sets. + */ + List getDataSetsByUidNoAcl( Collection uids ); + + /** * Returns a collection of data elements associated with the given * corresponding data set. * === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/hibernate/HibernateIdentifiableObjectStore.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/hibernate/HibernateIdentifiableObjectStore.java 2014-02-12 14:22:58 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/hibernate/HibernateIdentifiableObjectStore.java 2014-03-14 10:15:34 +0000 @@ -639,6 +639,27 @@ return list; } + @Override + public List getByUidNoAcl( Collection uids ) + { + List list = new ArrayList(); + + if ( uids != null ) + { + for ( String uid : uids ) + { + T object = getByUidNoAcl( uid ); + + if ( object != null ) + { + list.add( object ); + } + } + } + + return list; + } + //---------------------------------------------------------------------------------------------------------------- // No ACL (unfiltered methods) //---------------------------------------------------------------------------------------------------------------- === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java 2014-01-02 13:36:45 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java 2014-03-14 10:15:34 +0000 @@ -358,6 +358,11 @@ { return dataSetStore.getByUid( uids ); } + + public List getDataSetsByUidNoAcl( Collection uids ) + { + return dataSetStore.getByUidNoAcl( uids ); + } public Collection getDataElements( DataSet dataSet ) { === modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java' --- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java 2014-03-05 14:22:19 +0000 +++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java 2014-03-14 10:15:34 +0000 @@ -187,10 +187,8 @@ public int countGetTrackedEntityInstancesByOrgUnitProgram( OrganisationUnit organisationUnit, Program program ) { String sql = "select count(p.trackedentityinstanceid) from trackedentityinstance p join programinstance pi on p.trackedentityinstanceid=pi.trackedentityinstanceid " - + "where p.organisationunitid=" - + organisationUnit.getId() - + " and pi.programid=" - + program.getId() + + "where p.organisationunitid=" + organisationUnit.getId() + + " and pi.programid=" + program.getId() + " and pi.status=" + ProgramInstance.STATUS_ACTIVE; return jdbcTemplate.queryForObject( sql, Integer.class ); === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetMetaDataAction.java' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetMetaDataAction.java 2014-02-25 05:51:59 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetMetaDataAction.java 2014-03-14 10:15:34 +0000 @@ -241,7 +241,7 @@ organisationUnitAssociationSetMap = organisationUnitSet.getOrganisationUnitAssociationSetMap(); - dataSets = new ArrayList( dataSetService.getDataSetsByUid( organisationUnitSet.getDistinctDataSets() ) ); + dataSets = new ArrayList( dataSetService.getDataSetsByUidNoAcl( organisationUnitSet.getDistinctDataSets() ) ); Set categoryComboSet = new HashSet(); Set categorySet = new HashSet(); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/SetupTreeAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/SetupTreeAction.java 2014-01-22 12:50:38 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/SetupTreeAction.java 2014-03-14 10:15:34 +0000 @@ -42,6 +42,7 @@ import org.hisp.dhis.attribute.Attribute; import org.hisp.dhis.attribute.AttributeService; import org.hisp.dhis.attribute.comparator.AttributeSortOrderComparator; +import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator; import org.hisp.dhis.i18n.I18nService; import org.hisp.dhis.i18n.locale.LocaleManager; import org.hisp.dhis.organisationunit.OrganisationUnitGroup; @@ -136,9 +137,9 @@ return userCredentials; } - private Collection userAuthorityGroups; + private List userAuthorityGroups; - public Collection getUserAuthorityGroups() + public List getUserAuthorityGroups() { return userAuthorityGroups; } @@ -236,6 +237,8 @@ currentLocale = LocaleManager.DHIS_STANDARD_LOCALE; } + Collections.sort( userAuthorityGroups, IdentifiableObjectNameComparator.INSTANCE ); + attributes = new ArrayList( attributeService.getUserAttributes() ); Collections.sort( attributes, AttributeSortOrderComparator.INSTANCE );