=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2011-05-12 13:10:29 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2011-05-28 18:05:39 +0000 @@ -1249,43 +1249,20 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/AddSectionAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/AddSectionAction.java 2011-05-28 11:57:54 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/section/AddSectionAction.java 2011-05-28 18:05:39 +0000 @@ -115,6 +115,7 @@ } section.setDataElements( selectedDataElements ); + dataSet.getSections().add( section ); sectionService.addSection( section ); if ( dataSet.getMobile() != null && dataSet.getMobile() ) // TODO Hack === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/AddOrganisationUnitAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/AddOrganisationUnitAction.java 2011-05-22 12:19:06 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/AddOrganisationUnitAction.java 2011-05-28 18:05:39 +0000 @@ -233,13 +233,12 @@ if ( parent == null ) { // ----------------------------------------------------------------- - // If no unit is selected, the parent is the parent of the roots in - // the tree + // If no unit is selected, the parent is the parent of the roots // ----------------------------------------------------------------- parent = selectionManager.getRootOrganisationUnitsParent(); } - + // --------------------------------------------------------------------- // Create organisation unit // --------------------------------------------------------------------- @@ -255,6 +254,11 @@ organisationUnit.setEmail( email ); organisationUnit.setPhoneNumber( phoneNumber ); + if ( parent != null ) + { + parent.getChildren().add( organisationUnit ); + } + organisationUnitId = organisationUnitService.addOrganisationUnit( organisationUnit ); for ( String id : dataSets ) @@ -264,6 +268,7 @@ if ( dataSet != null ) { dataSet.getSources().add( organisationUnit ); + organisationUnit.getDataSets().add( dataSet ); dataSetService.updateDataSet( dataSet ); } } @@ -275,6 +280,7 @@ if ( group != null ) { group.getMembers().add( organisationUnit ); + organisationUnit.getGroups().add( group ); organisationUnitGroupService.updateOrganisationUnitGroup( group ); } } === 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-05-22 12:19:06 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java 2011-05-28 18:05:39 +0000 @@ -283,6 +283,7 @@ if ( dataSet != null ) { dataSet.getSources().add( organisationUnit ); + organisationUnit.getDataSets().add( dataSet ); dataSetService.updateDataSet( dataSet ); } } @@ -301,11 +302,13 @@ if ( oldGroup != null && oldGroup.getMembers().remove( organisationUnit ) ) { + organisationUnit.getGroups().remove( oldGroup ); organisationUnitGroupService.updateOrganisationUnitGroup( oldGroup ); } if ( newGroup != null && newGroup.getMembers().add( organisationUnit ) ) { + organisationUnit.getGroups().add( newGroup ); organisationUnitGroupService.updateOrganisationUnitGroup( newGroup ); } }