dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20704
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9601: Fix bug - Cannot delete a program.
------------------------------------------------------------
revno: 9601
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-01-24 19:32:08 +0700
message:
Fix bug - Cannot delete a program.
modified:
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/ProgramValidationDeletionHandler.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-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 2012-10-02 08:22:33 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/ProgramInstanceDeletionHandler.java 2013-01-24 12:32:08 +0000
@@ -138,9 +138,12 @@
}
@Override
- public String allowDeleteProgram( Program program )
+ public void deleteProgram( Program program )
{
Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( program );
- return (programInstances != null && programInstances.size() > 0) ? null : ERROR;
+ for( ProgramInstance programInstance : programInstances)
+ {
+ programInstanceService.deleteProgramInstance( programInstance );
+ }
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/ProgramValidationDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/ProgramValidationDeletionHandler.java 2011-08-25 06:45:35 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/ProgramValidationDeletionHandler.java 2013-01-24 12:32:08 +0000
@@ -57,7 +57,7 @@
@Override
public String getClassName()
{
- return Program.class.getSimpleName();
+ return ProgramValidation.class.getSimpleName();
}
@Override