← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4397: Fixed bug with history chart

 

------------------------------------------------------------
revno: 4397
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2011-08-20 13:10:50 +0200
message:
  Fixed bug with history chart
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetHistoryChartAction.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/RemoveMinMaxLimitsAction.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SaveMinMaxLimitsAction.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.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-dataentry/src/main/java/org/hisp/dhis/de/action/GetHistoryChartAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetHistoryChartAction.java	2011-08-13 17:51:36 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetHistoryChartAction.java	2011-08-20 11:10:50 +0000
@@ -156,6 +156,7 @@
 
         Period period = PeriodType.createPeriodExternalId( periodId );
         
+        System.out.println( "id " + organisationUnitId + ", dep " + organisationUnitService );
         OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( organisationUnitId );
         
         chart = chartService.getJFreeChartHistory( dataElement, categoryOptionCombo, period, organisationUnit, HISTORY_LENGTH, format );

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/RemoveMinMaxLimitsAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/RemoveMinMaxLimitsAction.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/RemoveMinMaxLimitsAction.java	2011-08-20 11:10:50 +0000
@@ -95,11 +95,11 @@
         this.dataElementId = dataElementId;
     }
     
-    private Integer optionComboId;
+    private Integer categoryOptionComboId;
 
-    public void setOptionComboId( Integer optionComboId )
+    public void setCategoryOptionComboId( Integer categoryOptionComboId )
     {
-        this.optionComboId = optionComboId;
+        this.categoryOptionComboId = categoryOptionComboId;
     }
 
     // -------------------------------------------------------------------------
@@ -113,7 +113,7 @@
 
         DataElement dataElement = dataElementService.getDataElement( dataElementId );
         
-        DataElementCategoryOptionCombo optionCombo = categoryService.getDataElementCategoryOptionCombo( optionComboId );
+        DataElementCategoryOptionCombo optionCombo = categoryService.getDataElementCategoryOptionCombo( categoryOptionComboId );
 
         MinMaxDataElement minMaxDataElement = minMaxDataElementService.getMinMaxDataElement( organisationUnit,
             dataElement, optionCombo );

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SaveMinMaxLimitsAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SaveMinMaxLimitsAction.java	2010-11-22 21:48:22 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SaveMinMaxLimitsAction.java	2011-08-20 11:10:50 +0000
@@ -94,12 +94,12 @@
     {
         this.dataElementId = dataElementId;
     }
-    
-    private Integer optionComboId;
-
-    public void setOptionComboId( Integer optionComboId )
+
+    private Integer categoryOptionComboId;
+
+    public void setCategoryOptionComboId( Integer categoryOptionComboId )
     {
-        this.optionComboId = optionComboId;
+        this.categoryOptionComboId = categoryOptionComboId;
     }
 
     private Integer minLimit;
@@ -127,7 +127,7 @@
 
         DataElement dataElement = dataElementService.getDataElement( dataElementId );
         
-        DataElementCategoryOptionCombo optionCombo = categoryService.getDataElementCategoryOptionCombo( optionComboId );
+        DataElementCategoryOptionCombo optionCombo = categoryService.getDataElementCategoryOptionCombo( categoryOptionComboId );
 
         MinMaxDataElement minMaxDataElement = minMaxDataElementService.getMinMaxDataElement( organisationUnit,
             dataElement, optionCombo );

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js	2011-08-20 10:17:48 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js	2011-08-20 11:10:50 +0000
@@ -74,10 +74,13 @@
     $( '#minLimit' ).val( '' );
     $( '#maxLimit' ).val( '' );
 
-    var url = 'removeMinMaxLimits.action?organisationUnitId=' + currentOrganisationUnitId + '&dataElementId='
-            + currentDataElementId + '&optionComboId=' + currentOptionComboId;
-
-    $.get( url, refreshChart );
+    $.get( 'removeMinMaxLimits.action', 
+    	{
+    		dataElementId: currentDataElementId,
+    		categoryOptionComboId: currentOptionComboId,
+    		organisationUnitId: currentOrganisationUnitId
+    	},
+    	refreshChart );
 }
 
 function saveMinMaxLimit()
@@ -129,17 +132,21 @@
     currentMinMaxValueMap[minId] = minValue;
     currentMinMaxValueMap[maxId] = maxValue;
 
-    var url = 'saveMinMaxLimits.action?organisationUnitId=' + currentOrganisationUnitId + '&dataElementId='
-            + currentDataElementId + '&optionComboId=' + currentOptionComboId + '&minLimit=' + minValue + '&maxLimit='
-            + maxValue;
-
-    $.get( url, refreshChart );
+    $.get( 'saveMinMaxLimits.action', 
+    	{
+    		organisationUnitId: currentOrganisationUnitId,
+    		dataElementId: currentDataElementId,
+    		categoryOptionComboId: currentOptionComboId,
+    		minLimit: minValue,
+    		maxValue: maxValue
+    	},
+    	refreshChart );
 }
 
 function refreshChart()
 {
     var source = 'getHistoryChart.action?dataElementId=' + currentDataElementId + '&categoryOptionComboId='
-            + currentOptionComboId + '&r=' + Math.random();
+            + currentOptionComboId + '&periodId=' + periodId + '&organisationUnitId=' + currentOrganisationUnitId + '&r=' + Math.random();
 
     $( '#historyChart' ).attr( 'src', source );
 }