← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5022: (mobile) minor fix for select ou

 

------------------------------------------------------------
revno: 5022
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-10-24 14:18:38 +0200
message:
  (mobile) minor fix for select ou
modified:
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetOrganisationUnitsAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectOrganisationUnit.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-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetOrganisationUnitsAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetOrganisationUnitsAction.java	2011-10-24 11:36:21 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetOrganisationUnitsAction.java	2011-10-24 12:18:38 +0000
@@ -92,7 +92,6 @@
         {
             organisationUnits = new ArrayList<OrganisationUnit>( user.getOrganisationUnits() );
             Collections.sort( organisationUnits, new OrganisationUnitNameComparator() );
-            organisationUnits = sectionFormUtils.organisationUnitWithDataSetsFilter( organisationUnits );
         }
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectOrganisationUnit.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectOrganisationUnit.vm	2011-10-24 11:36:21 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectOrganisationUnit.vm	2011-10-24 12:18:38 +0000
@@ -4,10 +4,21 @@
 <p>
 <ul>
 #foreach( $organisationUnit in $organisationUnits )
-	<li><a href="selectDataSet.action?organisationUnitId=$organisationUnit.id">$!encoder.htmlEncode( ${organisationUnit.name} )</a></li>
-	#if( $organisationUnit.children.size() > 0 )
-		#foreach( $child in $sectionFormUtils.organisationUnitWithDataSetsFilter( $organisationUnit.children ))
-			<li>- <a href="selectDataSet.action?organisationUnitId=$child.id">$!encoder.htmlEncode( ${child.name} )</a></li>
+	#if( $organisationUnit.children.size() == 0 && $organisationUnit.dataSets.size() > 0 )
+		<li><a href="selectDataSet.action?organisationUnitId=$organisationUnit.id">$!encoder.htmlEncode( ${organisationUnit.name} )</a></li>
+	#else
+		#if( $organisationUnit.children.size() > 0 )
+			#set( $children = $sectionFormUtils.organisationUnitWithDataSetsFilter( $organisationUnit.children ) )
+
+			#if( $organisationUnit.dataSets.size() > 0 )
+				<li><a href="selectDataSet.action?organisationUnitId=$organisationUnit.id">$!encoder.htmlEncode( ${organisationUnit.name} )</a></li>
+			#else
+				<li>$!encoder.htmlEncode( ${organisationUnit.name} )</a></li>
+			#end
+
+			#foreach( $child in $children )
+				<li>- <a href="selectDataSet.action?organisationUnitId=$child.id">$!encoder.htmlEncode( ${child.name} )</a></li>
+			#end
 		#end
 	#end
 #end