=== removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/StatisticalProgramDetailsReportAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/StatisticalProgramDetailsReportAction.java 2012-12-17 02:46:17 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/StatisticalProgramDetailsReportAction.java 1970-01-01 00:00:00 +0000 @@ -1,199 +0,0 @@ -/* - * Copyright (c) 2004-2009, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package org.hisp.dhis.caseentry.action.report; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashSet; -import java.util.List; - -import org.hisp.dhis.i18n.I18nFormat; -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.organisationunit.OrganisationUnitService; -import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager; -import org.hisp.dhis.paging.ActionPagingSupport; -import org.hisp.dhis.patient.Patient; -import org.hisp.dhis.program.ProgramStage; -import org.hisp.dhis.program.ProgramStageInstance; -import org.hisp.dhis.program.ProgramStageInstanceService; -import org.hisp.dhis.program.ProgramStageService; - -/** - * @author Chau Thu Tran - * - * @version StatisticalProgramDetailsReportAction.java 12:37:43 PM Dec 16, 2012 - * $ - */ -public class StatisticalProgramDetailsReportAction - extends ActionPagingSupport -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private ProgramStageService programStageService; - - public void setProgramStageService( ProgramStageService programStageService ) - { - this.programStageService = programStageService; - } - - private ProgramStageInstanceService programStageInstanceService; - - public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService ) - { - this.programStageInstanceService = programStageInstanceService; - } - - private OrganisationUnitService organisationUnitService; - - public void setOrganisationUnitService( OrganisationUnitService organisationUnitService ) - { - this.organisationUnitService = organisationUnitService; - } - - private OrganisationUnitSelectionManager selectionManager; - - public void setSelectionManager( OrganisationUnitSelectionManager selectionManager ) - { - this.selectionManager = selectionManager; - } - - private I18nFormat format; - - public void setFormat( I18nFormat format ) - { - this.format = format; - } - - // ------------------------------------------------------------------------- - // Input/output - // ------------------------------------------------------------------------- - - private Integer programStageId; - - public void setProgramStageId( Integer programStageId ) - { - this.programStageId = programStageId; - } - - private String startDate; - - public void setStartDate( String startDate ) - { - this.startDate = startDate; - } - - private String endDate; - - public void setEndDate( String endDate ) - { - this.endDate = endDate; - } - - private Integer status; - - public void setStatus( Integer status ) - { - this.status = status; - } - - private String facilityLB; - - public void setFacilityLB( String facilityLB ) - { - this.facilityLB = facilityLB; - } - - private Integer total; - - public void setTotal( Integer total ) - { - this.total = total; - } - - private ProgramStage programStage; - - public ProgramStage getProgramStage() - { - return programStage; - } - - private List programStageInstances = new ArrayList(); - - public List getProgramStageInstances() - { - return programStageInstances; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - OrganisationUnit organisationUnit = selectionManager.getSelectedOrganisationUnit(); - - programStage = programStageService.getProgramStage( programStageId ); - - Date sDate = format.parseDate( startDate ); - - Date eDate = format.parseDate( endDate ); - - // --------------------------------------------------------------------- - // Get orgunitIds - // --------------------------------------------------------------------- - - Collection orgunitIds = new HashSet(); - - if ( facilityLB.equals( "selected" ) ) - { - orgunitIds.add( organisationUnit.getId() ); - } - else if ( facilityLB.equals( "childrenOnly" ) ) - { - orgunitIds.addAll( organisationUnitService.getOrganisationUnitHierarchy().getChildren( - organisationUnit.getId() ) ); - orgunitIds.remove( organisationUnit.getId() ); - } - else - { - orgunitIds.addAll( organisationUnitService.getOrganisationUnitHierarchy().getChildren( - organisationUnit.getId() ) ); - } - - this.paging = createPaging( total ); - - programStageInstances = programStageInstanceService.getStatisticalProgramStageDetailsReport( programStage, - orgunitIds, sDate, eDate, status, paging.getStartPos(), paging.getPageSize() ); - - 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 2013-03-08 09:15:27 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2013-03-11 03:26:57 +0000 @@ -275,19 +275,6 @@ ref="org.hisp.dhis.program.ProgramStageInstanceService" /> - - - - - - - F_GENERATE_STATISTICAL_PROGRAM_REPORT - - - /content.vm - /dhis-web-caseentry/statisticalProgramDetailsReport.vm - F_GENERATE_STATISTICAL_PROGRAM_REPORT - - + === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/statisticalReport.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/statisticalReport.js 2013-03-08 09:22:54 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/statisticalReport.js 2013-03-11 03:26:57 +0000 @@ -36,80 +36,6 @@ } -function statisticalProgramDetailsReport( programStageId, status, total ) -{ - showLoader(); - hideById( 'reportTbl' ); - hideById( 'detailsDiv' ); - contentDiv = 'detailsDiv'; - jQuery( "#detailsDiv" ).load( "statisticalProgramDetailsReport.action", - { - programStageId: programStageId, - startDate: getFieldValue( 'startDate' ), - endDate: getFieldValue( 'endDate' ), - status:status, - total: total, - facilityLB: $('input[name=facilityLB]:checked').val() - }, function() - { - setFieldValue('status',status); - setFieldValue('total',total); - var programStageTitle = "» " + getStatusString( status ) - + " - " + getFieldValue("programStageName"); - setInnerHTML('programStageTitleLbl', programStageTitle ); - setInnerHTML('totalLbl', i18n_total_result + ": " + total ); - showById('totalLbl'); - showById('programStageTitleLbl'); - showById( 'detailsDiv'); - hideLoader(); - }); -} - -function getStatusString( status ) -{ - switch(status){ - case 1: return i18n_completed; - case 2: return i18n_incomplete; - case 3: return i18n_scheduled; - case 4: return i18n_overdue; - default: return ""; - } -} - -function loadDataEntry( programStageInstanceId ) -{ - hideById("detailsDiv"); - jQuery('#viewRecordsDiv' ) - .load( 'viewProgramStageRecords.action?programStageInstanceId=' + programStageInstanceId - ,function(){ - showById('reportTitle'); - jQuery("#viewRecordsDiv :input" ).attr("disabled", true); - jQuery("#viewRecordsDiv :input" ).datepicker("destroy"); - jQuery(".ui-combobox" ).hide(); - showById("viewRecordsDiv"); - hideById('inputCriteriaDiv'); - hideById('totalLbl'); - }); -} - -function entryFormContainerOnReady(){} - -function showCriteriaForm() -{ - showById('reportForm'); -} - -function showStatisticalReport() -{ - showById('reportTbl'); - hideById('detailsDiv'); - hideById('totalLbl'); - hideById('viewRecordsDiv'); - hideById('programStageTitleLbl'); - hideById('patientNameLbl'); - hideById('totalLbl'); -} - function detailsReport() { hideById('viewRecordsDiv'); === removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/statisticalProgramDetailsReport.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/statisticalProgramDetailsReport.vm 2013-01-23 10:27:28 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/statisticalProgramDetailsReport.vm 1970-01-01 00:00:00 +0000 @@ -1,67 +0,0 @@ - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - #foreach( $programStageInstance in $programStageInstances ) - #set( $patient = $programStageInstance.programInstance.patient ) - - - - - - - - - - - - #end - -
#$i18n.getString( "orgunit" )$i18n.getString('full_name')$i18n.getString( "gender" )$i18n.getString( "date_of_birth" )$i18n.getString( "age" )$i18n.getString( "phone_number" )$i18n.getString( "due_date" )$i18n.getString( "report_date" )
- #set( $nr = ( ( $paging.getCurrentPage() - 1 ) * $paging.pageSize ) + $velocityCount ) - $nr - $!encoder.htmlEncode($!patient.organisationUnit.name)$!encoder.htmlEncode($patient.getFullName())$i18n.getString($!patient.gender)$format.formatDate( $!patient.birthDate)$!patient.getAge()$!patient.phoneNumber$format.formatDate($!programStageInstance.dueDate) - #if($programStageInstance.executionDate) - $format.formatDate($programStageInstance.executionDate) - #end -
-
-

-
- #parse( "/dhis-web-commons/paging/paging.vm" ) -
-
- - \ No newline at end of file