← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14573: Remove wrong statements in TableAlterator in tracker module.

 

------------------------------------------------------------
revno: 14573
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-03-31 23:44:18 +0700
message:
  Remove wrong statements in TableAlterator in tracker module.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceHistoryAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceLocationAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowRelationshipListAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/TrackedEntityInstanceDashboardAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentity/RemoveTrackedEntityAction.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-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java	2014-03-27 14:36:12 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceAction.java	2014-03-31 16:44:18 +0000
@@ -103,7 +103,7 @@
 
     private Collection<RelationshipType> relationshipTypes;
 
-    private int id;
+    private String id;
 
     private TrackedEntityInstance entityInstance;
 
@@ -338,7 +338,7 @@
         return relationship;
     }
 
-    public void setId( int id )
+    public void setId( String id )
     {
         this.id = id;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceHistoryAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceHistoryAction.java	2014-03-26 14:01:14 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceHistoryAction.java	2014-03-31 16:44:18 +0000
@@ -75,9 +75,9 @@
     // Getters && Setters
     // -------------------------------------------------------------------------
 
-    private Integer entityInstanceId;
+    private String entityInstanceId;
 
-    public void setEntityInstanceId( Integer entityInstanceId )
+    public void setEntityInstanceId( String entityInstanceId )
     {
         this.entityInstanceId = entityInstanceId;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceLocationAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceLocationAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceLocationAction.java	2014-03-31 16:44:18 +0000
@@ -64,14 +64,14 @@
     // Getter && Setter
     // -------------------------------------------------------------------------
 
-    private Integer entityInstanceId;
+    private String entityInstanceId;
 
-    public void setEntityInstanceId( Integer entityInstanceId )
+    public void setEntityInstanceId( String entityInstanceId )
     {
         this.entityInstanceId = entityInstanceId;
     }
 
-    public Integer getEntityInstanceId()
+    public String getEntityInstanceId()
     {
         return entityInstanceId;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentAction.java	2014-03-18 14:54:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentAction.java	2014-03-31 16:44:18 +0000
@@ -31,11 +31,13 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 
+import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
 import org.hisp.dhis.program.Program;
@@ -63,6 +65,8 @@
 
     private OrganisationUnitSelectionManager selectionManager;
 
+    private I18nFormat format;
+
     // -------------------------------------------------------------------------
     // Input/Output
     // -------------------------------------------------------------------------
@@ -88,11 +92,17 @@
     // -------------------------------------------------------------------------
     // Getters/Setters
     // -------------------------------------------------------------------------
+
     public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
     {
         this.selectionManager = selectionManager;
     }
 
+    public void setFormat( I18nFormat format )
+    {
+        this.format = format;
+    }
+
     public Collection<TrackedEntityAttribute> getNoGroupAttributes()
     {
         return noGroupAttributes;
@@ -190,8 +200,14 @@
             {
                 if ( attributes.contains( attributeValue.getAttribute() ) )
                 {
-                    attributeValueMap.put( attributeValue.getAttribute().getId(),
-                        attributeValue.getValue() );
+                    String value = attributeValue.getValue();
+                    if ( attributeValue.getAttribute().getValueType().equals( TrackedEntityAttribute.TYPE_AGE ) )
+                    {
+                        Date date = format.parseDate( value );
+                        value = TrackedEntityAttribute.getAgeFromDate( date ) + "";
+                    }
+
+                    attributeValueMap.put( attributeValue.getAttribute().getId(), value );
                 }
             }
         }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowRelationshipListAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowRelationshipListAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ShowRelationshipListAction.java	2014-03-31 16:44:18 +0000
@@ -68,9 +68,9 @@
     // Input/Output
     // -------------------------------------------------------------------------
 
-    private Integer id;
+    private String id;
 
-    public void setId( Integer id )
+    public void setId( String id )
     {
         this.id = id;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/TrackedEntityInstanceDashboardAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/TrackedEntityInstanceDashboardAction.java	2014-03-28 07:24:57 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/TrackedEntityInstanceDashboardAction.java	2014-03-31 16:44:18 +0000
@@ -232,6 +232,7 @@
                 value = TrackedEntityAttribute.getAgeFromDate( date ) + "";
             }
             
+            attributeValue.setValue( value );
             attributeValues.add( attributeValue );
         }
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2014-03-31 07:46:14 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2014-03-31 16:44:18 +0000
@@ -681,4 +681,5 @@
 complete_success = The program is completed successfully
 program_active_success = The program is active successfully
 program_cancelled_success = The program is cancelled successfully
-descendants = Descendants
\ No newline at end of file
+descendants = Descendants
+auto_save_tracked_entity_registration_forms = Auto save tracked entity registration forms 
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentity/RemoveTrackedEntityAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentity/RemoveTrackedEntityAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/trackedentity/RemoveTrackedEntityAction.java	2014-03-31 16:44:18 +0000
@@ -55,9 +55,9 @@
     // Input/Output
     // -------------------------------------------------------------------------
 
-    private Integer id;
+    private String id;
 
-    public void setId( Integer id )
+    public void setId( String id )
     {
         this.id = id;
     }