dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #23140
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11252: i18n-db fixes for data-entry
------------------------------------------------------------
revno: 11252
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-06-24 12:33:13 +0700
message:
i18n-db fixes for data-entry
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java
dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/LoadFormAction.java
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/multiOrgSectionForm.vm
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.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-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java 2013-03-19 17:09:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java 2013-06-24 05:33:13 +0000
@@ -90,6 +90,18 @@
DataSet getDataSet( int id, boolean i18nDataElements, boolean i18nIndicators, boolean i18nOrgUnits );
/**
+ * Get a DataSet
+ *
+ * @param id The unique identifier for the DataSet to get.
+ * @param i18nDataElements whether to i18n the data elements of this data set.
+ * @param i18nIndicators whether to i18n the indicators of this data set.
+ * @param i18nOrgUnits whether to i18n the org units of this data set.
+ * @param i18nSections whether to i18n the sections of this data set.
+ * @return The DataSet with the given id or null if it does not exist.
+ */
+ DataSet getDataSet( int id, boolean i18nDataElements, boolean i18nIndicators, boolean i18nOrgUnits, boolean i18nSections );
+
+ /**
* Returns the DataSet with the given UID.
*
* @param uid the UID.
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java 2013-03-19 17:09:10 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java 2013-06-24 05:33:13 +0000
@@ -117,6 +117,11 @@
public DataSet getDataSet( int id, boolean i18nDataElements, boolean i18nIndicators, boolean i18nOrgUnits )
{
+ return getDataSet( id, i18nDataElements, i18nIndicators, i18nOrgUnits, false );
+ }
+
+ public DataSet getDataSet( int id, boolean i18nDataElements, boolean i18nIndicators, boolean i18nOrgUnits, boolean i18nSections )
+ {
DataSet dataSet = getDataSet( id );
if ( i18nDataElements )
@@ -134,6 +139,11 @@
i18n( i18nService, dataSet.getSources() );
}
+ if ( i18nSections && dataSet.hasSections() )
+ {
+ i18n( i18nService, dataSet.getSections() );
+ }
+
return dataSet;
}
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/LoadFormAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/LoadFormAction.java 2013-04-04 18:06:19 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/LoadFormAction.java 2013-06-24 05:33:13 +0000
@@ -214,7 +214,7 @@
public String execute()
throws Exception
{
- DataSet dataSet = dataSetService.getDataSet( dataSetId, true, false, false );
+ DataSet dataSet = dataSetService.getDataSet( dataSetId, true, false, false, true );
List<DataElement> dataElements = new ArrayList<DataElement>( dataElementService.getDataElements( dataSet, null,
null ) );
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm 2013-05-23 10:40:52 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm 2013-06-24 05:33:13 +0000
@@ -16,7 +16,7 @@
#set( $cols = $colRepeat.get( $category.id ) )
#foreach( $col in $cols )
#foreach( $categoryOption in $categoryOptions )
- <th colspan="$colCount"><span align="center">#if( $categoryOption.isDefault() )${i18n.getString( "value" )}#else ${encoder.htmlEncode( $categoryOption.name )}#end</span></th>
+ <th colspan="$colCount"><span align="center">#if( $categoryOption.isDefault() )${i18n.getString( "value" )}#else ${encoder.htmlEncode( $categoryOption.displayName )}#end</span></th>
#end
#end
</tr>
@@ -26,7 +26,7 @@
#set( $dataElements = $orderedDataElements.get( $categoryCombo ) )
#set( $optionCombos = $orderedCategoryOptionCombos.get( $categoryCombo.id ) )
#set( $mark = 0 )
- #foreach( $optionCombo in $optionCombos )<span id="${optionCombo.uid}-optioncombo" class="hidden">${encoder.htmlEncode( $optionCombo.name )}</span>
+ #foreach( $optionCombo in $optionCombos )<span id="${optionCombo.uid}-optioncombo" class="hidden">${encoder.htmlEncode( $optionCombo.displayName )}</span>
#end
#foreach( $dataElement in $dataElements )
#if( $mark == 1 )
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/multiOrgSectionForm.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/multiOrgSectionForm.vm 2013-05-23 10:40:52 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/multiOrgSectionForm.vm 2013-06-24 05:33:13 +0000
@@ -36,7 +36,7 @@
<tr>
<td rowspan="$rowSpan"></td>
#foreach( $dataElement in $section.dataElements )
- <th colspan="$colCount">$dataElement.name</th>
+ <th colspan="$colCount">$dataElement.displayName</th>
#end
</tr>
@@ -50,7 +50,7 @@
#foreach( $dataElement in $section.dataElements )
#foreach( $col in $cols )
#foreach( $categoryOption in $categoryOptions )
- <th colspan="$colCount"><span align="center">${encoder.htmlEncode( $categoryOption.name )}</span></th>
+ <th colspan="$colCount"><span align="center">${encoder.htmlEncode( $categoryOption.displayName )}</span></th>
#end
#end
#end
@@ -61,7 +61,7 @@
#set( $count = 0 )
#set( $mark = 0 )
#set( $optionCombos = $orderedCategoryOptionCombos.get( $categoryComboId ) )
- #foreach( $optionCombo in $optionCombos )<span id="${optionCombo.uid}-optioncombo" class="hidden">${encoder.htmlEncode( $optionCombo.name )}</span>#end
+ #foreach( $optionCombo in $optionCombos )<span id="${optionCombo.uid}-optioncombo" class="hidden">${encoder.htmlEncode( $optionCombo.displayName )}</span>#end
#foreach( $organisationUnit in $organisationUnits )
#if( $mark == 1 )
@@ -72,7 +72,7 @@
#set( $count = $count + 1 )
#set( $dataEntryId = "${organisationUnit.id}-${dataElement.uid}-${optionCombo.uid}-val" )
<tr>
- <td #if( $mark == 1 )class="alt"#else class="reg"#end>${encoder.htmlEncode( $organisationUnit.name )}</td>
+ <td #if( $mark == 1 )class="alt"#else class="reg"#end>${encoder.htmlEncode( $organisationUnit.displayName )}</td>
#foreach( $dataElement in $section.dataElements )
<span class="hidden" id="${dataElement.uid}-dataelement">${encoder.htmlEncode( $dataElement.getFormNameFallback() )}</span>
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm 2013-05-29 21:15:22 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm 2013-06-24 05:33:13 +0000
@@ -35,7 +35,7 @@
#set( $cols = $colRepeat.get( $category.id ) )
#foreach( $col in $cols )
#foreach( $categoryOption in $categoryOptions )
- <th colspan="$colCount"><span align="center">#if( $categoryOption.isDefault() )${i18n.getString( "value" )}#else ${encoder.htmlEncode( $categoryOption.name )}#end</span></th>
+ <th colspan="$colCount"><span align="center">#if( $categoryOption.isDefault() )${i18n.getString( "value" )}#else ${encoder.htmlEncode( $categoryOption.displayName )}#end</span></th>
#end
#end
</tr>
@@ -44,7 +44,7 @@
#set( $count = 0 )
#set( $mark = 0 )
#set( $optionCombos = $orderedCategoryOptionCombos.get( $categoryComboId ) )
- #foreach( $optionCombo in $optionCombos )<span id="${optionCombo.uid}-optioncombo" class="hidden">${encoder.htmlEncode( $optionCombo.name )}</span>
+ #foreach( $optionCombo in $optionCombos )<span id="${optionCombo.uid}-optioncombo" class="hidden">${encoder.htmlEncode( $optionCombo.displayName )}</span>
#end
#foreach( $dataElement in $section.dataElements )
#if( $mark == 1 )