← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3899: made add/update chart start with orgunits at level 1

 

------------------------------------------------------------
revno: 3899
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-06-14 14:47:22 +0200
message:
  made add/update chart start with orgunits at level 1
modified:
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GetChartOptionsAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartOrganisationUnitModeForm.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/chart/action/GetChartOptionsAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GetChartOptionsAction.java	2011-06-07 16:12:23 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GetChartOptionsAction.java	2011-06-14 12:47:22 +0000
@@ -268,7 +268,8 @@
 
         levels = organisationUnitService.getOrganisationUnitLevels();
 
-        availableOrganisationUnits = new ArrayList<OrganisationUnit>( organisationUnitService.getAllOrganisationUnits() );
+        availableOrganisationUnits = new ArrayList<OrganisationUnit>(
+            organisationUnitService.getOrganisationUnitsAtLevel( 1 ) );
 
         Collections.sort( indicatorGroups, new IndicatorGroupNameComparator() );
         Collections.sort( dataElementGroups, new DataElementGroupNameComparator() );

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartOrganisationUnitModeForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartOrganisationUnitModeForm.vm	2011-03-28 20:09:32 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartOrganisationUnitModeForm.vm	2011-06-14 12:47:22 +0000
@@ -7,10 +7,14 @@
 <tr>
     <td colspan="2">
         <select id="organisationUnitLevel" name="organisationUnitLevel" style="min-width:600px" onchange="getOrganisationUnits()">
-            <option value="$ALL">[ $i18n.getString( "select_organisationunit_level_all" ) ]</option>
-            #foreach ( $level in $levels )
-                <option value="$level.level">$encoder.htmlEncode( $level.name )</option>
-            #end
+            <option value="0">[ $i18n.getString( "select_organisationunit_level_all" ) ]</option>
+			#foreach ( $level in $levels )
+				#if( $velocityCount == 1 )
+				<option value="$level.level" selected="selected">$encoder.htmlEncode( $level.name )</option>
+				#else
+				<option value="$level.level">$encoder.htmlEncode( $level.name )</option>
+				#end
+			#end
         </select>
     </td>
 </tr>