← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8849: Updated chart deletion handler

 

------------------------------------------------------------
revno: 8849
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2012-11-04 10:29:27 +0300
message:
  Updated chart deletion handler
modified:
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/ChartDeletionHandler.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/java/org/hisp/dhis/chart/ChartDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/ChartDeletionHandler.java	2012-07-01 11:33:07 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/ChartDeletionHandler.java	2012-11-04 07:29:27 +0000
@@ -31,6 +31,7 @@
 
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.period.Period;
 import org.hisp.dhis.system.deletion.DeletionHandler;
 import org.hisp.dhis.user.User;
 
@@ -63,6 +64,20 @@
     }
 
     @Override
+    public String allowDeletePeriod( Period period )
+    {
+        for ( Chart chart : chartService.getAllCharts() )
+        {
+            if ( chart.getPeriods().contains( period ) )
+            {
+                return chart.getName();
+            }
+        }
+        
+        return null;
+    }
+
+    @Override
     public void deleteIndicator( Indicator indicator )
     {
         for ( Chart chart : chartService.getAllCharts() )