← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4197: Put a date picker heading for input fields for date dataelements in dataentry

 

------------------------------------------------------------
revno: 4197
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-07-22 10:19:01 +0200
message:
  Put a date picker heading for input fields for date dataelements in dataentry
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/LoadDataSetsAction.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/responseDataSets.vm


--
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-dataentry/src/main/java/org/hisp/dhis/de/action/LoadDataSetsAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/LoadDataSetsAction.java	2011-07-19 21:49:16 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/LoadDataSetsAction.java	2011-07-22 08:19:01 +0000
@@ -110,14 +110,7 @@
     {
         return dataSetValid;
     }
-    
-    private boolean periodValid;
-
-    public boolean isPeriodValid()
-    {
-        return periodValid;
-    }
-    
+        
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2011-07-21 20:11:07 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2011-07-22 08:19:01 +0000
@@ -40,7 +40,8 @@
     {
     	var id = $( this ).attr( 'id' );    	
 		var dataElementId = id.split( '-' )[0];
-		var optionComboId = id.split( '-' )[1];	
+		var optionComboId = id.split( '-' )[1];
+		var type = dataElements[dataElementId].type;
     	
     	$( this ).focus( valueFocus );
     	
@@ -58,6 +59,11 @@
     	
     	$( this ).css( 'width', '100%' );
     	$( this ).css( 'text-align', 'center' );
+    	
+    	if ( type == 'date' ) {
+    		$( this ).css( 'width', '80%' );    		
+    		datePicker( id );
+    	}
     } );
     
     $( '[name="entryselect"]' ).each( function( i )
@@ -219,7 +225,7 @@
         
         var previousPeriodType = currentDataSetId ? dataSets[currentDataSetId].periodType : null;
 
-        if ( periodId && periodId != -1 && previousPeriodType && previousPeriodType == periodType ) //TODO if periodValid
+        if ( periodId && periodId != -1 && previousPeriodType && previousPeriodType == periodType )
         {
             showLoader();
             $( '#selectedPeriodId' ).val( periodId );

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/responseDataSets.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/responseDataSets.vm	2011-07-14 11:06:39 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/responseDataSets.vm	2011-07-22 08:19:01 +0000
@@ -11,6 +11,5 @@
     "id": $!{organisationUnit.id},
     "name": "$!encoder.jsonEncode( ${organisationUnit.name} )"
   },
-  "dataSetValid": ${dataSetValid},
-  "periodValid": ${periodValid}
+  "dataSetValid": ${dataSetValid}
 }
\ No newline at end of file