← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7822: Add button to add_and_continue in single events with registration.

 

------------------------------------------------------------
revno: 7822
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-08-02 13:03:53 +0700
message:
  Add button to add_and_continue in single events with registration.
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/addSingleEventRegistration.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.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-08-02 02:48:18 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-08-02 06:03:53 +0000
@@ -386,4 +386,5 @@
 please_select_relationship_type = Please select a relationship type
 please_select_a_patient_for_setting_relationship = Please select a person for setting relationship
 report_date_from_to=Report date (from-to)
-enter_age_in_year = Enter age in years ...
\ No newline at end of file
+enter_age_in_year = Enter age in years ...
+add_and_continue = Add && Continue
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm	2012-08-02 05:27:55 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm	2012-08-02 06:03:53 +0000
@@ -50,7 +50,8 @@
 	<h3 id='entryName'></h3>
 	<div id='dataForm'>#parse( "/dhis-web-caseentry/dataEntryForm.vm" )</div>
 	<p>
-		<input type="submit" class="button" value="$i18n.getString( 'add' )" />
+		<input type="submit" class="button" value="$i18n.getString( 'add' )" onclick='_continue=false;'/>
+		<input type="submit" class="button" value="$i18n.getString( 'add_and_continue' )" onclick='_continue=true;'/>
 		<input type="button" class="button" value="$i18n.getString( 'back' )" onclick="javascript:backAddNewBtn();"/>
 	</p>
 </form>

=== 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	2012-08-02 05:27:55 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js	2012-08-02 06:03:53 +0000
@@ -1,4 +1,5 @@
 var unSave = true;
+var _continue = false;
 function orgunitSelected( orgUnits, orgUnitNames )
 {	
 	organisationUnitSelected( orgUnits, orgUnitNames );
@@ -113,13 +114,34 @@
 		success: function(json) {
 			showSuccessMessage( i18n_save_success );
 			jQuery("#resultSearchDiv").dialog("close");
-			hideById('addNewDiv');
-			if( getFieldValue('listAll')=='true'){
-				listAllPatient();
+			if( _continue==true )
+			{
+				jQuery('#patientForm :input').each(function()
+				{
+					var type=$( this ).attr('type');
+					if(type!='button'){
+						$( this ).val('');
+					}
+					enable(this.id);
+				});
+				jQuery('#dataForm :input').each(function()
+				{
+					var type=$( this ).attr('type');
+					if(type!='button'){
+						$( this ).val('');
+					}
+				});
 			}
-			else{
-				showById('searchDiv');
-				showById('contentDiv');
+			else
+			{
+				hideById('addNewDiv');
+				if( getFieldValue('listAll')=='true'){
+					listAllPatient();
+				}
+				else{
+					showById('searchDiv');
+					showById('contentDiv');
+				}
 			}
 		}
      });