← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4618: Added a parameter for wheter to include the organisation unit group sets map in jasper reports

 

------------------------------------------------------------
revno: 4618
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-09-19 15:34:58 +0200
message:
  Added a parameter for wheter to include the organisation unit group sets map in jasper reports
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/Report.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/report/impl/DefaultReportService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/report/hibernate/Report.hbm.xml
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/AddReportAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addReportForm.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/report/Report.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/Report.java	2011-07-22 04:09:05 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/Report.java	2011-09-19 13:34:58 +0000
@@ -51,6 +51,8 @@
 
     private ReportTable reportTable;
 
+    private Boolean usingOrgUnitGroupSets;
+    
     private Set<ReportGroup> groups = new HashSet<ReportGroup>();
 
     // -------------------------------------------------------------------------
@@ -104,6 +106,11 @@
     {
         return reportTable != null;
     }
+    
+    public boolean isUsingOrganisationUnitGroupSets()
+    {
+        return usingOrgUnitGroupSets != null && usingOrgUnitGroupSets;
+    }
 
     // -------------------------------------------------------------------------
     // Equals and hashCode
@@ -168,6 +175,16 @@
         this.reportTable = reportTable;
     }
 
+    public Boolean getUsingOrgUnitGroupSets()
+    {
+        return usingOrgUnitGroupSets;
+    }
+
+    public void setUsingOrgUnitGroupSets( Boolean usingOrgUnitGroupSets )
+    {
+        this.usingOrgUnitGroupSets = usingOrgUnitGroupSets;
+    }
+
     public Set<ReportGroup> getGroups()
     {
         return groups;

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/report/impl/DefaultReportService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/report/impl/DefaultReportService.java	2011-09-18 14:36:11 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/report/impl/DefaultReportService.java	2011-09-19 13:34:58 +0000
@@ -131,7 +131,10 @@
             {
                 ReportTable reportTable = report.getReportTable();
                 
-                params.putAll( reportTable.getOrganisationUnitGroupMap( organisationUnitGroupService.getCompulsoryOrganisationUnitGroupSets() ) );
+                if ( report.isUsingOrganisationUnitGroupSets() )
+                {
+                    params.putAll( reportTable.getOrganisationUnitGroupMap( organisationUnitGroupService.getCompulsoryOrganisationUnitGroupSets() ) );
+                }
                 
                 Grid grid = reportTableService.getReportTableGrid( reportTable.getId(), format, reportingPeriod, organisationUnitId );
                 

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/report/hibernate/Report.hbm.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/report/hibernate/Report.hbm.xml	2011-07-28 03:25:28 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/report/hibernate/Report.hbm.xml	2011-09-19 13:34:58 +0000
@@ -21,12 +21,13 @@
     <many-to-one name="reportTable" class="org.hisp.dhis.reporttable.ReportTable" column="reporttableid"
       foreign-key="fk_report_reporttableid" />
 	  
+	<property name="usingOrgUnitGroupSets"/>
+	  
 	<set name="groups" table="reportgroupmembers" inverse="true">
 	  <cache usage="read-write" />
 	  <key column="reportid" />
 	  <many-to-many class="org.hisp.dhis.report.ReportGroup" column="reportgroupid" />
 	</set>
 	
-
   </class>
 </hibernate-mapping>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/AddReportAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/AddReportAction.java	2011-05-05 21:15:45 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/AddReportAction.java	2011-09-19 13:34:58 +0000
@@ -102,6 +102,13 @@
         this.reportTableId = reportTableId;
     }
 
+    private boolean usingOrgUnitGroupSets;
+    
+    public void setUsingOrgUnitGroupSets( boolean usingOrgUnitGroupSets )
+    {
+        this.usingOrgUnitGroupSets = usingOrgUnitGroupSets;
+    }
+
     private File file;
 
     public void setUpload( File file )
@@ -183,6 +190,7 @@
         
         report.setName( name );
         report.setReportTable( reportTableService.getReportTable( reportTableId ) );
+        report.setUsingOrgUnitGroupSets( usingOrgUnitGroupSets );
                 
         log.info( "Upload file name: " + fileName + ", content type: " + contentType );
 

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties	2011-09-16 09:29:21 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties	2011-09-19 13:34:58 +0000
@@ -386,4 +386,5 @@
 range_axis_label_y = Range axis label (y)
 leaf_parent_organisation_unit = Leaf organisation units
 reporting_bimonth = Reporting bimonth
-reporting_quarter = Reporting quarter
\ No newline at end of file
+reporting_quarter = Reporting quarter
+include_organisation_unit_group_sets = Include org unit group sets param
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addReportForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addReportForm.vm	2011-04-15 14:57:44 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addReportForm.vm	2011-09-19 13:34:58 +0000
@@ -38,6 +38,15 @@
 		</td>
 	</tr>
 	<tr>
+		<td><label for="usingOrgUnitGroupSets">$i18n.getString( "include_organisation_unit_group_sets" )</label></td>
+		<td>
+			<select id="usingOrgUnitGroupSets" name="usingOrgUnitGroupSets" style="min-width:325px">
+			<option value="false"#if ( $report && $report.usingOrgUnitGroupSets )selected="selected"#end>$i18n.getString( "no" )</option>
+			<option value="true"#if ( $report && $report.usingOrgUnitGroupSets )selected="selected"#end>$i18n.getString( "yes" )</option>			
+			</select>
+		</td>
+	</tr>
+	<tr>
 		<td></td>
 		<td>
 			<input type="button" value="$i18n.getString( 'save' )" style="width:10em" onclick="addReport()" />