← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10920: Program list is loaded by selected orgunit in Program stage completeness function

 

------------------------------------------------------------
revno: 10920
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-05-21 16:08:24 +0700
message:
  Program list is loaded by selected orgunit in Program stage completeness function
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/programStageCompleteness.js


--
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/programStageCompleteness.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/programStageCompleteness.js	2013-04-16 05:41:25 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/programStageCompleteness.js	2013-05-21 09:08:24 +0000
@@ -5,6 +5,19 @@
 	hideById("listPatientDiv");
 	setFieldValue('orgunitName', orgUnitNames[0]);
 	setFieldValue('orgunitId', orgUnits[0]);
+	clearListById('programId');
+	jQuery.get("getPrograms.action",{}, 
+		function(json)
+		{
+			jQuery( '#programId').append( '<option value="">' + i18n_please_select + '</option>' );
+			for ( i in json.programs ) {
+				if(json.programs[i].type==1){
+					jQuery( '#programId').append( '<option value="' + json.programs[i].id +'" type="' + json.programs[i].type + '">' + json.programs[i].name + '</option>' );
+				}
+			}
+			hideById('programLoader');
+			enable('programId');
+		});
 }
 
 selection.setListenerFunction( orgunitSelected );