← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2925: Hiding static periods/orgunits by default in add reporttable screen

 

Merge authors:
  Lars Helge Øverland (larshelge)
------------------------------------------------------------
revno: 2925 [merge]
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2011-02-26 23:07:25 +0100
message:
  Hiding static periods/orgunits by default in add reporttable screen
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/blue/head.png
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/head.png
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportDesignAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addTableForm.vm
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/table.js


--
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-commons-resources/src/main/webapp/dhis-web-commons/css/blue/head.png'
Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/blue/head.png	2010-11-29 16:55:31 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/blue/head.png	2011-02-26 22:07:25 +0000 differ
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/head.png'
Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/head.png	2010-11-29 16:55:31 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/head.png	2011-02-26 22:07:25 +0000 differ
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportDesignAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportDesignAction.java	2010-12-26 15:38:45 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportDesignAction.java	2011-02-26 22:07:25 +0000
@@ -33,6 +33,7 @@
 
 import org.hisp.dhis.report.Report;
 import org.hisp.dhis.report.ReportService;
+import org.hisp.dhis.system.util.CodecUtils;
 import org.hisp.dhis.util.ContextUtils;
 import org.hisp.dhis.util.StreamActionSupport;
 
@@ -43,6 +44,8 @@
 public class GetReportDesignAction
     extends StreamActionSupport
 {
+    private static final String EXT_JRXML = ".jrxml";
+    
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
@@ -64,6 +67,12 @@
     {
         this.id = id;
     }
+    
+    // -------------------------------------------------------------------------
+    // Output
+    // -------------------------------------------------------------------------
+
+    private String filename;
 
     // -------------------------------------------------------------------------
     // Action implementation
@@ -74,7 +83,12 @@
     {
         Report report = reportService.getReport( id );
         
-        out.write( report.getDesignContent().getBytes() );
+        if ( report.getDesignContent() != null )
+        {
+            out.write( report.getDesignContent().getBytes() );
+        }
+        
+        filename = CodecUtils.filenameEncode( report.getName() ) + EXT_JRXML;
         
         return SUCCESS;    
     }
@@ -88,6 +102,6 @@
     @Override
     protected String getFilename()
     {
-        return "report.jrxml";
+        return filename;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addTableForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addTableForm.vm	2011-02-19 00:09:05 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addTableForm.vm	2011-02-26 19:24:20 +0000
@@ -256,6 +256,14 @@
     
     #end
     
+</table>
+
+<span><a href="javascript:toggleFixedOrganisationUnits()">Toggle fixed organisation units</a>&nbsp;</span>
+
+<div id="fixedOrganisationUnits" style="display:none">
+
+<table>
+	
 	<!-- OrganisationUnits -->
 	
 	<tr>
@@ -305,6 +313,16 @@
 		<td style="height:15px"></td>
 	</tr>
 	
+</table>
+
+</div>
+
+<span><a href="javascript:toggleFixedPeriods()">Toggle fixed periods</a>&nbsp;</span>
+
+<div id="fixedPeriods" style="display:none">
+
+<table>
+	
 	<!-- Periods -->
 	
 	<tr>
@@ -357,10 +375,12 @@
 	
 </table>
 	
+</div>
+	
+<table>	
+
 	<!-- Relative Periods -->
 	
-<table>	
-
 	<tr>
 		<th>$i18n.getString( "relative_periods" )</th>
 	</tr>

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/table.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/table.js	2011-02-19 00:09:05 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/table.js	2011-02-26 19:24:20 +0000
@@ -188,6 +188,16 @@
     }
 }
 
+function toggleFixedOrganisationUnits()
+{
+	$( '#fixedOrganisationUnits' ).toggle( 'fast' );
+}
+
+function toggleFixedPeriods()
+{
+	$( '#fixedPeriods' ).toggle( 'fast' );
+}
+
 // -----------------------------------------------------------------------------
 // Dashboard
 // -----------------------------------------------------------------------------