← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5805: Comparing display name instead of name in IdentifiableObjectNameComparator which means translatio...

 

------------------------------------------------------------
revno: 5805
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-01-25 20:22:00 +0100
message:
  Comparing display name instead of name in IdentifiableObjectNameComparator which means translations are respected in sorts
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/comparator/IdentifiableObjectNameComparator.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addTableForm.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/common/comparator/IdentifiableObjectNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/comparator/IdentifiableObjectNameComparator.java	2012-01-25 17:11:43 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/comparator/IdentifiableObjectNameComparator.java	2012-01-25 19:22:00 +0000
@@ -41,6 +41,6 @@
     
     public int compare( IdentifiableObject object0, IdentifiableObject object1 )
     {
-        return object0.getName().compareToIgnoreCase( object1.getName() );
+        return object0.getDisplayName().compareToIgnoreCase( object1.getDisplayName() );
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addTableForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addTableForm.vm	2011-12-23 18:01:04 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addTableForm.vm	2012-01-25 19:22:00 +0000
@@ -106,7 +106,7 @@
         <td>
             <select multiple size="6" id="availableDataElements" name="availableDataElements" style="min-width:640px" ondblclick="moveSelectedById( 'availableDataElements', 'selectedDataElements' )">
                 #foreach ( $element in $dataElements )
-                    <option value="$element.id">$encoder.htmlEncode( $element.name )</option>
+                    <option value="$element.id">$encoder.htmlEncode( $element.displayName )</option>
                 #end
             </select>
         </td>
@@ -126,7 +126,7 @@
         <td>
             <select multiple size="6" id="selectedDataElements" name="selectedDataElements" style="min-width:640px" ondblclick="moveSelectedById( 'selectedDataElements', 'availableDataElements' )">
                 #foreach( $element in $selectedDataElements )
-                    <option value="$element.id">$encoder.htmlEncode( $element.name )</option>
+                    <option value="$element.id">$encoder.htmlEncode( $element.displayName )</option>
                 #end
             </select>
         </td>
@@ -147,7 +147,7 @@
             <select id="indicatorGroupId" name="indicatorGroupId" style="min-width:640px" onchange="getIndicators()">
                 <option value="$ALL">[ $i18n.getString( "select_indicatorgroup_all" ) ]</option>
                 #foreach ( $group in $indicatorGroups )
-                    <option value="$group.id">$encoder.htmlEncode( $group.name )</option>
+                    <option value="$group.id">$encoder.htmlEncode( $group.displayName )</option>
                 #end
             </select>
         </td>
@@ -156,7 +156,7 @@
         <td>
             <select multiple size="6" id="availableIndicators" name="availableIndicators" style="min-width:640px" ondblclick="moveSelectedById( 'availableIndicators', 'selectedIndicators' )">             
                 #foreach ( $indicator in $indicators )
-                    <option value="$indicator.id">$encoder.htmlEncode( $indicator.name )</option>
+                    <option value="$indicator.id">$encoder.htmlEncode( $indicator.displayName )</option>
                 #end
             </select>
         </td>
@@ -176,7 +176,7 @@
         <td>
             <select multiple size="6" id="selectedIndicators" name="selectedIndicators" style="min-width:640px" ondblclick="moveSelectedById( 'selectedIndicators', 'availableIndicators' )">
                 #foreach( $indicator in $selectedIndicators )
-                    <option value="$indicator.id">$encoder.htmlEncode( $indicator.name )</option>
+                    <option value="$indicator.id">$encoder.htmlEncode( $indicator.displayName )</option>
                 #end
             </select>
         </td>
@@ -195,7 +195,7 @@
             <select id="dataElementGroupId" name="dataElementGroupId" style="min-width:640px" onchange="getDataElements()">
                 <option value="$ALL">[ $i18n.getString( "select_dataelementgroup_all" ) ]</option>
                 #foreach ( $group in $dataElementGroups )
-                    <option value="$group.id">$encoder.htmlEncode( $group.name )</option>
+                    <option value="$group.id">$encoder.htmlEncode( $group.displayName )</option>
                 #end
             </select>
         </td>
@@ -204,7 +204,7 @@
         <td>
             <select multiple size="6" id="availableDataElements" name="availableDataElements" style="min-width:640px" ondblclick="moveSelectedById( 'availableDataElements', 'selectedDataElements' )">             
                 #foreach ( $element in $dataElements )
-                    <option value="$element.id">$encoder.htmlEncode( $element.name )</option>
+                    <option value="$element.id">$encoder.htmlEncode( $element.displayName )</option>
                 #end
             </select>
         </td>
@@ -224,7 +224,7 @@
         <td>
             <select multiple size="6" id="selectedDataElements" name="selectedDataElements" style="min-width:640px" ondblclick="moveSelectedById( 'selectedDataElements', 'availableDataElements' )">
                 #foreach( $element in $selectedDataElements )
-                    <option value="$element.id">$encoder.htmlEncode( $element.name )</option>
+                    <option value="$element.id">$encoder.htmlEncode( $element.displayName )</option>
                 #end
             </select>
         </td>
@@ -242,7 +242,7 @@
         <td>
             <select multiple size="6" id="availableDataSets" name="availableDataSets" style="min-width:640px" ondblclick="moveSelectedById( 'availableDataSets', 'selectedDataSets' )">
                 #foreach ( $dataSet in $dataSets )
-                    <option value="$dataSet.id">$encoder.htmlEncode( $dataSet.name )</option>
+                    <option value="$dataSet.id">$encoder.htmlEncode( $dataSet.displayName )</option>
                 #end
             </select>
         </td>
@@ -262,7 +262,7 @@
         <td>
             <select multiple size="6" id="selectedDataSets" name="selectedDataSets" style="min-width:640px" ondblclick="moveSelectedById( 'selectedDataSets', 'availableDataSets' )">               
                 #foreach ( $dataSet in $selectedDataSets )
-                    <option value="$dataSet.id">$encoder.htmlEncode( $dataSet.name )</option>
+                    <option value="$dataSet.id">$encoder.htmlEncode( $dataSet.displayName )</option>
                 #end
             </select>
         </td>
@@ -290,7 +290,7 @@
 		<td>
 			<select multiple size="6" id="availableOrganisationUnitGroups" name="availableOrganisationUnitGroups" style="min-width:640px" ondblclick="moveSelectedById( 'availableOrganisationUnitGroups', 'selectedOrganisationUnitGroups' )">
 				#foreach ( $group in $organisationUnitGroups )
-					<option value="$group.id">$encoder.htmlEncode( $group.name )</option>
+					<option value="$group.id">$encoder.htmlEncode( $group.displayName )</option>
 				#end
 			</select>
 		</td>
@@ -310,7 +310,7 @@
 		<td>
 			<select multiple size="6" id="selectedOrganisationUnitGroups" name="selectedOrganisationUnitGroups" style="min-width:640px" ondblclick="moveSelectedById( 'selectedOrganisationUnitGroups', 'availableOrganisationUnitGroups' )">				
 				#foreach ( $group in $selectedOrganisationUnitGroups )
-					<option value="$group.id">$encoder.htmlEncode( $group.name )</option>
+					<option value="$group.id">$encoder.htmlEncode( $group.displayName )</option>
 				#end
 			</select>
 		</td>