← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10421: Fixed bug with chart periods on update

 

------------------------------------------------------------
revno: 10421
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-03-26 00:23:06 +0100
message:
  Fixed bug with chart periods on update
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java


--
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-api/src/main/java/org/hisp/dhis/chart/Chart.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2013-03-19 16:20:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2013-03-25 23:23:06 +0000
@@ -280,16 +280,6 @@
         return organisationUnitGroupSet != null && organisationUnitGroupSet.getOrganisationUnitGroups() != null;
     }
     
-    public void removeAllOrganisationUnits()
-    {
-        organisationUnits.clear();
-    }
-
-    public void removeAllDataSets()
-    {
-        dataSets.clear();
-    }
-
     public void removeAllDataElements()
     {
         dataElements.clear();
@@ -300,6 +290,21 @@
         indicators.clear();
     }
 
+    public void removeAllDataSets()
+    {
+        dataSets.clear();
+    }
+
+    public void removeAllPeriods()
+    {
+        periods.clear();
+    }
+
+    public void removeAllOrganisationUnits()
+    {
+        organisationUnits.clear();
+    }
+
     /**
      * Sets all dimensions for this chart.
      *
@@ -768,6 +773,9 @@
 
             removeAllDataSets();
             dataSets.addAll( chart.getDataSets() );
+            
+            removeAllPeriods();
+            periods.addAll( chart.getPeriods() );
 
             removeAllOrganisationUnits();
             organisationUnits.addAll( chart.getOrganisationUnits() );