← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6840: (patient) Close due-date dialog when selecting an other program or an other orgunit in data entry...

 

------------------------------------------------------------
revno: 6840
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-05-03 14:59:27 +0700
message:
  (patient) Close due-date dialog when selecting an other program or an other orgunit in data entry form.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/form.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/entry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js	2012-03-28 09:26:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js	2012-05-03 07:59:27 +0000
@@ -5,6 +5,7 @@
 
 function loadProgramStages()
 {
+	jQuery('#createNewEncounterDiv').dialog('close');
 	hideById('dataEntryFormDiv');
 	clearListById('programStageId');
 	setFieldValue('executionDate','');
@@ -637,7 +638,7 @@
 					disable('completeBtn');
 					disable('executionDate');
 					var irregular = jQuery('#entryFormContainer [name=irregular]').val();
-					if( irregular == 'true')
+					if( irregular == 'true' )
 					{
 						jQuery('#createNewEncounterDiv').dialog({
 								title: i18n_create_new_encounter,
@@ -651,7 +652,7 @@
 					}
 					
 					var selectedProgram = jQuery('#dataRecordingSelectForm [name=programId] option:selected');
-					if( selectedProgram.attr('singleevent')=='true' )
+					if( selectedProgram.attr('singleevent')=='true' && irregular == 'false' )
 					{
 						selectedProgram.remove();
 					}
@@ -748,16 +749,11 @@
 	jQuery.postJSON( "registerIrregularEncounter.action",{ dueDate: dueDate }, 
 		function( json ) 
 		{   
+			jQuery('#createNewEncounterDiv').dialog('close');
 			loadDataEntry();
-			jQuery('#createNewEncounterDiv').dialog('close');
 		});
 }
 
-function closeDueDateDiv()
-{
-	jQuery('#createNewEncounterDiv').dialog('close');
-}
-
 function autocompletedField( idField )
 {
 	var input = jQuery( "#" +  idField )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/form.js	2012-03-27 09:40:11 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/form.js	2012-05-03 07:59:27 +0000
@@ -1,6 +1,7 @@
 
 function organisationUnitSelected( orgUnits, orgUnitNames )
 {
+	jQuery('#createNewEncounterDiv').dialog('close');
 	setInnerHTML( 'contentDiv', '' );
 	setFieldValue( 'orgunitName', orgUnitNames[0] );
 	
@@ -24,6 +25,7 @@
 	hideById('dataEntryFormDiv');
 	showById('searchPatientDiv');
 	showById('contentDiv');
+	jQuery('#createNewEncounterDiv').dialog('close');
 }
 
 //--------------------------------------------------------------------------------------------