dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17599
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7060: TB WIP
------------------------------------------------------------
revno: 7060
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-05-28 12:17:04 +0200
message:
TB WIP
modified:
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js
--
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/hibernate/HibernateProgramStageInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java 2012-05-28 09:46:00 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java 2012-05-28 10:17:04 +0000
@@ -53,6 +53,7 @@
import org.hisp.dhis.system.grid.GridUtils;
import org.hisp.dhis.system.grid.ListGrid;
import org.hisp.dhis.system.util.DateUtils;
+import org.hisp.dhis.system.util.TextUtils;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.support.rowset.SqlRowSet;
@@ -296,7 +297,10 @@
sql += "and psi.executiondate >= '" + sDate + "' ";
sql += "and psi.executiondate < '" + eDate + "' ";
- //TODO org unit criteria
+ if ( orgUnits != null )
+ {
+ sql += "and ou.organisationunitid in (" + TextUtils.getCommaDelimitedString( orgUnits ) + ") ";
+ }
sql += "order by ";
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java 2012-05-28 09:46:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java 2012-05-28 10:17:04 +0000
@@ -286,12 +286,20 @@
else if ( facilityLB.equals( "childrenOnly" ) )
{
OrganisationUnit selectedOrgunit = organisationUnitService.getOrganisationUnit( orgunitId );
- organisationUnits.addAll( new HashSet<Integer>( ConversionUtils.getIdentifiers( OrganisationUnit.class, selectedOrgunit.getChildren() ) ) );
+ organisationUnits = new HashSet<Integer>( ConversionUtils.getIdentifiers( OrganisationUnit.class, selectedOrgunit.getChildren() ) );
}
else
{
- Set<Integer> children = organisationUnitService.getOrganisationUnitHierarchy().getChildren( orgunitId );
- organisationUnits.addAll( children );
+ OrganisationUnit selectedOrgunit = organisationUnitService.getOrganisationUnit( orgunitId );
+
+ if ( selectedOrgunit.getParent() == null )
+ {
+ organisationUnits = null; // Ignore org unit criteria when root
+ }
+ else
+ {
+ organisationUnits = organisationUnitService.getOrganisationUnitHierarchy().getChildren( orgunitId );
+ }
}
// ---------------------------------------------------------------------
@@ -450,7 +458,6 @@
}
index++;
}
-
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2012-05-27 21:57:33 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2012-05-28 10:17:04 +0000
@@ -1012,12 +1012,7 @@
datatable: null,
rowEditing: null,
getDataTable: function() {
-
- var paramsLen = TR.cmp.params.identifierType.selected.store.data.length
- + TR.cmp.params.patientAttribute.selected.store.data.length
- + TR.cmp.params.dataelement.selected.store.data.length;
- var metaDatatColsLen = TR.value.columns.length - paramsLen;
-
+
var orgUnitCols = ( TR.init.system.maxLevels + 1 - TR.cmp.settings.level.getValue() );
var index = 0;
var cols = [];