← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13473: Enable Advanced search functionality in Single event with registration functionality.

 

------------------------------------------------------------
revno: 13473
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-12-30 10:19:24 +0700
message:
  Enable Advanced search functionality in Single event with registration functionality.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listPatient.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.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-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js	2013-12-19 06:41:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js	2013-12-30 03:19:24 +0000
@@ -14,13 +14,16 @@
 		{
 			var count = 0;
 			for ( i in json.programs ) {
-				jQuery( '#programIdAddPatient').append( '<option value="' + json.programs[i].id +'" programStageId="' + json.programs[i].programStageId + '" type="' + json.programs[i].type + '">' + json.programs[i].name + '</option>' );
+				if( json.programs[i].type==2){
+					jQuery( '#programIdAddPatient').append( '<option value="' + json.programs[i].id +'" programStageId="' + json.programs[i].programStageId + '" type="' + json.programs[i].type + '">' + json.programs[i].name + '</option>' );
+					count++;
+				}
 			}
 			
-			if(json.programs.length==0){
+			if(count==0){
 				jQuery( '#programIdAddPatient').prepend( '<option value="" >' + i18n_none_program + '</option>' );
 			}
-			else if(json.programs.length>1){
+			else if(count>1){
 				jQuery( '#programIdAddPatient').prepend( '<option value="" selected>' + i18n_please_select + '</option>' );
 			}
 			

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listPatient.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listPatient.vm	2013-12-18 06:05:41 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listPatient.vm	2013-12-30 03:19:24 +0000
@@ -30,12 +30,8 @@
 		#if( $auth.hasAccess( "dhis-web-caseentry", "accessPatientAttributes" ) )
 			#foreach( $identifierType in $identifierTypes) <col/> #end
 		#if( $identifierTypes.size()==0 ) <col/> #end
-		<col width="60"/>
-		<col width="110"/>
-		<col width="60"/>
 		#end
 		#if($mapPatientOrgunit.size()!=0) <col/> #end
-		<col/>
 		<col width="80"/>
 	</colgroup>	  
 	

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm	2013-12-18 08:01:59 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm	2013-12-30 03:19:24 +0000
@@ -6,14 +6,11 @@
 				item.remove();
 			}
 		});
-		if(jQuery("#programIdAddPatient option").length==0)
+		if(jQuery("#programIdAddPatient option").length==1)
 		{
+			jQuery("#programIdAddPatient [value=]").remove();
 			jQuery( '#programIdAddPatient').append( '<option value="" type="">' + i18n_none_program + '</option>' );
 		}
-		else if(jQuery("#programIdAddPatient option").length==1)
-		{
-			jQuery("#programIdAddPatient [value=]").remove();
-		}
 		
 		disable('advancedSearchBtn');
 		hideById('removeEventLink');
@@ -22,6 +19,7 @@
 		$("#searchObjectId option[value='prg']").remove();
 		setFieldValue('startDueDate','');
 		setFieldValue('endDueDate','');
+		showById('advancedSearchBtn');
 	});
 </script>