← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3893: Fix bug: Search patients with unicode key.

 

------------------------------------------------------------
revno: 3893
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-06-14 14:44:43 +0700
message:
  Fix bug: Search patients with unicode key.
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/paging/paging.vm
  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/listPatient.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/selectPatient.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-commons-resources/src/main/webapp/dhis-web-commons/paging/paging.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/paging/paging.vm	2011-05-24 04:29:53 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/paging/paging.vm	2011-06-14 07:44:43 +0000
@@ -86,7 +86,15 @@
 	else
 	{
 		if( contentDiv == undefined) { $( '#contentDiv' ).load(url); }
-		else { $( '#' + contentDiv ).load(url); }
+		else {
+			var index = url.indexOf('?');
+			var link = url.substring(0, index);
+			var data = url.substring(index + 1);
+			jQuery.postUTF8( link , data, function(html)
+			{
+				setInnerHTML(contentDiv, html);
+			});
+		}
 	}
 }
 

=== 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	2011-05-26 03:19:50 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js	2011-06-14 07:44:43 +0000
@@ -254,16 +254,6 @@
 		});
 }
 
-/* function searchPatientsbyBackBtn()
-{
-	showLoader();
-	
-	var url  = 'searchPatient.action';
-	$('#listPatientDiv').load(url);
-	
-	hideLoader();
-} */
-
 // -----------------------------------------------------------------------------
 // Disable form
 // -----------------------------------------------------------------------------
@@ -688,6 +678,7 @@
 	jQuery('#listPatientDiv').load('searchPatient.action?listAll=true',
 		function(){
 			showById('listPatientDiv');
+			setInnerHTML( 'searchTextInfo', i18n_list_all_patient );
 			jQuery('#loaderDiv').hide();
 		});
 	hideLoader();

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatient.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatient.vm	2011-05-13 09:11:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatient.vm	2011-06-14 07:44:43 +0000
@@ -4,7 +4,6 @@
 		<td>&nbsp;</td>
 		<td>&nbsp;</td>
 		<td>
-		   <span id='titleInfo'></span>
 		   <span id='searchTextInfo'></span>
 		</td>
 	</tr>	
@@ -145,16 +144,15 @@
 	jQuery(document).ready(function(){	
 		tableSorter( 'patientList' );
 		
-		if( byId('searchingAttributeId').value == 0 )
-		{
-			setInnerHTML( 'titleInfo', i18n_list_all_patient );
+		if( byId('searchingAttributeId').value == '0' )
+		{
+			var  programName = byId('programId').options[byId('programId').selectedIndex].text;
+			setInnerHTML( 'searchTextInfo', i18n_list_patients_by_program + programName );
+		}
+		else 
+		{
 			setInnerHTML( 'searchTextInfo', getFieldValue('searchText'));
 		}
-		else
-		{
-			setInnerHTML( 'titleInfo', i18n_list_patients_by_program );
-			setInnerHTML( 'searchTextInfo', getFieldValue('programId') );
-		}
 	});
 	
 	var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_patient" ) , "'" )';

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/selectPatient.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/selectPatient.vm	2011-05-26 03:19:50 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/selectPatient.vm	2011-06-14 07:44:43 +0000
@@ -77,6 +77,7 @@
 	var i18n_specify_a_search_criteria = '$encoder.jsEscape( $i18n.getString( "specify_a_search_criteria" ) , "'")';
 	var i18n_select_program = '[' + '$encoder.jsEscape( $i18n.getString( "select_program" ), "'")' + ']';
 	var i18n_save_success = '$encoder.jsEscape( $i18n.getString( "save_success" ) , "'")';
+	var i18n_list_all_patient = '$encoder.jsEscape( $i18n.getString( "list_all_patient" ) , "'")';
 	
 	var i18n_program_enrollment_failed = '$encoder.jsEscape( $i18n.getString( "program_enrollment_failed" ) , "'")';
     var i18n_saving_value_failed_status_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_status_code" ) , "'")';