← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9824: Add Add-and-register-new button in single event with registration form.

 

------------------------------------------------------------
revno: 9824
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-02-18 19:16:32 +0700
message:
  Add Add-and-register-new button in single event with registration form.
modified:
  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/webapp/dhis-web-caseentry/addSingleEventRegistration.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm	2012-12-27 03:35:12 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm	2013-02-18 12:16:32 +0000
@@ -41,21 +41,13 @@
 	<input type="hidden" id="relationshipTypeId" name="relationshipTypeId"/>
 	<input type="hidden" id="programStageId" name="programStageId" value='$programStage.id'/>
 	
-	<table>
-		<tbody id='patientForm'>
-		#parse( "/dhis-web-caseentry/patientForm.vm" )
-		</tbody>
-		<tr><td>&nbsp;</td><tr>
-		#parse( "/dhis-web-caseentry/singleDataEntryForm.vm" )
-		<tr><td>&nbsp;</td><tr>
-		<tr>
-			<td></td>
-			<td>
-				<input type="submit" class="button" value="$i18n.getString( 'add' )" onclick='_continue=false;'/>
-				<input type="button" class="button" value="$i18n.getString( 'back' )" onclick="javascript:backEventList();"/>
-			</td>
-		</tr>
-	</table>
+	<div id='patientForm'>#parse( "/dhis-web-caseentry/patientForm.vm" )</div>
+	<div id="entryForm"> #parse( "/dhis-web-caseentry/singleDataEntryForm.vm" )</div>
+	<p>
+		<input type="submit" class="button" value="$i18n.getString( 'add' )" onclick='_continue=false;' style="width:80px;"/>
+		<input type="submit" class="button" value="$i18n.getString( 'add_and_register_new' )" style="width:160px;" onclick="_continue=true;"/>
+		<input type="button" class="button" value="$i18n.getString( 'back' )" onclick="javascript:backEventList();" style="width:80px;"/>
+	</p>
 </form>
 
 <script>

=== 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-12-27 05:20:24 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js	2013-02-18 12:16:32 +0000
@@ -67,6 +67,7 @@
 {
 	var params = "programId=" + getFieldValue('programIdAddPatient') + "&" + getParamsForDiv('patientForm');
 	$("#patientForm :input").attr("disabled", true);
+	$("#entryForm :input").attr("disabled", true);
 	$.ajax({
 		type: "POST",
 		url: 'validatePatient.action',
@@ -126,13 +127,16 @@
 		url: 'saveValues.action',
 		data: params,
 		success: function(json) {
-			$("#patientForm :input").attr("disabled", true);
-			jQuery("#resultSearchDiv").dialog("close");
 			if( _continue==true )
 			{
+				$("#patientForm :input").attr("disabled", false);
+				$("#entryForm :input").attr("disabled", false);
 				jQuery('#patientForm :input').each(function()
 				{
 					var type=$( this ).attr('type');
+					if(type=='checkbox'){
+						this.checked = false;
+					}
 					if(type!='button'){
 						$( this ).val('');
 					}
@@ -151,6 +155,7 @@
 			}
 			else
 			{
+				setInnerHTML('singleProgramName','');
 				hideById('addNewDiv');
 				if( getFieldValue('listAll')=='true'){
 					listAllPatient();