← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5827: I18n db dataentry

 

------------------------------------------------------------
revno: 5827
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-01-30 21:16:08 +0100
message:
  I18n db dataentry
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java
  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


--
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/dataelement/DataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2012-01-30 20:16:08 +0000
@@ -354,7 +354,7 @@
      */
     public String getFormNameFallback()
     {
-        return formName != null && !formName.isEmpty() ? formName : name;
+        return formName != null && !formName.isEmpty() ? formName : getDisplayName();
     }
 
     public String toJSON()

=== 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	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java	2012-01-30 20:16:08 +0000
@@ -77,6 +77,16 @@
     DataSet getDataSet( int id );
 
     /**
+     * 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 i18nOrgUnits whether to i18n the org units 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 i18nOrgUnits );
+    
+    /**
      * 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	2012-01-28 16:24:59 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java	2012-01-30 20:16:08 +0000
@@ -117,12 +117,28 @@
         return i18n( i18nService, dataSetStore.get( id ) );
     }
     
-    @Override
     public DataSet getDataSet( String uid )
     {
         return i18n( i18nService, dataSetStore.getByUid( uid ) );
     }
-
+    
+    public DataSet getDataSet( int id, boolean i18nDataElements, boolean i18nOrgUnits )
+    {
+        DataSet dataSet = getDataSet( id );
+        
+        if ( i18nDataElements )
+        {
+            i18n( i18nService, dataSet.getDataElements() );
+        }
+        
+        if ( i18nOrgUnits )
+        {
+            i18n( i18nService, dataSet.getSources() );
+        }
+        
+        return dataSet;
+    }
+    
     public DataSet getDataSetByName( String name )
     {
         return i18n( i18nService, dataSetStore.getByName( name ) );

=== 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	2012-01-25 17:11:43 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/LoadFormAction.java	2012-01-30 20:16:08 +0000
@@ -201,7 +201,7 @@
     public String execute()
         throws Exception
     {
-        DataSet dataSet = dataSetService.getDataSet( dataSetId );
+        DataSet dataSet = dataSetService.getDataSet( dataSetId, true, false );
 
         List<DataElement> dataElements = new ArrayList<DataElement>( dataSet.getDataElements() );