← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5113: Merge Line Listing Data Entry from 2.3 to trunk

 

------------------------------------------------------------
revno: 5113
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-11-04 13:33:14 +0530
message:
  Merge Line Listing Data Entry from 2.3 to trunk
modified:
  local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/api/LLDataSets.java
  local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/general.js
  local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llcoldchain.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/api/LLDataSets.java'
--- local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/api/LLDataSets.java	2011-10-14 13:44:18 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/api/LLDataSets.java	2011-11-04 08:03:14 +0000
@@ -41,13 +41,13 @@
     //----------------------------------------------------------------
     // LineListing Cold Chain
     //----------------------------------------------------------------
-    public static final int LLCC_EQUIPMENT = 5726;
-    public static final int LLCC_MACHINE = 5727;
-    public static final int LLCC_MACHINE_WORKING = 5728;
-    public static final int LLCC_BREAKDOWN_DATE = 5729;
-    public static final int LLCC_INTIMATION_DATE = 5730;
-    public static final int LLCC_REPAIR_DATE = 5731;
-    public static final int LLCC_REMARKS = 5732;
+    public static final int LLCC_EQUIPMENT = 5786;
+    public static final int LLCC_MACHINE = 5787;
+    public static final int LLCC_MACHINE_WORKING = 5788;
+    public static final int LLCC_BREAKDOWN_DATE = 5789;
+    public static final int LLCC_INTIMATION_DATE = 5790;
+    public static final int LLCC_REPAIR_DATE = 5791;
+    public static final int LLCC_REMARKS = 5792;
     
     //----------------------------------------------------------------
     // LineListing IDSP LAB

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/general.js'
--- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/general.js	2011-10-24 11:27:50 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/general.js	2011-11-04 08:03:14 +0000
@@ -79,7 +79,7 @@
 {
     if(lastRecordNo == -1) return true;
 
-    var dataElementId = 5732;
+    var dataElementId = 5792;
     var field = document.getElementById( 'value[' + dataElementId + '].value:value[' + lastRecordNo + '].value' );
     var resVal = field.selectedIndex;
 
@@ -125,9 +125,9 @@
 
 function isColdChainEquipmentFieldEntered( recordNo )
 {
-    var dataElementId = 5726;
+	var dataElementId = 5786;
     var field = document.getElementById( 'value[' + dataElementId + '].value:value[' + recordNo + '].value' );
-    alert( 'value[' + dataElementId + '].value:value[' + recordNo + '].value' );
+    //alert( 'value[' + dataElementId + '].value:value[' + recordNo + '].value' );
     var resVal = field.selectedIndex;
     
     if(resVal <= 0 || resVal == "---")
@@ -173,7 +173,7 @@
 
 function isColdChainMachineNumberFieldEntered( recordNo )
 {
-    var dataElementId = 5727;
+	var dataElementId = 5787;
     var field = document.getElementById( 'value[' + dataElementId + '].value:value[' + recordNo + '].value' );
     var resVal = field.value;
 
@@ -209,7 +209,17 @@
         }
         else
         {
-            saveLLbirthValue( dataElementId, recordNo );
+        	//alert( field.options[ resVal ].value );
+        	
+        	if( field.options[ resVal ].value == "N" )
+        	{
+        		document.getElementById( 'value[5789].value:value[' + recordNo + '].value' ).disabled = false;
+        	}
+        	else
+        	{
+        		document.getElementById( 'value[5789].value:value[' + recordNo + '].value' ).disabled = true;
+        	}
+        	saveLLbirthValue( dataElementId, recordNo );
         }
     }
     else
@@ -302,7 +312,7 @@
 
 function isColdChainDateOfBreakdownFieldEntered( recordNo )
 {
-    var dataElementId = 5729;
+	 var dataElementId = 5789;
     var field = document.getElementById( 'value[' + dataElementId + '].value:value[' + recordNo + '].value' );
     var resVal = field.value;
 
@@ -348,7 +358,13 @@
     var startDate = startDateObj.value;
     var endDate = endDateObj.value;
 
-    if( isColdChainDateOfBreakdownFieldEntered( recordNo ) )
+    var flag = 1;
+    if( document.getElementById( 'value[' + dataElementId + '].value:value[' + recordNo + '].value' ).value == "N" )
+    {
+    	flag = 2;
+    }
+    
+    if( flag == 1 || isColdChainDateOfBreakdownFieldEntered( recordNo ) )
     {
         if(isDate(resVal) )
         {
@@ -384,7 +400,7 @@
 
 function isColdChainDateOfIntimationFieldEntered( recordNo )
 {
-    var dataElementId = 5730;
+	var dataElementId = 5790;
     var field = document.getElementById( 'value[' + dataElementId + '].value:value[' + recordNo + '].value' );
     var resVal = field.value;
 
@@ -466,7 +482,7 @@
 
 function isColdChainDateOfRepairFieldEntered( recordNo )
 {
-    var dataElementId = 5731;
+	var dataElementId = 5791;
     var field = document.getElementById( 'value[' + dataElementId + '].value:value[' + recordNo + '].value' );
     var resVal = field.value;
 
@@ -529,7 +545,7 @@
         {
             saveLLbirthValue( dataElementId, recordNo );
         }
-        addLLColdChainNewRow( resVal, 5726, recordNo );
+        addLLColdChainNewRow( resVal, 5786, recordNo );
     }
     else
     {
@@ -2493,7 +2509,7 @@
     		dataElementId == 1035 || dataElementId == 1036 || dataElementId == 1037 || dataElementId == 1038 || 
     		dataElementId == 1039 || dataElementId == 1040 || dataElementId == 1043 || dataElementId == 1046 || 
     		dataElementId == 1050 || dataElementId == 1051 || dataElementId == 1052 || dataElementId == 1054 || 
-    		dataElementId == 5726 || dataElementId == 5728 || dataElementId == 3120
+    		dataElementId == 5786 || dataElementId == 5788 || dataElementId == 3120
     		)
     {
         resVal = field.options[field.selectedIndex].value;

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llcoldchain.vm'
--- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llcoldchain.vm	2011-10-14 13:44:18 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llcoldchain.vm	2011-11-04 08:03:14 +0000
@@ -37,35 +37,35 @@
         var newRow = tbl.insertRow(lastRow);        
             
         var oCell = newRow.insertCell(0);
-        oCell.innerHTML = "<div id='value[5726].value:value["+nextRecordNo+"].slno' align='center'>" + slnos + "</div>";
+        oCell.innerHTML = "<div id='value[5786].value:value["+nextRecordNo+"].slno' align='center'>" + slnos + "</div>";
 
         oCell = newRow.insertCell(1);
-        oCell.innerHTML = "<select name='entryfield' id='value[5726].value:value["+nextRecordNo+"].value' onchange='validateColdChainEquipmentField(5726,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'><option value='NONE' selected>---</option><option value='CCEQP1'>WIC- CFC</option><option value='CCEQP2'>WIC- non CFC</option><option value='CCEQP3'>WIF</option><option value='CCEQP4'>ILR Large- CFC</option><option value='CCEQP5'>ILR Large- non CFC</option><option value='CCEQP6'>ILR Small- CFC</option><option value='CCEQP7'>ILR Small- non CFC</option><option value='CCEQP8'>Deep Freezer- Large - CFC</option><option value='CCEQP9'>Deep Freezer- Large - non CFC</option><option value='CCEQP10'>Deep Freezer- Small - CFC</option><option value='CCEQP11'>Deep Freezer- Small - non CFC</option><option value='CCEQP12'>Generator</option><option value='CCEQP13'>Voltage stabilizer</option><option value='CCEQP14'>Cold box- Large</option><option value='CCEQP15'>Cold box- Small </option><option value='CCEQP16'>Vaccine carrier</option><option value='CCEQP17'>Vaccine van</option></select>";        
+        oCell.innerHTML = "<select name='entryfield' id='value[5786].value:value["+nextRecordNo+"].value' onchange='validateColdChainEquipmentField(5786,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'><option value='NONE' selected>---</option><option value='CCEQP1'>WIC- CFC</option><option value='CCEQP2'>WIC- non CFC</option><option value='CCEQP3'>WIF</option><option value='CCEQP4'>ILR Large- CFC</option><option value='CCEQP5'>ILR Large- non CFC</option><option value='CCEQP6'>ILR Small- CFC</option><option value='CCEQP7'>ILR Small- non CFC</option><option value='CCEQP8'>Deep Freezer- Large - CFC</option><option value='CCEQP9'>Deep Freezer- Large - non CFC</option><option value='CCEQP10'>Deep Freezer- Small - CFC</option><option value='CCEQP11'>Deep Freezer- Small - non CFC</option><option value='CCEQP12'>Generator</option><option value='CCEQP13'>Voltage stabilizer</option><option value='CCEQP14'>Cold box- Large</option><option value='CCEQP15'>Cold box- Small </option><option value='CCEQP16'>Vaccine carrier</option><option value='CCEQP17'>Vaccine van</option></select>";        
     
         oCell = newRow.insertCell(2);
-        oCell.innerHTML = "<input name='entryfield' id='value[5727].value:value["+nextRecordNo+"].value' type='text' value='' onchange='validateColdChainMachineNumberField(5727,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'>";
+        oCell.innerHTML = "<input name='entryfield' id='value[5787].value:value["+nextRecordNo+"].value' type='text' value='' onchange='validateColdChainMachineNumberField(5787,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'>";
     
         oCell = newRow.insertCell(3);       
-        oCell.innerHTML = "<select name='entryfield' id='value[5728].value:value["+nextRecordNo+"].value' onchange='validateColdChainMachineWorkingField(5728,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'><option value='NONE' selected>---</option><option value='Y'>YES</option><option value='N'>NO</option><option value='NK'>NOT KNOWN</option></select>";
+        oCell.innerHTML = "<select name='entryfield' id='value[5788].value:value["+nextRecordNo+"].value' onchange='validateColdChainMachineWorkingField(5788,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'><option value='NONE' selected>---</option><option value='Y'>YES</option><option value='N'>NO</option><option value='NK'>NOT KNOWN</option></select>";
 
         oCell = newRow.insertCell(4);
-        oCell.innerHTML = "<input name='entryfield' id='value[5729].value:value["+nextRecordNo+"].value' type='text' value='' onchange='validateColdChainDateOfBreakdownField(5729,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:10em text-align:center'>";
+        oCell.innerHTML = "<input name='entryfield' id='value[5789].value:value["+nextRecordNo+"].value' type='text' value='' onchange='validateColdChainDateOfBreakdownField(5789,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:10em text-align:center'>";
                                 
         oCell = newRow.insertCell(5);
-        oCell.innerHTML = "<input name='entryfield' id='value[5730].value:value["+nextRecordNo+"].value' type='text' value='' onchange='validateColdChainDateOfIntimationField(5730,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'>";
+        oCell.innerHTML = "<input name='entryfield' id='value[5790].value:value["+nextRecordNo+"].value' type='text' value='' onchange='validateColdChainDateOfIntimationField(5790,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'>";
 
         oCell = newRow.insertCell(6);
-        oCell.innerHTML = "<input name='entryfield' id='value[5731].value:value["+nextRecordNo+"].value' type='text' value='' onchange='validateColdChainDateOfRepairField(5731,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'>";
+        oCell.innerHTML = "<input name='entryfield' id='value[5791].value:value["+nextRecordNo+"].value' type='text' value='' onchange='validateColdChainDateOfRepairField(5791,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'>";
 
         oCell = newRow.insertCell(7);
-        oCell.innerHTML = "<input name='entryfield' id='value[5732].value:value["+nextRecordNo+"].value' type='text' value='' onchange='validateColdChainRemarksField(5732,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'>";
+        oCell.innerHTML = "<input name='entryfield' id='value[5792].value:value["+nextRecordNo+"].value' type='text' value='' onchange='validateColdChainRemarksField(5792,"+nextRecordNo+")' onkeypress='return keyPress(event, this)' style='width:100% text-align:center'>";
 
         oCell = newRow.insertCell(8);
         oCell.innerHTML = "<div id='"+nextRecordNo+"' ><a href='javascript:removeLLRecord( " + nextRecordNo + " )' title='remove'><img src='../images/delete.png' alt='remove'></a></div>";
         
-        var inputFieldVal1 = "value\\[5729\\]\\.value\\:value\\["+nextRecordNo+"\\]\\.value";
-		var inputFieldVal2 = "value\\[5730\\]\\.value\\:value\\["+nextRecordNo+"\\]\\.value";
-		var inputFieldVal3 = "value\\[5731\\]\\.value\\:value\\["+nextRecordNo+"\\]\\.value";
+        var inputFieldVal1 = "value\\[5789\\]\\.value\\:value\\["+nextRecordNo+"\\]\\.value";
+		var inputFieldVal2 = "value\\[5790\\]\\.value\\:value\\["+nextRecordNo+"\\]\\.value";
+		var inputFieldVal3 = "value\\[5791\\]\\.value\\:value\\["+nextRecordNo+"\\]\\.value";
         
         datePicker( inputFieldVal1, false);
 		datePicker( inputFieldVal2, false);
@@ -96,6 +96,7 @@
     #set($llDataValues = $lldataValueMap.get($mapKey))
     #set($count1 = 1)
     #foreach( $llDataValue in $llDataValues )
+		#set( $flag = 1 )
         #if( $count1 == 1 )
             <td align="center"><div id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].slno" align='center'>$slno</div></td>
             <td>
@@ -123,6 +124,9 @@
         #elseif( $count1 == 2 )
             <td><input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateColdChainMachineNumberField($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 )
+			#if($llDataValue.getValue() && $llDataValue.getValue()=="N")
+				#set( $flag = 2 )
+			#end
             <td>
                 <select name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" onchange="validateColdChainMachineWorkingField($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>
@@ -133,7 +137,7 @@
             </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="validateColdChainDateOfBreakdownField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:10em text-align:center" #if( $locked ) disabled="disabled"#end>
+                <input name="entryfield" id="value[$llDataValue.getDataElement().getId()].value:value[$llDataValue.getRecordNo()].value" type="text" value="#if($llDataValue.getValue())$llDataValue.getValue()#end" onchange="validateColdChainDateOfBreakdownField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())" onkeypress="return keyPress(event, this)" style="width:10em text-align:center" #if( $locked || $flag == 1 ) disabled="disabled"#end>
                 #if( !$locked ) <script type="text/javascript"> datePicker('value\\[$llDataValue.getDataElement().getId()\\]\\.value\\:value\\[$llDataValue.getRecordNo()\\]\\.value', false); </script> #end   
            </td>
         #elseif( $count1 == 5 )
@@ -161,9 +165,9 @@
 
 #if( !$locked )
 <tr>
-    <td align="center"><div id='value[5726].value:value[$recordNo].slno' align='center'>$slno</div></td>    
+    <td align="center"><div id='value[5786].value:value[$recordNo].slno' align='center'>$slno</div></td>    
     <td>
-        <select name="entryfield" id="value[5726].value:value[$recordNo].value" onchange="validateColdChainEquipmentField(5726,$recordNo)" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
+        <select name="entryfield" id="value[5786].value:value[$recordNo].value" onchange="validateColdChainEquipmentField(5786,$recordNo)" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
             <option value="NONE" selected>---</option>
             <option value="CCEQP1">WIC- CFC</option>
             <option value="CCEQP2">WIC- non CFC</option>
@@ -184,9 +188,9 @@
 			<option value="CCEQP17">Vaccine van</option>			
         </select>
     </td>   
-    <td><input name="entryfield" id="value[5727].value:value[$recordNo].value" type="text" value="" onchange="validateColdChainMachineNumberField(5727,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
+    <td><input name="entryfield" id="value[5787].value:value[$recordNo].value" type="text" value="" onchange="validateColdChainMachineNumberField(5787,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
     <td>
-        <select name="entryfield" id="value[5728].value:value[$recordNo].value" onchange="validateColdChainMachineWorkingField(5728,$recordNo)" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
+        <select name="entryfield" id="value[5788].value:value[$recordNo].value" onchange="validateColdChainMachineWorkingField(5788,$recordNo)" onkeypress="return keyPress(event, this)" style="width:100% text-align:center">
             <option value="NONE" selected>---</option>
             <option value="Y">YES</option>
             <option value="N">NO</option>
@@ -194,30 +198,30 @@
         </select>   
     </td>
     <td>
-        #set( $tempVar =  "value[5729].value:value["+$recordNo+"].value" )
-        <input name="entryfield" id="$tempVar" type="text" value="" onchange="validateColdChainDateOfBreakdownField(5729,$recordNo)" onkeypress="return keyPress(event, this)" style="width:10em text-align:center">
+        #set( $tempVar =  "value[5789].value:value["+$recordNo+"].value" )
+        <input name="entryfield" id="$tempVar" type="text" value="" onchange="validateColdChainDateOfBreakdownField(5789,$recordNo)" onkeypress="return keyPress(event, this)" style="width:10em text-align:center">
 		<script type="text/javascript">
-			var a = "value\\[5729\\]\\.value\\:value\\[$recordNo\\]\\.value";
+			var a = "value\\[5789\\]\\.value\\:value\\[$recordNo\\]\\.value";
 			datePicker( a, false);
 		</script>           
     </td>   
     <td>
-        #set( $tempVar =  "value[5730].value:value["+$recordNo+"].value" )
-        <input name="entryfield" id="$tempVar" type="text" value="" onchange="validateColdChainDateOfIntimationField(5730,$recordNo)" onkeypress="return keyPress(event, this)" style="width:10em text-align:center">
+        #set( $tempVar =  "value[5790].value:value["+$recordNo+"].value" )
+        <input name="entryfield" id="$tempVar" type="text" value="" onchange="validateColdChainDateOfIntimationField(5790,$recordNo)" onkeypress="return keyPress(event, this)" style="width:10em text-align:center">
         <script type="text/javascript">
-            var a = "value\\[5730\\]\\.value\\:value\\[$recordNo\\]\\.value";
+            var a = "value\\[5790\\]\\.value\\:value\\[$recordNo\\]\\.value";
             datePicker( a, false);
         </script>           
     </td>   
     <td>
-        #set( $tempVar =  "value[5731].value:value["+$recordNo+"].value" )
-        <input name="entryfield" id="$tempVar" type="text" value="" onchange="validateColdChainDateOfRepairField(5731,$recordNo)" onkeypress="return keyPress(event, this)" style="width:10em text-align:center">
+        #set( $tempVar =  "value[5791].value:value["+$recordNo+"].value" )
+        <input name="entryfield" id="$tempVar" type="text" value="" onchange="validateColdChainDateOfRepairField(5791,$recordNo)" onkeypress="return keyPress(event, this)" style="width:10em text-align:center">
         <script type="text/javascript">
-            var a = "value\\[5731\\]\\.value\\:value\\[$recordNo\\]\\.value";
+            var a = "value\\[5791\\]\\.value\\:value\\[$recordNo\\]\\.value";
             datePicker( a, false);
         </script>           
     </td>   
-    <td><input name="entryfield" id="value[5732].value:value[$recordNo].value" type="text" value="" onchange="validateColdChainRemarksField(5732,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
+    <td><input name="entryfield" id="value[5792].value:value[$recordNo].value" type="text" value="" onchange="validateColdChainRemarksField(5792,$recordNo )" onkeypress="return keyPress(event, this)" style="width:100% text-align:center"></td>
     <td>
         <div id='$recordNo'><a href="javascript:removeLLRecord( '$recordNo' ) " title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></div>
     </td>