=== 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-03-07 05:54:02 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java 2012-03-09 04:46:32 +0000 @@ -261,7 +261,7 @@ String condition = " WHERE psi.duedate >= '" + DateUtils.getMediumDateString( startDate ) + "' AND psi.duedate <= '" + DateUtils.getMediumDateString( endDate ) + "' " - + " AND psi.organisationunitid in( " + orgunitIds + ") "; + + " AND psi.organisationunitid in " + splitListHelper ( orgunitIds ) + " "; Iterator keys = searchingKeys.keySet().iterator(); boolean index = false; @@ -335,5 +335,34 @@ holder.close(); } } + + /** + * Splits a list of integers by comma. Use this method if you have a list + * that will be used in f.ins. a WHERE xxx IN (list) clause in SQL. + * + * @param Collection list of Integers + * @return the list as a string splitted by a comma. + */ + private String splitListHelper( Collection list ) + { + StringBuffer sb = new StringBuffer(); + int count = 0; + + sb.append( "(" ); + for ( Integer i : list ) + { + sb.append( i ); + + count++; + + if ( count < list.size() ) + { + sb.append( "," ); + } + } + sb.append( ")" ); + + return sb.toString(); + } } === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java 2012-02-27 05:35:23 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java 2012-03-09 04:46:32 +0000 @@ -188,11 +188,11 @@ return SUCCESS; } - if ( facilityLB.equals( "random" ) ) + if ( facilityLB.equals( "selected" ) ) { orgunits.add( selectedOrgunit ); } - else if ( facilityLB.equals( "immChildren" ) ) + else if ( facilityLB.equals( "childrenOnly" ) ) { orgunits.addAll( getChildOrgUnitTree( selectedOrgunit ) ); } === 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-03-07 05:54:02 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java 2012-03-09 04:46:32 +0000 @@ -203,7 +203,7 @@ Set orgunitIds = new HashSet(); - if ( facilityLB.equals( "random" ) ) + if ( facilityLB.equals( "selected" ) ) { orgunitIds.add( selectedOrgunit.getId() ); } @@ -215,7 +215,7 @@ orgunitIds.addAll( childOrgUnitIdentifiers ); - if ( facilityLB.equals( "immChildren" ) ) + if ( facilityLB.equals( "childrenOnly" ) ) { orgunitIds.remove( selectedOrgunit.getId() ); } === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/TabularReportSelectAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/TabularReportSelectAction.java 2012-03-05 04:22:57 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/TabularReportSelectAction.java 2012-03-09 04:46:32 +0000 @@ -29,8 +29,6 @@ import java.util.Collection; -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager; import org.hisp.dhis.program.Program; import org.hisp.dhis.program.ProgramService; @@ -47,14 +45,7 @@ // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- - - private OrganisationUnitSelectionManager selectionManager; - - public void setSelectionManager( OrganisationUnitSelectionManager selectionManager ) - { - this.selectionManager = selectionManager; - } - + private ProgramService programService; public void setProgramService( ProgramService programService ) @@ -66,13 +57,6 @@ // Dependencies // ------------------------------------------------------------------------- - private OrganisationUnit orgunit; - - public OrganisationUnit getOrgunit() - { - return orgunit; - } - private Collection programs; public Collection getPrograms() @@ -86,9 +70,7 @@ public String execute() { - orgunit = selectionManager.getSelectedOrganisationUnit(); - - programs = programService.getPrograms( orgunit ); + programs = programService.getAllPrograms(); return SUCCESS; } === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-03-08 04:56:36 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-03-09 04:46:32 +0000 @@ -256,8 +256,6 @@ - === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2012-03-09 01:56:35 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2012-03-09 04:46:32 +0000 @@ -76,8 +76,7 @@ value_must_negative_integer=Value must be an negative integer days=days please_select=Please select -immediate_children=Immediate Children -all_children=All children +children_only=Children Only aggregate=Aggregate added=Added updated=Updated @@ -271,4 +270,5 @@ program_enrollment = Program enrollment date_of_enrollment=Date of enrollment date_of_incident=Date of incident -patient_details_and_history = Beneficiary details and history \ No newline at end of file +patient_details_and_history = Beneficiary details and history +selected = Selected === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2012-03-08 04:56:36 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2012-03-09 04:46:32 +0000 @@ -265,7 +265,7 @@ ../dhis-web-caseentry/style/report.css - /dhis-web-caseentry/responsePrograms.vm === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/caseAggregationForm.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/caseAggregationForm.vm 2012-03-08 06:39:51 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/caseAggregationForm.vm 2012-03-09 04:46:32 +0000 @@ -45,17 +45,17 @@ - + $i18n.getString( "facility_by" ) === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/tabularReport.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/tabularReport.js 2012-03-07 05:54:02 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/tabularReport.js 2012-03-09 04:46:32 +0000 @@ -5,7 +5,7 @@ clearListById( 'programStageId' ); clearListById( 'availableDataElementIds' ); - $.getJSON( 'loadProgramsByOrgunit.action',{} + $.getJSON( 'loadAllPrograms.action',{} , function( json ) { clearListById( 'programId' ); @@ -14,7 +14,9 @@ var preSelectedProgramId = getFieldValue('selectedProgramId'); for ( i in json.programs ) { - $('#programId').append(''); + $('#programId').append( '' ); } if( json.programs.length > 0 ) @@ -50,12 +52,21 @@ } , function( json ) { - addOptionById( 'programStageId', '', i18n_please_select ); + var singleEvent = jQuery('#programId option:selected').attr('singleevent'); + if(singleEvent=='false') + { + addOptionById( 'programStageId', '', i18n_please_select ); + } for ( i in json.programStages ) { $('#programStageId').append(''); } + + if(singleEvent=='true') + { + loadDataElements(); + } } ); } === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePrograms.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePrograms.vm 2011-12-28 06:21:57 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePrograms.vm 2012-03-09 04:46:32 +0000 @@ -4,7 +4,8 @@ #foreach( $program in $programs ) { "id": ${program.id} , - "name": "$!encoder.jsonEncode( ${program.name} )" + "name": "$!encoder.jsonEncode( ${program.name} )", + "singleEvent": "$program.singleEvent" }#if( $velocityCount < $size ),#end #end] } \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTabularReportResult.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTabularReportResult.vm 2012-03-05 06:07:54 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTabularReportResult.vm 2012-03-09 04:46:32 +0000 @@ -2,7 +2,7 @@ #set( $mark = false ) #set( $i = 1 ) #foreach( $row in $grid.getVisibleRows() ) - + #set( $nr = ( ( $paging.getCurrentPage() - 1 ) * $paging.pageSize ) + $velocityCount ) $nr === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/report.css' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/report.css 2012-03-07 05:54:02 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/report.css 2012-03-09 04:46:32 +0000 @@ -27,9 +27,9 @@ width:75%; } -.grid tr { - background-color:#eee; - } +.filter { background: #cccccc; } + +.rowGrid{ background-color:#eee; } .grid th, .grid td { @@ -39,8 +39,6 @@ border:1px solid #fff; } -.small-button { - font-size: .8em !important; -} +.small-button { font-size: .8em !important; } .ui-autocomplete { height: 100px; overflow-y: scroll; overflow-x: hidden;} \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/tabularReportResult.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/tabularReportResult.vm 2012-03-05 06:07:54 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/tabularReportResult.vm 2012-03-09 04:46:32 +0000 @@ -15,15 +15,16 @@ - + #foreach( $dataElement in $dataElements ) #end - - + + + #foreach( $dataElement in $dataElements ) - + - - + - - - + + + + + + + + + + + - - - - +
# $!encoder.htmlEncode( $dataElement.name )
$i18n.getString('filter') === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/tabularReportSelect.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/tabularReportSelect.vm 2012-03-08 08:56:27 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/tabularReportSelect.vm 2012-03-09 04:46:32 +0000 @@ -17,20 +17,21 @@
- + $i18n.getString( "facility_by" ) + + -
@@ -49,6 +50,20 @@
+ +
@@ -81,18 +96,7 @@

- $i18n.getString( "facility_by" ) - - -