dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #06118
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1906: Delete table reporttable_categoryoptioncombos which is not in use any more. Update DataElementCat...
------------------------------------------------------------
revno: 1906
committer: Quang <Quang@Quang-PC>
branch nick: trunk
timestamp: Wed 2010-05-26 22:47:51 +0700
message:
Delete table reporttable_categoryoptioncombos which is not in use any more. Update DataElementCategoryComboDeletionHandler.
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/ReportTableDeletionHandler.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/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2010-05-17 14:01:28 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2010-05-26 15:47:51 +0000
@@ -129,6 +129,9 @@
executeSql( "UPDATE patientattribute SET mandatory=false" );
}
+ //drop table reporttable_categoryoptioncombos
+ executeSql( "DROP table reporttable_categoryoptioncombos" );
+
log.info( "Tables updated" );
}
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/ReportTableDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/ReportTableDeletionHandler.java 2010-04-21 14:32:54 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/ReportTableDeletionHandler.java 2010-05-26 15:47:51 +0000
@@ -28,6 +28,7 @@
*/
import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryCombo;
import org.hisp.dhis.dataset.DataSet;
import org.hisp.dhis.indicator.Indicator;
import org.hisp.dhis.period.Period;
@@ -129,4 +130,20 @@
}
}
}
+
+ @Override
+ public boolean allowDeleteDataElementCategoryCombo( DataElementCategoryCombo categoryCombo )
+ {
+ for ( ReportTable reportTable : reportTableService.getAllReportTables() )
+ {
+ DataElementCategoryCombo eachCatCombo = reportTable.getCategoryCombo();
+
+ if ( eachCatCombo != null && eachCatCombo.equals( categoryCombo ) )
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
}