dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #35273
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18106: Missing deletion handler
------------------------------------------------------------
revno: 18106
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-01-22 18:10:43 +0100
message:
Missing deletion handler
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationDeletionHandler.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-core/src/main/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationDeletionHandler.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/CompleteDataSetRegistrationDeletionHandler.java 2015-01-22 17:10:43 +0000
@@ -28,6 +28,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.period.Period;
import org.hisp.dhis.system.deletion.DeletionHandler;
@@ -88,4 +89,12 @@
{
completeDataSetRegistrationService.deleteCompleteDataSetRegistrations( unit );
}
+
+ @Override
+ public String allowDeleteDataElementCategoryOptionCombo( DataElementCategoryOptionCombo optionCombo )
+ {
+ String sql = "SELECT COUNT(*) FROM completedatasetregistration where attributeoptioncomboid=" + optionCombo.getId();
+
+ return jdbcTemplate.queryForObject( sql, Integer.class ) == 0 ? null : ERROR;
+ }
}