← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12292: Tabular report, invalid json issue

 

------------------------------------------------------------
revno: 12292
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2013-09-28 15:07:29 +0200
message:
  Tabular report, invalid json issue
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.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-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2013-09-19 18:18:13 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2013-09-28 13:07:29 +0000
@@ -326,6 +326,11 @@
     {
         return !this.children.isEmpty();
     }
+    
+    public boolean isLeaf()
+    {
+        return children == null || children.isEmpty();
+    }
 
     public boolean hasChildrenWithCoordinates()
     {

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm	2013-08-29 09:34:09 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm	2013-09-28 13:07:29 +0000
@@ -11,7 +11,7 @@
 					 "id":  "${orgunit.uid}" ,
 					 "localid": "$orgunit.id",
 					 "name": "$!encoder.jsonEncode( ${orgunit.name} )",
-					 "leaf": !$orgunit.hasChild()
+					 "leaf": "${orgunit.isLeaf()}"
 			   }#if( $velocityCount < $currentUser.organisationUnits.size() ),#end
 			#end
 		]