← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8960: Exception when to register a new person in single event with registation.

 

------------------------------------------------------------
revno: 8960
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-11-09 15:29:29 +0700
message:
  Exception when to register a new person in single event with registation.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveValuesAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.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/SaveValuesAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveValuesAction.java	2012-11-09 07:22:44 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveValuesAction.java	2012-11-09 08:29:29 +0000
@@ -60,8 +60,9 @@
 public class SaveValuesAction
     implements Action
 {
-
     private static final Log LOG = LogFactory.getLog( SaveValueAction.class );
+    
+    private static final String PREFIX_DATA_ELEMENT = "DE";
 
     // -------------------------------------------------------------------------
     // Dependencies
@@ -193,12 +194,12 @@
         Collection<ProgramStageDataElement> psDataElements = programStage.getProgramStageDataElements();
         for ( ProgramStageDataElement psDataElement : psDataElements )
         {
-            String dataElementFieldId = programStage.getId() + "-" + psDataElement.getDataElement().getId() + "-val";
-            String providedElsewhereId = programStage.getId() + "_" + psDataElement.getDataElement().getId()
-                + "_facility";
+            String dataElementFieldId = PREFIX_DATA_ELEMENT + "_" + programStage.getId() + "-" + psDataElement.getDataElement().getId() + "-val";
             String value = request.getParameter( dataElementFieldId );
             if ( value != null && value.trim().length()>0)
             {
+                String providedElsewhereId = PREFIX_DATA_ELEMENT + "_" + programStage.getId() + "_" + psDataElement.getDataElement().getId()
+                    + "_facility";
                 boolean providedElsewhere = (request.getParameter( providedElsewhereId ) == null) ? false : true;
 
                 PatientDataValue patientDataValue = new PatientDataValue( programStageInstance, psDataElement.getDataElement(), new Date(), value.trim() );

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm	2012-10-23 08:11:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm	2012-11-09 08:29:29 +0000
@@ -47,9 +47,10 @@
 	<input type="hidden" id="relationshipTypeId" name="relationshipTypeId"/>
 	<input type="hidden" id="programStageId" name="programStageId" value='$programStage.id'/>
 	
-	<table id='patientForm'>
+	<table>
+		<tbody id='patientForm'>
 		#parse( "/dhis-web-caseentry/patientForm.vm" )
-		
+		</tbody>
 		<tr><td>$programStage.program.name</td></tr>
 		#parse( "/dhis-web-caseentry/singleDataEntryForm.vm" )
 	</table>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm	2012-10-31 07:27:43 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm	2012-11-09 08:29:29 +0000
@@ -28,7 +28,7 @@
 		</td>        
 		##entry        
 		<td class='input-column'>   
-			#set( $id = $programStageDataElement.programStage.id + '-' + $programStageDataElement.dataElement.id + '-val' )
+			#set( $id = "DE_" + $programStageDataElement.programStage.id + '-' + $programStageDataElement.dataElement.id + '-val' )
 			#if( $!programStageDataElement.dataElement.optionSet )
 				#set($hasOptionSet = 'true')
 			#else
@@ -67,7 +67,7 @@
 			#elseif( $programStageDataElement.dataElement.type == "date" )
 				<input name="entryfield" type="text" id="$id" name="entryfield" value="$!encoder.htmlEncode( $patientDataValue.value )"class="{validate:{$validate}}">
 				<script type="text/javascript">
-					datePicker($programStageDataElement.programStage.id + '-' + $programStageDataElement.dataElement.id + '-val', false);
+					datePicker("DE_" +  $programStageDataElement.programStage.id + '-' + $programStageDataElement.dataElement.id + '-val', false);
 				</script> 
 			#elseif($hasOptionSet=='true')
 				<input name="entryfield" options='$hasOptionSet' id="$id" type="text" value="$!encoder.htmlEncode( $patientDataValue.value )" class="option {validate:{$validate}}" />
@@ -75,9 +75,11 @@
 				<input name="entryfield" id="$id" type="text" value="$!encoder.htmlEncode( $patientDataValue.value )" class="{validate:{$validate}}" />
 			#end
 			#if( $programStage.program.displayProvidedOtherFacility=='true' )
-				#set( $id = $programStageDataElement.programStage.id + '_' + $programStageDataElement.dataElement.id + '_facility' )
+				#set( $id = "DE_" + $programStageDataElement.programStage.id + '_' + $programStageDataElement.dataElement.id + '_facility' )
 				#if( $programStageDataElement.allowProvidedElsewhere == 'true')
 					<input class='provided-elsewhere' name="$id" id="$id" type="checkbox" title="$i18n.getString('provided_elsewhere') ?"/>
+				#else
+					<input class='provided-elsewhere' name="$id" id="$id" type="hidden" value="false";>
 				#end
 			#end
 		</td>