← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6764: Made statistics page load ajax style

 

------------------------------------------------------------
revno: 6764
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-04-26 20:32:46 +0200
message:
  Made statistics page load ajax style
removed:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/statistics/GetStatisticsChartAction.java
added:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/statistics.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/responseStatistics.vm
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewStatistics.vm
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataCompleteness.js
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/orgUnitDistribution.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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2012-04-24 08:02:39 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2012-04-26 18:32:46 +0000
@@ -1478,8 +1478,6 @@
 	return regex.test( value );
 }
 
-// Recommended in using this method
-// which same as name one from Ext
 function isNumber( value )
 {
 	var regex = /^[+-]?\d+(\.\d+)?([eE][+-]?\d+)?$/;
@@ -1503,7 +1501,12 @@
 
 function getRandomNumber()
 {
-	return Math.floor( 1000000 * Math.random() );
+	return Math.floor( 100000000 * Math.random() );
+}
+
+function getDC()
+{
+	return "_dc=" + getRandomNumber();
 }
 
 /**

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/statistics/GetStatisticsChartAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/statistics/GetStatisticsChartAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/statistics/GetStatisticsChartAction.java	1970-01-01 00:00:00 +0000
@@ -1,108 +0,0 @@
-package org.hisp.dhis.dataadmin.action.statistics;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.hisp.dhis.chart.ChartService;
-import org.hisp.dhis.common.Objects;
-import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.statistics.StatisticsProvider;
-import org.jfree.chart.JFreeChart;
-import org.jfree.chart.axis.CategoryLabelPositions;
-import org.jfree.chart.plot.PlotOrientation;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class GetStatisticsChartAction
-    implements Action
-{
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-    
-    private StatisticsProvider statisticsProvider;
-
-    public void setStatisticsProvider( StatisticsProvider statisticsProvider )
-    {
-        this.statisticsProvider = statisticsProvider;
-    }
-    
-    private ChartService chartService;
-
-    public void setChartService( ChartService chartService )
-    {
-        this.chartService = chartService;
-    }
-
-    private I18n i18n;
-
-    public void setI18n( I18n i18n )
-    {
-        this.i18n = i18n;
-    }
-    
-    // -------------------------------------------------------------------------
-    // Output
-    // -------------------------------------------------------------------------
-
-    private JFreeChart chart;
-
-    public JFreeChart getChart()
-    {
-        return chart;
-    }
-
-    // -------------------------------------------------------------------------
-    // Action implemenation
-    // -------------------------------------------------------------------------
-
-    public String execute()
-    {
-        Map<Objects, Integer> counts = statisticsProvider.getObjectCounts();
-        
-        Map<String, Double> categoryValues = new HashMap<String, Double>();
-        
-        categoryValues.put( i18n.getString( "data_elements" ), Double.valueOf( counts.get( Objects.DATAELEMENT ) ) );
-        categoryValues.put( i18n.getString( "indicators" ), Double.valueOf( counts.get( Objects.INDICATOR ) ) );
-        categoryValues.put( i18n.getString( "data_sets" ), Double.valueOf( counts.get( Objects.DATASET ) ) );
-        categoryValues.put( i18n.getString( "organisation_units" ), Double.valueOf( counts.get( Objects.SOURCE ) ) );
-        categoryValues.put( i18n.getString( "periods" ), Double.valueOf( counts.get( Objects.PERIOD ) ) );
-        
-        chart = chartService.getJFreeChart( i18n.getString( "number_of_objects" ), 
-            PlotOrientation.HORIZONTAL, CategoryLabelPositions.STANDARD, categoryValues );
-        
-        return SUCCESS;
-    }
-}
-

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml	2012-04-04 10:48:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml	2012-04-26 18:32:46 +0000
@@ -57,13 +57,6 @@
     <property name="dataValueService" ref="org.hisp.dhis.datavalue.DataValueService" />
   </bean>
 
-  <bean id="org.hisp.dhis.dataadmin.action.statistics.GetStatisticsChartAction"
-      class="org.hisp.dhis.dataadmin.action.statistics.GetStatisticsChartAction"
-      scope="prototype">
-    <property name="statisticsProvider" ref="org.hisp.dhis.statistics.StatisticsProvider" />
-    <property name="chartService" ref="org.hisp.dhis.chart.ChartService" />
-  </bean>
-
   <!-- Databrowser Grid -->
 
   <bean id="org.hisp.dhis.dataadmin.action.databrowser.DataBrowserAction"

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml	2012-04-04 10:48:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml	2012-04-26 18:32:46 +0000
@@ -80,18 +80,16 @@
 
     <!-- Statistics -->
 
-    <action name="viewStatistics" class="org.hisp.dhis.dataadmin.action.statistics.GetStatisticsAction">
-      <result name="success" type="velocity">/main.vm</result>
+    <action name="viewStatistics" class="org.hisp.dhis.dataadmin.action.NoAction">
+	  <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-maintenance-dataadmin/viewStatistics.vm</param>
       <param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
-	  <param name="requiredAuthorities">F_PERFORM_MAINTENANCE</param>
+      <param name="javascripts">javascript/statistics.js</param>
+	  <param name="requiredAuthorities">F_PERFORM_MAINTENANCE</param>
     </action>
 
-    <action name="viewStatisticsChart" class="org.hisp.dhis.dataadmin.action.statistics.GetStatisticsChartAction">
-      <result name="success" type="chart">
-        <param name="width">420</param>
-        <param name="height">220</param>
-      </result>
+    <action name="getStatistics" class="org.hisp.dhis.dataadmin.action.statistics.GetStatisticsAction">
+      <result name="success" type="velocity">/dhis-web-maintenance-dataadmin/responseStatistics.vm</result>
 	  <param name="requiredAuthorities">F_PERFORM_MAINTENANCE</param>
     </action>
 

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/statistics.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/statistics.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/statistics.js	2012-04-26 18:32:46 +0000
@@ -0,0 +1,10 @@
+
+$( document ).ready( function()
+{
+	showLoader();
+	
+	$( '#contentDiv' ).load( 'getStatistics.action?' + getDC(), function()
+	{
+		hideLoader();
+	} );
+} );

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/responseStatistics.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/responseStatistics.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/responseStatistics.vm	2012-04-26 18:32:46 +0000
@@ -0,0 +1,130 @@
+
+<table>
+	<tr>
+		<th style="width:200px">$i18n.getString( "object_type" )</th>
+		<th style="width:200px">$i18n.getString( "number" )</th>
+	</tr>
+	<tr>
+		<td>$i18n.getString( "data_elements" )</td>
+		<td>$objects.getValue( "DATAELEMENT" )</td>
+	</tr>
+    <tr>
+        <td>$i18n.getString( "data_element_groups" )</td>
+        <td>$objects.getValue( "DATAELEMENTGROUP" )</td>
+    </tr>
+    <tr>
+        <td>$i18n.getString( "indicator_types" )</td>
+        <td>$objects.getValue( "INDICATORTYPE" )</td>
+    </tr>
+    <tr>
+        <td>$i18n.getString( "indicators" )</td>
+        <td>$objects.getValue( "INDICATOR" )</td>
+    </tr>
+    <tr>
+        <td>$i18n.getString( "indicator_groups" )</td>
+        <td>$objects.getValue( "INDICATORGROUP" )</td>
+    </tr>
+    <tr>
+        <td>$i18n.getString( "data_sets" )</td>
+        <td>$objects.getValue( "DATASET" )</td>
+    </tr>
+    <tr>
+        <td>$i18n.getString( "data_dictionaries" )</td>
+        <td>$objects.getValue( "DATADICTIONARY" )</td>
+    </tr>
+    <tr>
+        <td>$i18n.getString( "organisation_units" )</td>
+        <td>$objects.getValue( "SOURCE" )</td>
+    </tr>
+    <tr>
+        <td>$i18n.getString( "validation_rules" )</td>
+        <td>$objects.getValue( "VALIDATIONRULE" )</td>
+    </tr>
+    <tr>
+        <td>$i18n.getString( "periods" )</td>
+        <td>$objects.getValue( "PERIOD" )</td>
+    </tr>
+    <tr>
+        <td>$i18n.getString( "users" )</td>
+        <td>$objects.getValue( "USER" )</td>
+    </tr>
+    <tr>
+        <td>$i18n.getString( "data_values" )</td>
+        <td>$objects.getValue( "DATAVALUE" )</td>
+    </tr>
+    <tr>
+        <td>$i18n.getString( "aggregated_data_values" )</td>
+        <td>$objects.getValue( "AGGREGATEDDATAVALUE" )</td>
+    </tr>
+    <tr>
+        <td>$i18n.getString( "aggregated_indicator_values" )</td>
+        <td>$objects.getValue( "AGGREGATEDINDICATORVALUE" )</td>
+    </tr>
+    <tr>
+        <td>$i18n.getString( "aggregated_org_unit_data_values" )</td>
+        <td>$objects.getValue( "AGGREGATEDORGUNITDATAVALUE" )</td>
+    </tr>
+    <tr>
+        <td>$i18n.getString( "aggregated_org_unit_indicator_values" )</td>
+        <td>$objects.getValue( "AGGREGATEDORGUNITINDICATORVALUE" )</td>
+    </tr>
+    <tr>
+        <td>$i18n.getString( "aggregated_data_set_completeness" )</td>
+        <td>$objects.getValue( "AGGREGATEDDATASETCOMPLETENESS" )</td>
+    </tr>
+    <tr>
+    	<td colspan="2" style="height:15px"></td>
+    </tr>
+</table>
+
+<table>
+	<tr>
+		<th style="width:200px">$i18n.getString( "users_logged_in" )</th>
+		<th style="width:200px">$i18n.getString( "number" )</th>
+	</tr>
+	<tr>
+		<td>$i18n.getString( "today" )</td>
+		<td>$activeUsers.get( 0 )</td>
+	</tr>
+	<tr>
+		<td>$i18n.getString( "yesterday" )</td>
+		<td>$activeUsers.get( 1 )</td>
+	</tr>
+	<tr>
+		<td>$i18n.getString( "last_7_days" )</td>
+		<td>$activeUsers.get( 7 )</td>
+	</tr>
+	<tr>
+		<td>$i18n.getString( "last_30_days" )</td>
+		<td>$activeUsers.get( 30 )</td>
+	</tr>
+    <tr>
+    	<td colspan="2" style="height:15px"></td>
+    </tr>
+</table>
+
+<table>
+	<tr>
+		<th style="width:200px">$i18n.getString( "data_values" )</th>
+		<th style="width:200px">$i18n.getString( "number" )</th>
+	</tr>
+	<tr>
+		<td>$i18n.getString( "today" )</td>
+		<td>$dataValueCount.get( 0 )</td>
+	</tr>
+	<tr>
+		<td>$i18n.getString( "yesterday" )</td>
+		<td>$dataValueCount.get( 1 )</td>
+	</tr>
+	<tr>
+		<td>$i18n.getString( "last_7_days" )</td>
+		<td>$dataValueCount.get( 7 )</td>
+	</tr>
+	<tr>
+		<td>$i18n.getString( "last_30_days" )</td>
+		<td>$dataValueCount.get( 30 )</td>
+	</tr>
+    <tr>
+    	<td colspan="2" style="height:15px"></td>
+    </tr>
+</table>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewStatistics.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewStatistics.vm	2012-04-23 14:11:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewStatistics.vm	2012-04-26 18:32:46 +0000
@@ -1,134 +1,6 @@
 
 <h3>$i18n.getString( "data_statistics" ) #openHelp( "dataStatistics" )</h3>
 
-<table>
-	<tr>
-		<th style="width:200px">$i18n.getString( "object_type" )</th>
-		<th style="width:200px">$i18n.getString( "number" )</th>
-	</tr>
-	<tr>
-		<td>$i18n.getString( "data_elements" )</td>
-		<td>$objects.getValue( "DATAELEMENT" )</td>
-	</tr>
-    <tr>
-        <td>$i18n.getString( "data_element_groups" )</td>
-        <td>$objects.getValue( "DATAELEMENTGROUP" )</td>
-    </tr>
-    <tr>
-        <td>$i18n.getString( "indicator_types" )</td>
-        <td>$objects.getValue( "INDICATORTYPE" )</td>
-    </tr>
-    <tr>
-        <td>$i18n.getString( "indicators" )</td>
-        <td>$objects.getValue( "INDICATOR" )</td>
-    </tr>
-    <tr>
-        <td>$i18n.getString( "indicator_groups" )</td>
-        <td>$objects.getValue( "INDICATORGROUP" )</td>
-    </tr>
-    <tr>
-        <td>$i18n.getString( "data_sets" )</td>
-        <td>$objects.getValue( "DATASET" )</td>
-    </tr>
-    <tr>
-        <td>$i18n.getString( "data_dictionaries" )</td>
-        <td>$objects.getValue( "DATADICTIONARY" )</td>
-    </tr>
-    <tr>
-        <td>$i18n.getString( "organisation_units" )</td>
-        <td>$objects.getValue( "SOURCE" )</td>
-    </tr>
-    <tr>
-        <td>$i18n.getString( "validation_rules" )</td>
-        <td>$objects.getValue( "VALIDATIONRULE" )</td>
-    </tr>
-    <tr>
-        <td>$i18n.getString( "periods" )</td>
-        <td>$objects.getValue( "PERIOD" )</td>
-    </tr>
-    <tr>
-        <td>$i18n.getString( "users" )</td>
-        <td>$objects.getValue( "USER" )</td>
-    </tr>
-    <tr>
-        <td>$i18n.getString( "data_values" )</td>
-        <td>$objects.getValue( "DATAVALUE" )</td>
-    </tr>
-    <tr>
-        <td>$i18n.getString( "aggregated_data_values" )</td>
-        <td>$objects.getValue( "AGGREGATEDDATAVALUE" )</td>
-    </tr>
-    <tr>
-        <td>$i18n.getString( "aggregated_indicator_values" )</td>
-        <td>$objects.getValue( "AGGREGATEDINDICATORVALUE" )</td>
-    </tr>
-    <tr>
-        <td>$i18n.getString( "aggregated_org_unit_data_values" )</td>
-        <td>$objects.getValue( "AGGREGATEDORGUNITDATAVALUE" )</td>
-    </tr>
-    <tr>
-        <td>$i18n.getString( "aggregated_org_unit_indicator_values" )</td>
-        <td>$objects.getValue( "AGGREGATEDORGUNITINDICATORVALUE" )</td>
-    </tr>
-    <tr>
-        <td>$i18n.getString( "aggregated_data_set_completeness" )</td>
-        <td>$objects.getValue( "AGGREGATEDDATASETCOMPLETENESS" )</td>
-    </tr>
-    <tr>
-    	<td colspan="2" style="height:15px"></td>
-    </tr>
-</table>
-
-<table>
-	<tr>
-		<th style="width:200px">$i18n.getString( "users_logged_in" )</th>
-		<th style="width:200px">$i18n.getString( "number" )</th>
-	</tr>
-	<tr>
-		<td>$i18n.getString( "today" )</td>
-		<td>$activeUsers.get( 0 )</td>
-	</tr>
-	<tr>
-		<td>$i18n.getString( "yesterday" )</td>
-		<td>$activeUsers.get( 1 )</td>
-	</tr>
-	<tr>
-		<td>$i18n.getString( "last_7_days" )</td>
-		<td>$activeUsers.get( 7 )</td>
-	</tr>
-	<tr>
-		<td>$i18n.getString( "last_30_days" )</td>
-		<td>$activeUsers.get( 30 )</td>
-	</tr>
-    <tr>
-    	<td colspan="2" style="height:15px"></td>
-    </tr>
-</table>
-
-<table>
-	<tr>
-		<th style="width:200px">$i18n.getString( "data_values" )</th>
-		<th style="width:200px">$i18n.getString( "number" )</th>
-	</tr>
-	<tr>
-		<td>$i18n.getString( "today" )</td>
-		<td>$dataValueCount.get( 0 )</td>
-	</tr>
-	<tr>
-		<td>$i18n.getString( "yesterday" )</td>
-		<td>$dataValueCount.get( 1 )</td>
-	</tr>
-	<tr>
-		<td>$i18n.getString( "last_7_days" )</td>
-		<td>$dataValueCount.get( 7 )</td>
-	</tr>
-	<tr>
-		<td>$i18n.getString( "last_30_days" )</td>
-		<td>$dataValueCount.get( 30 )</td>
-	</tr>
-    <tr>
-    	<td colspan="2" style="height:15px"></td>
-    </tr>
-</table>
-
-<p><img src="viewStatisticsChart.action" alt="$i18n.getString( 'number_of_objects' )" style="border: 1px solid #d0d0d0; margin-left: 2px"/></p>
+#parse( "dhis-web-commons/loader/loader.vm" )
+
+<div id="contentDiv"></div>

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataCompleteness.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataCompleteness.js	2012-03-26 18:11:26 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataCompleteness.js	2012-04-26 18:32:46 +0000
@@ -21,7 +21,7 @@
     showLoader();
 
     var url = "getDataCompleteness.action" + "?periodId=" + periodId + "&criteria=" + criteria + "&dataSetId="
-            + dataSetId + "&type=html&r=" + getRandomNumber();
+            + dataSetId + "&type=html&" + getDC();
 
     $( "#contentDiv" ).load( url, function()
     {
@@ -49,5 +49,5 @@
 
 function getCompleteness( type )
 {
-    window.location.href = "getDataCompleteness.action?type=" + type;
+    window.location.href = "getDataCompleteness.action?type=" + type + "&" + getDC();
 }
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/orgUnitDistribution.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/orgUnitDistribution.js	2012-03-18 22:44:02 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/orgUnitDistribution.js	2012-04-26 18:32:46 +0000
@@ -11,7 +11,7 @@
     displayDiv( "loaderDiv", distributionDivs );
 
     var groupSetId = $( "#groupSetId" ).val();
-    var url = "getOrgUnitDistribution.action?groupSetId=" + groupSetId + "&type=html&r=" + getRandomNumber();
+    var url = "getOrgUnitDistribution.action?groupSetId=" + groupSetId + "&type=html&" + getDC();
     $( "#tableDiv" ).load( url, function()
     {
         displayDiv( "tableDiv", distributionDivs );
@@ -27,7 +27,7 @@
     }
 
     var groupSetId = $( "#groupSetId" ).val();
-    var url = "getOrgUnitDistribution.action?groupSetId=" + groupSetId + "&type=" + type + "&r=" + getRandomNumber();
+    var url = "getOrgUnitDistribution.action?groupSetId=" + groupSetId + "&type=" + type + "&" + getDC();
     window.location.href = url;
 }
 
@@ -41,7 +41,7 @@
     displayDiv( "chartDiv", distributionDivs );
     $( "#chartImg" ).attr( "src", "../images/ajax-loader-circle.gif" );
     var groupSetId = $( "#groupSetId" ).val();
-    var source = "getOrgUnitDistributionChart.action?groupSetId=" + groupSetId + "&r=" + getRandomNumber();
+    var source = "getOrgUnitDistributionChart.action?groupSetId=" + groupSetId + "&"  + getDC();
     $( "#chartImg" ).attr( "src", source );
 }