dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20979
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9818: Translation for Aggregation Query Builder.
------------------------------------------------------------
revno: 9818
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-02-18 10:04:47 +0700
message:
Translation for Aggregation Query Builder.
removed:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregationList.vm
modified:
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java
dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregation.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/relationshipType.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-patient/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java 2013-02-07 14:28:18 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java 2013-02-18 03:04:47 +0000
@@ -41,6 +41,7 @@
import static org.hisp.dhis.caseaggregation.CaseAggregationCondition.OPERATOR_AND;
import static org.hisp.dhis.caseaggregation.CaseAggregationCondition.SEPARATOR_ID;
import static org.hisp.dhis.caseaggregation.CaseAggregationCondition.SEPARATOR_OBJECT;
+import static org.hisp.dhis.i18n.I18nUtils.i18n;
import java.util.ArrayList;
import java.util.Collection;
@@ -52,6 +53,7 @@
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.i18n.I18nService;
import org.hisp.dhis.jdbc.StatementBuilder;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.patient.Patient;
@@ -125,9 +127,12 @@
private StatementBuilder statementBuilder;
+ private I18nService i18nService;
+
// -------------------------------------------------------------------------
// Getters && Setters
// -------------------------------------------------------------------------
+
public void setStatementBuilder( StatementBuilder statementBuilder )
{
this.statementBuilder = statementBuilder;
@@ -163,6 +168,11 @@
this.dataElementService = dataElementService;
}
+ public void setI18nService( I18nService service )
+ {
+ i18nService = service;
+ }
+
// -------------------------------------------------------------------------
// Implementation Methods
// -------------------------------------------------------------------------
@@ -192,13 +202,13 @@
@Override
public Collection<CaseAggregationCondition> getAllCaseAggregationCondition()
{
- return aggregationConditionStore.getAll();
+ return i18n( i18nService, aggregationConditionStore.getAll());
}
@Override
public CaseAggregationCondition getCaseAggregationCondition( int id )
{
- return aggregationConditionStore.get( id );
+ return i18n( i18nService, aggregationConditionStore.get( id ));
}
@@ -211,14 +221,14 @@
@Override
public Collection<CaseAggregationCondition> getCaseAggregationCondition( DataElement dataElement )
{
- return aggregationConditionStore.get( dataElement );
+ return i18n( i18nService, aggregationConditionStore.get( dataElement ));
}
@Override
public CaseAggregationCondition getCaseAggregationCondition( DataElement dataElement,
DataElementCategoryOptionCombo optionCombo )
{
- return aggregationConditionStore.get( dataElement, optionCombo );
+ return i18n( i18nService, aggregationConditionStore.get( dataElement, optionCombo ));
}
@Override
@@ -325,8 +335,8 @@
|| operator.equals( CaseAggregationCondition.AGGRERATION_SUM ) )
{
aggregationCondition.setOperator( AGGRERATION_SUM );
- sql = createSQL( aggregationCondition.getAggregationExpression(),
- aggregationCondition.getOperator(), orgunitId, startDate, endDate );
+ sql = createSQL( aggregationCondition.getAggregationExpression(), aggregationCondition.getOperator(),
+ orgunitId, startDate, endDate );
}
else
{
@@ -345,7 +355,7 @@
+ convertCondition( aggregationCondition, orgunit, period ) + " ) ";
}
}
-
+
Collection<Integer> stageInstanceIds = aggregationConditionStore.executeSQL( sql );
for ( Integer stageInstanceId : stageInstanceIds )
@@ -551,7 +561,7 @@
public Collection<CaseAggregationCondition> getCaseAggregationCondition( Collection<DataElement> dataElements )
{
- return aggregationConditionStore.get( dataElements );
+ return i18n( i18nService, aggregationConditionStore.get( dataElements ));
}
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml 2013-02-18 02:49:25 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml 2013-02-18 03:04:47 +0000
@@ -180,6 +180,7 @@
<property name="programStageInstanceService"
ref="org.hisp.dhis.program.ProgramStageInstanceService" />
<property name="statementBuilder" ref="statementBuilder" />
+ <property name="i18nService" ref="org.hisp.dhis.i18n.I18nService" />
</bean>
<bean id="org.hisp.dhis.relationship.RelationshipService" class="org.hisp.dhis.relationship.DefaultRelationshipService">
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregation.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregation.vm 2013-02-07 08:12:12 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregation.vm 2013-02-18 03:04:47 +0000
@@ -29,7 +29,7 @@
<table class="listTable">
<col>
- <col width="100">
+ <col width="120">
<tr>
<th>$i18n.getString( "name" )</th>
@@ -37,7 +37,20 @@
</tr>
<tbody id="list">
- #parse( "/dhis-web-maintenance-patient/caseAggregationList.vm" )
+ #set( $mark = true )
+ #foreach( $aggregationCondition in $aggregationConditions )
+ <tr id="tr${aggregationCondition.id}" #alternate( $mark )>
+ <td>$encoder.htmlEncode( $aggregationCondition.displayName )</td>
+ <td>
+ <a href="showUpdateCaseAggregationForm.action?id=$aggregationCondition.id&dataSetId=$!dataSetId" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
+ <a href="javascript:translate( 'CaseAggregationCondition', '$aggregationCondition.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a>
+ <a href="javascript:removeCaseAggregation( '$aggregationCondition.id', '$encoder.jsEncode( $aggregationCondition.displayName )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
+ <a href="javascript:showCaseAggregationDetails( $aggregationCondition.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"></a>
+ </td>
+
+ </tr>
+ #set( $mark = !$mark )
+ #end
</tbody>
</table>
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregationList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregationList.vm 2012-06-04 04:06:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregationList.vm 1970-01-01 00:00:00 +0000
@@ -1,15 +0,0 @@
-#set( $mark = true )
-#foreach( $aggregationCondition in $aggregationConditions )
- <tr id="tr${aggregationCondition.id}" #alternate( $mark )>
-
- <td>$encoder.htmlEncode( $aggregationCondition.name )</td>
-
- <td>
- <a href="showUpdateCaseAggregationForm.action?id=$aggregationCondition.id&dataSetId=$!dataSetId" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
- <a href="javascript:removeCaseAggregation( '$aggregationCondition.id', '$encoder.jsEncode( $aggregationCondition.name )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
- <a href="javascript:showCaseAggregationDetails( $aggregationCondition.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"></a>
- </td>
-
- </tr>
- #set( $mark = !$mark )
-#end
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/relationshipType.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/relationshipType.vm 2013-02-18 02:49:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/relationshipType.vm 2013-02-18 03:04:47 +0000
@@ -30,7 +30,8 @@
<td style="text-align:center"#alternate( $mark )>
<a href="showUpdateRelationshipTypeForm.action?id=$relationshipType.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
- <a href="javascript:translate( 'RelationshipType', '$relationshipType.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a> <a href="javascript:removeRelationshipType( '$relationshipType.id', '$encoder.jsEncode( $relationshipType.aIsToB )', '$encoder.jsEncode( $relationshipType.bIsToA )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
+ <a href="javascript:translate( 'RelationshipType', '$relationshipType.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a>
+ <a href="javascript:removeRelationshipType( '$relationshipType.id', '$encoder.jsEncode( $relationshipType.aIsToB )', '$encoder.jsEncode( $relationshipType.bIsToA )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
<a href="javascript:showRelationshipTypeDetails( $relationshipType.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"></a>
</td>