← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3660: Reverted r 3621

 

------------------------------------------------------------
revno: 3660
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-05-19 10:17:24 +0200
message:
  Reverted r 3621
removed:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeList.vm
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttribute.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm


--
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-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml	2011-05-19 08:14:24 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml	2011-05-19 08:17:24 +0000
@@ -201,14 +201,7 @@
 			<param name="page">
 				/dhis-web-maintenance-patient/patientAttribute.vm</param>
 			<param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
-			<param name="javascripts">javascript/commons.js,javascript/patientAttribute.js</param>
-		</action>
-		
-		<action name="patientAttributeList"
-			class="org.hisp.dhis.patient.action.patientattribute.GetPatientAttributeListAction">
-			<result name="success" type="velocity">/content.vm</result>
-			<param name="page">
-				/dhis-web-maintenance-patient/patientAttributeList.vm</param>
+			<param name="javascripts">javascript/patientAttribute.js</param>
 		</action>
 
 		<action name="getPatientAttribute"
@@ -227,28 +220,36 @@
 
 		<action name="addPatientAttribute"
 			class="org.hisp.dhis.patient.action.patientattribute.AddPatientAttributeAction">
-			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+			<result name="success" type="redirect">patientAttribute.action
+			</result>
 			<param name="requiredAuthorities">F_PATIENTATTRIBUTE_ADD</param>
 		</action>
 
 		<action name="showAddPatientAttributeForm" class="org.hisp.dhis.patient.action.NoAction">
-			<result name="success" type="velocity">/content.vm</result>
-			<param name="page">/dhis-web-maintenance-patient/addPatientAttributeForm.vm</param>
+			<result name="success" type="velocity">/main.vm</result>
+			<param name="page">
+				/dhis-web-maintenance-patient/addPatientAttributeForm.vm</param>
+			<param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
+			<param name="javascripts">javascript/patientAttribute.js</param>
 			<param name="requiredAuthorities">F_PATIENTATTRIBUTE_ADD</param>
 		</action>
 
 		<action name="showUpdatePatientAttributeForm"
 			class="org.hisp.dhis.patient.action.patientattribute.GetPatientAttributeAction">
-			<result name="success" type="velocity">/content.vm</result>
-			<param name="page">/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm</param>
+			<result name="success" type="velocity">/main.vm</result>
+			<param name="page">
+				/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm</param>
+			<param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
+			<param name="javascripts">javascript/patientAttribute.js
+				,../dhis-web-commons/javascripts/jQuery/ui/jquery.cluetip.min.js</param>
+			<param name="stylesheets">../dhis-web-commons/javascripts/jQuery/ui/css/theme/jquery.cluetip.css</param>
 			<param name="requiredAuthorities">F_PATIENTATTRIBUTE_UPDATE</param>
 		</action>
 
 		<action name="updatePatientAttribute"
 			class="org.hisp.dhis.patient.action.patientattribute.UpdatePatientAttributeAction">
-			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+			<result name="success" type="redirect">patientAttribute.action
+			</result>
 			<param name="requiredAuthorities">F_PATIENTATTRIBUTE_UPDATE</param>
 		</action>
 
@@ -258,6 +259,7 @@
 				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
 			<result name="input" type="velocity-json">
 				/dhis-web-commons/ajax/jsonResponseInput.vm</result>
+			<param name="onExceptionReturn">plainTextError</param>
 		</action>
 
 		<action name="removePatientAttributeOption"

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm	2011-05-19 08:15:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm	2011-05-19 08:17:24 +0000
@@ -1,35 +1,34 @@
-<script>
-	var i18n_remove_option = '$encoder.jsEscape( $i18n.getString( "remove_option" ) , "'") ';
-	var i18n_field_is_required = '$encoder.jsEscape( $i18n.getString( "field_is_required" ) , "'") ';
-	var isSubmit = true;
-	jQuery("#addPatientAttributeForm").ready( function(){
-			validation( 'addPatientAttributeForm', function(form){
-				if( isSubmit && ATTRIBUTE_OPTION.checkOnSubmit() ) {
-					form.submit(i18n_field_is_required);
+<script type="text/javascript">
+	jQuery(document).ready(	function(){
+		validation( 'addPatientAttributeForm', function(form){
+			if( isSubmit && ATTRIBUTE_OPTION.checkOnSubmit() ) {
+				form.submit(i18n_field_is_required);
+			}
+		}, function(){
+			isSubmit = true;
+			
+			var fields = jQuery("#addPatientAttributeForm").serializeArray();
+			jQuery.each(fields, function(i, field) {
+				if(  field.name.match("^attrOption")=='attrOption' && field.value == ""){
+					setInnerHTML("attrMessage", i18n_field_is_required);
+					isSubmit = false;
 				}
-			}, function(){
-				isSubmit = true;
-				
-				var fields = $("#addPatientAttributeForm").serializeArray();
-				jQuery.each(fields, function(i, field) {
-					if(  field.name.match("^attrOption")=='attrOption' && field.value == ""){
-						setInnerHTML("attrMessage", i18n_field_is_required);
-						isSubmit = false;
-					}
-				});
-			}); 
-			
+			});
+		}); 
 		
 		jQuery("#attributeComboRow").hide();
 			
 		checkValueIsExist( "name", "validatePatientAttribute.action");
 	});		
+
+	var i18n_remove_option = '$encoder.jsEscape( $i18n.getString( "remove_option" ) , "'") ';
+	var i18n_field_is_required = '$encoder.jsEscape( $i18n.getString( "field_is_required" ) , "'") ';
+	var isSubmit = true;
 </script>
-				
-<input type="button" value="$i18n.getString( 'back' )" onclick="javascript:onClickBackBtn();" style="width:10em">
-													
+
+																		
 <h3>$i18n.getString( "add_new_patient_attribute" )</h3>
-<form id="addPatientAttributeForm" method="post">
+<form id="addPatientAttributeForm" action="addPatientAttribute.action" method="post" >
 
 <table id="attrTable"> 
 	<thead>
@@ -102,8 +101,10 @@
     </tr>
      </tbody>
 </table>
+<span id='message'></span>
 <p>
-    <input type="button" value="$i18n.getString( 'add' )" style="width:10em" onclick="addPatientAttribute();"/>
+    <input type="submit" value="$i18n.getString( 'add' )" style="width:10em"/>
+    <input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='patientAttribute.action'" style="width:10em"/>
 </p>
 
 </form>   

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js	2011-05-16 06:44:39 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js	2011-05-19 08:17:24 +0000
@@ -730,6 +730,7 @@
       url: 'addPatient.action',
       data: getParamsForDiv('addPatientDiv'),
       success: function(json) {
+		var type = json.response;
 		showProgramEnrollmentSelectForm( json.message );
       }
      });

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttribute.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttribute.js	2011-05-19 08:15:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttribute.js	2011-05-19 08:17:24 +0000
@@ -27,7 +27,6 @@
 // -----------------------------------------------------------------------------
 // Remove Patient Attribute
 // -----------------------------------------------------------------------------
-
 function removePatientAttribute( patientAttributeId, name )
 {
 	removeItem( patientAttributeId, name, i18n_confirm_delete, 'removePatientAttribute.action' );	
@@ -99,90 +98,4 @@
 	{
 		return "<tr><td><input type='text' name='attrOptions' style='width:28em'/><a href='#' style='text-decoration: none; margin-left:0.5em;' title='"+i18n_remove_option+"'  onClick='ATTRIBUTE_OPTION.remove(this,null)'>[ - ]</a></td></tr>";
 	}
-}
-
-// ------------------------------------------------------------------
-// Add Patient-attribute
-// ------------------------------------------------------------------
-
-function showAddPatientAttributeForm()
-{
-	hideById('attributeList');
-	jQuery('#loaderDiv').show();
-	jQuery('#editPatientAttributeForm').load('showAddPatientAttributeForm.action',
-	{
-	}, function()
-	{
-		showById('editPatientAttributeForm');
-		jQuery('#loaderDiv').hide();
-	});
-}
-
-function addPatientAttribute()
-{	
-	$.ajax({
-		type: "POST",
-		url: 'addPatientAttribute.action',
-		data: getParamsForDiv('editPatientAttributeForm'),
-		success: function( json ) {
-			if( json.response == 'success')
-			{
-				onClickBackBtn();
-			}
-		}
-	});
-	
-    return false;
-}
-
-// ------------------------------------------------------------------
-// Show Update Patient-attribute
-// ------------------------------------------------------------------
-
-function showUpdatePatientAttributeForm( attributeId )
-{
-	hideById('attributeList');
-	jQuery('#loaderDiv').show();
-	jQuery('#editPatientAttributeForm').load('showUpdatePatientAttributeForm.action',
-	{
-		id:attributeId
-	}, function()
-	{
-		showById('editPatientAttributeForm');
-		jQuery('#loaderDiv').hide();
-	});
-	
-}
-
-function updatePatientAttribute()
-{
-	$.ajax({
-		type: "POST",
-		url: 'updatePatientAttribute.action',
-		data: getParamsForDiv('editPatientAttributeForm'),
-		success: function( json ) {
-			if( json.response == 'success')
-			{
-				onClickBackBtn();
-			}
-		}
-	});
-    return false;
-}
-
-// ------------------------------------------------------------------
-// Click Back button
-// ------------------------------------------------------------------
-
-function onClickBackBtn()
-{
-	hideById('editPatientAttributeForm');	
-	jQuery('#loaderDiv').show();
-	jQuery('#attributeList').load('patientAttributeList.action',
-	{
-	}, function()
-	{
-		showById('attributeList');
-		jQuery('#loaderDiv').hide();
-	});
-}	
\ No newline at end of file
+}
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm	2011-05-19 08:15:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm	2011-05-19 08:17:24 +0000
@@ -1,12 +1,64 @@
-<div id='attributeList'>
-	#parse( "/dhis-web-maintenance-patient/patientAttributeList.vm" )
-</div>
-
-#parse( "/dhis-web-commons/loader/loader.vm" )
-
-<div id='editPatientAttributeForm'></div>
-<p></p>
-<span id='message' style='display:none;' onclick="hideById(this.id)"> $i18n.getString( "save_success" )</span>
+
+<h3>$i18n.getString( "patient_attribute_management" )</h3>
+
+<table class="mainPageTable">
+  <tr>
+    <td style="vertical-align:top">
+    
+      <table class="listTable">
+          <col>          
+          <col width="20">
+          <col width="20">
+          <col width="20">          		  
+		  <tr>
+		  	<td></td>
+			<td colspan="3" style="text-align:right"><input type="button" value="$i18n.getString( "add_new" )" onclick="window.location.href='showAddPatientAttributeForm.action'" style="width:70px"></td>
+		  </tr>
+          <tr>
+            <th>$i18n.getString( "attribute_name" )</th>
+            <th colspan="3">$i18n.getString( "operations" )</th>
+          </tr>
+
+          <tbody id="list">
+            #foreach( $patientAttribute in $patientAttributes )
+              <tr id="tr${patientAttribute.id}">
+              
+                <td>$encoder.htmlEncode( $patientAttribute.name )</td>                
+                
+                <td style="text-align:center">
+                  <a href="showUpdatePatientAttributeForm.action?id=$patientAttribute.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a>
+                </td>                
+ 
+                <td style="text-align:center">
+                  <a href="javascript:removePatientAttribute( '$patientAttribute.id', '$encoder.jsEncode( $patientAttribute.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
+                </td>            
+                
+                <td style="text-align:center">
+                  <a href="javascript:showPatientAttributeDetails( $patientAttribute.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a>
+                </td>
+                
+              </tr>
+			#end
+
+          </tbody>
+
+        </table>
+    </td>
+		<td style="width:20em; padding-left:2em; vertical-align:top">
+
+			<div id="detailsArea" style="display:none">
+				<div style="float:right">
+					<a href="javascript:hideDetails()" title="$i18n.getString( "hide_details" )"><img src="../images/close.png" alt="$i18n.getString( "hide_details" )"></a>
+				</div>				
+				<p><label>$i18n.getString( "id" ):</label><br><span id="idField"></span></p>
+                <p><label>$i18n.getString( "name" ):</label><br><span id="nameField"></span></p>
+                <p><label>$i18n.getString( "description" ):</label><br><span id="descriptionField"></span></p>
+                <p><label>$i18n.getString( "value_type" ):</label><br><span id="valueTypeField"></span></p>
+			</div>
+
+		</td>
+  </tr>
+</table>
 
 <script type="text/javascript">
 	var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_patient_attribute" ) , "'" )';

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeList.vm	2011-05-16 06:44:39 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeList.vm	1970-01-01 00:00:00 +0000
@@ -1,62 +0,0 @@
-<h3>$i18n.getString( "patient_attribute_management" )</h3>
-
-<table class="mainPageTable">
-  <tr>
-	<td style="vertical-align:top">
-	
-	  <table class="listTable">
-		  <col>          
-		  <col width="20">
-		  <col width="20">
-		  <col width="20">          		  
-		  <tr>
-			<td></td>
-			<td colspan="3" style="text-align:right"><input type="button" value="$i18n.getString( 'add_new' )" onclick="javascript:showAddPatientAttributeForm();" style="width:70px"></td>
-		  </tr>
-		  <tr>
-			<th>$i18n.getString( "attribute_name" )</th>
-			<th colspan="3">$i18n.getString( "operations" )</th>
-		  </tr>
-
-		  <tbody id="list">
-			#set( $mark = false )
-			#foreach( $patientAttribute in $patientAttributes )
-			  <tr id="tr${patientAttribute.id}" #alternate( $mark )>
-			  
-				<td>$encoder.htmlEncode( $patientAttribute.name )</td>                
-				
-				<td style="text-align:center">
-				  <a href="javascript:showUpdatePatientAttributeForm('$patientAttribute.id');" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a>
-				</td>                
- 
-				<td style="text-align:center">
-				  <a href="javascript:removePatientAttribute( '$patientAttribute.id', '$encoder.jsEncode( $patientAttribute.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
-				</td>            
-				
-				<td style="text-align:center">
-				  <a href="javascript:showPatientAttributeDetails( $patientAttribute.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a>
-				</td>
-				
-			  </tr>
-			  #set( $mark = !$mark)
-			#end
-
-		  </tbody>
-
-		</table>
-	</td>
-		<td style="width:20em; padding-left:2em; vertical-align:top">
-
-			<div id="detailsArea" style="display:none">
-				<div style="float:right">
-					<a href="javascript:hideDetails()" title="$i18n.getString( "hide_details" )"><img src="../images/close.png" alt="$i18n.getString( "hide_details" )"></a>
-				</div>				
-				<p><label>$i18n.getString( "id" ):</label><br><span id="idField"></span></p>
-				<p><label>$i18n.getString( "name" ):</label><br><span id="nameField"></span></p>
-				<p><label>$i18n.getString( "description" ):</label><br><span id="descriptionField"></span></p>
-				<p><label>$i18n.getString( "value_type" ):</label><br><span id="valueTypeField"></span></p>
-			</div>
-
-		</td>
-  </tr>
-</table>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm	2011-05-16 06:44:39 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm	2011-05-19 08:17:24 +0000
@@ -1,68 +1,84 @@
-<script>
-jQuery(document).ready(function()
-{
-	jQuery("#tabs").tabs();
-	datePickerValid( 'birthDate' );
-	
-	jQuery("#searchForm").validate({
-		meta:"validate"
-		,errorElement:"span"
-		,submitHandler: function(form)
-						{
-							searchPerson();
-						}
-		,rules : {
-			relationshipTypeId  : { required: true },
-			searchType			: { required: true },
-			searchValue		: { required: true }
-		}
-	});
-	
-	
-	jQuery("#addRepresentativeForm").validate({
-		 meta:"validate"
-		,errorElement:"td"
-		,submitHandler: function(form)
-						{
-							validateAddRepresentative();
-						}
-		,rules : {
-			relationshipTypeId  : { required: true },
-			fullName : {required:true,rangelength:[7,50], unicodechars:true},
-			gender : { required: true },
-			birthDate :{required:false,dateISO:true,datelessthanequaltoday:true}
-		},beforeValidateHandler: function(form)
-			{
-				var dobType = $('#dobType').val();
-						
-				if( dobType=='V' || dobType=='D' ) 
+<script type="text/javascript">
+	jQuery(document).ready(function() {
+		jQuery("#tabs").tabs();
+		datePickerValid( 'birthDate' );
+			
+		jQuery("#searchForm").validate({
+			meta:"validate"
+			,errorElement:"span"
+			,submitHandler: function(form) { searchPerson(); }
+			,rules : {
+				relationshipTypeId  : { required: true },
+				searchType			: { required: true },
+				searchValue			: { required: true }
+			}
+		});
+
+		jQuery("#addRepresentativeForm").validate({
+			 meta:"validate"
+			,errorElement:"td"
+			,submitHandler: function(form) { validateAddRepresentative(); }
+			,rules : {
+				relationshipTypeId  : { required: true },
+				fullName : {required:true,rangelength:[7,50], unicodechars:true},
+				gender : { required: true },
+				birthDate :{required:false,dateISO:true,datelessthanequaltoday:true}
+			},beforeValidateHandler: function(form)
 				{
-					var birthDate = $('#birthDate').val();
-					if( birthDate != '' ){
-						$("#memberValidator").val(birthDate);
+					var dobType = jQuery('#dobType').val();
+
+					if( dobType=='V' || dobType=='D' ) 
+					{
+						var birthDate = jQuery('#birthDate').val();
+						if( birthDate != '' ){
+							jQuery("#memberValidator").val(birthDate);
+						}
+					}else{
+						var age = jQuery('#age').val();
+						jQuery("#memberValidator").val(age);
 					}
-				}else{
-					var age = $('#age').val();
-					$("#memberValidator").val(age);
 				}
-			}
-	});
-	
-	// Esc key for jQuery thickbox
-	// jQuery thickbox already has this event
-	// but somehow it's over written by jQuery tabs plugin
-	document.onkeydown = function(e){ 	
-		if (e == null) { // ie
-			keycode = event.keyCode;
-		} else { // mozilla
-			keycode = e.which;
-		}
-		if(keycode == 27){ // close
-			window.parent.tb_remove();
-		}
-	}
-}); 
-
+
+		});
+
+		// Esc key for jQuery thickbox
+		// jQuery thickbox already has this event
+		// but somehow it's over written by jQuery tabs plugin
+		document.onkeydown = function(e){ 	
+			if (e == null) { // ie
+				keycode = event.keyCode;
+			} else { // mozilla
+				keycode = e.which;
+			}
+
+			if(keycode == 27){ // close
+				window.parent.tb_remove();
+			}
+		}
+	}); 
+
+	var i18n_patient_identifiers = '$encoder.jsEscape( $i18n.getString( "patient_identifiers" ) , "'")';
+	var i18n_patient_attributes = '$encoder.jsEscape( $i18n.getString( "patient_attributes" ) , "'")';
+	var i18n_patient_fullName = '$encoder.jsEscape( $i18n.getString( "full_name" ) , "'")';
+	var i18n_patient_demographics = '$encoder.jsEscape( $i18n.getString( "demographics" ) , "'")';
+	var i18n_patient_gender = '$encoder.jsEscape( $i18n.getString( "gender" ) , "'")';
+	var i18n_patient_date_of_birth = '$encoder.jsEscape( $i18n.getString( "date_of_birth" ) , "'")';
+	var i18n_patient_age = '$encoder.jsEscape( $i18n.getString( "age" ) , "'")';
+	var i18n_patient_blood_group = '$encoder.jsEscape( $i18n.getString( "blood_group" ) , "'")';
+	var i18n_choose_this_person = '$encoder.jsEscape( $i18n.getString( "choose_this_patient" ) , "'")';
+	var i18n_no_duplicate_found = '$encoder.jsEscape( $i18n.getString( "no_duplicate_found" ) , "'")';
+	var i18n_patient_system_id = '$encoder.jsEscape( $i18n.getString( "patient_system_id" ) , "'")';
+	var i18n_child_representative = '$encoder.jsEscape( $i18n.getString( "child_representative" ) , "'")';
+	var i18n_no_result = '$encoder.jsEscape( $i18n.getString( "no_result" ) , "'")';
+	var i18n_error_connect_to_server = '$encoder.jsEscape( $i18n.getString( "error_connect_to_server" ) , "'")';
+	var i18n_please_enter_value = '$encoder.jsEscape( $i18n.getString( "please_enter_value" ) , "'")';
+	var i18n_please_select_search_type = '$encoder.jsEscape( $i18n.getString( "please_select_search_type" ) , "'")';
+	var i18n_please_select_identifier_type = '$encoder.jsEscape( $i18n.getString( "please_select_identifier_type" ) , "'")';
+	var i18n_please_select_attribute_type = '$encoder.jsEscape( $i18n.getString( "please_select_attribute_type" ) , "'")';
+	var i18n_add_person_successfully = '$encoder.jsEscape( $i18n.getString( "add_person_successfully" ) , "'")';
+	var i18n_please_select_relationshipType = '$encoder.jsEscape( $i18n.getString( "please_select_relationshipType" ) , "'")';
+	var i18n_no_patients_found = '$encoder.jsEscape( $i18n.getString( "no_patients_found" ) , "'")';
+	var i18n_search_result = '$encoder.jsEscape( $i18n.getString( "search_result" ) , "'")';
 </script>
 
 <!-- TAB Header -->
@@ -260,29 +276,4 @@
 		</div>
 	</div>
 </div>
-<script>
-
-	var i18n_patient_identifiers = '$encoder.jsEscape( $i18n.getString( "patient_identifiers" ) , "'")';
-	var i18n_patient_attributes = '$encoder.jsEscape( $i18n.getString( "patient_attributes" ) , "'")';
-	var i18n_patient_fullName = '$encoder.jsEscape( $i18n.getString( "full_name" ) , "'")';
-	var i18n_patient_demographics = '$encoder.jsEscape( $i18n.getString( "demographics" ) , "'")';
-	var i18n_patient_gender = '$encoder.jsEscape( $i18n.getString( "gender" ) , "'")';
-	var i18n_patient_date_of_birth = '$encoder.jsEscape( $i18n.getString( "date_of_birth" ) , "'")';
-	var i18n_patient_age = '$encoder.jsEscape( $i18n.getString( "age" ) , "'")';
-	var i18n_patient_blood_group = '$encoder.jsEscape( $i18n.getString( "blood_group" ) , "'")';
-	var i18n_choose_this_person = '$encoder.jsEscape( $i18n.getString( "choose_this_patient" ) , "'")';
-	var i18n_no_duplicate_found = '$encoder.jsEscape( $i18n.getString( "no_duplicate_found" ) , "'")';
-	var i18n_patient_system_id = '$encoder.jsEscape( $i18n.getString( "patient_system_id" ) , "'")';
-	var i18n_child_representative = '$encoder.jsEscape( $i18n.getString( "child_representative" ) , "'")';
-	var i18n_no_result = '$encoder.jsEscape( $i18n.getString( "no_result" ) , "'")';
-	var i18n_error_connect_to_server = '$encoder.jsEscape( $i18n.getString( "error_connect_to_server" ) , "'")';
-	var i18n_please_enter_value = '$encoder.jsEscape( $i18n.getString( "please_enter_value" ) , "'")';
-	var i18n_please_select_search_type = '$encoder.jsEscape( $i18n.getString( "please_select_search_type" ) , "'")';
-	var i18n_please_select_identifier_type = '$encoder.jsEscape( $i18n.getString( "please_select_identifier_type" ) , "'")';
-	var i18n_please_select_attribute_type = '$encoder.jsEscape( $i18n.getString( "please_select_attribute_type" ) , "'")';
-	var i18n_add_person_successfully = '$encoder.jsEscape( $i18n.getString( "add_person_successfully" ) , "'")';
-	var i18n_please_select_relationshipType = '$encoder.jsEscape( $i18n.getString( "please_select_relationshipType" ) , "'")';
-	var i18n_no_patients_found = '$encoder.jsEscape( $i18n.getString( "no_patients_found" ) , "'")';
-	var i18n_search_result = '$encoder.jsEscape( $i18n.getString( "search_result" ) , "'")';
-</script>
 	

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm	2011-05-19 08:15:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm	2011-05-19 08:17:24 +0000
@@ -27,11 +27,10 @@
 	});		
 </script>
 
-<input type="button" value="$i18n.getString( 'back' )" onclick="javascript:onClickBackBtn();" style="width:10em">
 
 <h3>$i18n.getString( "update_patient_attribute" )</h3>
 
-<form id="updatePatientAttributeForm" name="updatePatientAttributeForm"  action='#' method="post" onsubmit='return updatePatientAttribute();'>
+<form id="updatePatientAttributeForm" name="updatePatientAttributeForm" action="updatePatientAttribute.action" method="post" >
 
 <div style="display:inline">
   <input type="hidden" id="id" name="id" value="$patientAttribute.id">
@@ -118,7 +117,8 @@
   </table>  
 
 <p>
-    <input type="submit" value="$i18n.getString( "update" )" style="width:10em" >
+    <input type="submit" value="$i18n.getString( "update" )" style="width:10em">
+    <input type="button" value="$i18n.getString( "cancel" )" onclick="window.location.href='patientAttribute.action'" style="width:10em">
 </p>
 
 </form>