← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19764: nalytics, getFromAnalyticalObject, fixed bug related to user org units

 

------------------------------------------------------------
revno: 19764
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-08-10 23:02:49 +0200
message:
  nalytics, getFromAnalyticalObject, fixed bug related to user org units
modified:
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java


--
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-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-08-07 17:59:15 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-08-10 21:02:49 +0000
@@ -1028,6 +1028,8 @@
     {
         DataQueryParams params = new DataQueryParams();
         
+        List<OrganisationUnit> userOrgUnits = getUserOrgUnits( null );
+        
         if ( object != null )
         {
             Date date = object.getRelativePeriodDate();
@@ -1036,17 +1038,17 @@
 
             for ( DimensionalObject column : object.getColumns() )
             {
-                params.addDimension( getDimension( column.getDimension(), getUids( column.getItems() ), date, null, format, false ) );
+                params.addDimension( getDimension( column.getDimension(), getUids( column.getItems() ), date, userOrgUnits, format, false ) );
             }
 
             for ( DimensionalObject row : object.getRows() )
             {
-                params.addDimension( getDimension( row.getDimension(), getUids( row.getItems() ), date, null, format, false ) );
+                params.addDimension( getDimension( row.getDimension(), getUids( row.getItems() ), date, userOrgUnits, format, false ) );
             }
 
             for ( DimensionalObject filter : object.getFilters() )
             {
-                params.getFilters().add( getDimension( filter.getDimension(), getUids( filter.getItems() ), date, null, format, false ) );
+                params.getFilters().add( getDimension( filter.getDimension(), getUids( filter.getItems() ), date, userOrgUnits, format, false ) );
             }
         }
 
@@ -1551,7 +1553,7 @@
      * @param userOrgUnit the user org unit parameter string.
      * @return a list of organisation units.
      */
-    private List<OrganisationUnit> getUserOrgUnits( String userOrgUnit)
+    private List<OrganisationUnit> getUserOrgUnits( String userOrgUnit )
     {
         List<OrganisationUnit> units = new ArrayList<>();