← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2727: Fixed bug sort order of DataElement and Indicator inside sort order list.

 

------------------------------------------------------------
revno: 2727
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-01-24 14:45:39 +0700
message:
  Fixed bug sort order of DataElement and Indicator inside sort order list.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementSortOrderComparator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorSortOrderComparator.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/SaveDataElementSortOrderAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/SaveIndicatorSortOrderAction.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/comparator/DataElementSortOrderComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementSortOrderComparator.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/comparator/DataElementSortOrderComparator.java	2011-01-24 07:45:39 +0000
@@ -49,6 +49,6 @@
             return dataElement0.getName().compareTo( dataElement1.getName() );
         }
         
-        return dataElement1.getSortOrder() - dataElement0.getSortOrder();
+        return dataElement0.getSortOrder() - dataElement1.getSortOrder();
     }
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorSortOrderComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorSortOrderComparator.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/comparator/IndicatorSortOrderComparator.java	2011-01-24 07:45:39 +0000
@@ -50,6 +50,6 @@
             return indicator0.getName().compareTo( indicator1.getName() );
         }
         
-        return indicator1.getSortOrder() - indicator0.getSortOrder();
+        return indicator0.getSortOrder() - indicator1.getSortOrder();
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/SaveDataElementSortOrderAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/SaveDataElementSortOrderAction.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/SaveDataElementSortOrderAction.java	2011-01-24 07:45:39 +0000
@@ -27,7 +27,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collections;
 import java.util.List;
 
 import org.hisp.dhis.dataelement.DataElement;
@@ -72,8 +71,6 @@
     {
         int sortOrder = 1;
         
-        Collections.reverse( dataElements );
-        
         for ( String id : dataElements )
         {
             DataElement element = dataElementService.getDataElement( Integer.parseInt( id ) );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/SaveIndicatorSortOrderAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/SaveIndicatorSortOrderAction.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/SaveIndicatorSortOrderAction.java	2011-01-24 07:45:39 +0000
@@ -27,7 +27,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collections;
 import java.util.List;
 
 import org.hisp.dhis.indicator.Indicator;
@@ -72,8 +71,6 @@
     {
         int sortOrder = 1;
         
-        Collections.reverse( indicators );
-        
         for ( String id : indicators )
         {
             Indicator indicator = indicatorService.getIndicator( Integer.parseInt( id ) );