← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7551: Remove Date icon in dataentry if the field not belongs to selected stage.

 

------------------------------------------------------------
revno: 7551
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-07-10 13:14:34 +0700
message:
  Remove Date icon in dataentry if the field not belongs to selected stage.
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramDataEntryService.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-patient/src/main/java/org/hisp/dhis/program/DefaultProgramDataEntryService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramDataEntryService.java	2012-07-06 03:53:08 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramDataEntryService.java	2012-07-10 06:14:34 +0000
@@ -250,7 +250,6 @@
                 else if ( DataElement.VALUE_TYPE_DATE.equals( dataElement.getType() ) )
                 {
                     inputHTML = populateCustomDataEntryForDate( inputHTML, dataElementValue );
-                    inputHTML += jQueryCalendar;
                 }
                 else if ( DataElement.VALUE_TYPE_TRUE_ONLY.equals( dataElement.getType() ) )
                 {
@@ -266,17 +265,24 @@
                 // disable
                 // If programStagsInstance is completed then disabled it
                 // -----------------------------------------------------------
-                
+
                 disabled = "";
                 if ( programStageId != programStage.getId() )
                 {
                     disabled = "disabled=\"\"";
                 }
-
-                else if ( !programStageInstance.isCompleted() && allowProvidedElsewhere )
+                else
                 {
-                    // Add ProvidedByOtherFacility checkbox
-                    inputHTML = addProvidedElsewherCheckbox( inputHTML, patientDataValue, programStage );
+                    if ( DataElement.VALUE_TYPE_DATE.equals( dataElement.getType() ) )
+                    {
+                        inputHTML += jQueryCalendar;
+                    }
+                    
+                    if ( !programStageInstance.isCompleted() && allowProvidedElsewhere )
+                    {
+                        // Add ProvidedByOtherFacility checkbox
+                        inputHTML = addProvidedElsewherCheckbox( inputHTML, patientDataValue, programStage );
+                    }
                 }
 
                 // -----------------------------------------------------------
@@ -549,7 +555,7 @@
 
         inputHTML = inputHTML.replace( "name=\"entryfield\"", jsCodeForDate );
         inputHTML += " />";
-        
+
         return inputHTML;
     }