← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4181: Fixed bug: Error when selecting a string-dataelement into case-entry form, and minor fix for vali...

 

------------------------------------------------------------
revno: 4181
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-07-21 15:12:15 +0700
message:
  Fixed bug: Error when selecting a string-dataelement into case-entry form, and minor fix for validating duplicated entry name ( Patient module ).
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewDataEntryForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewDataEntryForm.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/webapp/dhis-web-maintenance-patient/javascript/viewDataEntryForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewDataEntryForm.js	2011-07-14 09:31:24 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewDataEntryForm.js	2011-07-21 08:12:15 +0000
@@ -156,28 +156,6 @@
 	});	
 }
 
-function validateDataEntryForm( )
-{
-	$.postJSON(
-    	    'validateDataEntryForm.action',
-    	    {
-    	        dataEntryFormId: getFieldValue('dataEntryFormId'),
-				name: getFieldValue('name')
-    	    },
-    	    function( json )
-    	    {
-    	    	if ( json.response == "success" )
-    	    	{
-					byId( 'saveDataEntryForm' ).submit(); 
-    	    	}
-    	    	else if ( json.response == "error" )
-    	    	{
-    	    		setHeaderMessage( json.message );
-    	    	}
-    	    }
-    	);
-}
-
 function insertDataElement( source, associationId )
 {
 	var oEditor = jQuery("#designTextarea").ckeditorGet();
@@ -209,7 +187,7 @@
 			var titleValue = dataElementId + "." + dataElementName 
 					+ "-" + categoryOptionCombos[0].id + "." + categoryOptionCombos[0].id 
 					+ " "+dataElementType+"\"";
-			var displayName = dataElementName + "-" + optionComboName + " ]";
+			var displayName = dataElementName + "-" + categoryOptionCombos[0].name + " ]";
 			id  = associationId + "-" + dataElementId + "-" + categoryOptionCombos[0].id +"-val";
 			htmlCode += "<input name=\"entryfield\" id=\""+ id + "\" value=\"" + displayName + "\" title=\"" + displayName + "\" onkeypress=\"return keyPress(event, this)\" >";			
 		}else{	

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewDataEntryForm.vm	2011-06-23 08:27:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewDataEntryForm.vm	2011-07-21 08:12:15 +0000
@@ -1,10 +1,13 @@
 <script type="text/javascript">   
 	jQuery(document).ready(	function()
 	{		
-		validation( 'saveDataEntryForm', function( form ){ validateDataEntryForm();});
+		validation( 'saveDataEntryForm', function( form ){ form.submit();});
 
 		jQuery('#designTextarea').ckeditor();
 		jQuery("#designTextarea").ckeditorGet().setData('$encoder.jsEscape( $dataEntryValue, "'" )');
+		
+		checkValueIsExist( "name", "validateDataEntryForm.action", {dataEntryFormId:'$!programStage.dataEntryForm.id'});
+
 	});
 
     var i18n_dataelement_is_inserted = '$encoder.jsEscape( $i18n.getString( "dataelement_is_inserted" ) , "'" )';
@@ -58,7 +61,7 @@
 
 </style>
 
-<form id="saveDataEntryForm" name="saveDataEntryForm" action="saveDataEntryForm.action" method="post" onsubmit=' validateDataEntryForm(); return false;'>
+<form id="saveDataEntryForm" name="saveDataEntryForm" action="saveDataEntryForm.action" method="post">
 <input type="hidden" name="programStageId" id="programStageId" value="$!programStage.id"/>
 <input type="hidden" name="dataEntryFormId" id="dataEntryFormId" value="$!programStage.dataEntryForm.id"/>
 <h3>$i18n.getString( "dataentryform_management_for_program_stage" ): $programStage.name </h3>
@@ -180,12 +183,6 @@
 		</tr>
 		<tr>
 			<td>
-				<!-- <b>$i18n.getString( "view_as" )</b><br>
-				<select name="viewBySelector" id="viewBySelector" style="width:150px">		
-					<option value="deid">$i18n.getString( "id" )</option>
-					<option value="dename">$i18n.getString( "name" )</option>
-					<option value="deshortname" selected>$i18n.getString( "short_name" )</option> 	
-				</select> -->
 				<input type="button" value="Insert" id="insert" name="insert" onclick="insertDataElement( '#otherProgramStageDataElements', byId('programStageIds').value )"/>
 			</td>
 			<td>