=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveRelationshipAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveRelationshipAction.java 2012-07-30 03:39:34 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveRelationshipAction.java 2013-06-13 07:36:43 +0000 @@ -155,7 +155,7 @@ relationship.setRelationshipType( relationshipType ); relationshipService.saveRelationship( relationship ); - + return SUCCESS; } } === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SearchRelationshipPatientAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SearchRelationshipPatientAction.java 2012-06-12 07:46:25 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SearchRelationshipPatientAction.java 2013-06-13 07:36:43 +0000 @@ -123,7 +123,7 @@ { return patients; } - + // ------------------------------------------------------------------------- // Input/Output // ------------------------------------------------------------------------- === 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-06-10 08:45:01 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2013-06-13 07:36:43 +0000 @@ -749,9 +749,8 @@ - - /dhis-web-caseentry/responseRelationshipPatients.vm - + /content.vm + /dhis-web-caseentry/relationshipPatients.vm F_RELATIONSHIP_ADD === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addRelationshipForm.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addRelationshipForm.vm 2013-06-12 04:19:18 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addRelationshipForm.vm 2013-06-13 07:36:43 +0000 @@ -23,57 +23,37 @@
+ - - + + + -
- - - - - - - - - - - - - - - - - - - - - - - -
$i18n.getString('patient_profile')
$i18n.getString( "full_name" ): - $encoder.htmlEncode( $patient.getFullName() ) -
$i18n.getString( "gender" ): - #if($patient.gender=='F') - - #else - - #end -
$i18n.getString( "date_of_birth" ): - $format.formatDate( $patient.birthDate ) -
$i18n.getString( "age" ): - $encoder.htmlEncode( $patient.getAge() ) -
 
-
+ + + + + + + + + + + + +
$patient.getFullName() + #if($patient.gender=='F') + + #else + + #end +
$i18n.getString('date_of_birth'):$!format.formatDate($!patient.birthDate)
$i18n.getString('age'):$!patient.getAge()
+
- - - - + - - - + - - - - - - - - -
$i18n.getString('relationship_for') $patient.getFullName()
$encoder.htmlEncode( $patient.getFullName() ) $i18n.getString( "is" )
- +
- #foreach( $attribute in $patientAttributes ) #end * - - + + +
- $i18n.getString( "result_matching_the_search_criteria" ) - #if( $searchText ) - $encoder.htmlEncode( $searchText ) - #end -
- -
- - -
+
+
+ === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/female_small.png' Binary files dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/female_small.png 2013-06-11 06:36:03 +0000 and dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/female_small.png 2013-06-13 07:36:43 +0000 differ === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/relationshipPatient.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/relationshipPatient.js 2012-12-10 12:54:54 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/relationshipPatient.js 2013-06-13 07:36:43 +0000 @@ -209,6 +209,7 @@ function validateSearchPartner() { + hideById('searchRelationshipDiv'); $.ajax({ url: 'validateSearchRelationship.action', type:"POST", @@ -227,27 +228,13 @@ if( type == 'success' ) { jQuery('#loaderDiv').show(); - jQuery("#relationshipSelectForm :input").each(function() - { - jQuery(this).attr('disabled', 'disabled'); - }); - $.ajax({ type: "GET", url: 'searchRelationshipPatient.action', data: getParamsForDiv('relationshipSelectForm'), - success: function( json ) { - clearListById('availablePartnersList'); - for ( i in json.patients ) - { - addOptionById( 'availablePartnersList', json.patients[i].id, json.patients[i].fullName ); - } - - jQuery("#relationshipSelectForm :input").each(function() - { - jQuery(this).removeAttr('disabled'); - }); - + success: function( html ) { + setInnerHTML('searchRelationshipDiv',html); + showById('searchRelationshipDiv'); jQuery('#loaderDiv').hide(); } }); @@ -263,11 +250,9 @@ } } -function validateAddRelationship() +function validateAddRelationship(partnerId) { - var relationshipTypeId = jQuery( '#relationshipSelectForm [id=relationshipTypeId] option:selected' ).val(); - var partnerId = jQuery( '#relationshipSelectForm [id=availablePartnersList]' ).val(); - + var relationshipTypeId = jQuery( '#relationshipSelectForm [id=relationshipTypeId] option:selected' ).val(); if( relationshipTypeId==''){ showWarningMessage( i18n_please_select_relationship_type ); return; @@ -276,14 +261,12 @@ showWarningMessage( i18n_please_select_a_patient_for_setting_relationship ); return; } - addRelationship(); + addRelationship(partnerId); } -function addRelationship() +function addRelationship(partnerId) { - var relationshipTypeId = jQuery( '#relationshipSelectForm [id=relationshipTypeId] option:selected' ).val(); - var partnerId = jQuery( '#relationshipSelectForm [id=availablePartnersList]' ).val(); - + var relationshipTypeId = jQuery( '#relationshipSelectForm [id=relationshipTypeId] option:selected' ).val(); var relTypeId = relationshipTypeId.substr( 0, relationshipTypeId.indexOf(':') ); var relName = relationshipTypeId.substr( relationshipTypeId.indexOf(':') + 1, relationshipTypeId.length ); @@ -292,40 +275,32 @@ '&relationshipTypeId=' + relTypeId + '&relationshipName=' + relName ; - jQuery('#loaderDiv').show(); - $.ajax({ url: 'saveRelationship.action', type:"POST", data: params, dataType: "xml", - success: addRelationshipCompleted - }); + success: function( messageElement ) { + messageElement = messageElement.getElementsByTagName( 'message' )[0]; + var type = messageElement.getAttribute( 'type' ); + var message = messageElement.firstChild.nodeValue; + + if( type == 'success' ){ + jQuery('#searchRelationshipDiv [id=tr' + partnerId + ']').css("background-color","#C0C0C0") + showSuccessMessage( i18n_save_success ); + } + else if( type == 'error' ){ + showErrorMessage( i18n_adding_relationship_failed + ':' + '\n' + message ); + } + else if( type == 'input' ){ + showWarningMessage( message ); + } + } + }); return false; } -function addRelationshipCompleted( messageElement ) -{ - messageElement = messageElement.getElementsByTagName( 'message' )[0]; - var type = messageElement.getAttribute( 'type' ); - var message = messageElement.firstChild.nodeValue; - - if( type == 'success' ) - { - showSuccessMessage( i18n_save_success ); - } - else if( type == 'error' ) - { - showErrorMessage( i18n_adding_relationship_failed + ':' + '\n' + message ); - } - else if( type == 'input' ) - { - showWarningMessage( message ); - } - jQuery('#loaderDiv').hide(); -} - //------------------------------------------------------------------------------ // Remove Relationship //------------------------------------------------------------------------------ === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientLocation.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientLocation.vm 2013-06-12 04:19:18 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientLocation.vm 2013-06-13 07:36:43 +0000 @@ -28,7 +28,7 @@   - $i18n.getString('dob_type'): + $i18n.getString('date_of_birth'): $!format.formatDate($!patient.birthDate) === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm 2013-05-29 15:42:21 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm 2013-06-13 07:36:43 +0000 @@ -3,7 +3,7 @@ - +
@@ -68,7 +68,7 @@
-