=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/visitplan/VisitPlanAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/visitplan/VisitPlanAction.java 2011-05-12 07:02:28 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/visitplan/VisitPlanAction.java 2011-05-12 08:32:03 +0000 @@ -28,7 +28,10 @@ package org.hisp.dhis.caseentry.action.visitplan; import java.util.Collection; +import java.util.HashSet; +import org.hisp.dhis.organisationunit.OrganisationUnit; +import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager; import org.hisp.dhis.patient.PatientAttribute; import org.hisp.dhis.patient.PatientAttributeService; @@ -47,6 +50,13 @@ // Dependencies // ------------------------------------------------------------------------- + private OrganisationUnitSelectionManager selectionManager; + + public void setSelectionManager( OrganisationUnitSelectionManager selectionManager ) + { + this.selectionManager = selectionManager; + } + private PatientAttributeService patientAttributeService; public void setPatientAttributeService( PatientAttributeService patientAttributeService ) @@ -58,13 +68,20 @@ // Output // ------------------------------------------------------------------------- - private Collection attributes; + private Collection attributes = new HashSet(); public Collection getAttributes() { return attributes; } + private OrganisationUnit organisationUnit; + + public OrganisationUnit getOrganisationUnit() + { + return organisationUnit; + } + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -72,9 +89,12 @@ public String execute() throws Exception { - // --------------------------------------------------------------------- - // Make attributes available so that users can sort based on attributes - // --------------------------------------------------------------------- + organisationUnit = selectionManager.getSelectedOrganisationUnit(); + + if ( organisationUnit == null ) + { + return SUCCESS; + } attributes = patientAttributeService.getAllPatientAttributes(); === removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/visitplan/VisitPlanSelectAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/visitplan/VisitPlanSelectAction.java 2011-03-31 01:49:21 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/visitplan/VisitPlanSelectAction.java 1970-01-01 00:00:00 +0000 @@ -1,82 +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.visitplan; - -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager; - -import com.opensymphony.xwork2.Action; - -/** - * @author Abyot Asalefew Gizaw - * @version $Id$ - */ -public class VisitPlanSelectAction - implements Action -{ - private static final String VISIT_PLAN = "visitplan"; - - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private OrganisationUnitSelectionManager selectionManager; - - public void setSelectionManager( OrganisationUnitSelectionManager selectionManager ) - { - this.selectionManager = selectionManager; - } - - // ------------------------------------------------------------------------- - // Input/output - // ------------------------------------------------------------------------- - - private OrganisationUnit organisationUnit; - - public OrganisationUnit getOrganisationUnit() - { - return organisationUnit; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - organisationUnit = selectionManager.getSelectedOrganisationUnit(); - - if ( organisationUnit == null ) - { - return SUCCESS; - } - - return VISIT_PLAN; - } -} === 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 2011-05-12 07:02:28 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2011-05-12 08:32:03 +0000 @@ -228,17 +228,12 @@ - - - - - + + === 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 2011-05-12 07:02:28 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2011-05-12 08:32:03 +0000 @@ -138,16 +138,7 @@ getDataRecords.action?programId=${programId} - - - - - visitplan - /main.vm - /dhis-web-caseentry/visitPlanSelect.vm - /dhis-web-caseentry/reportsMenu.vm - ../dhis-web-commons/ouwt/ouwt.js,javascript/visitPlan.js - + === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm 2011-04-06 06:44:02 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm 2011-05-12 08:32:03 +0000 @@ -5,6 +5,6 @@ #introListImgItem( "dataEntrySelect.action" "data_entry" "dataentry" ) #introListImgItem( "multipledataEntrySelect.action" "multiple_dataentry" "dataentry" ) #introListImgItem( "reportSelect.action" "summary_report" "summaryreport" ) - #introListImgItem( "visitPlanSelect.action" "visit_plan" "visitplan" ) + #introListImgItem( "visitplan.action" "visit_plan" "visitplan" ) #introListImgItem( "caseAggregationForm.action" "case_aggregation" "caseaggregation" ) \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/visitPlan.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/visitPlan.js 2011-05-12 07:02:28 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/visitPlan.js 2011-05-12 08:32:03 +0000 @@ -3,7 +3,7 @@ function organisationUnitSelected( orgUnits ) { - window.location.href = 'visitPlanSelect.action'; + window.location.href = 'visitplan.action'; } selection.setListenerFunction( organisationUnitSelected ); === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm 2010-08-05 12:25:16 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm 2011-05-12 08:32:03 +0000 @@ -8,7 +8,7 @@

$i18n.getString( "reports" ) 

$i18n.getString( "case_aggregation" ) 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitPlan.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitPlan.vm 2011-05-12 07:02:28 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitPlan.vm 2011-05-12 08:32:03 +0000 @@ -10,7 +10,7 @@ $i18n.getString( "sort_by" ) - #foreach( $attribute in $attributes ) @@ -21,7 +21,5 @@
- -
- #parse ( "/dhis-web-caseentry/loadVisitPlan.vm" ) -
\ No newline at end of file + +
\ No newline at end of file === removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitPlanSelect.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitPlanSelect.vm 2011-03-24 17:27:39 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitPlanSelect.vm 1970-01-01 00:00:00 +0000 @@ -1,12 +0,0 @@ -

$i18n.getString( "visit_plan" )

- - - - - - -
- -
- -