← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15267: Tracker, fixed bug, display in list no program was assuming column value to be false

 

------------------------------------------------------------
revno: 15267
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-05-14 15:37:02 +0200
message:
  Tracker, fixed bug, display in list no program was assuming column value to be false
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeStore.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAttributeStore.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetAttributesByProgramAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SelectAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAttributeInListNoProgramAction.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/trackedentity/TrackedEntityAttributeService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeService.java	2014-03-26 17:39:16 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeService.java	2014-05-14 13:37:02 +0000
@@ -167,7 +167,7 @@
      * 
      * @return List of attributes
      */
-    Collection<TrackedEntityAttribute> getTrackedEntityAttributesDisplayInList( boolean displayInListNoProgram );
+    Collection<TrackedEntityAttribute> getTrackedEntityAttributesDisplayInList();
 
     /**
      * Returns {@link TrackedEntityAttribute} list with paging

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeStore.java	2014-03-20 15:05:57 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAttributeStore.java	2014-05-14 13:37:02 +0000
@@ -75,10 +75,8 @@
     /**
      * Get attributes which are displayed in visit schedule
      * 
-     * @param displayInList True/False value
-     * 
      * @return List of attributes
      */
-    Collection<TrackedEntityAttribute> getDisplayInList( boolean displayInList );
+    Collection<TrackedEntityAttribute> getDisplayInList();
 
 }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java	2014-03-27 23:40:38 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAttributeService.java	2014-05-14 13:37:02 +0000
@@ -149,9 +149,9 @@
         return new HashSet<TrackedEntityAttribute>();
     }
 
-    public Collection<TrackedEntityAttribute> getTrackedEntityAttributesDisplayInList( boolean displayInList )
+    public Collection<TrackedEntityAttribute> getTrackedEntityAttributesDisplayInList()
     {
-        return attributeStore.getDisplayInList( displayInList );
+        return attributeStore.getDisplayInList();
     }
 
     public Collection<TrackedEntityAttribute> getTrackedEntityAttributesBetweenByName( String name, int min, int max )

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAttributeStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAttributeStore.java	2014-03-22 15:22:03 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAttributeStore.java	2014-05-14 13:37:02 +0000
@@ -76,8 +76,8 @@
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<TrackedEntityAttribute> getDisplayInList( boolean displayInList )
+    public Collection<TrackedEntityAttribute> getDisplayInList()
     {
-        return getCriteria( Restrictions.eq( "displayInListNoProgram", displayInList ) ).list();
+        return getCriteria( Restrictions.eq( "displayInListNoProgram", true ) ).list();
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java	2014-04-28 14:22:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java	2014-05-14 13:37:02 +0000
@@ -238,7 +238,7 @@
             if ( program == null )
             {
                 attributes = new ArrayList<TrackedEntityAttribute>(
-                    attributeService.getTrackedEntityAttributesDisplayInList( true ) );
+                    attributeService.getTrackedEntityAttributesDisplayInList() );
                 Collection<Program> programs = programService.getAllPrograms();
 
                 for ( Program p : programs )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetAttributesByProgramAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetAttributesByProgramAction.java	2014-05-07 09:03:42 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetAttributesByProgramAction.java	2014-05-14 13:37:02 +0000
@@ -121,7 +121,7 @@
         else
         {
             attributes = new ArrayList<TrackedEntityAttribute>(
-                attributeService.getTrackedEntityAttributesDisplayInList( true ) );
+                attributeService.getTrackedEntityAttributesDisplayInList() );
         }
 
         Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE );

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SelectAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SelectAction.java	2014-05-07 09:03:42 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SelectAction.java	2014-05-14 13:37:02 +0000
@@ -128,7 +128,7 @@
     {
         organisationUnit = selectionManager.getSelectedOrganisationUnit();
 
-        attributes = new ArrayList<TrackedEntityAttribute>( attributeService.getTrackedEntityAttributesDisplayInList( true )  );
+        attributes = new ArrayList<TrackedEntityAttribute>( attributeService.getTrackedEntityAttributesDisplayInList()  );
         Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE );
 
         trackedEntities = new ArrayList<TrackedEntity>( trackedEntityService.getAllTrackedEntity() );

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java	2014-04-12 12:12:30 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowAddTrackedEntityInstanceFormAction.java	2014-05-14 13:37:02 +0000
@@ -344,7 +344,7 @@
             if ( program == null )
             {
                 attributes = new ArrayList<TrackedEntityAttribute>(
-                    attributeService.getTrackedEntityAttributesDisplayInList( true ) );
+                    attributeService.getTrackedEntityAttributesDisplayInList() );
                 Collection<Program> programs = programService.getAllPrograms();
 
                 for ( Program p : programs )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAttributeInListNoProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAttributeInListNoProgramAction.java	2014-04-04 17:43:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentityattribute/ShowAttributeInListNoProgramAction.java	2014-05-14 13:37:02 +0000
@@ -84,14 +84,15 @@
     public String execute()
         throws Exception
     {
+        selectedAttributes = new ArrayList<TrackedEntityAttribute>(
+            attributeService.getTrackedEntityAttributesDisplayInList() );
+        Collections.sort( selectedAttributes, new TrackedEntityAttributeSortOrderInListNoProgramComparator() );
+
         availableAttributes = new ArrayList<TrackedEntityAttribute>(
-            attributeService.getTrackedEntityAttributesDisplayInList( false ) );
+            attributeService.getAllTrackedEntityAttributes() );
+        availableAttributes.removeAll( selectedAttributes );
         Collections.sort( availableAttributes, IdentifiableObjectNameComparator.INSTANCE );
 
-        selectedAttributes = new ArrayList<TrackedEntityAttribute>(
-            attributeService.getTrackedEntityAttributesDisplayInList( true ) );
-        Collections.sort( selectedAttributes, new TrackedEntityAttributeSortOrderInListNoProgramComparator() );
-
         return SUCCESS;
     }
 }
\ No newline at end of file