← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1202: Total columns are now included in report table views/exports.

 

------------------------------------------------------------
revno: 1202
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Thu 2009-12-10 14:30:07 +0100
message:
  Total columns are now included in report table views/exports.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java
  dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/location/DefaultLocationManager.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/responseReportTableData.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-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2009-12-10 09:13:44 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2009-12-10 13:30:07 +0000
@@ -82,6 +82,7 @@
 
     public static final String TOTAL_COLUMN_NAME = "total";
     public static final String TOTAL_COLUMN_PREFIX = "total_";
+    public static final String TOTAL_COLUMN_PRETTY_PREFIX = "Total ";
     
     public static final String REGRESSION_COLUMN_PREFIX = "regression_";
     
@@ -578,8 +579,12 @@
             {
                 for ( DimensionOption dimensionOption : dimension.getDimensionOptions() )
                 {
+                    String columnName = databaseEncode( TOTAL_COLUMN_PREFIX + dimensionOption.getName() );
+                    String prettyColumnName = TOTAL_COLUMN_PRETTY_PREFIX + dimensionOption.getName();
+                    
                     dimensionOptions.add( dimensionOption );
-                    dimensionOptionColumns.add( databaseEncode( TOTAL_COLUMN_PREFIX + dimensionOption.getName() ) );
+                    dimensionOptionColumns.add( columnName );
+                    prettyCrossTabColumns.put( columnName, prettyColumnName );
                 }
             }
         }
@@ -646,6 +651,12 @@
         columns.addAll( getIndexNameColumns() );
         columns.add( ReportTable.REPORTING_MONTH_COLUMN_NAME );
         columns.addAll( getCrossTabColumns() );
+        columns.addAll( getDimensionOptionColumns() );
+        
+        if ( doTotal() )
+        {
+            columns.add( TOTAL_COLUMN_NAME );
+        }
         
         if ( isRegression() )
         {

=== modified file 'dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/location/DefaultLocationManager.java'
--- dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/location/DefaultLocationManager.java	2009-11-29 21:46:31 +0000
+++ dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/location/DefaultLocationManager.java	2009-12-10 13:30:07 +0000
@@ -50,8 +50,8 @@
 {
     private static final Log log = LogFactory.getLog( DefaultLocationManager.class );
 
-    private static String LINUX_DEFAULT_DHIS2_HOME = "/opt/dhis2";
-    private static String LINUX_OS_NAME = "Linux";
+    private static final String LINUX_DEFAULT_DHIS2_HOME = "/opt/dhis2";
+    //private static final String LINUX_OS_NAME = "Linux";
 
     private String externalDir = null;
 
@@ -110,10 +110,12 @@
             {
                 log.info( "Environment variable " + environmentVariable + " not set" );
                 // if Linux try fallback to /opt/dhis2
-                //if ( LINUX_OS_NAME.equals( System.getProperty("os.name") )) {
-                if (true) {
+                // if ( LINUX_OS_NAME.equals( System.getProperty("os.name") ) ) 
+                if ( true )
+                {
                     path = LINUX_DEFAULT_DHIS2_HOME;
-                    if (directoryIsValid(new File(path))) {
+                    if ( directoryIsValid( new File( path ) ) )
+                    {
                         externalDir = path;
                         log.info( "externalDir set to " + LINUX_DEFAULT_DHIS2_HOME );
                     }

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/responseReportTableData.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/responseReportTableData.vm	2009-05-20 08:31:50 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/responseReportTableData.vm	2009-12-10 13:30:07 +0000
@@ -9,7 +9,7 @@
     </tr>
     <tr>
     #foreach( $column in $data.prettyPrintColumns )
-        <td class="reportTableHeader">$column</td>
+        <td class="reportTableHeader" style="min-width:100px">$column</td>
     #end
     </tr>
     #set( $mark = false )