← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13340: fix for orgunit merge, use uids from oust

 

------------------------------------------------------------
revno: 13340
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-12-20 12:34:19 +0100
message:
  fix for orgunit merge, use uids from oust
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/organisationunitmerge/MergeOrganisationUnitsAction.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-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/organisationunitmerge/MergeOrganisationUnitsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/organisationunitmerge/MergeOrganisationUnitsAction.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/organisationunitmerge/MergeOrganisationUnitsAction.java	2013-12-20 11:34:19 +0000
@@ -28,14 +28,13 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import com.opensymphony.xwork2.Action;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.hisp.dhis.datamerge.DataMergeService;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 
-import com.opensymphony.xwork2.Action;
-
 /**
  * @author Lars Helge Overland
  */
@@ -54,7 +53,7 @@
     {
         this.dataMergeService = dataMergeService;
     }
-    
+
     private OrganisationUnitService organisationUnitService;
 
     public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
@@ -66,16 +65,16 @@
     // Input
     // -------------------------------------------------------------------------
 
-    private Integer organisationUnitToEliminate;
-    
-    public void setOrganisationUnitToEliminate( Integer organisationUnitToEliminate )
+    private String organisationUnitToEliminate;
+
+    public void setOrganisationUnitToEliminate( String organisationUnitToEliminate )
     {
         this.organisationUnitToEliminate = organisationUnitToEliminate;
     }
 
-    private Integer organisationUnitToKeep;
-    
-    public void setOrganisationUnitToKeep( Integer organisationUnitToKeep )
+    private String organisationUnitToKeep;
+
+    public void setOrganisationUnitToKeep( String organisationUnitToKeep )
     {
         this.organisationUnitToKeep = organisationUnitToKeep;
     }
@@ -90,14 +89,14 @@
         OrganisationUnit keep = organisationUnitService.getOrganisationUnit( organisationUnitToKeep );
 
         log.info( "Merging " + eliminate + " into " + keep );
-        
-        if ( !( organisationUnitToEliminate == organisationUnitToKeep ) )
+
+        if ( !(organisationUnitToEliminate.equals( organisationUnitToKeep )) )
         {
             dataMergeService.mergeOrganisationUnits( keep, eliminate );
         }
-        
+
         log.info( "Merging complete" );
-        
+
         return SUCCESS;
     }
 }