← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9691: Including org unit children in html based standard report

 

------------------------------------------------------------
revno: 9691
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2013-02-02 21:59:51 +0200
message:
  Including org unit children in html based standard report
modified:
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportAndParamsAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderHtmlReport.vm


--
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-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportAndParamsAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportAndParamsAction.java	2013-01-31 14:48:30 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportAndParamsAction.java	2013-02-02 19:59:51 +0000
@@ -107,6 +107,13 @@
     {
         return organisationUnitHierarchy;
     }
+    
+    private List<OrganisationUnit> organisationUnitChildren = new ArrayList<OrganisationUnit>();
+    
+    public List<OrganisationUnit> getOrganisationUnitChildren()
+    {
+        return organisationUnitChildren;
+    }
 
     private List<Period> periods;
     
@@ -138,6 +145,8 @@
                     parent = parent.getParent();
                     organisationUnitHierarchy.add( parent );
                 }
+                
+                organisationUnitChildren.addAll( organisationUnit.getChildren() );
             }
         }
         

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderHtmlReport.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderHtmlReport.vm	2013-02-02 19:22:58 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/renderHtmlReport.vm	2013-02-02 19:59:51 +0000
@@ -31,6 +31,19 @@
 #end
 #end
 ];
+
+dhis2.report.organisationUnitChildren = [
+#if( $organisationUnitChildren )
+#set( $size = $organisationUnitChildren.size() )
+#foreach( $ou in $organisationUnitChildren )
+{
+    "id": "$!encoder.htmlEncode( ${ou.uid} )",
+    "name": "$!encoder.htmlEncode( ${ou.name} )",
+    "code": "$!encoder.htmlEncode( ${ou.code} )"
+}#if( $velocityCount < $size ),#end
+#end
+#end
+];
 
 </script>