← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9699: Cleanup

 

------------------------------------------------------------
revno: 9699
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2013-02-03 12:44:42 +0200
message:
  Cleanup
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.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/dataset/DataSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2012-12-08 16:07:13 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2013-02-03 10:44:42 +0000
@@ -67,6 +67,7 @@
     public static final String TYPE_DEFAULT = "default";
     public static final String TYPE_SECTION = "section";
     public static final String TYPE_CUSTOM = "custom";
+    public static final String TYPE_SECTION_MULTIORG = "multiorg_section";
 
     public static final int NO_EXPIRY = 0;
 

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java	2013-01-28 08:50:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java	2013-02-03 10:44:42 +0000
@@ -261,14 +261,14 @@
 
     public List<DataElementCategoryCombo> getDataElementCategoryCombos( List<DataElement> dataElements )
     {
-        Set<DataElementCategoryCombo> setCategoryCombos = new HashSet<DataElementCategoryCombo>();
+        Set<DataElementCategoryCombo> categoryCombos = new HashSet<DataElementCategoryCombo>();
 
         for ( DataElement dataElement : dataElements )
         {
-            setCategoryCombos.add( dataElement.getCategoryCombo() );
+            categoryCombos.add( dataElement.getCategoryCombo() );
         }
 
-        List<DataElementCategoryCombo> listCategoryCombos = new ArrayList<DataElementCategoryCombo>( setCategoryCombos );
+        List<DataElementCategoryCombo> listCategoryCombos = new ArrayList<DataElementCategoryCombo>( categoryCombos );
 
         Collections.sort( listCategoryCombos, new DataElementCategoryComboSizeComparator() );
 

=== 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-01-28 08:50:29 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/LoadFormAction.java	2013-02-03 10:44:42 +0000
@@ -88,17 +88,6 @@
     }
 
     // -------------------------------------------------------------------------
-    // Comparator
-    // -------------------------------------------------------------------------
-
-    private Comparator<DataElement> dataElementComparator;
-
-    public void setDataElementComparator( Comparator<DataElement> dataElementComparator )
-    {
-        this.dataElementComparator = dataElementComparator;
-    }
-
-    // -------------------------------------------------------------------------
     // Input
     // -------------------------------------------------------------------------
 
@@ -235,7 +224,7 @@
             return INPUT;
         }
 
-        Collections.sort( dataElements, dataElementComparator );
+        Collections.sort( dataElements, IdentifiableObjectNameComparator.INSTANCE );
 
         orderedDataElements = dataElementService.getGroupedDataElementsByCategoryCombo( dataElements );
 
@@ -307,13 +296,11 @@
 
         String displayMode = dataSet.getDataSetType();
 
-        if ( multiOrganisationUnit != null && multiOrganisationUnit != 0 ) // for
-                                                                           // multiOrg,
-                                                                           // we
-                                                                           // only
-                                                                           // support
-                                                                           // section
-                                                                           // forms
+        // ---------------------------------------------------------------------
+        // For multi-org unit we only support custom forms
+        // ---------------------------------------------------------------------
+        
+        if ( multiOrganisationUnit != null && multiOrganisationUnit != 0 ) 
         {
             OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( multiOrganisationUnit );
             List<OrganisationUnit> organisationUnitChildren = new ArrayList<OrganisationUnit>();
@@ -336,7 +323,8 @@
             organisationUnits.addAll( organisationUnitChildren );
 
             getSectionForm( dataElements, dataSet );
-            displayMode = "multiorg_section";
+            
+            displayMode = DataSet.TYPE_SECTION_MULTIORG;
         }
         if ( displayMode.equals( DataSet.TYPE_SECTION ) )
         {
@@ -403,6 +391,5 @@
 
             orderedDataElements.put( categoryCombo, des );
         }
-
     }
 }