← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7382: Show the total events in anonymous form.

 

------------------------------------------------------------
revno: 7382
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-06-25 21:27:43 +0700
message:
  Show the total events in anonymous form.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstancesList.vm


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java	2012-06-24 14:29:16 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java	2012-06-25 14:27:43 +0000
@@ -105,7 +105,7 @@
     {
         this.patientAttributeService = patientAttributeService;
     }
-    
+
     private PatientIdentifierTypeService patientIdentifierTypeService;
 
     public void setPatientIdentifierTypeService( PatientIdentifierTypeService patientIdentifierTypeService )
@@ -180,6 +180,18 @@
         return grid;
     }
 
+    private int totalRecords;
+
+    public int getTotalRecords()
+    {
+        return totalRecords;
+    }
+
+    public void setTotal( Integer total )
+    {
+        this.total = total;
+    }
+
     private Integer total;
 
     public Integer getTotal()
@@ -304,30 +316,31 @@
         Date startValue = format.parseDate( startDate );
         Date endValue = format.parseDate( endDate );
         List<TabularReportColumn> columns = getTableColumns();
-        
+
         // ---------------------------------------------------------------------
         // Generate tabular report
         // ---------------------------------------------------------------------
 
         if ( type == null ) // Tabular report
         {
-            int totalRecords = programStageInstanceService.getTabularReportCount( programStage, columns,
-                organisationUnits, level, startValue, endValue );
+            totalRecords = programStageInstanceService.getTabularReportCount( programStage, columns, organisationUnits,
+                level, startValue, endValue );
 
             total = getNumberOfPages( totalRecords );
 
             this.paging = createPaging( totalRecords );
             // total = paging.getTotal(); //TODO
 
-            grid = programStageInstanceService.getTabularReport( programStage, columns, organisationUnits,
-                level, startValue, endValue, !orderByOrgunitAsc, paging.getStartPos(), paging.getPageSize() );
+            grid = programStageInstanceService.getTabularReport( programStage, columns, organisationUnits, level,
+                startValue, endValue, !orderByOrgunitAsc, paging.getStartPos(), paging.getPageSize() );
         }
-        else // Download as Excel        
+        else
+        // Download as Excel
         {
-            grid = programStageInstanceService.getTabularReport( programStage, columns, organisationUnits,
-                level, startValue, endValue, !orderByOrgunitAsc, null, null );
+            grid = programStageInstanceService.getTabularReport( programStage, columns, organisationUnits, level,
+                startValue, endValue, !orderByOrgunitAsc, null, null );
         }
-        
+
         System.out.println();
         System.out.println( grid );
 
@@ -347,18 +360,18 @@
     private List<TabularReportColumn> getTableColumns()
     {
         List<TabularReportColumn> columns = new ArrayList<TabularReportColumn>();
-        
+
         int index = 0;
-        
+
         for ( String searchValue : searchingValues )
         {
             String[] values = searchValue.split( "_" );
             String prefix = values[0];
-            
+
             TabularReportColumn column = new TabularReportColumn();
             column.setPrefix( prefix );
             column.setIdentifier( values[1] );
-            column.setHidden( Boolean.parseBoolean( values[2] ) );            
+            column.setHidden( Boolean.parseBoolean( values[2] ) );
             column.setQuery( values.length == 4 ? TextUtils.lower( values[3] ) : null );
 
             if ( PREFIX_FIXED_ATTRIBUTE.equals( prefix ) )
@@ -367,8 +380,9 @@
             }
             else if ( PREFIX_IDENTIFIER_TYPE.equals( prefix ) )
             {
-                PatientIdentifierType identifierType = patientIdentifierTypeService.getPatientIdentifierType( column.getIdentifierAsInt() );
-                
+                PatientIdentifierType identifierType = patientIdentifierTypeService.getPatientIdentifierType( column
+                    .getIdentifierAsInt() );
+
                 column.setName( identifierType.getName() );
             }
             else if ( PREFIX_PATIENT_ATTRIBUTE.equals( prefix ) )
@@ -376,10 +390,10 @@
                 int objectId = Integer.parseInt( values[1] );
                 PatientAttribute attribute = patientAttributeService.getPatientAttribute( objectId );
                 patientAttributes.add( attribute );
-                
+
                 valueTypes.add( attribute.getValueType() );
                 mapSuggestedValues.put( index, getSuggestedAttributeValues( attribute ) );
-                
+
                 column.setName( attribute.getName() );
             }
             else if ( PREFIX_DATA_ELEMENT.equals( prefix ) )
@@ -391,15 +405,15 @@
                 String valueType = dataElement.getOptionSet() != null ? VALUE_TYPE_OPTION_SET : dataElement.getType();
                 valueTypes.add( valueType );
                 mapSuggestedValues.put( index, getSuggestedDataElementValues( dataElement ) );
-                
+
                 column.setName( dataElement.getName() );
             }
-            
+
             columns.add( column );
-            
+
             index++;
         }
-        
+
         return columns;
     }
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstancesList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstancesList.vm	2012-06-25 02:11:55 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstancesList.vm	2012-06-25 14:27:43 +0000
@@ -10,7 +10,7 @@
 		<td class='text-column'>$i18n.getString( "total_result" )</td>
 		<td>&nbsp;</td>
 		<td>&nbsp;</td>
-		<td>$!total</td>
+		<td>$!totalRecords</td>
 	</tr>
 </table>