← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4815: Data mart - Should not allow to load all of units for the first time.

 

------------------------------------------------------------
revno: 4815
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-10-04 12:10:07 +0700
message:
  Data mart - Should not allow to load all of units for the first time.
modified:
  dhis-2/dhis-web/dhis-web-datamart/src/main/java/org/hisp/dhis/datamart/action/GetOptionsAction.java
  dhis-2/dhis-web/dhis-web-datamart/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-datamart/src/main/webapp/dhis-web-datamart/exportForm.vm
  dhis-2/dhis-web/dhis-web-datamart/src/main/webapp/dhis-web-datamart/javascript/addUpdateDatamart.js


--
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-datamart/src/main/java/org/hisp/dhis/datamart/action/GetOptionsAction.java'
--- dhis-2/dhis-web/dhis-web-datamart/src/main/java/org/hisp/dhis/datamart/action/GetOptionsAction.java	2011-10-01 09:05:47 +0000
+++ dhis-2/dhis-web/dhis-web-datamart/src/main/java/org/hisp/dhis/datamart/action/GetOptionsAction.java	2011-10-04 05:10:07 +0000
@@ -129,13 +129,6 @@
     // Output
     // -------------------------------------------------------------------------
 
-    private List<OrganisationUnit> organisationUnits;
-
-    public List<OrganisationUnit> getOrganisationUnits()
-    {
-        return organisationUnits;
-    }
-
     private List<OrganisationUnitLevel> levels;
 
     public List<OrganisationUnitLevel> getLevels()

=== modified file 'dhis-2/dhis-web/dhis-web-datamart/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-datamart/src/main/resources/struts.xml	2011-10-01 09:05:47 +0000
+++ dhis-2/dhis-web/dhis-web-datamart/src/main/resources/struts.xml	2011-10-04 05:10:07 +0000
@@ -20,7 +20,7 @@
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-datamart/exportForm.vm</param>
       <param name="menu">/dhis-web-datamart/menu.vm</param>
-      <param name="javascripts">javascript/datamart.js</param>
+      <param name="javascripts">javascript/addUpdateDatamart.js</param>
       <param name="requiredAuthorities">F_DATAMART_ADMIN</param>
     </action>
 	

=== modified file 'dhis-2/dhis-web/dhis-web-datamart/src/main/webapp/dhis-web-datamart/exportForm.vm'
--- dhis-2/dhis-web/dhis-web-datamart/src/main/webapp/dhis-web-datamart/exportForm.vm	2011-10-03 08:45:21 +0000
+++ dhis-2/dhis-web/dhis-web-datamart/src/main/webapp/dhis-web-datamart/exportForm.vm	2011-10-04 05:10:07 +0000
@@ -1,4 +1,3 @@
-<script type="text/javascript" src="javascript/addUpdateDatamart.js"></script>	
 <script type="text/javascript">	
     var i18n_select_min_datatype = '$encoder.jsEscape( $i18n.getString( "select_min_datatype" ), "'" )';
     var i18n_select_min_level = '$encoder.jsEscape( $i18n.getString( "select_min_level" ), "'" )';
@@ -113,7 +112,7 @@
 	</tr>
 	<tr>
 		<td>
-			<select id="organisationUnitLevel" name="organisationUnitLevel" style="min-width:325px" onchange="getOrganisationUnits()">
+			<select id="organisationUnitLevel" name="organisationUnitLevel" style="min-width:325px" onchange="getOrganisationUnitsAtLevel()">
 				<option value="$ALL">[ $i18n.getString( "select_organisationunit_level_all" ) ]</option>
 				#foreach ( $level in $levels )
 					<option value="$level.level">$level.name</option>
@@ -151,14 +150,14 @@
 	</tr>	
 	<tr>
 		<td>
-			<input type="button" style="width:50px" value="$i18n.getString( 'prev' )" onclick="getAvailablePeriods( 'periodType', 'availablePeriods', 'selectedPeriods', '-1' )"/><input
-				   type="button" style="width:50px" value="$i18n.getString( 'next' )" onclick="getAvailablePeriods( 'periodType', 'availablePeriods', 'selectedPeriods', '1' )"/>
 			<select id="periodType" name="periodType" style="min-width:224px" onchange="getAvailablePeriods( 'periodType', 'availablePeriods', 'selectedPeriods', '0' )">
 				<option value="">[ $i18n.getString( "select_period_type_all" ) ]</option>
 				#foreach ( $type in $periodTypes )
 					<option value="$type.name">$i18n.getString( $type.name )</option>
 				#end
-			</select><br/>
+			</select>
+			<input type="button" style="width:50px" value="$i18n.getString( 'prev' )" onclick="getAvailablePeriods( 'periodType', 'availablePeriods', 'selectedPeriods', '-1' )"/><input
+				   type="button" style="width:50px" value="$i18n.getString( 'next' )" onclick="getAvailablePeriods( 'periodType', 'availablePeriods', 'selectedPeriods', '1' )"/><br/>
 			<select multiple size="6" id="availablePeriods" name="availablePeriods" style="min-width:325px;height:120px" ondblclick="moveSelectedById( 'availablePeriods', 'selectedPeriods' )">
 				#foreach ( $period in $periods )
 					<option value="$period.externalId">$format.formatPeriod( $period )</option>

=== modified file 'dhis-2/dhis-web/dhis-web-datamart/src/main/webapp/dhis-web-datamart/javascript/addUpdateDatamart.js'
--- dhis-2/dhis-web/dhis-web-datamart/src/main/webapp/dhis-web-datamart/javascript/addUpdateDatamart.js	2011-10-01 09:05:47 +0000
+++ dhis-2/dhis-web/dhis-web-datamart/src/main/webapp/dhis-web-datamart/javascript/addUpdateDatamart.js	2011-10-04 05:10:07 +0000
@@ -69,7 +69,7 @@
 	
 	/* Loads the available organisation units */
 	jQuery("#availableOrganisationUnits").dhisAjaxSelect({
-		source: "../dhis-web-commons-ajax-json/getOrganisationUnits.action",
+		source: "../dhis-web-commons-ajax-json/getOrganisationUnits.action?level=1",
 		iterator: "organisationUnits",
 		connectedTo: "selectedOrganisationUnits",
 		handler: function(item) {
@@ -86,7 +86,7 @@
 // Data retrieval methods
 // -----------------------------------------------------------------------------
 
-function getOrganisationUnits()
+function getOrganisationUnitsAtLevel()
 {
 	var organisationUnitLevel = getFieldValue( 'organisationUnitLevel' );
 	var filterInput = jQuery( "#availableOrganisationUnits_filter_input" );