← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2014: Made changes in LileListing Module for LineListing Locking

 

------------------------------------------------------------
revno: 2014
committer: neeraj
branch nick: trunk
timestamp: Tue 2010-08-31 13:21:06 +0530
message:
  Made changes in LileListing Module for LineListing Locking
modified:
  local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/FormAction.java
  local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/SelectAction.java
  local/in/dhis-web-dataentry-linelisting/src/main/resources/META-INF/dhis/beans.xml
  local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llbirthForm.vm
  local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/lldeathForm.vm
  local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llmdeathForm.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 'local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/FormAction.java'
--- local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/FormAction.java	2010-06-15 11:26:37 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/FormAction.java	2010-08-31 07:51:06 +0000
@@ -43,6 +43,7 @@
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.dataentryform.DataEntryForm;
 import org.hisp.dhis.dataentryform.DataEntryFormService;
+import org.hisp.dhis.datalock.DataSetLockService;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.datavalue.DataValue;
 import org.hisp.dhis.den.api.LLDataSets;
@@ -127,6 +128,13 @@
     {
         this.selectedStateManager = selectedStateManager;
     }
+    
+    private DataSetLockService dataSetLockService;
+    
+    public void setDataSetLockService( DataSetLockService dataSetLockService)
+    {
+        this.dataSetLockService = dataSetLockService;
+    }
 
     private I18n i18n;
 
@@ -329,8 +337,14 @@
     {
         return maxRecordNo;
     }
-    
-    
+	
+	private boolean locked = false;
+
+    public boolean isLocked()
+    {
+        return locked;
+    }
+	    
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -484,6 +498,18 @@
             
         }
         
+        if( dataSetLockService == null )
+        {
+            System.out.println(" DataSetLockService is null");
+        }
+        if( dataSetLockService.getDataSetLockByDataSetAndPeriod( dataSet, period ) != null)
+        {                               
+            if( dataSetLockService.getDataSetLockByDataSetAndPeriod( dataSet, period ).getSources().contains(organisationUnit) ) 
+            {
+                locked = true;
+            }
+        }
+        
         maxRecordNo = dataValueService.getMaxRecordNo();
         
         return SUCCESS;

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/SelectAction.java'
--- local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/SelectAction.java	2010-07-13 09:28:43 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/SelectAction.java	2010-08-31 07:51:06 +0000
@@ -293,7 +293,7 @@
             
             if(temp.getName().equalsIgnoreCase( LLDataSets.LL_IDSP_LAB ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_DEATHS_IDSP ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_UU_IDSP_EVENTSP ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_BIRTHS ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_DEATHS )  || temp.getName().equalsIgnoreCase( LLDataSets.LL_MATERNAL_DEATHS ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_UU_IDSP_EVENTS ))
             {
-                if ( !( temp.getPeriodType() instanceof CalendarPeriodType ) || temp.getLocked() )
+                if ( !( temp.getPeriodType() instanceof CalendarPeriodType ) )
                 {
                     it.remove();
                 }

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-dataentry-linelisting/src/main/resources/META-INF/dhis/beans.xml	2010-06-17 07:51:57 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/resources/META-INF/dhis/beans.xml	2010-08-31 07:51:06 +0000
@@ -107,7 +107,9 @@
     <property name="selectedStateManager"
       ref="org.hisp.dhis.den.state.SelectedStateManager"/>    
 	<property name="dataElementCategoryService"
-      ref="org.hisp.dhis.dataelement.DataElementCategoryService"/>  
+      ref="org.hisp.dhis.dataelement.DataElementCategoryService"/>
+	<property name="dataSetLockService"
+      ref="org.hisp.dhis.datalock.DataSetLockService"/>  
   </bean>
 	
   <bean id="org.hisp.dhis.den.action.multidimensional.FormAction"

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llbirthForm.vm'
--- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llbirthForm.vm	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llbirthForm.vm	2010-08-31 07:51:06 +0000
@@ -95,7 +95,7 @@
 	#foreach( $llDataValue in $llDataValues)
 		#if($count1 == 3)
 			<td>
-				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateLLBSexField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
+				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateLLBSexField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center" #if( $locked ) disabled="disabled"#end>
 					<option value="NONE" #if(!$llDataValue.getValue() || $llDataValue.getValue()=="NONE") selected #end>---</option>
 					<option value="M" #if($llDataValue.getValue() && $llDataValue.getValue()=="M") selected #end>Male</option>
 					<option value="F" #if($llDataValue.getValue() && $llDataValue.getValue()=="F") selected #end>Female</option>
@@ -103,29 +103,29 @@
 			</td>			
 		#elseif($count1 == 6)
 			<td>
-				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateLLBBreastFedField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
+				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateLLBBreastFedField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center" #if( $locked ) disabled="disabled"#end>
 					<option value="NONE" #if(!$llDataValue.getValue() || $llDataValue.getValue()=="NONE") selected #end>---</option>
 					<option value="Y" #if($llDataValue.getValue() && $llDataValue.getValue()=="Y") selected #end>YES</option>
 					<option value="N" #if($llDataValue.getValue() && $llDataValue.getValue()=="N") selected #end>NO</option>
 					<option value="NK" #if($llDataValue.getValue() && $llDataValue.getValue()=="NK") selected #end>NOT KNOWN</option>
 				</select>
 			</td>
-            <td>
-            	<a href="#" onclick="javascript:removeLLRecord( '$llDataValue.getRecordNo()' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
+            <td #if( $locked ) style="display:none" #end>
+            	<a href="#" onclick="javascript:removeLLRecord( '$llDataValue.getRecordNo()' )" title="$i18n.getString( "remove" )" #if( $locked ) disabled="disabled"#end><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
             </td>			
 		#elseif($count1 == 4)
 			<td>
-				<input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateLLBDOBField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:10em text-align:center">
-				<img src="../images/calendar_icon.gif" width="16" height="16" id="getvalue[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" cursor: pointer;" title="$i18n.getString( "date_selector" )" onmouseover="this.style.background='orange';" onmouseout="this.style.background=''">
+				<input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateLLBDOBField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:10em text-align:center" #if( $locked ) disabled="disabled"#end>
+				#if( !$locked ) <img src="../images/calendar_icon.gif" width="16" height="16" id="getvalue[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" cursor: pointer;" title="$i18n.getString( "date_selector" )" onmouseover="this.style.background='orange';" onmouseout="this.style.background=''" > #end
 			</td>
 			#set($calInfo = $calInfo + "Calendar.setup({inputField:'value["+$llDataValue.getDataElement().getId()+"].value:value["+$llDataValue.getRecordNo()+"].value',ifFormat:'$i18n.getString('format.date.label')',button:'getvalue["+$llDataValue.getDataElement().getId()+"].value:value["+$llDataValue.getRecordNo()+"].value'});")
 		#elseif($count1 == 1)
 			<td align="center"><div id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].slno" align='center'>$slno</div></td>
-			<td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateLLBNameField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
+			<td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateLLBNameField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"  #if( $locked ) disabled="disabled"#end></td>
         #elseif($count1 == 5)
-            <td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateLLBWeightField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>											
+            <td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateLLBWeightField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"  #if( $locked ) disabled="disabled"#end></td>											
 		#else
-			<td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateLLBVillageField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>		
+			<td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateLLBVillageField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"  #if( $locked ) disabled="disabled"#end></td>		
 		#end
 		#set( $count1 = $count1 + 1 )
 		#set( $lastRecord = $llDataValue.getRecordNo() )				
@@ -133,6 +133,7 @@
 	#set( $slno = $slno + 1 )
 	</tr>	
 #end
+#if( !$locked )
 <tr>
 	<td align="center"><div id='value[1020].value:value[$recordNo].slno' align='center'>$slno</div></td>	
 	<td><input name="entryfield" id="value[1020].value:value[$recordNo].value" type="text" value="" onchange="validateLLBNameField(1020,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
@@ -168,6 +169,7 @@
         <input type="hidden" value="$!selEndDate" id="selEndDate" name="selEndDate" >
     </td>
  </tr>
+#end
 </table>
 
 

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/lldeathForm.vm'
--- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/lldeathForm.vm	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/lldeathForm.vm	2010-08-31 07:51:06 +0000
@@ -86,7 +86,7 @@
 	#foreach( $llDataValue in $llDataValues)
 		#if($count1 == 3)
 			<td>
-				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateLLDSexField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
+				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateLLDSexField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center" #if( $locked ) disabled="disabled"#end>
 					<option value="NONE" #if(!$llDataValue.getValue() || $llDataValue.getValue()=="NONE") selected #end>---</option>
 					<option value="M" #if($llDataValue.getValue() && $llDataValue.getValue()=="M") selected #end>Male</option>
 					<option value="F" #if($llDataValue.getValue() && $llDataValue.getValue()=="F") selected #end>Female</option>
@@ -94,7 +94,7 @@
 			</td>			
 		#elseif($count1 == 4)
 			<td>
-				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateLLDAgeCategoryField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
+				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateLLDAgeCategoryField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center" #if( $locked ) disabled="disabled"#end>
 					<option value="NONE" #if(!$llDataValue.getValue() || $llDataValue.getValue()=="NONE") selected #end>---</option>
 					<option value="B1DAY" #if($llDataValue.getValue() && $llDataValue.getValue()=="B1DAY") selected #end>BELOW 1 DAY</option>
 					<option value="B1WEEK" #if($llDataValue.getValue() && $llDataValue.getValue()=="B1WEEK") selected #end>1 DAY - 1 WEEK</option>
@@ -108,7 +108,7 @@
 			</td>
 		#elseif($count1 == 5)
 			<td>
-				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateLLDPCDField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
+				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateLLDPCDField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center" #if( $locked ) disabled="disabled"#end>
 					<option value="NONE" #if(!$llDataValue.getValue() || $llDataValue.getValue()=="NONE") selected #end>---</option>
 					<option value="ASPHYXIA" #if($llDataValue.getValue() && $llDataValue.getValue()=="ASPHYXIA") selected #end>ASPHYXIA</option>					
 					<option value="SEPSIS" #if($llDataValue.getValue() && $llDataValue.getValue()=="SEPSIS") selected #end>SEPSIS</option>
@@ -135,15 +135,15 @@
 					<option value="NK" #if($llDataValue.getValue() && $llDataValue.getValue()=="NK") selected #end>NOT KNOWN</option>
 				</select>
 			</td>
-            <td>
+            <td #if( $locked ) style="display:none" #end>
                 <a href="javascript:removeLLRecord( '$llDataValue.getRecordNo()' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
             </td>           
 			
 		#elseif($count1 == 1)
 			<td align="center"><div id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].slno" align='center'>$slno</div></td>
-			<td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateLLDNameField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
+			<td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateLLDNameField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"  #if( $locked ) disabled="disabled"#end></td>
 		#else
-			<td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateLLDVillageField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
+			<td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateLLDVillageField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"  #if( $locked ) disabled="disabled"#end></td>
 		#end
 		#set($count1 = $count1+1)
 		#set( $lastRecord = $llDataValue.getRecordNo() )		
@@ -151,7 +151,7 @@
 	#set( $slno = $slno + 1 )			
 	</tr>	
 #end
-<tr>
+<tr #if( $locked ) style="display:none" #end>
 	<td align="center"><div id='value[1027].value:value[$recordNo].slno' align='center'>$slno</div></td>
 	<td><input name="entryfield" id="value[1027].value:value[$recordNo].value" type="text" value="" onchange="validateLLDNameField(1027,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
 	<td><input name="entryfield" id="value[1028].value:value[$recordNo].value" type="text" value="" onchange="validateLLDVillageField(1028,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llmdeathForm.vm'
--- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llmdeathForm.vm	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llmdeathForm.vm	2010-08-31 07:51:06 +0000
@@ -98,19 +98,19 @@
 	#foreach( $llDataValue in $llDataValues)
 		#if($count1 == 8)
 			<td>
-				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateLLMDAuditedField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
+				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateLLMDAuditedField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center" #if( $locked ) disabled="disabled"#end>
 					<option value="NONE" #if(!$llDataValue.getValue() || $llDataValue.getValue()=="NONE") selected #end>---</option>
 					<option value="Y" #if($llDataValue.getValue() && $llDataValue.getValue()=="Y") selected #end>YES</option>
 					<option value="N" #if($llDataValue.getValue() && $llDataValue.getValue()=="N") selected #end>NO</option>
 					<option value="NK" #if($llDataValue.getValue() && $llDataValue.getValue()=="NK") selected #end>NOT KNOWN</option>
 				</select>
 			</td>
-			<td>
+			<td #if( $locked ) style="display:none" #end>
                 <a href="javascript:removeLLRecord( '$llDataValue.getRecordNo()' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
             </td>
 		#elseif($count1 == 4)
 			<td>
-				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateLLMDDuringField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
+				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateLLMDDuringField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center" #if( $locked ) disabled="disabled"#end>
 					<option value="NONE" #if(!$llDataValue.getValue() || $llDataValue.getValue()=="NONE") selected #end>---</option>					
 					<option value="FTP" #if($llDataValue.getValue() && $llDataValue.getValue()=="FTP") selected #end>FIRST TRIMESTER PREGNANCY</option>
 					<option value="STP" #if($llDataValue.getValue() && $llDataValue.getValue()=="STP") selected #end>SECOND TRIMESTER PREGNANCY</option>
@@ -121,7 +121,7 @@
 			</td>
 		#elseif($count1 == 5)
 			<td>
-				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateLLMDDeliveryAtField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
+				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateLLMDDeliveryAtField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center" #if( $locked ) disabled="disabled"#end>
 					<option value="NONE" #if(!$llDataValue.getValue() || $llDataValue.getValue()=="NONE") selected #end>---</option>
 					<option value="HOME" #if($llDataValue.getValue() && $llDataValue.getValue()=="HOME") selected #end>HOME</option>
 					<option value="SC" #if($llDataValue.getValue() && $llDataValue.getValue()=="SC") selected #end>SUBCENTER</option>
@@ -132,7 +132,7 @@
 			</td>
 		#elseif($count1 == 6)
 			<td>
-				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateLLMDDeliveryByField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
+				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateLLMDDeliveryByField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center" #if( $locked ) disabled="disabled"#end>
 					<option value="NONE" #if(!$llDataValue.getValue() || $llDataValue.getValue()=="NONE") selected #end>---</option>
 					<option value="UNTRAINED" #if($llDataValue.getValue() && $llDataValue.getValue()=="UNTRAINED") selected #end>UNTRAINED</option>
 					<option value="TRAINED" #if($llDataValue.getValue() && $llDataValue.getValue()=="TRAINED") selected #end>TRAINED</option>
@@ -144,7 +144,7 @@
 			</td>
 		#elseif($count1 == 7)
 			<td>
-				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateLLMDCauseField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
+				<select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateLLMDCauseField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center" #if( $locked ) disabled="disabled"#end>
 					<option value="NONE" #if(!$llDataValue.getValue() || $llDataValue.getValue()=="NONE") selected #end>---</option>
 					<option value="ABORTION" #if($llDataValue.getValue() && $llDataValue.getValue()=="ABORTION") selected #end>ABORTION</option>
 					<option value="OPL" #if($llDataValue.getValue() && $llDataValue.getValue()=="OPL") selected #end>OBSTRUCTED/PROLONGED LABOUR</option>
@@ -160,11 +160,11 @@
 			</td>
 		#elseif($count1 == 1)
 			<td align="center"><div id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].slno" align='center'>$slno</div></td>
-			<td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateLLMDNameField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
+			<td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateLLMDNameField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center" #if( $locked ) disabled="disabled"#end></td>
         #elseif($count1 == 3)
-            <td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateLLMDAgeAtDeathField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center" maxlength='2'></td>     						
+            <td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateLLMDAgeAtDeathField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center" maxlength='2' #if( $locked ) disabled="disabled"#end></td>     						
 		#else
-			<td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateLLMDVillageField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>		
+			<td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateLLMDVillageField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:100% text-align:center" #if( $locked ) disabled="disabled"#end></td>		
 		#end				
 		#set($count1 = $count1+1)
 		#set( $lastRecord = $llDataValue.getRecordNo() )		
@@ -172,7 +172,7 @@
 	#set( $slno = $slno + 1 )
 	</tr>	
 #end
-<tr>
+<tr #if( $locked ) style="display:none" #end>
 	<td align="center"><div id='value[1032].value:value[$recordNo].slno' align='center'>$slno</div></td>
 	<td><input name="entryfield" id="value[1032].value:value[$recordNo].value" type="text" value="" onchange="validateLLMDNameField(1032,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
 	<td><input name="entryfield" id="value[1033].value:value[$recordNo].value" type="text" value="" onchange="validateLLMDVillageField(1033,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>