← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3111: Fixed bug with add/update organisation unit - dataset on server

 

------------------------------------------------------------
revno: 3111
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-03-21 21:20:48 +0100
message:
  Fixed bug with add/update organisation unit - dataset on server
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.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-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java	2011-03-17 10:20:34 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java	2011-03-21 20:20:48 +0000
@@ -237,9 +237,14 @@
         organisationUnit.setEmail( email );
         organisationUnit.setPhoneNumber( phoneNumber );
 
+        for ( DataSet dataSet : organisationUnit.getDataSets() ) // Remove current
+        {
+            dataSet.getSources().remove( organisationUnit );
+        }
+        
         organisationUnit.getDataSets().clear();
         
-        for ( String id : dataSets )
+        for ( String id : dataSets ) // Add selected
         {
             DataSet dataSet = dataSetService.getDataSet( Integer.parseInt( id ) );
             dataSet.getSources().add( organisationUnit );