← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7307: Minor fix.

 

------------------------------------------------------------
revno: 7307
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-06-15 11:55:20 +0700
message:
  Minor fix.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStageInstancesAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageInstances.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-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStageInstancesAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStageInstancesAction.java	2012-06-14 04:41:08 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStageInstancesAction.java	2012-06-15 04:55:20 +0000
@@ -165,7 +165,10 @@
                     ProgramStage programStage = program.getProgramStages().iterator().next();
                     ProgramStageInstance programStageInstance = programStageInstanceService.getProgramStageInstance(
                         programInstance, programStage );
-                    programStageInstances.add( programStageInstance );
+                    if( programStageInstance!= null )
+                    {
+                        programStageInstances.add( programStageInstance );
+                    }
                 }
             }
         }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js	2012-06-07 09:55:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js	2012-06-15 04:55:20 +0000
@@ -61,12 +61,11 @@
 		}, 
 		function( json ) 
 		{    
-			setFieldValue( 'programStageInstanceId', json.programStageInstances[0].id );
-			setFieldValue( 'selectedProgramId', programId );
-			$('#executionDate').bind('change');
-			
 			if( json.programStageInstances.length > 0 )
 			{
+				setFieldValue( 'programStageInstanceId', json.programStageInstances[0].id );
+				setFieldValue( 'selectedProgramId', programId );
+				$('#executionDate').bind('change');
 				loadEventRegistrationForm();
 			}
 			else

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js	2012-06-15 04:41:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js	2012-06-15 04:55:20 +0000
@@ -130,7 +130,7 @@
 			showById('inputCriteriaDiv');
 			enable('validationBtn');
 			enable('validationInBelowBtn');
-			if(  executionDate == '' )
+			if( executionDate == '' )
 			{
 				disable('validationBtn');
 				disable('validationInBelowBtn');
@@ -823,8 +823,7 @@
 function autocompletedField( idField )
 {
 	var input = jQuery( "#" +  idField )
-	var dataElementId = input.attr( 'dataElementId' );
-	
+	var dataElementId = input.attr('id').split('-')[1];
 	input.autocomplete({
 			delay: 0,
 			minLength: 0,

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageInstances.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageInstances.vm	2012-06-07 04:23:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageInstances.vm	2012-06-15 04:55:20 +0000
@@ -1,7 +1,8 @@
-#set( $size = $programStageInstances.size() )
+
+ #set( $size = $programStageInstances.size() )
 { 
 "programStageInstances": [
-	#foreach( $programStageInstance in $programStageInstances )
+	#foreach( $programStageInstance in $!programStageInstances )
 	  {
 		"id": "$programStageInstance.id",
 		"programStageId": "$programStageInstance.programStage.id",