dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20743
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9627: Translation for OrgunitLevel object
------------------------------------------------------------
revno: 9627
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-01-28 13:30:22 +0700
message:
Translation for OrgunitLevel object
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java
dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewScheduledTasks.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/saveOrganisationUnitLevelForm.vm
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonMapView.vm
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonMapViews.vm
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonOrganisationUnitLevels.vm
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/responseOrganisationUnitLevel.vm
--
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-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java 2013-01-14 21:35:56 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java 2013-01-28 06:30:22 +0000
@@ -27,9 +27,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import static org.hisp.dhis.i18n.I18nUtils.i18n;
+
import org.apache.commons.collections.CollectionUtils;
import org.hisp.dhis.dataset.DataSet;
import org.hisp.dhis.hierarchy.HierarchyViolationException;
+import org.hisp.dhis.i18n.I18nService;
import org.hisp.dhis.organisationunit.comparator.OrganisationUnitLevelComparator;
import org.hisp.dhis.system.util.ConversionUtils;
import org.hisp.dhis.system.util.Filter;
@@ -94,6 +97,13 @@
this.versionService = versionService;
}
+ private I18nService i18nService;
+
+ public void setI18nService( I18nService service )
+ {
+ i18nService = service;
+ }
+
// -------------------------------------------------------------------------
// OrganisationUnit
// -------------------------------------------------------------------------
@@ -455,7 +465,7 @@
return organisationUnitStore.getOrganisationUnitsByNameAndGroups( query, groups, limit );
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings( "unchecked" )
public Collection<OrganisationUnit> getOrganisationUnitsByNameAndGroups( String name,
Collection<OrganisationUnitGroup> groups, OrganisationUnit parent, boolean limit )
{
@@ -573,7 +583,8 @@
}
@Override
- public Collection<OrganisationUnit> getOrganisationUnitsBetweenByStatusLastUpdated( boolean status, Date lastUpdated, int first, int max )
+ public Collection<OrganisationUnit> getOrganisationUnitsBetweenByStatusLastUpdated( boolean status,
+ Date lastUpdated, int first, int max )
{
return organisationUnitStore.getBetweenByStatusLastUpdated( status, lastUpdated, first, max );
}
@@ -668,8 +679,8 @@
public List<OrganisationUnitLevel> getOrganisationUnitLevels()
{
- List<OrganisationUnitLevel> organisationUnitLevels = new ArrayList<OrganisationUnitLevel>(
- organisationUnitLevelStore.getAll() );
+ List<OrganisationUnitLevel> organisationUnitLevels = new ArrayList<OrganisationUnitLevel>( i18n( i18nService,
+ organisationUnitLevelStore.getAll() ) );
Collections.sort( organisationUnitLevels, OrganisationUnitLevelComparator.INSTANCE );
@@ -678,12 +689,12 @@
public OrganisationUnitLevel getOrganisationUnitLevelByLevel( int level )
{
- return organisationUnitLevelStore.getByLevel( level );
+ return i18n( i18nService, organisationUnitLevelStore.getByLevel( level ) );
}
public OrganisationUnitLevel getOrganisationUnitLevelByName( String name )
{
- return organisationUnitLevelStore.getByName( name );
+ return i18n( i18nService, organisationUnitLevelStore.getByName( name ) );
}
public List<OrganisationUnitLevel> getFilledOrganisationUnitLevels()
=== 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 2013-01-28 06:07:57 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2013-01-28 06:30:22 +0000
@@ -430,6 +430,7 @@
<property name="organisationUnitLevelStore" ref="org.hisp.dhis.organisationunit.OrganisationUnitLevelStore" />
<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
<property name="versionService" ref="org.hisp.dhis.version.VersionService" />
+ <property name="i18nService" ref="org.hisp.dhis.i18n.I18nService" />
</bean>
<bean id="org.hisp.dhis.organisationunit.OrganisationUnitGroupService"
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm 2013-01-23 10:27:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm 2013-01-28 06:30:22 +0000
@@ -35,7 +35,7 @@
#foreach( $level in $levels )
{
"value": "${level.level}" ,
- "name": "$!encoder.jsonEncode( ${level.name} )"
+ "name": "$!encoder.jsonEncode( ${level.displayName} )"
}#if($velocityCount < $levels.size()),#end
#end
]
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewScheduledTasks.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewScheduledTasks.vm 2012-05-08 18:53:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewScheduledTasks.vm 2013-01-28 06:30:22 +0000
@@ -34,7 +34,7 @@
<select id="orgUnitGroupSetAggLevel" name="orgUnitGroupSetAggLevel" class="scheduling" style="width:100%">
<option value="0"#if( $orgUnitGroupSetAggLevel && $orgUnitGroupSetAggLevel == 0 ) selected="selected"#end>[$i18n.getString( "no_aggregation" )]</option>
#foreach( $level in $levels )
- <option value="$level.level"#if( $orgUnitGroupSetAggLevel && $orgUnitGroupSetAggLevel == $level.level ) selected="selected"#end>$encoder.htmlEncode( $level.name )</option>
+ <option value="$level.level"#if( $orgUnitGroupSetAggLevel && $orgUnitGroupSetAggLevel == $level.level ) selected="selected"#end>$encoder.htmlEncode( $level.displayName )</option>
#end
</select>
</td>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm 2013-01-24 04:15:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm 2013-01-28 06:30:22 +0000
@@ -170,7 +170,7 @@
<td>
<select multiple size="4" id="organisationUnitLevels" style="width:440px" ondblclick="moveSelectedById( 'organisationUnitLevels', 'aggregationLevels' )">
#foreach( $level in $organisationUnitLevels )
- <option value="$level.level">$level.name</option>
+ <option value="$level.level">$level.displayName</option>
#end
</select>
</td>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm 2013-01-24 04:15:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm 2013-01-28 06:30:22 +0000
@@ -187,7 +187,7 @@
<td>
<select multiple size="4" id="organisationUnitLevels" style="width:450px" ondblclick="moveSelectedById( 'organisationUnitLevels', 'aggregationLevels' )">
#foreach( $level in $organisationUnitLevels )
- <option value="$level.level">$level.name</option>
+ <option value="$level.level">$level.displayName</option>
#end
</select>
</td>
@@ -205,7 +205,7 @@
<td>
<select multiple size="4" id="aggregationLevels" name="aggregationLevels" style="width:450px" ondblclick="moveSelectedById( 'aggregationLevels', 'organisationUnitLevels' )">
#foreach( $level in $aggregationLevels )
- <option value="$level.level">$level.name</option>
+ <option value="$level.level">$level.displayName</option>
#end
</select>
</td>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/saveOrganisationUnitLevelForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/saveOrganisationUnitLevelForm.vm 2012-10-17 18:53:29 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/saveOrganisationUnitLevelForm.vm 2013-01-28 06:30:22 +0000
@@ -12,11 +12,13 @@
<tr>
<th>$i18n.getString( "level" )</th>
<th>$i18n.getString( "name" )</th>
+ <th>$i18n.getString( "operator" )</th>
</tr>
#foreach ( $level in $levels )
<tr>
<td style="text-align: center">$level.level</td>
- <td><input type="text" id="level${level.level}" name="level${level.level}" value="$!level.name" class="uniqueFields {validate:{required:true,alphanumeric:false,unique:'uniqueFields'}}"/></td>
+ <td><input type="text" id="level${level.level}" name="level${level.level}" value="$!level.displayName" class="uniqueFields {validate:{required:true,alphanumeric:false,unique:'uniqueFields'}}"/></td>
+ <td align="center"><a href="javascript:translate( 'OrganisationUnitLevel', '$level.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a></td>
</tr>
#end
<tr>
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonMapView.vm'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonMapView.vm 2011-12-01 15:49:20 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonMapView.vm 2013-01-28 06:30:22 +0000
@@ -16,7 +16,7 @@
"parentOrganisationUnitName": "$!encoder.jsonEncode( ${object.parentOrganisationUnit.name} )",
"parentOrganisationUnitLevel": "$!{object.parentOrganisationUnit.level}",
"organisationUnitLevel": "$!{object.organisationUnitLevel.level}",
- "organisationUnitLevelName": "$!{object.organisationUnitLevel.name}",
+ "organisationUnitLevelName": "$!{object.organisationUnitLevel.displayName}",
"mapLegendType": "$!encoder.jsonEncode( ${object.mapLegendType} )",
"method": "$!{object.method}",
"classes": "$!{object.classes}",
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonMapViews.vm'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonMapViews.vm 2011-12-01 15:49:20 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonMapViews.vm 2013-01-28 06:30:22 +0000
@@ -18,7 +18,7 @@
"parentOrganisationUnitName": "$!encoder.jsonEncode( ${mapView.parentOrganisationUnit.name} )",
"parentOrganisationUnitLevel": "$!{mapView.parentOrganisationUnit.level}",
"organisationUnitLevel": "$!{mapView.organisationUnitLevel.level}",
- "organisationUnitLevelName": "$!{mapView.organisationUnitLevel.name}",
+ "organisationUnitLevelName": "$!{mapView.organisationUnitLevel.displayName}",
"mapLegendType": "$!encoder.jsonEncode( ${mapView.mapLegendType} )",
"method": "$!{mapView.method}",
"classes": "$!{mapView.classes}",
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonOrganisationUnitLevels.vm'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonOrganisationUnitLevels.vm 2010-11-25 15:08:07 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonOrganisationUnitLevels.vm 2013-01-28 06:30:22 +0000
@@ -4,7 +4,7 @@
{
"id": "$!{level.id}",
"level": "$!{level.level}",
- "name": "$!encoder.jsonEncode( ${level.name} )"
+ "name": "$!encoder.jsonEncode( ${level.displayName} )"
}#if( $velocityCount < $size ),#end
#end
] }
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/responseOrganisationUnitLevel.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/responseOrganisationUnitLevel.vm 2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/responseOrganisationUnitLevel.vm 2013-01-28 06:30:22 +0000
@@ -3,7 +3,7 @@
{
"id": $!{level.id},
"level": $!{level.level},
- "name": "$!{level.name}"
+ "name": "$!{level.displayName}"
},
#end
] }
\ No newline at end of file