=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/jdbc/JdbcDataAnalysisStore.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/jdbc/JdbcDataAnalysisStore.java 2012-07-20 07:29:46 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/jdbc/JdbcDataAnalysisStore.java 2012-07-23 12:33:49 +0000 @@ -44,6 +44,7 @@ import org.hisp.dhis.system.objectmapper.DeflatedDataValueNameMinMaxRowMapper; import org.hisp.dhis.system.util.ConversionUtils; import org.hisp.dhis.system.util.TextUtils; +import org.springframework.jdbc.core.JdbcTemplate; /** * @author Lars Helge Overland @@ -68,6 +69,13 @@ { this.statementBuilder = statementBuilder; } + + private JdbcTemplate jdbcTemplate; + + public void setJdbcTemplate( JdbcTemplate jdbcTemplate ) + { + this.jdbcTemplate = jdbcTemplate; + } // ------------------------------------------------------------------------- // OutlierAnalysisStore implementation @@ -117,8 +125,6 @@ public Collection getDataValuesMarkedForFollowup() { - final StatementHolder holder = statementManager.getHolder(); - final String sql = "SELECT dv.dataelementid, dv.periodid, dv.sourceid, dv.categoryoptioncomboid, dv.value, " + "dv.storedby, dv.lastupdated, dv.comment, dv.followup, mm.minvalue, mm.maxvalue, de.name AS dataelementname, " + @@ -132,19 +138,6 @@ "LEFT JOIN _categoryoptioncomboname AS cc ON (dv.categoryoptioncomboid = cc.categoryoptioncomboid) " + "WHERE dv.followup=true"; - try - { - final ResultSet resultSet = holder.getStatement().executeQuery( sql ); - - return new ObjectMapper().getCollection( resultSet, new DeflatedDataValueNameMinMaxRowMapper() ); - } - catch ( SQLException ex ) - { - throw new RuntimeException( "Failed to get deflated data values for followup", ex ); - } - finally - { - holder.close(); - } + return jdbcTemplate.query( sql, new DeflatedDataValueNameMinMaxRowMapper() ); } } === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2012-07-20 11:41:57 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2012-07-23 12:33:49 +0000 @@ -190,6 +190,7 @@ + === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/history.vm' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/history.vm 2012-06-09 22:56:39 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/history.vm 2012-07-23 12:33:49 +0000 @@ -10,7 +10,7 @@ - + + + + + - - - +
+

$i18n.getString( "dataelement_comment" ) #if ( $dataValue && $dataValue.isFollowup() ) @@ -21,13 +21,18 @@ #end

+
+

$encoder.htmlEncode( $i18n.getString( "min_max_limits" ) )

+

-
-

$encoder.htmlEncode( $i18n.getString( "min_max_limits" ) )

+
=== modified file 'resources/sql/div.sql' --- resources/sql/div.sql 2012-07-02 10:21:54 +0000 +++ resources/sql/div.sql 2012-07-23 12:33:49 +0000 @@ -59,15 +59,16 @@ -- Facility overview -- -select ou.name, ou.uid, ou.code, ou.coordinates, oustr.level, gsstr.type, gsstr.ownership, - (select name from organisationunit where organisationunitid=oustr.idlevel2) as province, - (select name from organisationunit where organisationunitid=oustr.idlevel3) as county, - (select name from organisationunit where organisationunitid=oustr.idlevel4) as district -from _orgunitstructure as oustr -join organisationunit as ou on oustr.organisationunitid=ou.organisationunitid -join _organisationunitgroupsetstructure as gsstr on ou.organisationunitid=gsstr.organisationunitid -where oustr.level >= 5 -order by province, county, district, type, ownership, ou.name; +select distinct ous.idlevel5 as internalid, ou.uid, ou.code, ou.name, ougs.type, ougs.ownership, +ou2.name as province, ou3.name as county, ou4.name as district, ou.coordinates as longitide_latitude +from _orgunitstructure ous +left join organisationunit ou on ous.organisationunitid=ou.organisationunitid +left join organisationunit ou2 on ous.idlevel2=ou2.organisationunitid +left join organisationunit ou3 on ous.idlevel3=ou3.organisationunitid +left join organisationunit ou4 on ous.idlevel4=ou4.organisationunitid +left join _organisationunitgroupsetstructure ougs on ous.organisationunitid=ougs.organisationunitid +where ous.level=5 +order by province, county, district, ou.name; -- Compare user roles --