← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2151: Bug Fixed in DataStatus(Validation Statue) in Dashboard

 

------------------------------------------------------------
revno: 2151
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: trunk
timestamp: Tue 2010-11-23 15:29:00 +0530
message:
  Bug Fixed in DataStatus(Validation Statue) in Dashboard
modified:
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/action/GenerateValidationStatusResultAction.java
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/validationSatusResult.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-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/action/GenerateValidationStatusResultAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/action/GenerateValidationStatusResultAction.java	2010-08-31 11:27:36 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/action/GenerateValidationStatusResultAction.java	2010-11-23 09:59:00 +0000
@@ -117,17 +117,11 @@
 
     private Map<OrganisationUnit, List<Integer>> ouMapValidationPassStatusResult;
 
-    public Map<OrganisationUnit, List<Integer>> getouMapValidationPassStatusResult()
+    public Map<OrganisationUnit, List<Integer>> getOuMapValidationPassStatusResult()
     {
         return ouMapValidationPassStatusResult;
     }
 
-    private List<Integer> dsValidationPassResults;
-
-    public List<Integer> getDsValidationPassResults() {
-        return dsValidationPassResults;
-    }
-
     private Collection<Period> periodList;
 
     public Collection<Period> getPeriodList()
@@ -156,20 +150,6 @@
         return results;
     }
 
-    private Map<DataSet, Map<OrganisationUnit, List<Integer>>> dataStatusResult;
-
-    public Map<DataSet, Map<OrganisationUnit, List<Integer>>> getDataStatusResult()
-    {
-        return dataStatusResult;
-    }
-
-    private Map<DataSet, Collection<Period>> dataSetPeriods;
-
-    public Map<DataSet, Collection<Period>> getDataSetPeriods()
-    {
-        return dataSetPeriods;
-    }
-
     List<Period> selectedPeriodList;
 
     public List<Period> getSelectedPeriodList()
@@ -306,7 +286,7 @@
         return periodNameList;
     }
 
-    String orgUnitInfo;
+   String orgUnitInfo;
 
     String periodInfo;
 
@@ -452,8 +432,8 @@
 
             periodIterator = periodList.iterator();
             Period p;
-            List<Integer> dsResults = new ArrayList<Integer>();
-            dsValidationPassResults = new ArrayList<Integer>();
+            //List<Integer> dsResults = new ArrayList<Integer>();
+            List<Integer> dsValidationPassResults = new ArrayList<Integer>();
            
             while ( periodIterator.hasNext() )
             {
@@ -463,7 +443,7 @@
 
                 if ( dso == null )
                 {
-                    dsResults.add( -1 );
+                    //dsResults.add( -1 );
                     dsValidationPassResults.add( -1 );
                     continue;
                 }
@@ -473,7 +453,7 @@
                     childOrgUnits = filterChildOrgUnitsByDataSet( dataSetService.getDataSet( Integer
                         .valueOf( selectedDataSets.get( 0 ) ) ), o );
                     Iterator assignedChildrenIterator = childOrgUnits.iterator();
-                    int dataStatusCount = 0;
+                    Integer dataStatusCount = 0;
 
                     while ( assignedChildrenIterator.hasNext() )
                     {
@@ -492,29 +472,46 @@
                         }
                         
                     }
+                    //System.out.println("\ndataStatusCount : " + dataStatusCount);
+                    //System.out.println(o.getName()+ " : "+dataStatusCount);
                     dsValidationPassResults.add( dataStatusCount );
 
                     continue;
                 }
 
+               // System.out.println("\no = "+o.getName() + " dsValidationPassResults size = "+dsValidationPassResults.size());
+                
                 orgUnitInfo = "" + o.getId();
 
                 CompleteDataSetRegistration completeDataSetRegistration = registrationService.getCompleteDataSetRegistration( selDataSet, p, o );
                 
                 if ( completeDataSetRegistration != null )
                 {
-                    dsValidationPassResults.add( 1 );
+                    dsValidationPassResults.add( new Integer(1) );
+                   // System.out.println(o.getName()+ " : 1");
                 }
                 else
                 {
-                    dsValidationPassResults.add( 0 );
+                    dsValidationPassResults.add( new Integer(0) );
+                    //System.out.println(o.getName()+ " : 0");
                 }
                 
             }
             //System.out.println("o = "+o.getName() + " dsValidationPassResults size = "+dsValidationPassResults.size());
             ouMapValidationPassStatusResult.put( o, dsValidationPassResults );
         }
+/*        
         
+        for( OrganisationUnit orgUnit : ouMapValidationPassStatusResult.keySet() )
+        {
+            System.out.print( orgUnit.getName() );
+            for( Integer result : ouMapValidationPassStatusResult.get( orgUnit ) )
+            {
+                System.out.print( " - "+ result );
+            }
+            System.out.println("");
+        }
+*/        
         // For Level Names
         String ouLevelNames[] = new String[organisationUnitService.getNumberOfOrganisationalLevels() + 1];
         

=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/validationSatusResult.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/validationSatusResult.vm	2010-08-31 11:27:36 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/validationSatusResult.vm	2010-11-23 09:59:00 +0000
@@ -1,4 +1,6 @@
 
+<link type="text/css" rel="stylesheet" media="screen" href="css/StylesForTags.css"> 
+
 <script>
     var startDate = "$sDateLB";
     var endDate = "$eDateLB";
@@ -20,68 +22,68 @@
 <form id="form1" name="form1" action="exportDataStatusToExcel.action" method="post" onsubmit="return exportDataStatusResultToWorkBook()" target="_newtab">
     <input type="hidden" name="htmlCode" id="htmlCode" />
     <div align="right" class="NormalB">
-        <!--<input type="checkbox" name="includeZeros" id="includeZeros" #if($includeZeros) checked #end /> Include Zero<br />-->
         <input type="submit" name="ExportToWorkBook" value="Export To WorkBook" style="width: 160; height: 25; font-family:Arial; font-weight:bold; color:#000000">
     </div>
 
     <div id="formResult">
         <div align="center" class="NormalB">Validation Status</div>
+        
         <div align="right">
             <table width="30%">
-                <tr class="TableDataCellStyles" >
-                    <td bgcolor="#a0c0a0">&nbsp;</td>
-                    <td align="left">&nbsp;Validation Check Performed On Data Entry Screen</td>
+                <tr class="TableHeadingCellStyles" >
+                    <td class="TableHeadingCellStyles" bgcolor="#a0c0a0">&nbsp;</td>
+                    <td class="TableHeadingCellStyles" align="left"><strong>Validation Check Performed On Data Entry Screen</strong></td>
                 </tr>
-
-                <tr class="TableDataCellStyles">
-                    <td bgcolor="#ff0000">&nbsp;</td>
-                    <td align="left">&nbsp;Validation Check Not Performed On Data Entry Screen</td>
+                <tr class="TableHeadingCellStyles">
+                    <td class="TableHeadingCellStyles" bgcolor="#ff0000">&nbsp;</td>
+                    <td class="TableHeadingCellStyles" align="left"><strong>Validation Check Not Performed On Data Entry Screen</strong></td>
                 </tr>
             </table>
         </div>
+        
         #set($count2 = 0)
 
-        <br><br>
+        <br/>
+        
         <div align="left" class="NormalB">DataSet : $selDataSet.name</div>
-        <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%">
-            <tr class="TableHeadingCellStyles" align="center">
-                #foreach($levelName in $levelNames)
-                    <th>$!levelName</th>
-                #end
-                #foreach($periodname in $periodNameList)
-                    <th>$periodname</th>
-                #end
-            </tr>
-
-            #foreach($chiildorgUnit in $orgUnitList)
-                #set($count1 = $minOULevel)
-                #set($curOrgUnitLevel = $organisationUnitService.getLevelOfOrganisationUnit($chiildorgUnit))
-                <tr class="TableHeadingCellStyles">
-                    #foreach($levelName in $levelNames)
-                        #if($count1 == $curOrgUnitLevel)
-                            <td><a href="#" onclick="javascript:getImmChildInfo(event, '$selDataSet.id', '$chiildorgUnit.id')" target="_blank">$chiildorgUnit.name</a></td>
-  			#else
-                            <td>&nbsp;</td>
-  			#end
-  			#set($count1 = $count1 + 1)
-                    #end
-                    #set($dsValidationPassResults = $ouMapValidationPassStatusResult.get($chiildorgUnit))
-                    #foreach($result in $dsValidationPassResults)
-
-                        #set($count2 = $count2 + 1)
-                        #if($result < 0)
-                            <td  bgcolor="white">&nbsp;</td>
-                        #elseif($result == 0)
-                            <td align="center" bgcolor="#ff0000"><font color="#ffffff">0</font></td>
-                        #elseif($result == 1)
-                            <td align="center" bgcolor="#a0c0a0"><font color="#ffffff">1</font></td>
-                        #elseif($result > 1)
-                            <td align="center" bgcolor="#a0c0a0"><font color="#ffffff">$result</font></td>
-                        #end
-                    #end
-               </tr>
-            #end
+            <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse  border-style: solid" bordercolor="black" width="100%">
+	            <tr class="TableHeadingCellStyles" align="center">
+	                #foreach($levelName in $levelNames)
+	                    <td class="TableHeadingCellStyles"  bgcolor="#C0C0C0"><strong>$!levelName</strong></td>
+	                #end
+	                #foreach( $periodname in $periodNameList )
+	                    <td class="TableHeadingCellStyles"  bgcolor="#C0C0C0"><strong>$periodname</strong></td>
+	                #end
+	            </tr>
+
+	            #foreach( $chiildorgUnit in $orgUnitList )
+	                #set( $count1 = $minOULevel )
+	                #set( $curOrgUnitLevel = $organisationUnitService.getLevelOfOrganisationUnit($chiildorgUnit) )
+	                <tr class="TableHeadingCellStyles" >
+	                    #foreach($levelName in $levelNames)
+	                    	#if($count1 == $curOrgUnitLevel)
+	                           <td><a href="#" onclick="javascript:getImmChildInfo(event, '$selDataSet.id', '$chiildorgUnit.id')" target="_blank">$chiildorgUnit.name</a></td>
+	  			            #else
+	                           <td>&nbsp;</td>
+	  			            #end
+			  			    #set($count1 = $count1 + 1)
+			            #end
+			            
+			            #set( $dsValidationPassResults = $ouMapValidationPassStatusResult.get($chiildorgUnit) )
+			            
+			            #foreach( $result in $dsValidationPassResults )		
+	                        #if($result < 0)
+	                            <td  bgcolor="white">&nbsp;</td>
+	                        #elseif($result == 0)
+	                            <td align="center" bgcolor="#ff0000"><font color="#ffffff">0</font></td>
+	                        #elseif($result == 1)
+	                            <td  align="center" bgcolor="#a0c0a0"><font color="#ffffff">1</font></td>
+	                        #elseif($result > 1)
+	                            <td align="center" bgcolor="#a0c0a0"><font color="#ffffff">$result</font></td>                           
+	                        #end
+	                    #end
+                    </tr>
+                #end
         </table>
-
     </div>
 </form>