← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11154: PT, fixed issue related to legend sets, proper saving of legend set in favorite

 

------------------------------------------------------------
revno: 11154
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-06-06 09:31:24 +0200
message:
  PT, fixed issue related to legend sets, proper saving of legend set in favorite
modified:
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ReportTableController.java


--
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-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml	2013-06-05 20:11:33 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml	2013-06-06 07:31:24 +0000
@@ -145,7 +145,7 @@
     <property name="userOrganisationUnitChildren" />
 
     <many-to-one name="legendSet" class="org.hisp.dhis.mapping.MapLegendSet" column="legendsetid"
-		cascade="all" foreign-key="fk_reporttable_legendsetid" />
+		foreign-key="fk_reporttable_legendsetid" />
 
     <!-- Access properties -->
     <many-to-one name="user" class="org.hisp.dhis.user.User" column="userid" foreign-key="fk_reporttable_userid" />

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ReportTableController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ReportTableController.java	2013-06-05 20:11:33 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/ReportTableController.java	2013-06-06 07:31:24 +0000
@@ -106,6 +106,9 @@
     
     @Autowired
     private DimensionService dimensionService;
+    
+    @Autowired
+    private MappingService mappingService;
 
     @Autowired
     private I18nManager i18nManager;
@@ -304,6 +307,11 @@
         
         reportTable.getColumnDimensions().addAll( getUniqueDimensions( reportTable.getColumns() ) );
         reportTable.getRowDimensions().addAll( getUniqueDimensions( reportTable.getRows() ) );
-        reportTable.getFilterDimensions().addAll( getUniqueDimensions( reportTable.getFilters() ) );        
+        reportTable.getFilterDimensions().addAll( getUniqueDimensions( reportTable.getFilters() ) );
+        
+        if ( reportTable.getLegendSet() != null )
+        {
+            reportTable.setLegendSet( mappingService.getMapLegendSet( reportTable.getLegendSet().getUid() ) );
+        }
     }
 }