← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5633: Don't save datavalues into default multi-data entry form.

 

------------------------------------------------------------
revno: 5633
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-12-29 11:50:47 +0700
message:
  Don't save datavalues into default multi-data entry form.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ProgramStageCustomDataEntryAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageDataEntryForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.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-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ProgramStageCustomDataEntryAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ProgramStageCustomDataEntryAction.java	2011-09-29 05:59:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ProgramStageCustomDataEntryAction.java	2011-12-29 04:50:47 +0000
@@ -29,6 +29,7 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -50,6 +51,7 @@
 import org.hisp.dhis.program.ProgramStageDataElementService;
 import org.hisp.dhis.program.ProgramStageInstance;
 import org.hisp.dhis.program.ProgramStageInstanceService;
+import org.hisp.dhis.program.comparator.ProgramStageDataElementSortOrderComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -250,6 +252,8 @@
         programStage = programStageInstance.getProgramStage();
 
         programStageDataElements = programStage.getProgramStageDataElements();
+        
+        Collections.sort( programStageDataElements, new ProgramStageDataElementSortOrderComparator() );
 
         program = programStage.getProgram();
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2011-12-28 06:21:57 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2011-12-29 04:50:47 +0000
@@ -134,7 +134,7 @@
 			<param name="page">/dhis-web-caseentry/multiDataEntrySelect.vm</param>
 			<param name="menu">/dhis-web-caseentry/dataEntryMenu.vm</param>
 			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,javascript/commons.js,
-				javascript/form.js, javascript/multiDataEntry.js</param>
+				javascript/form.js,javascript/multiDataEntry.js</param>
 		</action>
 
 		<action name="getPrograms"

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageDataEntryForm.vm	2011-12-22 04:59:33 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageDataEntryForm.vm	2011-12-29 04:50:47 +0000
@@ -85,125 +85,4 @@
 
 <hr style="clear:both">
 
-<div id="entryFormContainer" #if( $programStageInstance.executionDate ) #else style='display:none;' #end>
-
-#if( $customDataEntryFormCode ) 
-	<div id="customEntryScreenContainer">
-		$customDataEntryFormCode
-	</div>
-#else 
-	<div id='defaultEntryScreenContainer'>
-		<table class="mainPageTable">
-			<col id="noCol">
-			<col id="deCol">    
-			<col id="entryCol">
-			<col id="facilityCol">       
-
-			<tr>
-				<th>$i18n.getString( "nr" )</th>
-				<th>$i18n.getString( "data_element" )</th>                   
-				<th>$i18n.getString( "entry" )</th>
-				<th>$i18n.getString( "provided_elsewhere" )</th>             
-			</tr>
-
-		#set( $dataElementRowCount = 0 )
-		#set( $mark = 0 )
-		#set( $tabIndex = 1 )
-		#foreach( $programStageDataElement in $programStageDataElements )
-			#set( $dataElementRowCount = $dataElementRowCount + 1 )    
-			#if( $mark == 1 )
-				#set( $mark = 0 )
-			#else
-				#set( $mark = 1 )
-			#end    
-			#set( $patientDataValue = false )
-			#set( $patientDataValue = $patientDataValueMap.get( $programStageDataElement.dataElement.id ) )    
-			<tr #if( $mark == 0 ) style="background-color:#dddddd" #end>
-				##dataElementRowCount
-				<td style="text-align:right">$dataElementRowCount</td>        
-				##data element name
-				<td>
-					<span id="value[$programStageDataElement.dataElement.id].name" title="$!encoder.htmlEncode( $programStageDataElement.dataElement.description )">
-						$encoder.htmlEncode( $programStageDataElement.dataElement.name ) 
-						#if ( $programStageDataElement.compulsory )
-							<em title="$i18n.getString( "required" )" class="required">*</em>
-						#end        
-					</span>
-				</td>        
-				##type        
-				<td style="display:none"><span id="value[$programStageDataElement.dataElement.id].type" style="display:none">$encoder.htmlEncode( $programStageDataElement.dataElement.getDetailedNumberType() )</span></td>       
-				##entry        
-				<td>        
-					#if( $programStageDataElement.dataElement.type == "bool" )
-						<select name="entryselect" #if($programStageInstance.completed) disabled="disabled" #end data="{compulsory: $programStageDataElement.compulsory }" id="value[$programStageDataElement.dataElement.id].boolean" onchange="saveChoice( $programStageDataElement.dataElement.id, this )"  tabindex="$tabIndex">              
-							<option value="">[$i18n.getString( "select_value" )]</option>
-							<option value="true" #if( $patientDataValue.value == "true" ) selected="selected" #end>$i18n.getString( "yes" )</option>
-							<option value="false" #if( $patientDataValue.value == "false" ) selected="selected" #end>$i18n.getString( "no" )</option>
-						</select>                              
-					#elseif( $programStageDataElement.dataElement.type == "string" && $programStageDataElement.dataElement.isMultiDimensional() )
-						#set( $optionValues = $optionMap.get( $programStageDataElement.dataElement.id ) )
-						<select name="entryselect" data="{compulsory: $programStageDataElement.compulsory }" #if($programStageInstance.completed) disabled="disabled" #end id="value[$programStageDataElement.dataElement.id].value" onchange="saveChoice( $programStageDataElement.dataElement.id, this )" tabindex="$tabIndex">              
-							<option value="">[$i18n.getString( "no_value" )]</option>
-							#foreach( $optionValue in $optionValues )
-								<option value="$optionValue.id" #if( $patientDataValue.value == $optionValue.id ) selected="selected" #end>$encoder.htmlEncode( $optionValue.name )</option>
-							#end
-						</select>
-					#elseif( $programStageDataElement.dataElement.type == "date" )
-						<input type="text" data="{compulsory: $programStageDataElement.compulsory }" #if($programStageInstance.completed) disabled="disabled" #end id="value[$programStageDataElement.dataElement.id].date" name="entryfield" value="$!encoder.htmlEncode( $patientDataValue.value )" onchange="saveDateValue( $programStageDataElement.dataElement.id, '$encoder.jsEncode( $programStageDataElement.dataElement.name )' )" tabindex="$tabIndex" >
-							<script type="text/javascript">
-								datePicker('value[$programStageDataElement.dataElement.id].date');
-							</script>                    
-					#else
-						<input name="entryfield" data="{compulsory: $programStageDataElement.compulsory }" #if($programStageInstance.completed) disabled="disabled" #end id="value[$programStageDataElement.dataElement.id].value" type="text" value="$!encoder.htmlEncode( $patientDataValue.value )" onchange="saveValue( $programStageDataElement.dataElement.id, '$encoder.jsEncode( $programStageDataElement.dataElement.name )' )" onkeypress="return keyPress(event, this)" tabindex="$tabIndex" >
-					#end
-				</td>   
-				##providedByAnotherFacility                
-				<td>     
-					#if ( $patientDataValue.value )        
-						#if( !$patientDataValue.providedByAnotherFacility )
-							$patientDataValue.organisationUnit.name
-							<input  name="providedByAnotherFacility" id="value[$programStageDataElement.dataElement.id].providedByAnotherFacility" type="hidden" onclick="updateProvidingFacility( $programStageDataElement.dataElement.id, this )">
-						#else
-							$i18n.getString("other_facility")
-							<input  name="providedByAnotherFacility" id="value[$programStageDataElement.dataElement.id].providedByAnotherFacility" type="hidden" onclick="updateProvidingFacility( $programStageDataElement.dataElement.id, this )">
-						#end
-					 #else
-						<input name="providedByAnotherFacility" id="value[$programStageDataElement.dataElement.id].providedByAnotherFacility" type="checkbox" onclick="updateProvidingFacility( $programStageDataElement.dataElement.id, this )">
-					 #end                         
-				</td>    
-			</tr>
-			#set( $tabIndex = $tabIndex + 1 )
-		#end
-		</table>
-	</div>
-#end
-</div>
-
-	<div id="completeDataEntryFormContainer">
-		<form id="completeDataEntryForm" name="completeDataEntry" method="post" action="completeProgramStageDataEntry.action"> 
-			<input type="hidden" name="id" value="$patient.id"/>
-			<input type="hidden" name="programId" value="$program.id"/>
-			<input type="hidden" name="programStageId" value="$programStage.id"/>
-			<input type="hidden" name="programStageInstanceId" value="$programStageInstance.id"/>
-		</form>
-	</div>
-</div>
-
-<script type="text/javascript">
-    initCustomCheckboxes();
-	
-	var i18n_value_must_integer = '$encoder.jsEscape( $i18n.getString( "value_must_integer" ) , "'")';
-	var i18n_value_must_number = '$encoder.jsEscape( $i18n.getString( "value_must_number" ) , "'")';
-	var i18n_value_must_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_positive_integer" ) , "'")';
-	var i18n_value_must_negative_integer = '$encoder.jsEscape( $i18n.getString( "value_must_negative_integer" ) , "'")';
-    var i18n_invalid_date =   '$encoder.jsEscape( $i18n.getString( "invalid_date" ) , "'")' + ".\n " 
-							+ '$encoder.jsEscape( $i18n.getString( "format_date" ) , "'")' + " '" 
-							+ dateFormat.replace('yy', 'yyyy') + " '" ; 
-    var i18n_saving_value_failed_status_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_status_code" ) , "'")';
-    var i18n_saving_value_failed_error_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_error_code" ) , "'")';
-    var i18n_searching_patient_failed = '$encoder.jsEscape( $i18n.getString( "searching_patient_failed" ) , "'")';
-    var i18n_complete_confirm_message = '$encoder.jsEscape( $i18n.getString( "complete_confirm_message" ) , "'")';
-    var i18n_error_required_field = '$encoder.jsEscape( $i18n.getString( "error_required_field" ) , "'")';
-	var i18n_violate_validation = '$encoder.jsEscape( $i18n.getString( "violate_validation" ) , "'")';
-	var i18n_date_is_greater_then_or_equals_due_date = '$encoder.jsEscape( $i18n.getString( "date_is_greater_then_or_equals_due_date" ) , "'")';</script>
-</script>
\ No newline at end of file
+#parse( "dhis-web-caseentry/dataEntryForm.vm" )
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm	2011-12-27 06:23:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm	2011-12-29 04:50:47 +0000
@@ -69,7 +69,7 @@
 	</tr>
 	<tr>
 		<td><label for="fullName">$i18n.getString( "full_name" )</label></td>
-		<td class="input-column" ><input type="text" id="fullName" name="fullName" value="$encoder.htmlEncode( $patient.getFullName() )" style="width:30em" class="required_group {validate:{required_group:true, unicodechars:true, rangelength:[7,50]}}"></td>
+		<td class="input-column" ><input type="text" id="fullName" name="fullName" value="$encoder.htmlEncode( $patient.getFullName() )" style="width:30em" class="{validate:{required:true, unicodechars:true, rangelength:[7,50]}}"></td>
 	</tr>
 	<tr>
 		<td><label for="gender">$i18n.getString( "gender" )<em title="$i18n.getString( "required" )" class="required">*</em></label></td>