← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3093: Displaying 'Value' as header for default category option if default

 

------------------------------------------------------------
revno: 3093
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2011-03-20 10:29:59 +0100
message:
  Displaying 'Value' as header for default category option if default
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties
  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/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/dataelement/DataElementCategoryOption.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java	2011-01-31 19:47:04 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOption.java	2011-03-20 09:29:59 +0000
@@ -62,6 +62,15 @@
     }
 
     // -------------------------------------------------------------------------
+    // Logic
+    // -------------------------------------------------------------------------
+
+    public boolean isDefault()
+    {
+        return name.equals( DEFAULT_NAME );
+    }
+    
+    // -------------------------------------------------------------------------
     // hashCode, equals and toString
     // -------------------------------------------------------------------------
 

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties	2011-02-17 16:53:18 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties	2011-03-20 09:29:59 +0000
@@ -121,4 +121,5 @@
 select_period						= Select period
 change_from							= change from
 to									= to
-on									= On
\ No newline at end of file
+on									= On
+value								= Value
\ No newline at end of file

=== 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	2011-03-20 09:21:04 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm	2011-03-20 09:29:59 +0000
@@ -16,8 +16,7 @@
     #set( $cols = $colRepeat.get( $category.id ) )
     #foreach( $col in $cols )
       #foreach( $categoryOption in $categoryOptions )
-      #set( $optionName = $categoryOption.name )
-      <th colspan="$colCount"><div align="center"> #if( $optionName != "default" ) $optionName #end </div></th>
+      <th colspan="$colCount"><div align="center"> #if( $categoryOption.isDefault() )${i18n.getString( "value" )}#else ${encoder.htmlEncode( $categoryOption.name )}#end </div></th>
       #end
     #end
   </tr>

=== 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	2011-03-20 09:21:04 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm	2011-03-20 09:29:59 +0000
@@ -35,8 +35,7 @@
         #set( $cols = $colRepeat.get( $category.id ) )
         #foreach( $col in $cols )
           #foreach( $categoryOption in $categoryOptions )
-          #set( $optionName = $categoryOption.name )
-          <th colspan="$colCount"> <div align="center"> #if( $optionName != "default" ) $optionName #end </div> </th>
+          <th colspan="$colCount"><div align="center"> #if( $categoryOption.isDefault() )${i18n.getString( "value" )}#else ${encoder.htmlEncode( $categoryOption.name )}#end </div></th>
           #end
         #end
       </tr>