=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/SearchPersonAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/SearchPersonAction.java 2010-03-03 11:02:53 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/SearchPersonAction.java 2010-03-05 06:24:12 +0000 @@ -63,7 +63,7 @@ private Integer attributeId; - private String value; + private String searchValue; // ------------------------------------------------------------------------- // Output @@ -80,24 +80,28 @@ public String execute() throws Exception { - patients = patientService.searchPatient( identifierTypeId, attributeId, value ); - - for ( Patient p : patients ) + patients = patientService.searchPatient( identifierTypeId, attributeId, searchValue ); + + + + + if( patients != null && patients.size() > 0 ) { - Collection patientAttributeValues = patientAttributeValueService - .getPatientAttributeValues( p ); - - for ( PatientAttributeValue patientAttributeValue : patientAttributeValues ) + for ( Patient p : patients ) { - patientAttributeValueMap - .put( p.getId() + "_" + patientAttributeValue.getPatientAttribute().getId(), - patientAttributeValue.getValue() ); + Collection patientAttributeValues = patientAttributeValueService + .getPatientAttributeValues( p ); + + for ( PatientAttributeValue patientAttributeValue : patientAttributeValues ) + { + patientAttributeValueMap + .put( p.getId() + "_" + patientAttributeValue.getPatientAttribute().getId(), + patientAttributeValue.getValue() ); + } } - } - + } return SUCCESS; } - // ------------------------------------------------------------------------- // Getter/Setter @@ -113,11 +117,6 @@ this.attributeId = attributeId; } - public void setValue( String value ) - { - this.value = value; - } - public void setPatientService( PatientService patientService ) { this.patientService = patientService; @@ -128,17 +127,21 @@ return patients; } - public Map getPatientAttributeValueMap() { return patientAttributeValueMap; } - public void setPatientAttributeValueService( PatientAttributeValueService patientAttributeValueService ) { this.patientAttributeValueService = patientAttributeValueService; } + public void setSearchValue( String searchValue ) + { + this.searchValue = searchValue; + } + + } === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java 2009-10-24 09:32:01 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java 2010-03-05 06:24:12 +0000 @@ -66,7 +66,29 @@ public void setDescription( String description ) { this.description = description; - } + } + + /** + * Description of Date of Enrollment + * This description is differ from each program + */ + private String dateOfEnrollmentDescription; + + public void setDateOfEnrollmentDescription( String dateOfEnrollmentDescription ) + { + this.dateOfEnrollmentDescription = dateOfEnrollmentDescription; + } + + /** + * Description of Date of Incident + * This description is differ from each program + */ + private String dateOfIncidentDescription; + + public void setDateOfIncidentDescription( String dateOfIncidentDescription ) + { + this.dateOfIncidentDescription = dateOfIncidentDescription; + } // ------------------------------------------------------------------------- // Action implementation @@ -80,6 +102,8 @@ program.setName( nameField ); program.setDescription( description ); + program.setDateOfEnrollmentDescription( dateOfEnrollmentDescription ); + program.setDateOfIncidentDescription( dateOfIncidentDescription ); programService.saveProgram( program ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java 2009-10-24 09:32:01 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java 2010-03-05 06:24:12 +0000 @@ -75,6 +75,27 @@ this.description = description; } + /** + * Description of Date of Enrollment + * This description is differ from each program + */ + private String dateOfEnrollmentDescription; + + public void setDateOfEnrollmentDescription( String dateOfEnrollmentDescription ) + { + this.dateOfEnrollmentDescription = dateOfEnrollmentDescription; + } + + /** + * Description of Date of Incident + * This description is differ from each program + */ + private String dateOfIncidentDescription; + + public void setDateOfIncidentDescription( String dateOfIncidentDescription ) + { + this.dateOfIncidentDescription = dateOfIncidentDescription; + } // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -86,6 +107,8 @@ program.setName( nameField ); program.setDescription( description ); + program.setDateOfEnrollmentDescription( dateOfEnrollmentDescription ); + program.setDateOfIncidentDescription( dateOfIncidentDescription ); programService.updateProgram( program ); === 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 2010-03-03 11:02:53 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2010-03-05 06:24:12 +0000 @@ -373,4 +373,7 @@ add_person_successfully = Add Person successfully please_select_relationshipType = Please select Relationship type please_choose_representative_for_this_under_age_patient = Please chose representative for this under age patient -please_choose_relationshipType_for_this_under_age_patient = Please choose relationship type for this under age patient \ No newline at end of file +please_choose_relationshipType_for_this_under_age_patient = Please choose relationship type for this under age patient +dateOfEnrollmentDescription = Date of Enrollment description +dateOfIncidentDescription = Date of Incident description +child_representative = Child'sRepresentative \ 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/javascript/patient.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js 2010-03-04 11:51:40 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js 2010-03-05 06:24:12 +0000 @@ -515,7 +515,7 @@ /** * Show list patient duplicate by jQuery thickbox plugin * @param rootElement : root element of the response xml - * @param validate : is TRUE if this method is called in validation method + * @param validate : is TRUE if this method is called from validation method */ function showListPatientDuplicate(rootElement, validate) { @@ -564,6 +564,7 @@ tb_show( message, "#TB_inline?height=500&width=500&inlineId=hiddenModalContent", null); } } + function validatePatient() { if( jQuery("#id").val() ) @@ -571,6 +572,12 @@ else validateAddPatient(); } +// ------------------------------ +// checked = TRUE : show pop up +// ------------------------------ +// checked = FALSE : find all identifier which is disabled, remove its value and enable it +// This happen when user chose a representative, but now they dont want this patient to be under age anymore +// TODO : if user created a new person, should we delete that person in this case ? function toggleUnderAge(this_) { if( jQuery(this_).is(":checked")) === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/underage.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/underage.js 2010-03-03 11:02:53 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/underage.js 2010-03-05 06:24:12 +0000 @@ -1,5 +1,7 @@ -jQuery(document).ready(function(){ +jQuery(document).ready(function() +{ jQuery("#tabs").tabs(); + jQuery("#searchForm").validate({ meta:"validate" ,errorElement:"td" @@ -13,6 +15,7 @@ ,searchValue :"required" } }); + jQuery("#addRepresentativeForm").validate({ meta:"validate" ,errorElement:"td" @@ -20,9 +23,26 @@ { validateAddRepresentative(); } + ,rules : { + birthDate :{required:true,dateISO:true,datelessthanequaltoday:true} + } }); + jQuery.validator.loadLocaled( jQuery("#curLocaleCode").val() ); - jQuery("#birthDate").rules("add",{required:true,dateISO:true,datelessthanequaltoday:true}); + + // Esc key for jQuery thickbox + // jQuery thickbox already has this event + // but somehow it's over written by jQuery tabs plugin + document.onkeydown = function(e){ + if (e == null) { // ie + keycode = event.keyCode; + } else { // mozilla + keycode = e.which; + } + if(keycode == 27){ // close + window.parent.tb_remove(); + } + } }); @@ -39,7 +59,6 @@ alert(i18n_please_select_relationshipType); } - var params = '&firstName=' + getFieldValue( 'firstName' ) +'&middleName=' + getFieldValue( 'middleName' ) @@ -181,6 +200,7 @@ } } +// Will be call after save new person successfully function autoChoosePerson(xmlElement) { jQuery("#tab-2").html("
"+i18n_add_person_successfully+"
"); @@ -199,6 +219,7 @@ } +// Set Representative information to parent page. function choosePerson(this_) { === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm 2010-03-03 11:02:53 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm 2010-03-05 06:24:12 +0000 @@ -3,6 +3,9 @@ div#listPatients {font-size: 0.8em} div#listPatients label { font-weight: bold;} div#listPatients td {padding: 2px 5px} +div#popupHeader {text-align: center} +span#popupHeaderText{position: relative;} +span#popupHeaderText {left:0}
@@ -41,6 +44,7 @@ $i18n.getString("identifier_type") + #foreach($attribute in $attributes) #end === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm 2010-02-28 10:44:15 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm 2010-03-05 06:24:12 +0000 @@ -43,11 +43,11 @@ $i18n.getString( "name" ) * - + $i18n.getString( "description" ) * - + === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm 2010-02-22 09:19:15 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm 2010-03-05 06:24:12 +0000 @@ -35,22 +35,22 @@ - + - + - + - +