=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitGroupService.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitGroupService.java 2011-12-26 10:07:59 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitGroupService.java 2012-01-22 08:21:22 +0000 @@ -27,10 +27,13 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +import static org.hisp.dhis.i18n.I18nUtils.i18n; + import java.util.ArrayList; import java.util.Collection; import org.hisp.dhis.common.GenericIdentifiableObjectStore; +import org.hisp.dhis.i18n.I18nService; import org.hisp.dhis.system.util.Filter; import org.hisp.dhis.system.util.FilterUtils; import org.springframework.transaction.annotation.Transactional; @@ -61,6 +64,13 @@ this.organisationUnitGroupSetStore = organisationUnitGroupSetStore; } + private I18nService i18nService; + + public void setI18nService( I18nService service ) + { + i18nService = service; + } + // ------------------------------------------------------------------------- // OrganisationUnitGroup // ------------------------------------------------------------------------- @@ -82,7 +92,7 @@ public OrganisationUnitGroup getOrganisationUnitGroup( int id ) { - return organisationUnitGroupStore.get( id ); + return i18n( i18nService, organisationUnitGroupStore.get( id ) ); } public Collection getOrganisationUnitGroups( final Collection identifiers ) @@ -100,24 +110,44 @@ public OrganisationUnitGroup getOrganisationUnitGroup( String uid ) { - return organisationUnitGroupStore.getByUid( uid ); + return i18n( i18nService, organisationUnitGroupStore.getByUid( uid ) ); } public OrganisationUnitGroup getOrganisationUnitGroupByName( String name ) { - return organisationUnitGroupStore.getByName( name ); + return i18n( i18nService, organisationUnitGroupStore.getByName( name ) ); } public Collection getAllOrganisationUnitGroups() { - return organisationUnitGroupStore.getAll(); + return i18n( i18nService, organisationUnitGroupStore.getAll() ); } public Collection getOrganisationUnitGroupsWithGroupSets() { - return organisationUnitGroupStore.getOrganisationUnitGroupsWithGroupSets(); - } - + return i18n( i18nService, organisationUnitGroupStore.getOrganisationUnitGroupsWithGroupSets() ); + } + + public Collection getOrganisationUnitGroupsBetween( int first, int max ) + { + return i18n( i18nService, organisationUnitGroupStore.getBetween( first, max ) ); + } + + public Collection getOrganisationUnitGroupsBetweenByName( String name, int first, int max ) + { + return i18n( i18nService, organisationUnitGroupStore.getBetweenByName( name, first, max ) ); + } + + public int getOrganisationUnitGroupCount() + { + return organisationUnitGroupStore.getCount(); + } + + public int getOrganisationUnitGroupCountByName( String name ) + { + return organisationUnitGroupStore.getCountByName( name ); + } + // ------------------------------------------------------------------------- // OrganisationUnitGroupSet // ------------------------------------------------------------------------- @@ -139,12 +169,12 @@ public OrganisationUnitGroupSet getOrganisationUnitGroupSet( int id ) { - return organisationUnitGroupSetStore.get( id ); + return i18n( i18nService, organisationUnitGroupSetStore.get( id ) ); } public OrganisationUnitGroupSet getOrganisationUnitGroupSet( String uid ) { - return organisationUnitGroupSetStore.getByUid( uid ); + return i18n( i18nService, organisationUnitGroupSetStore.getByUid( uid ) ); } public Collection getOrganisationUnitGroupSets( final Collection identifiers ) @@ -162,12 +192,12 @@ public OrganisationUnitGroupSet getOrganisationUnitGroupSetByName( String name ) { - return organisationUnitGroupSetStore.getByName( name ); + return i18n( i18nService, organisationUnitGroupSetStore.getByName( name ) ); } public Collection getAllOrganisationUnitGroupSets() { - return organisationUnitGroupSetStore.getAll(); + return i18n( i18nService, organisationUnitGroupSetStore.getAll() ); } public Collection getCompulsoryOrganisationUnitGroupSets() @@ -223,35 +253,15 @@ return groupSets; } - - public Collection getOrganisationUnitGroupsBetween( int first, int max ) - { - return organisationUnitGroupStore.getBetween( first, max ); - } - - public Collection getOrganisationUnitGroupsBetweenByName( String name, int first, int max ) - { - return organisationUnitGroupStore.getBetweenByName( name, first, max ); - } - - public int getOrganisationUnitGroupCount() - { - return organisationUnitGroupStore.getCount(); - } - - public int getOrganisationUnitGroupCountByName( String name ) - { - return organisationUnitGroupStore.getCountByName( name ); - } public Collection getOrganisationUnitGroupSetsBetween( int first, int max ) { - return organisationUnitGroupSetStore.getBetween( first, max ); + return i18n( i18nService, organisationUnitGroupSetStore.getBetween( first, max ) ); } public Collection getOrganisationUnitGroupSetsBetweenByName( String name, int first, int max ) { - return organisationUnitGroupSetStore.getBetweenByName( name, first, max ); + return i18n( i18nService, organisationUnitGroupSetStore.getBetweenByName( name, first, max ) ); } public int getOrganisationUnitGroupSetCount() @@ -263,5 +273,4 @@ { return organisationUnitGroupSetStore.getCountByName( name ); } - } === 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 2012-01-22 08:05:52 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2012-01-22 08:21:22 +0000 @@ -363,6 +363,7 @@ + === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnitGroup.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnitGroup.vm 2011-03-19 19:30:05 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnitGroup.vm 2012-01-22 08:21:22 +0000 @@ -19,7 +19,7 @@ - + @@ -29,11 +29,12 @@ #foreach( $organisationUnitGroup in $organisationUnitGroups ) - + === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnitGroupSet.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnitGroupSet.vm 2011-03-19 19:30:05 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnitGroupSet.vm 2012-01-22 08:21:22 +0000 @@ -21,7 +21,7 @@
$i18n.getString( "name" )
$encoder.htmlEncode( $organisationUnitGroup.name )$encoder.htmlEncode( $organisationUnitGroup.displayName ) $i18n.getString( 'edit' ) + $i18n.getString( 'translation_translate' ) #if( $auth.hasAccess( "dhis-web-maintenance-organisationunit", "removeOrganisationUnitGroup" ) ) - $i18n.getString( 'remove' ) + $i18n.getString( 'remove' ) #else $i18n.getString( 'remove' ) #end $i18n.getString( 'show_details' )
- + @@ -32,11 +32,12 @@ #foreach( $organisationUnitGroupSet in $organisationUnitGroupSets ) - +
$encoder.htmlEncode( $organisationUnitGroupSet.name )$encoder.htmlEncode( $organisationUnitGroupSet.displayName ) $i18n.getString( 'edit' ) + $i18n.getString( 'translation_translate' ) #if( $auth.hasAccess( "dhis-web-maintenance-organisationunit", "removeOrganisationUnitGroupSet" ) ) - $i18n.getString( 'remove' ) + $i18n.getString( 'remove' ) #else $i18n.getString( 'remove' ) #end $i18n.getString( 'show_details' )