← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7381: Add new button in anonymous entry form for Complete and add new event.

 

------------------------------------------------------------
revno: 7381
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-06-25 21:15:51 +0700
message:
  Add new button in anonymous entry form for Complete and add new event.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js
  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/patient.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/resources/org/hisp/dhis/caseentry/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-06-25 04:17:52 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-06-25 14:15:51 +0000
@@ -366,4 +366,5 @@
 list_all_events = List all events
 specify_data_element = Please specify a data element
 advanced_search = Advanced search
-no_patient_enrolled_the_program = No person enrolled the program
\ No newline at end of file
+no_patient_enrolled_the_program = No person enrolled the program
+complete_and_add_new_event = Complete and add new

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm	2012-06-25 06:20:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm	2012-06-25 14:15:51 +0000
@@ -9,6 +9,8 @@
 <input type='hidden' id='orgunitId' name='orgunitId' value='$orgunit.id'>
 <input type='hidden' id='programStageInstanceId' name='programStageInstanceIdrgunitId'>
 <input type='hidden' id='programStageId' name='programStageId'>
+<input type='hidden' id='isShowEventList' name='isShowEventList'>
+
 <select multiple id='compulsoryDE' name='compulsoryDE' class='hidden'></select>
 
 <div id='criteriaDiv'>
@@ -93,8 +95,9 @@
 <div id='dataEntryInfor' class='hidden'>
 	<h4 id='programName' name='programName'></h4>
 	<p>
-		<input type="button" class='large-button' id='backBtn' value="$i18n.getString( 'back' )" onclick="javascript:backEventList();" >
-		<input type="button" onclick="doComplete()" value="Complete data entry" id="completeBtn">
+		<input type="button" id='backBtn' value="$i18n.getString( 'back' )" onclick="javascript:backEventList();" >
+		<input type="button" onclick="doComplete()" value="$i18n.getString('complete')" id="completeBtn">
+		<input type="button" onclick="completedAndAddNewEvent()" value="$i18n.getString('complete_and_add_new_event')" id="completeBtn">
 	</p>
 	<div id='dataEntryFormDiv'></div>
 </div>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js	2012-06-25 06:20:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js	2012-06-25 14:15:51 +0000
@@ -180,7 +180,8 @@
 {
 	hideById('dataEntryInfor');
 	hideById('listDiv');
-		
+	setFieldValue('isShowEventList', listAll );
+	
 	var params = '';
 	if(listAll){	
 		params += '&startDate=';
@@ -289,6 +290,7 @@
 	hideById('searchDiv');
 	hideById('listDiv');
 	setFieldValue('programStageInstanceId', psId);
+	setInnerHTML('dataEntryFormDiv','');
 	showLoader();
 	
 	$( '#dataEntryFormDiv' ).load( "dataentryform.action", 
@@ -320,6 +322,7 @@
 	showById('selectDiv');
 	showById('searchDiv');
 	showById('listDiv');
+	searchEvents( getFieldValue('isShowEventList') );
 }
 
 function showAddEventForm()
@@ -342,3 +345,8 @@
 			}
 		});
 }
+
+function completedAndAddNewEvent()
+{
+	doComplete( true );
+}

=== 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-06-25 13:20:32 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js	2012-06-25 14:15:51 +0000
@@ -614,7 +614,7 @@
     }
 }
 
-function doComplete()
+function doComplete( isCreateEvent )
 {
     var flag = false;
     jQuery("#dataEntryFormDiv input[name='entryfield'],select[name='entryselect']").each(function(){
@@ -690,6 +690,11 @@
 					selection.enable();
 					hideLoader();
 					hideById('contentDiv');
+					
+					if( isCreateEvent )
+					{
+						showAddEventForm();
+					}
 				});
 		}
     }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2012-06-25 03:19:12 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2012-06-25 14:15:51 +0000
@@ -383,7 +383,6 @@
 		}, function()
 		{	
 			showById('enrollmentDiv');
-			
 			jQuery('#loaderDiv').hide();
 		});
 }