------------------------------------------------------------
revno: 83
committer: Bharath <bhar...@hispindia>
branch nick: trunk
timestamp: Thu 2009-03-19 12:25:54 +0530
message:
  Added Validations for Linelisting Death,MaternalDeath Forms
modified:
  dhis-2/dhis-web/dhis-web-portal/pom.xml
  
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/graphicalAnalysisResult.vm
  
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/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
  
local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/action/GetPeriodsAction.java
  
local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/javascript/reports.js
  
local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/responsePeriod.vm

=== modified file 'dhis-2/dhis-web/dhis-web-portal/pom.xml'
--- dhis-2/dhis-web/dhis-web-portal/pom.xml     2009-03-14 11:05:58 +0000
+++ dhis-2/dhis-web/dhis-web-portal/pom.xml     2009-03-19 06:55:54 +0000
@@ -84,31 +84,35 @@
       <version>${version}</version>
       <type>war</type>
     </dependency>
+<!--
     <dependency>
       <groupId>org.hisp.dhis</groupId>
       <artifactId>dhis-web-validationrule</artifactId>
       <version>${version}</version>
       <type>war</type>
     </dependency>
+-->
     <dependency>
       <groupId>org.hisp.dhis</groupId>
       <artifactId>dhis-web-dataentry</artifactId>
       <version>${version}</version>
       <type>war</type>
     </dependency>
+<!--
     <dependency>
       <groupId>org.hisp.dhis</groupId>
       <artifactId>dhis-web-reporting</artifactId>
       <version>${version}</version>
       <type>war</type>
     </dependency>
+
     <dependency>
       <groupId>org.hisp.dhis</groupId>
       <artifactId>dhis-web-dashboard-integration</artifactId>
       <version>${version}</version>
       <type>war</type>
     </dependency>
-    <!-- 
+
     <dependency>
       <groupId>org.hisp.dhis</groupId>
       <artifactId>dhis-web-openhealth-integration</artifactId>
@@ -133,7 +137,7 @@
     
     <!-- India modules -->
     
-    <!--    
+
     <dependency>
       <groupId>org.hisp.dhis</groupId>
       <artifactId>dhis-web-dashboard</artifactId>
@@ -158,7 +162,7 @@
       <version>${version}</version>
       <type>war</type>
     </dependency>
-    -->
+
     
     <!-- Other -->
     

=== modified file 
'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/graphicalAnalysisResult.vm'
--- 
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/graphicalAnalysisResult.vm
   2009-03-10 06:15:33 +0000
+++ 
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/graphicalAnalysisResult.vm
   2009-03-19 06:55:54 +0000
@@ -346,8 +346,7 @@
                                        <input type="hidden" name="htmlCode" 
id="htmlCode" />
                        <div align="right" class="NormalB">
                                <!--<input type="submit" 
name="ExportToWorkBook" value="Export To WorkBook" style="width: 160; height: 
25; font-family:Arial; font-weight:bold; color:#000000">-->
-                       </div>
-                       <textarea id="testId" rows="10" cols="70" 
style="display:none">&nbsp;</textarea>                
+                       </div>                                  
  <div id="formResult">
     #if($riRadio.equals("indicatorsRadio1") && $categoryLB.equals( "period" )) 
     <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: 
collapse; border-style: dotted" bordercolor="#111111" width="100%">             
   
@@ -460,7 +459,8 @@
                                                    #end
                                                </table>   
         #end
-                                                                               
                                        
+                                               
+                               <textarea id="testId" rows="10" cols="70" 
style="display:none">&nbsp;</textarea>                                          
                                                                                
                      
                                </form>
 
  </body>

=== 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
   2009-03-17 11:36:23 +0000
+++ 
local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/general.js
   2009-03-19 06:55:54 +0000
@@ -223,7 +223,7 @@
   var resVal = field.value;
 
   if(resVal == null || resVal.replace(/^\s\s*/, '').replace(/\s\s*$/, '') == 
"" )
-  {
+  {    
     alert("Please enter Name");
     field.value = "";
     field.focus();
@@ -239,9 +239,12 @@
        var field = document.getElementById( 'value[' + dataElementId + 
'].value:value[' + recordNo + '].value' );    
   var resVal = field.value;
     
-       if( isDate(resVal) )
+       if(resVal == null || resVal.replace(/^\s\s*/, '').replace(/\s\s*$/, '') 
== "" )
        {       
-    saveLLbirthValue( dataElementId, recordNo );
+               alert("Please enter Name");
+               
+    field.value = "";
+    field.focus();    
        }
        else
        {
@@ -252,6 +255,90 @@
        return false; 
 }
 
+function validateAgeAtDeathField( dataElementId, recordNo )
+{
+  var field = document.getElementById( 'value[' + dataElementId + 
'].value:value[' + recordNo + '].value' );    
+  var resVal = field.value;
+  var resVal = resVal.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
+
+  if( !isLLMDNameFiledEntered( recordNo ) )
+  {
+       alert("Please enter name field");
+       
+       field.value = "";
+       return false;
+  }
+  
+  if(resVal == null || resVal == "" )
+  {    
+    field.value = "";
+    field.focus();
+    
+    return false;
+  }
+  
+  if( isInteger( resVal) && parseInt(resVal) >= 15 && parseInt(resVal) < 50 )
+  {
+      saveLLbirthValue( dataElementId, recordNo );
+  }
+  else
+  {
+    alert("Please enter valid AGE (between 15 - 50)");
+    field.value = "";
+    field.focus();
+    
+    return false;
+  }     
+}
+
+
+function isLLBNameFiledEntered( recordNo )
+{
+  var dataElementId = 1020;
+  var field = document.getElementById( 'value[' + dataElementId + 
'].value:value[' + recordNo + '].value' );    
+  var resVal = field.value;
+
+  if(resVal == null || resVal.replace(/^\s\s*/, '').replace(/\s\s*$/, '') == 
"" )
+  {    
+    return false;
+  }
+  else
+  {
+       return true;
+  }    
+}
+
+function isLLDNameFiledEntered( recordNo )
+{
+  var dataElementId = 1027;
+  var field = document.getElementById( 'value[' + dataElementId + 
'].value:value[' + recordNo + '].value' );    
+  var resVal = field.value;
+
+  if(resVal == null || resVal.replace(/^\s\s*/, '').replace(/\s\s*$/, '') == 
"" )
+  {    
+    return false;
+  }
+  else
+  {
+    return true;
+  } 
+}
+
+function isLLMDNameFiledEntered( recordNo )
+{
+  var dataElementId = 1032;
+  var field = document.getElementById( 'value[' + dataElementId + 
'].value:value[' + recordNo + '].value' );    
+  var resVal = field.value;
+
+  if(resVal == null || resVal.replace(/^\s\s*/, '').replace(/\s\s*$/, '') == 
"" )
+  {    
+    return false;
+  }
+  else
+  {
+    return true;
+  } 
+}
 
 // 
-----------------------------------------------------------------------------
 // Save

=== 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
  2009-03-17 11:36:23 +0000
+++ 
local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llbirthForm.vm
  2009-03-19 06:55:54 +0000
@@ -5,8 +5,7 @@
        var nextRecordNo = $recordNo;
        var nextFlag = 0;
        
-       var slnos = $recordNos.size()+1;
-       var curRecord = slnos;
+       var slnos = $recordNos.size()+1;        
        
        function addLLBNewRow( thisValue, dataElementId, recordNo )
        {
@@ -39,7 +38,7 @@
        var oCell = newRow.insertCell(0);
        oCell.innerHTML = "<div 
id='value[1020].value:value["+nextRecordNo+"].slno' align='center'>" + slnos + 
"</div>";
 
-       var oCell = newRow.insertCell(1);
+       oCell = newRow.insertCell(1);
        oCell.innerHTML = "<input name='entryfield' 
id='value[1020].value:value["+nextRecordNo+"].value' type='text' value='' 
onchange='validateNameField(1020,"+nextRecordNo+")' onkeypress='return 
keyPress(event, this)' onblur='addLLBNewRow(this.value, 1020, 
"+nextRecordNo+")' style='width:100% text-align:center'>";
     
        oCell = newRow.insertCell(2);

=== 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
  2009-03-17 11:36:23 +0000
+++ 
local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/lldeathForm.vm
  2009-03-19 06:55:54 +0000
@@ -4,36 +4,41 @@
        var nextRecordNo = $recordNo;
        var nextFlag = 0;
        
-       function addLLDNewRow()
+       var slnos = $recordNos.size()+1;
+       
+       function addLLDNewRow( thisValue, dataElementId, recordNo )
        {
-               if(nextFlag == 0)
-               {
-                  nextFlag = 1;
-               }
-               else
-               {
-                   return;
+               var field = document.getElementById( 'value[' + dataElementId + 
'].value:value[' + recordNo + '].slno' );    
+        var resVal = field.innerHTML;
+        
+               if( thisValue == null || thisValue.replace(/^\s\s*/, 
'').replace(/\s\s*$/, '') == "" || slnos != resVal )
+               {
+                       return;
                }
                
                nextRecordNo++;
-                       
+               slnos++;
+                               
                var tbl = document.getElementById("tblGrid");
                var lastRow = tbl.rows.length;
                var newRow = tbl.insertRow(lastRow);            
             
        var oCell = newRow.insertCell(0);
-       oCell.innerHTML = "<input name='entryfield' 
id='value[1027].value:value["+nextRecordNo+"].value' type='text' value=' ' 
onchange='saveLLbirthValue(1027,"+nextRecordNo+")' onkeypress='return 
keyPress(event, this)' onblur='addLLDNewRow()' style='width:100% 
text-align:center'>";
-    
-       oCell = newRow.insertCell(1);
-       oCell.innerHTML = "<input name='entryfield' 
id='value[1028].value:value["+nextRecordNo+"].value' type='text' value=' ' 
onchange='saveLLbirthValue(1028,"+nextRecordNo+")' onkeypress='return 
keyPress(event, this)' style='width:100% text-align:center'>";
+               oCell.innerHTML = "<div 
id='value[1027].value:value["+nextRecordNo+"].slno' align='center'>" + slnos + 
"</div>";
+       
+               oCell = newRow.insertCell(1);
+               oCell.innerHTML = "<input name='entryfield' 
id='value[1027].value:value["+nextRecordNo+"].value' type='text' value='' 
onchange='validateNameField(1027,"+nextRecordNo+")' onkeypress='return 
keyPress(event, this)' onblur='addLLDNewRow(this.value, 1027, 
"+nextRecordNo+")' style='width:100% text-align:center'>";
     
        oCell = newRow.insertCell(2);
+       oCell.innerHTML = "<input name='entryfield' 
id='value[1028].value:value["+nextRecordNo+"].value' type='text' value='' 
onchange='saveLLbirthValue(1028,"+nextRecordNo+")' onkeypress='return 
keyPress(event, this)' style='width:100% text-align:center'>";
+    
+       oCell = newRow.insertCell(3);
        oCell.innerHTML = "<select name='entryfield' 
id='value[1029].value:value["+nextRecordNo+"].value' 
onchange='saveLLbirthValue(1029,"+nextRecordNo+")' onkeypress='return 
keyPress(event, this)' style='width:100% text-align:center'><option 
value='NONE' selected>---</option><option value='M'>Male</option><option 
value='F'>Female</option></select>";       
 
-       oCell = newRow.insertCell(3);
+       oCell = newRow.insertCell(4);
        oCell.innerHTML = "<select name='entryfield' 
id='value[1030].value:value["+nextRecordNo+"].value' 
onchange='saveLLbirthValue(1030,"+nextRecordNo+")' onkeypress='return 
keyPress(event, this)' style='width:100% text-align:center'><option 
value='NONE' selected>---</option><option value='B1DAY'>BELOW 1 
DAY</option><option value='B1WEEK'>1 DAY - 1 WEEK</option><option 
value='B1MONTH'>1 WEEK - 1 MONTH</option><option value='B1YEAR'>1 MONTH - 1 
YEAR</option><option value='B5YEAR'>1 YEAR - 5 YEARS</option><option 
value='O5YEAR'>5 YEARS - 14 YEARS</option><option value='O15YEAR'>15 YEARS - 55 
YEARS</option><option value='O55YEAR'>OVER 55 YEARS</option></select>";
                                        
-       oCell = newRow.insertCell(4);
+       oCell = newRow.insertCell(5);
        oCell.innerHTML = "<select name='entryfield' 
id='value[1031].value:value["+nextRecordNo+"].value' 
onchange='saveLLbirthValue(1031,"+nextRecordNo+")' onkeypress='return 
keyPress(event, this)' style='width:100% text-align:center'><option 
value='NONE'>---</option><option value='ASPHYXIA'>ASPHYXIA</option><option 
value='SEPSIS'>SEPSIS</option><option 
value='LOWBIRTHWEIGH'>LOWBIRTHWEIGH</option><option 
value='IMMREAC'>Immunization reactions</option><option 
value='PNEUMONIA'>Pneumonia</option><option value='DIADIS'>Diarrhoeal 
Disease</option><option value='MEASLES'>Measles</option><option 
value='TUBER'>Tuberculosis</option><option 
value='MALARIA'>Malaria</option><option 
value='HIVAIDS'>HIV/AIDS</option><option value='OFR'>Other Fever 
related</option><option value='PRD'>Pregnancy Related Death( maternal 
mortality)</option><option value='SRD'>Sterilisation related 
deaths</option><option value='AI'>Accidents or Injuries</option><option 
value='SUICIDES'>Suicides</option><option value='ABS'>Animal Bites or 
Stings</option><option value='RID'>Respiratory Infections and 
Disease</option><option value='HDH'>Heart Disease and 
hypertension</option><option value='SND'>Stroke and Neurological 
Disease</option><option value='OKAD'>Other Known Acute Disease</option><option 
value='OKCD'>Other Known Chronic Disease</option><option 
value='OTHERS'>Others</option><option value='NK'>NOT KNOWN</option></select>";  
                
        }
 </script>
@@ -45,15 +50,17 @@
 
 <table id="tblGrid" width="100%">
        <tr>
-               <th width="25%">Name of Child<br>(If under 5 Mother/Father 
Name)</th>
-               <th width="25%">Village</th>
-               <th width="10%">Sex</th>
+               <th width="5%">Sl. No.</th>
+               <th width="24%">Name of Child<br>(If under 5 Mother/Father 
Name)</th>
+               <th width="24%">Village</th>
+               <th width="7%">Sex</th>
                <th width="20%">Age Category</th>
                <th width="20%">Probable Cause of death</th>            
        </tr>
 
-#set($calInfo = "")
+#set( $calInfo = "" )
 #set( $mapKeys = $lldataValueMap.keySet() )
+#set( $slno = 1 )
 #foreach( $mapKey in $mapKeys)
        <tr>
        #set($llDataValues = $lldataValueMap.get($mapKey))
@@ -89,38 +96,40 @@
                                        <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>
                                        <option value="LOWBIRTHWEIGH" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="LOWBIRTHWEIGH") 
selected #end>LOWBIRTHWEIGHT</option>
-          <option value="IMMREAC" #if($llDataValue.getValue() && 
$llDataValue.getValue()=="IMMREAC") selected #end>Immunization 
reactions</option>
-          <option value="PNEUMONIA" #if($llDataValue.getValue() && 
$llDataValue.getValue()=="PNEUMONIA") selected #end>Pneumonia</option>
-          <option value="DIADIS" #if($llDataValue.getValue() && 
$llDataValue.getValue()=="DIADIS") selected #end>Diarrhoeal Disease</option>
-          <option value="MEASLES" #if($llDataValue.getValue() && 
$llDataValue.getValue()=="MEASLES") selected #end>Measles</option>
-          <option value="TUBER" #if($llDataValue.getValue() && 
$llDataValue.getValue()=="TUBER") selected #end>Tuberculosis</option>
-          <option value="MALARIA" #if($llDataValue.getValue() && 
$llDataValue.getValue()=="MALARIA") selected #end>Malaria</option>
-          <option value="HIVAIDS" #if($llDataValue.getValue() && 
$llDataValue.getValue()=="HIVAIDS") selected #end>HIV/AIDS</option>
-          <option value="OFR" #if($llDataValue.getValue() && 
$llDataValue.getValue()=="OFR") selected #end>Other Fever related</option>
-          <option value="PRD" #if($llDataValue.getValue() && 
$llDataValue.getValue()=="PRD") selected #end>Pregnancy Related Death( maternal 
mortality)</option>
-          <option value="SRD" #if($llDataValue.getValue() && 
$llDataValue.getValue()=="SRD") selected #end>Sterilisation related 
deaths</option>
-          <option value="AI" #if($llDataValue.getValue() && 
$llDataValue.getValue()=="AI") selected #end>Accidents or Injuries</option>
-          <option value="SUICIDES" #if($llDataValue.getValue() && 
$llDataValue.getValue()=="SUICIDES") selected #end>Suicides</option>
-          <option value="ABS" #if($llDataValue.getValue() && 
$llDataValue.getValue()=="ABS") selected #end>Animal Bites or Stings</option>
-          <option value="RID" #if($llDataValue.getValue() && 
$llDataValue.getValue()=="RID") selected #end>Respiratory Infections and 
Disease</option>
-          <option value="HDH" #if($llDataValue.getValue() && 
$llDataValue.getValue()=="HDH") selected #end>Heart Disease and 
hypertension</option>
-          <option value="SND" #if($llDataValue.getValue() && 
$llDataValue.getValue()=="SND") selected #end>Stroke and Neurological 
Disease</option>
-          <option value="OKAD" #if($llDataValue.getValue() && 
$llDataValue.getValue()=="OKAD") selected #end>Other Known Acute 
Disease</option>
-          <option value="OKCD" #if($llDataValue.getValue() && 
$llDataValue.getValue()=="OKCD") selected #end>Other Known Chronic 
Disease</option>
-          <option value="OTHERS" #if($llDataValue.getValue() && 
$llDataValue.getValue()=="OTHERS") selected #end>Others</option>                
                               
-                       <option value="NK" #if($llDataValue.getValue() && 
$llDataValue.getValue()=="NK") selected #end>NOT KNOWN</option>
+                                       <option value="IMMREAC" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="IMMREAC") selected 
#end>Immunization reactions</option>
+                                       <option value="PNEUMONIA" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="PNEUMONIA") selected 
#end>Pneumonia</option>
+                                       <option value="DIADIS" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="DIADIS") selected 
#end>Diarrhoeal Disease</option>
+                                       <option value="MEASLES" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="MEASLES") selected 
#end>Measles</option>
+                                       <option value="TUBER" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="TUBER") selected 
#end>Tuberculosis</option>
+                                       <option value="MALARIA" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="MALARIA") selected 
#end>Malaria</option>
+                                       <option value="HIVAIDS" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="HIVAIDS") selected 
#end>HIV/AIDS</option>
+                                       <option value="OFR" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="OFR") selected 
#end>Other Fever related</option>
+                                       <option value="PRD" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="PRD") selected 
#end>Pregnancy Related Death( maternal mortality)</option>
+                                       <option value="SRD" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="SRD") selected 
#end>Sterilisation related deaths</option>
+                                       <option value="AI" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="AI") selected 
#end>Accidents or Injuries</option>
+                                       <option value="SUICIDES" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="SUICIDES") selected 
#end>Suicides</option>
+                                       <option value="ABS" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="ABS") selected 
#end>Animal Bites or Stings</option>
+                                       <option value="RID" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="RID") selected 
#end>Respiratory Infections and Disease</option>
+                                       <option value="HDH" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="HDH") selected 
#end>Heart Disease and hypertension</option>
+                                       <option value="SND" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="SND") selected 
#end>Stroke and Neurological Disease</option>
+                                       <option value="OKAD" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="OKAD") selected 
#end>Other Known Acute Disease</option>
+                                       <option value="OKCD" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="OKCD") selected 
#end>Other Known Chronic Disease</option>
+                                       <option value="OTHERS" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="OTHERS") selected 
#end>Others</option>                                                  
+                                       <option value="NK" 
#if($llDataValue.getValue() && $llDataValue.getValue()=="NK") selected #end>NOT 
KNOWN</option>
                                </select>
                        </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="saveLLbirthValue($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())"
 onkeypress="return keyPress(event, this)" style="width:100% 
text-align:center"></td>           
+                       <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="validateNameField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())"
 onkeypress="return keyPress(event, this)" style="width:100% 
text-align:center"></td>            
                #end
                #set($count1 = $count1+1)
        #end
        </tr>   
 #end
 <tr>
-       <td><input name="entryfield" 
id="value[1027].value:value[$recordNo].value" type="text" value=" " 
onchange="saveLLbirthValue(1027,$recordNo )" onkeypress="return keyPress(event, 
this)" onblur="addLLDNewRow()" style="width:100% text-align:center"></td>
-       <td><input name="entryfield" 
id="value[1028].value:value[$recordNo].value" type="text" value=" " 
onchange="saveLLbirthValue(1028,$recordNo )" onkeypress="return keyPress(event, 
this)" style="width:100% text-align:center"></td>
+       <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="validateNameField(1027,$recordNo )" onkeypress="return 
keyPress(event, this)" onblur="addLLDNewRow( this.value, 1027, $recordNo )" 
style="width:100% text-align:center"></td>
+       <td><input name="entryfield" 
id="value[1028].value:value[$recordNo].value" type="text" value="" 
onchange="saveLLbirthValue(1028,$recordNo )" onkeypress="return keyPress(event, 
this)" style="width:100% text-align:center"></td>
        <td>
                <select name="entryfield" 
id="value[1029].value:value[$recordNo].value" 
onchange="saveLLbirthValue(1029,$recordNo)" onkeypress="return keyPress(event, 
this)" style="width:100% text-align:center">
                        <option value="NONE" selected>---</option>

=== 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
 2009-03-17 11:36:23 +0000
+++ 
local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/llmdeathForm.vm
 2009-03-19 06:55:54 +0000
@@ -6,16 +6,16 @@
        
        var slnos = $recordNos.size()+1;
        
-       function addLLMDNewRow()
+       function addLLMDNewRow( thisValue, dataElementId, recordNo )
        {
-               if(nextFlag == 0)
-               {
-                  nextFlag = 1;
-               }
-               else
-               {
-                   return;
-               }
+
+               var field = document.getElementById( 'value[' + dataElementId + 
'].value:value[' + recordNo + '].slno' );    
+        var resVal = field.innerHTML;
+        
+        if( thisValue == null || thisValue.replace(/^\s\s*/, 
'').replace(/\s\s*$/, '') == "" || slnos != resVal )
+        {
+                       return;
+        }
                
                nextRecordNo++;
                slnos++;
@@ -25,16 +25,16 @@
                var newRow = tbl.insertRow(lastRow);            
 
        var oCell = newRow.insertCell(0);
-       oCell.innerHTML = "<div align='center'>" + slnos + "</div>";
+       oCell.innerHTML = "<div 
id='value[1032].value:value["+nextRecordNo+"].slno' align='center'>" + slnos + 
"</div>";
             
        oCell = newRow.insertCell(1);
-       oCell.innerHTML = "<input name='entryfield' 
id='value[1032].value:value["+nextRecordNo+"].value' type='text' value=' ' 
onchange='saveLLbirthValue(1032,"+nextRecordNo+")' onkeypress='return 
keyPress(event, this)' onblur='addLLMDNewRow()' style='width:100% 
text-align:center'>";
+       oCell.innerHTML = "<input name='entryfield' 
id='value[1032].value:value["+nextRecordNo+"].value' type='text' value='' 
onchange='validateNameField(1032,"+nextRecordNo+")' onkeypress='return 
keyPress(event, this)' onblur='addLLMDNewRow(this.value, 1032, 
"+nextRecordNo+")' style='width:100% text-align:center'>";
     
        oCell = newRow.insertCell(2);
-       oCell.innerHTML = "<input name='entryfield' 
id='value[1033].value:value["+nextRecordNo+"].value' type='text' value=' ' 
onchange='saveLLbirthValue(1033,"+nextRecordNo+")' onkeypress='return 
keyPress(event, this)' style='width:100% text-align:center'>";
+       oCell.innerHTML = "<input name='entryfield' 
id='value[1033].value:value["+nextRecordNo+"].value' type='text' value='' 
onchange='saveLLbirthValue(1033,"+nextRecordNo+")' onkeypress='return 
keyPress(event, this)' style='width:100% text-align:center'>";
 
        oCell = newRow.insertCell(3);
-       oCell.innerHTML = "<input name='entryfield' 
id='value[1034].value:value["+nextRecordNo+"].value' type='text' value=' ' 
onchange='saveLLbirthValue(1034,"+nextRecordNo+")' onkeypress='return 
keyPress(event, this)' style='width:100% text-align:center'>";
+       oCell.innerHTML = "<input name='entryfield' 
id='value[1034].value:value["+nextRecordNo+"].value' type='text' value='' 
onchange='validateAgeAtDeathField(1034,"+nextRecordNo+")' onkeypress='return 
keyPress(event, this)' style='width:100% text-align:center' maxlength='2'>";
     
        oCell = newRow.insertCell(4);
        oCell.innerHTML = "<select name='entryfield' 
id='value[1035].value:value["+nextRecordNo+"].value' 
onchange='saveLLbirthValue(1035,"+nextRecordNo+")' onkeypress='return 
keyPress(event, his)' style='width:100% text-align:center'><option value='NONE' 
selected>---</option><option value='FTP'>FIRST TRIMESTER 
PREGNANCY</option><option value='STP'>SECOND TRIMESTER PREGNANCY</option>      
<option value='TTP'>THIRD TRIMESTER PREGNANCY</option><option 
value='DELIVERY'>DELIVERY</option><option value='ADW42D'>AFTER DELIVERY WITHIN 
42 DAYS</option></select>";        
@@ -139,10 +139,12 @@
                                </select>
                        </td>
                #elseif($count1 == 1)
-                       <td align="center">$slno</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="saveLLbirthValue($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())"
 onkeypress="return keyPress(event, this)" style="width:100% 
text-align:center"></td>           
+                       <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="validateNameField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())"
 onkeypress="return keyPress(event, this)" style="width:100% 
text-align:center"></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="validateAgeAtDeathField($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())"
 onkeypress="return keyPress(event, this)" style="width:100% text-align:center" 
maxlength='2'></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="saveLLbirthValue($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="saveLLbirthValue($llDataValue.getDataElement().getId(),$llDataValue.getRecordNo())"
 onkeypress="return keyPress(event, this)" style="width:100% 
text-align:center"></td>             
                #end                            
                #set($count1 = $count1+1)
        #end
@@ -150,10 +152,10 @@
        </tr>   
 #end
 <tr>
-       <td align="center">$slno</td>
-       <td><input name="entryfield" 
id="value[1032].value:value[$recordNo].value" type="text" value=" " 
onchange="saveLLbirthValue(1032,$recordNo )" onkeypress="return keyPress(event, 
this)" onblur="addLLMDNewRow()" style="width:100% text-align:center"></td>
-       <td><input name="entryfield" 
id="value[1033].value:value[$recordNo].value" type="text" value=" " 
onchange="saveLLbirthValue(1033,$recordNo )" onkeypress="return keyPress(event, 
this)" style="width:100% text-align:center"></td>
-       <td><input name="entryfield" 
id="value[1034].value:value[$recordNo].value" type="text" value=" " 
onchange="saveLLbirthValue(1034,$recordNo )" onkeypress="return keyPress(event, 
this)" style="width:100% text-align:center"></td>
+       <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="validateNameField(1032,$recordNo )" onkeypress="return 
keyPress(event, this)" onblur="addLLMDNewRow( this.value, 1032, $recordNo )" 
style="width:100% text-align:center"></td>
+       <td><input name="entryfield" 
id="value[1033].value:value[$recordNo].value" type="text" value="" 
onchange="saveLLbirthValue(1033,$recordNo )" onkeypress="return keyPress(event, 
this)" style="width:100% text-align:center"></td>
+       <td><input name="entryfield" 
id="value[1034].value:value[$recordNo].value" type="text" value="" 
onchange="validateAgeAtDeathField(1034,$recordNo )" onkeypress="return 
keyPress(event, this)" style="width:100% text-align:center" maxlength='2'></td>
        <td>
                <select name="entryfield" 
id="value[1035].value:value[$recordNo].value" 
onchange="saveLLbirthValue(1035,$recordNo)" onkeypress="return keyPress(event, 
this)" style="width:100% text-align:center">
                        <option value="NONE" selected>---</option>              
                        

=== modified file 
'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/action/GetPeriodsAction.java'
--- 
local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/action/GetPeriodsAction.java
 2009-03-10 06:15:33 +0000
+++ 
local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/action/GetPeriodsAction.java
 2009-03-19 06:55:54 +0000
@@ -27,6 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -77,6 +78,17 @@
         return periods;
     }
 
+    private List<String> periodNameList;
+    
+       public List<String> getPeriodNameList() 
+       {
+               return periodNameList;
+       }
+    
+    private SimpleDateFormat simpleDateFormat1;
+
+    private SimpleDateFormat simpleDateFormat2;
+    
     // 
-------------------------------------------------------------------------
     // Action implementation
     // 
-------------------------------------------------------------------------
@@ -84,6 +96,8 @@
     public String execute()
         throws Exception
     {
+       periodNameList = new ArrayList<String>();
+       
         if ( id.equals( ALL ) )
         {
             Collection<PeriodType> periodTypes = 
periodService.getAllPeriodTypes();
@@ -100,10 +114,48 @@
             PeriodType periodType = periodService.getPeriodTypeByName( id );
 
             periods = new 
ArrayList<Period>(periodService.getPeriodsByPeriodType( periodType ));
+            
+            if(periodType.getName().equalsIgnoreCase("monthly"))
+            {
+               simpleDateFormat1 = new SimpleDateFormat( "MMM-yyyy" );
+               for(Period p1 : periods)
+               {
+                       periodNameList.add( 
simpleDateFormat1.format(p1.getStartDate() ) ); 
+               }
+            }
+            else if(periodType.getName().equalsIgnoreCase("quarterly"))
+            {
+               simpleDateFormat1 = new SimpleDateFormat( "MMM" );
+               simpleDateFormat2 = new SimpleDateFormat( "MMM yyyy" );
+               
+               for(Period p1 : periods)
+               {
+                       String tempPeriodName = simpleDateFormat1.format( 
p1.getStartDate() ) + " - " + simpleDateFormat2.format( p1.getEndDate() ); 
+                       periodNameList.add( tempPeriodName ); 
+               }
+            }
+            else if(periodType.getName().equalsIgnoreCase("yearly"))
+            {
+               simpleDateFormat1 = new SimpleDateFormat( "yyyy" );
+               for(Period p1 : periods)
+               {
+                       periodNameList.add( 
simpleDateFormat1.format(p1.getStartDate() ) ); 
+               }
+            }
+            else
+            {
+               simpleDateFormat1 = new SimpleDateFormat( "yyyy-mm-dd" );
+               for(Period p1 : periods)
+               {
+                       String tempPeriodName = simpleDateFormat1.format( 
p1.getStartDate() ) + " - " + simpleDateFormat1.format( p1.getEndDate() ); 
+                       periodNameList.add( tempPeriodName ); 
+               }
+            }
         }
 
         Collections.sort(periods, new PeriodComparator() );
         
         return SUCCESS;
     }
+
 }

=== modified file 
'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/javascript/reports.js'
--- 
local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/javascript/reports.js
   2009-03-13 07:45:42 +0000
+++ 
local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/javascript/reports.js
   2009-03-19 06:55:54 +0000
@@ -101,7 +101,7 @@
 
 function getReports( ouId, reportListFileName )
 {      
-    var periodTypeList = document.getElementById( "periodTypeId" );
+  var periodTypeList = document.getElementById( "periodTypeId" );
        var periodType = periodTypeList.options[ periodTypeList.selectedIndex 
].value;
                        
        if ( periodType != "NA" && ouId != null && ouId != "" )
@@ -155,10 +155,9 @@
        for ( var i = 0; i < periods.length; i++)
        {
                var id = periods[ i ].getElementsByTagName( "id" 
)[0].firstChild.nodeValue;
-               var startDate = periods[ i ].getElementsByTagName( "startDate" 
)[0].firstChild.nodeValue;
-               var endDate = periods[ i ].getElementsByTagName( "endDate" 
)[0].firstChild.nodeValue;
-               
-               var periodName = startDate + " - " + endDate;
+               //var startDate = periods[ i ].getElementsByTagName( 
"startDate" )[0].firstChild.nodeValue;
+               //var endDate = periods[ i ].getElementsByTagName( "endDate" 
)[0].firstChild.nodeValue;         
+               var periodName = periods[ i ].getElementsByTagName( 
"periodname" )[0].firstChild.nodeValue;
                
                if ( listContains( selectedPeriods, id ) == false )
                {                                               

=== modified file 
'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/responsePeriod.vm'
--- 
local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/responsePeriod.vm
       2009-03-10 06:15:33 +0000
+++ 
local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/responsePeriod.vm
       2009-03-19 06:55:54 +0000
@@ -1,10 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <periods>
-#foreach( $period in $periods )
+#foreach( $periodName in $periodNameList )
        <period>
                <id>$period.id</id>
-               <startDate>$period.startDate</startDate>
-               <endDate>$period.endDate</endDate>
+               <periodname>$periodName</periodname>
        </period>
 #end
 </periods>



--

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.

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp

Reply via email to