← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9946: Add coordinates for events.

 

------------------------------------------------------------
revno: 9946
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-03-01 21:09:05 +0700
message:
  Add coordinates for events.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/cacheManifest.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgramStage.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStage.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.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-api/src/main/java/org/hisp/dhis/program/ProgramStage.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java	2013-02-13 03:57:52 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java	2013-03-01 14:09:05 +0000
@@ -96,6 +96,8 @@
     private Boolean validCompleteOnly = false;
 
     private Boolean displayGenerateEventBox = true;
+    
+    private Boolean captureCoordinates = false;
 
     // -------------------------------------------------------------------------
     // Constructors
@@ -339,4 +341,15 @@
     {
         return "Dear {person-name}, please come to your appointment on {program-stage-name} at {due-date}";
     }
+
+    public Boolean getCaptureCoordinates()
+    {
+        return captureCoordinates;
+    }
+
+    public void setCaptureCoordinates( Boolean captureCoordinates )
+    {
+        this.captureCoordinates = captureCoordinates;
+    }
+    
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java	2013-02-13 03:00:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java	2013-03-01 14:09:05 +0000
@@ -78,6 +78,8 @@
 
     private Integer status;
 
+    private String coordinates;
+
     // -------------------------------------------------------------------------
     // Constructors
     // -------------------------------------------------------------------------
@@ -274,6 +276,16 @@
         this.status = status;
     }
 
+    public String getCoordinates()
+    {
+        return coordinates;
+    }
+
+    public void setCoordinates( String coordinates )
+    {
+        this.coordinates = coordinates;
+    }
+
     public Integer getEventStatus()
     {
         if ( this.status != null )

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java	2013-03-01 07:34:20 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java	2013-03-01 14:09:05 +0000
@@ -179,7 +179,8 @@
         executeSql( "UPDATE patientidentifiertype SET type='string' WHERE type='text'" );
 
         executeSql( "UPDATE program SET onlyEnrollOnce='false' WHERE onlyEnrollOnce is null" );
-
+        executeSql( "UPDATE programStage SET captureCoordinates='false' WHERE captureCoordinates is null" );
+        
         updateUid();
     }
 

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml	2013-02-07 10:25:34 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStage.hbm.xml	2013-03-01 14:09:05 +0000
@@ -50,6 +50,8 @@
     <property name="validCompleteOnly" />
 
     <property name="displayGenerateEventBox" />
+    
+    <property name="captureCoordinates" />
 
   </class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml	2012-09-11 13:35:26 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml	2013-03-01 14:09:05 +0000
@@ -38,5 +38,7 @@
     
     <property name="status" column="status" />
     
+    <property name="coordinates" type="text" />
+    
   </class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java	2013-02-04 03:09:04 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java	2013-03-01 14:09:05 +0000
@@ -27,6 +27,8 @@
 
 package org.hisp.dhis.caseentry.action.caseentry;
 
+import static org.hisp.dhis.system.util.ValidationUtils.coordinateIsValid;
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -55,6 +57,7 @@
 import org.hisp.dhis.program.ProgramStageSectionService;
 import org.hisp.dhis.program.comparator.ProgramStageDataElementSortOrderComparator;
 import org.hisp.dhis.program.comparator.ProgramStageSectionSortOrderComparator;
+import org.hisp.dhis.system.util.ValidationUtils;
 
 import com.opensymphony.xwork2.Action;
 
@@ -83,7 +86,7 @@
     private PatientAttributeValueService patientAttributeValueService;
 
     private ProgramStageSectionService programStageSectionService;
-    
+
     private I18nFormat format;
 
     // -------------------------------------------------------------------------
@@ -225,6 +228,20 @@
         return calAttributeValueMap;
     }
     
+    private String longitude;
+
+    public String getLongitude()
+    {
+        return longitude;
+    }
+
+    private String latitude;
+
+    public String getLatitude()
+    {
+        return latitude;
+    }
+
     // -------------------------------------------------------------------------
     // Implementation Action
     // -------------------------------------------------------------------------
@@ -302,10 +319,18 @@
             }
             else if ( programStage.getDataEntryType().equals( ProgramStage.TYPE_SECTION ) )
             {
-                sections = new ArrayList<ProgramStageSection>( programStageSectionService.getProgramStages( programStage ));
-                
+                sections = new ArrayList<ProgramStageSection>(
+                    programStageSectionService.getProgramStages( programStage ) );
+
                 Collections.sort( sections, new ProgramStageSectionSortOrderComparator() );
             }
+
+            // -----------------------------------------------------------------
+            // Allow update only if org unit does not have polygon coordinates
+            // -----------------------------------------------------------------
+
+            longitude = ValidationUtils.getLongitude( programStageInstance.getCoordinates() );
+            latitude = ValidationUtils.getLatitude( programStageInstance.getCoordinates() );
         }
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2013-03-01 09:15:24 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2013-03-01 14:09:05 +0000
@@ -152,6 +152,14 @@
 		<property name="userService" ref="org.hisp.dhis.user.UserService" />
 	</bean>
 
+	<bean
+		id="org.hisp.dhis.caseentry.action.caseentry.SaveCoordinatesEventAction"
+		class="org.hisp.dhis.caseentry.action.caseentry.SaveCoordinatesEventAction"
+		scope="prototype">
+		<property name="programStageInstanceService"
+			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
+	</bean>
+	
 	<!-- Multi DataEntry -->
 
 	<bean

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2013-03-01 09:15:24 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2013-03-01 14:09:05 +0000
@@ -558,4 +558,7 @@
 multiple_orgunits_selected_as_filter = Multiple organisation units selected as filter. The first one is being used.
 accessed_module = Accessed module
 sms = SMS
-reenrol_success = Re-enroll successfully
\ No newline at end of file
+reenrol_success = Re-enroll successfully
+longitude = Longitude
+latitude = Latitude
+coordinates = Coordinates
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2013-03-01 09:15:24 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2013-03-01 14:09:05 +0000
@@ -216,6 +216,13 @@
       <param name="onExceptionReturn">plainTextError</param>
       <param name="requiredAuthorities">F_PATIENT_DATAVALUE_ADD,F_PATIENT_DATAVALUE_UPDATE,F_PATIENT_DATAVALUE_DELETE</param>
     </action>
+    
+     <action name="saveCoordinatesEvent"
+      class="org.hisp.dhis.caseentry.action.caseentry.SaveCoordinatesEventAction">
+      <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+      <param name="onExceptionReturn">plainTextError</param>
+      <param name="requiredAuthorities">F_PATIENT_DATAVALUE_ADD,F_PATIENT_DATAVALUE_UPDATE,F_PATIENT_DATAVALUE_DELETE</param>
+    </action>
 
     <!-- save providing-facility -->
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/cacheManifest.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/cacheManifest.vm	2013-03-01 09:15:24 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/cacheManifest.vm	2013-03-01 14:09:05 +0000
@@ -1,5 +1,5 @@
 CACHE MANIFEST
-# 2.11-SNAPSHOT V12
+# 2.11-SNAPSHOT V14
 NETWORK:
 *
 CACHE:

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm	2013-02-06 14:08:33 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm	2013-03-01 14:09:05 +0000
@@ -11,6 +11,9 @@
 			setFieldValue( 'executionDate', "$!format.formatDate( $programStageInstance.executionDate )" );
 		#end
 		
+		validation( 'coordinatesForm', function(form){
+			saveCoordinatesEvent($!programStageInstance.id);
+		});
 		entryFormContainerOnReady();
 		
 	});
@@ -31,11 +34,36 @@
 <input type='hidden' name='blockEntryForm' id='blockEntryForm'  value='$!programStageInstance.programInstance.program.blockEntryForm'>
 
 <div id='entryForm' #if($!programStageInstance.executionDate) class='visible' #else class='hidden' #end>					
+	<form id='coordinatesForm'>
+		#if($programStageInstance.programStage.captureCoordinates=='true')
+		<fieldset style="width:570px;">
+			<legend>$i18n.getString('coordinates')</legend>
+			<table>
+				<tr>
+					<td><label for="longitude">$i18n.getString( "longitude" )</label></td>
+					<td><input type="text" id="longitude" name="longitude" value="$!{longitude}" class="{validate:{number:true,min:-180,max:180}}"></td>
+				</tr>
+				<tr>
+					<td><label for="latitude">$i18n.getString( "latitude" )</label></td>
+					<td><input type="text" id="latitude" name="latitude" value="$!{latitude}" class="{validate:{number:true,min:-90,max:90}}"></td>
+				</tr>
+				<tr>
+					<td></td>
+					<td><input type='submit' value='$i18n.getString("save")' onclick="" /></td>
+				</tr>
+			</table>
+		</fieldset>
+		#end
+	</form>
+	
+	<br>
+	
 	<table id="postCommentTbl" class="hidden">
 		<tr>
 			<td class="text-column">$i18n.getString('post_comment'):</td>
 			<td><input type="text" class="{validate:{maxlength:160}}" name="comment_$programStageInstance.id" id="comment_$programStageInstance.id" style="width:450px;" onkeypress="keypressOnComent(event,this,$programStageInstance.id);"></td>
 		</tr>
+		
 		<tr>
 			<td></td>
 			<td colspan='3'>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2013-03-01 09:15:24 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2013-03-01 14:09:05 +0000
@@ -1913,4 +1913,19 @@
 {
      $tbody.find( 'tr:visible:even' ).removeClass( 'listRow' ).removeClass( 'listAlternateRow' ).addClass( 'listRow' );
      $tbody.find( 'tr:visible:odd' ).removeClass( 'listRow' ).removeClass( 'listAlternateRow' ).addClass( 'listAlternateRow' );
+}
+
+function saveCoordinatesEvent(programStageInstanceId)
+{
+	jQuery.postJSON( "saveCoordinatesEvent.action",
+		{ 
+			programStageInstanceId:programStageInstanceId,
+			longitude: getFieldValue('longitude'),
+			latitude: getFieldValue('latitude')
+		}, 
+		function( json ) 
+		{   
+			 byId('longitude').style.backgroundColor = SUCCESS_COLOR;
+             byId('latitude').style.backgroundColor = SUCCESS_COLOR;
+		});
 }
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgramStage.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgramStage.vm	2012-12-12 04:43:25 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgramStage.vm	2013-03-01 14:09:05 +0000
@@ -19,6 +19,7 @@
 	"autoGenerateEvent": "$!programStage.autoGenerateEvent",
 	"validCompleteOnly": "$!programStage.validCompleteOnly",
 	"displayGenerateEventBox": "$!programStage.displayGenerateEventBox",
+	"captureCoordinates": "$!programStage.captureCoordinates",
 	#set( $size = ${programStageDataElements.size()} )
 	"dataElement": [
 	#foreach($d in $programStageDataElements)

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java	2012-12-12 04:43:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java	2013-03-01 14:09:05 +0000
@@ -204,7 +204,14 @@
     {
         this.displayGenerateEventBox = displayGenerateEventBox;
     }
-
+    
+    private Boolean captureCoordinates;
+    
+    public void setCaptureCoordinates( Boolean captureCoordinates )
+    {
+        this.captureCoordinates = captureCoordinates;
+    }
+    
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -217,7 +224,8 @@
         autoGenerateEvent = (autoGenerateEvent == null) ? false : autoGenerateEvent;
         validCompleteOnly = (validCompleteOnly == null) ? false : validCompleteOnly;
         displayGenerateEventBox = (displayGenerateEventBox == null) ? false : displayGenerateEventBox;
-
+        captureCoordinates =  (captureCoordinates == null) ? false : captureCoordinates;
+        
         ProgramStage programStage = new ProgramStage();
         Program program = programService.getProgram( id );
 
@@ -229,9 +237,9 @@
         programStage.setIrregular( irregular );
         programStage.setMinDaysFromStart( minDaysFromStart );
         programStage.setDisplayGenerateEventBox( displayGenerateEventBox );
-      
         programStage.setValidCompleteOnly( validCompleteOnly );
         programStage.setAutoGenerateEvent( autoGenerateEvent );
+        programStage.setCaptureCoordinates( captureCoordinates );
 
         Set<PatientReminder> patientReminders = new HashSet<PatientReminder>();
         for ( int i = 0; i < daysAllowedSendMessages.size(); i++ )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java	2012-12-12 04:43:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java	2013-03-01 14:09:05 +0000
@@ -198,6 +198,13 @@
         this.displayGenerateEventBox = displayGenerateEventBox;
     }
 
+    private Boolean captureCoordinates;
+
+    public void setCaptureCoordinates( Boolean captureCoordinates )
+    {
+        this.captureCoordinates = captureCoordinates;
+    }
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -221,9 +228,9 @@
         programStage.setIrregular( irregular );
         programStage.setMinDaysFromStart( minDaysFromStart );
         programStage.setDisplayGenerateEventBox( displayGenerateEventBox );
-
         programStage.setAutoGenerateEvent( autoGenerateEvent );
         programStage.setValidCompleteOnly( validCompleteOnly );
+        programStage.setCaptureCoordinates( captureCoordinates );
 
         Set<PatientReminder> patientReminders = new HashSet<PatientReminder>();
         for ( int i = 0; i < this.daysAllowedSendMessages.size(); i++ )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2013-03-01 07:34:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2013-03-01 14:09:05 +0000
@@ -360,4 +360,5 @@
 patient_registration_form = Person Registration Form
 insert_data_elements = Insert data elements
 only_enroll_once = Only enroll one
-insert_a_due_date = Please insert a due-date
\ No newline at end of file
+insert_a_due_date = Please insert a due-date
+capture_coordinates = Capture coordinates
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm	2013-01-23 10:27:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm	2013-03-01 14:09:05 +0000
@@ -53,6 +53,11 @@
 	<tr><th colspan="2">$i18n.getString( "form_details" )</th></tr>
 	
 	<tr>
+		<td><label>$i18n.getString( "capture_coordinates" )</label></td>
+		<td><input type="checkbox" id="captureCoordinates" name="captureCoordinates" value="true" /></td>
+	</tr>
+	
+	<tr>
 		<td><label>$i18n.getString( "complete_allowed_only_if_validation_passes" )</label></td>
 		<td><input type="checkbox" id="validCompleteOnly" name="validCompleteOnly" value="true" /></td>
 	</tr>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js	2012-12-12 04:43:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js	2013-03-01 14:09:05 +0000
@@ -68,6 +68,9 @@
 		var validCompleteOnly = (json.programStage.validCompleteOnly=='true') ? i18n_yes : i18n_no;
 		setInnerHTML( 'validCompleteOnlyField', validCompleteOnly );  
 		
+		var captureCoordinates = (json.programStage.captureCoordinates=='true') ? i18n_yes : i18n_no;
+		setInnerHTML( 'captureCoordinatesField', captureCoordinates );
+		
 		setInnerHTML( 'standardIntervalField', json.programStage.standardInterval );  
 		setInnerHTML( 'dataElementCountField', json.programStage.dataElementCount );   
 		setInnerHTML( 'reportDateDescriptionField', json.programStage.reportDateDescription );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStage.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStage.vm	2013-02-20 15:10:33 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStage.vm	2013-03-01 14:09:05 +0000
@@ -64,6 +64,7 @@
 				<p><label class="bold">$i18n.getString( "irregular" ):</label><br><span id="irregularField"></span></p>
 				<p><label class="bold">$i18n.getString( "display_generate_event_box_after_completed" ):</label><br><span id="displayGenerateEventBoxField"></span></p>
 				<p><label class="bold">$i18n.getString( "standard_interval_days" ):</label><br><span id="standardIntervalField"></span></p>
+				<p><label class="bold">$i18n.getString( "capture_coordinates" ):</label><br><span id="captureCoordinatesField"></span></p>
 				<p><label class="bold">$i18n.getString( "complete_allowed_only_if_validation_passes" ):</label><br><span id="validCompleteOnlyField"></span></p>
 				<p><label class="bold">$i18n.getString( "report_date_description" ):</label><br><span id="reportDateDescriptionField"></span></p>
 				<p><label class="bold">$i18n.getString( "no_of_dataelements" ):</label><br><span id="dataElementCountField"></span></p>		

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm	2013-01-23 10:27:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm	2013-03-01 14:09:05 +0000
@@ -56,6 +56,11 @@
 			<tr><th colspan="2">$i18n.getString( "form_details" )</th></tr>
 	
 			<tr>
+				<td><label>$i18n.getString( "capture_coordinates" )</label></td>
+				<td><input type="checkbox" id="captureCoordinates" name="captureCoordinates" value='true' #if( $programStage.captureCoordinates && $programStage.captureCoordinates=='true' ) checked #end /></td>
+			</tr>
+			
+			<tr>
 				<td><label>$i18n.getString( "complete_allowed_only_if_validation_passes" )</label></td>
 				<td><input type="checkbox" id="validCompleteOnly" name="validCompleteOnly" value='true' #if( $programStage.validCompleteOnly && $programStage.validCompleteOnly=='true' ) checked #end /></td>
 			</tr>