← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14323: Tracker, temp fix for compilation error, should be fixed properly

 

------------------------------------------------------------
revno: 14323
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-03-20 23:10:08 +0100
message:
  Tracker, temp fix for compilation error, should be fixed properly
modified:
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityFormService.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-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityFormService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityFormService.java	2014-03-20 15:05:57 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityFormService.java	2014-03-20 22:10:08 +0000
@@ -37,11 +37,9 @@
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramInstance;
-import org.hisp.dhis.program.ProgramTrackedEntityAttributeService;
 import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue;
 import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValueService;
 import org.hisp.dhis.user.User;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 
 /**
@@ -88,9 +86,6 @@
         this.attributeValueService = attributeValueService;
     }
 
-    @Autowired
-    private ProgramTrackedEntityAttributeService programAttributeService;
-    
     // -------------------------------------------------------------------------
     // TrackedEntityForm implementation
     // -------------------------------------------------------------------------
@@ -280,17 +275,12 @@
     private String getAttributeField( String inputHtml, TrackedEntityAttribute attribute, Program program, String value, I18n i18n,
         int index, String hidden, String style )
     {
-        boolean madatory = false;
-        
-        if( program!= null)
-        {
-            madatory = programAttributeService.getProgramTrackedEntityAttribute( program, attribute ).getMandatory();
-        }
-        
+        boolean mandatory = false; //TODO fix
+                
         inputHtml = TAG_OPEN + "input id=\"attr" + attribute.getId() + "\" name=\"attr" + attribute.getId()
             + "\" tabindex=\"" + index + "\" style=\"" + style + "\"";
 
-        inputHtml += "\" class=\"" + hidden + " {validate:{required:" + madatory;
+        inputHtml += "\" class=\"" + hidden + " {validate:{required:" + mandatory;
         if ( TrackedEntityAttribute.TYPE_INT.equals( attribute.getValueType() ) )
         {
             inputHtml += ",number:true";