=== 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 @@ + + === 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 @@ + + === 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( programStageSectionService.getProgramStages( programStage )); - + sections = new ArrayList( + 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 @@ + + + + plainTextError F_PATIENT_DATAVALUE_ADD,F_PATIENT_DATAVALUE_UPDATE,F_PATIENT_DATAVALUE_DELETE + + + /dhis-web-commons/ajax/jsonResponseSuccess.vm + plainTextError + F_PATIENT_DATAVALUE_ADD,F_PATIENT_DATAVALUE_UPDATE,F_PATIENT_DATAVALUE_DELETE + === 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 @@
+
+ #if($programStageInstance.programStage.captureCoordinates=='true') +
+ $i18n.getString('coordinates') + + + + + + + + + + + + + +
+
+ #end +
+ +
+ + + + + + + === 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 @@




+





=== 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 @@ + + + + +