------------------------------------------------------------ revno: 17448 committer: Lars Helge Overland <larshe...@gmail.com> branch nick: dhis2 timestamp: Wed 2014-11-12 10:21:19 +0100 message: Data entry, fixed bug, must check if data set is accessible to current user when fetching org unit data set assignment from server modified: dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitStore.java dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js
-- lp:dhis2 https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk Your team DHIS 2 developers is subscribed to branch lp:dhis2. To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitStore.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitStore.java 2014-10-01 11:05:44 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitStore.java 2014-11-12 09:21:19 +0000 @@ -129,6 +129,12 @@ */ Collection<OrganisationUnit> getOrganisationUnitsByNameAndGroups( String query, Collection<OrganisationUnitGroup> groups, boolean limit ); + /** + * Creates a mapping between organisation unit UID and set of data set UIDs + * being assigned to the organisation unit. + * + * @return a map of sets. + */ Map<String, Set<String>> getOrganisationUnitDataSetAssocationMap(); Set<Integer> getOrganisationUnitIdsWithoutData(); === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2014-10-28 16:22:52 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2014-11-12 09:21:19 +0000 @@ -986,6 +986,8 @@ }); } + /* TODO check if data sets are accessible for current user */ + return def.promise(); }; @@ -1003,12 +1005,16 @@ $.safeEach( orgUnitDataSets, function( idx, item ) { var dataSetId = orgUnitDataSets[idx]; - var dataSetName = dhis2.de.dataSets[dataSetId].name; - - var row = []; - row['id'] = dataSetId; - row['name'] = dataSetName; - dataSetList[idx] = row; + + if ( dhis2.de.dataSets[dataSetId] ) + { + var dataSetName = dhis2.de.dataSets[dataSetId].name; + + var row = []; + row['id'] = dataSetId; + row['name'] = dataSetName; + dataSetList[idx] = row; + } } ); dataSetList.sort( function( a, b )
_______________________________________________ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp