← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13668: Minor

 

------------------------------------------------------------
revno: 13668
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-01-09 11:26:40 +0100
message:
  Minor
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/ProgramAttributeDeletionHandler.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/ProgramDeletionHandler.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/ProgramInstanceDeletionHandler.java
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonModules.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-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/ProgramAttributeDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/ProgramAttributeDeletionHandler.java	2014-01-08 18:47:27 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/ProgramAttributeDeletionHandler.java	2014-01-09 10:26:40 +0000
@@ -59,6 +59,7 @@
         while ( iterator.hasNext() )
         {
             ProgramPatientAttribute attribute = iterator.next();
+            iterator.remove();
             programAttributeService.deleteProgramPatientAttribute( attribute );
         }
     }

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/ProgramDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/ProgramDeletionHandler.java	2014-01-08 11:18:13 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/ProgramDeletionHandler.java	2014-01-09 10:26:40 +0000
@@ -78,8 +78,6 @@
     @Override
     public void deleteOrganisationUnit( OrganisationUnit unit )
     {
-        // TODO improve performance
-
         Collection<Program> programs = programService.getAllPrograms();
 
         for ( Program program : programs )

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/ProgramInstanceDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/ProgramInstanceDeletionHandler.java	2014-01-07 08:22:52 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/ProgramInstanceDeletionHandler.java	2014-01-09 10:26:40 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.Iterator;
 
 import org.hisp.dhis.patient.Patient;
 import org.hisp.dhis.patientcomment.PatientComment;
@@ -121,9 +121,12 @@
     @Override
     public void deleteProgram( Program program )
     {
-        Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( program );
-        for ( ProgramInstance programInstance : programInstances )
+        Iterator<ProgramInstance> iterator = program.getProgramInstances().iterator();
+        
+        while ( iterator.hasNext() )
         {
+            ProgramInstance programInstance = iterator.next();
+            iterator.remove();
             programInstanceService.deleteProgramInstance( programInstance );
         }
     }

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonModules.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonModules.vm	2014-01-08 17:44:26 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonModules.vm	2014-01-09 10:26:40 +0000
@@ -7,6 +7,6 @@
 "defaultAction":"$!encoder.jsonEncode( $module.defaultAction )",
 "icon":"$!encoder.jsonEncode( $module.icon )",
 "description":"$!encoder.jsonEncode( $module.description )"
-}
+}#if( $velocityCount < $size ),#end
 #end
 ] }
\ No newline at end of file