=== 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 2010-08-31 14:34:31 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2010-09-03 04:31:57 +0000 @@ -1057,7 +1057,6 @@ name - title === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml' --- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml 2010-08-31 14:34:31 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml 2010-09-03 04:31:57 +0000 @@ -44,8 +44,8 @@ - + - + === modified file 'dhis-2/dhis-support/dhis-support-external/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-support/dhis-support-external/src/main/resources/META-INF/dhis/beans.xml 2010-06-01 12:03:19 +0000 +++ dhis-2/dhis-support/dhis-support-external/src/main/resources/META-INF/dhis/beans.xml 2010-09-03 04:31:57 +0000 @@ -6,8 +6,7 @@ xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd - http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd" - default-autowire="byName"> + http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"> === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/widgets.css' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/widgets.css 2010-08-25 09:31:57 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/widgets.css 2010-09-03 04:31:57 +0000 @@ -1,3 +1,17 @@ +/*----------------------------------------------------------------------------*/ +/* Search button for orgunit */ +/*----------------------------------------------------------------------------*/ + +.searchOrgunit +{ + display:none; + position:absolute; + position:absolute; + width: 15.5em; + margin-left:1em; + margin-top:-1.5em; + z-index: 9999; +} /*----------------------------------------------------------------------------*/ /* Right bar */ === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/orgunittree.vm' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/orgunittree.vm 2009-10-22 17:22:15 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/orgunittree.vm 2010-09-03 04:31:57 +0000 @@ -1,3 +1,16 @@ + + +  + #macro( parseNode $node ) #if( $node.hasChildren ) === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js 2010-07-23 07:04:03 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js 2010-09-03 04:31:57 +0000 @@ -41,7 +41,6 @@ this.select = function( unitId ) { - var unitTag = document.getElementById( getTagId( unitId )); var linkTags = unitTag.getElementsByTagName( 'a' ); @@ -343,3 +342,15 @@ return imgTag; } } + +function getOrgunitByCode(code) +{ + $.post(organisationUnitTreePath + "setOrgunitByCode.action",{ + orgunitcode:code + }, function (data){ + data = data.getElementsByTagName( "message" );; + if ( data.length == 0 ){ + window.location.reload(); + } + },'xml'); +} === added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/responseInput.vm' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/responseInput.vm 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/responseInput.vm 2010-09-03 04:31:57 +0000 @@ -0,0 +1,2 @@ + +$encoder.xmlEncode( $!message ) === added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/search.png' Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/search.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/search.png 2010-09-03 04:31:57 +0000 differ === added file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/action/GetOrganisationUnitByCodeAction.java' --- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/action/GetOrganisationUnitByCodeAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/action/GetOrganisationUnitByCodeAction.java 2010-09-03 04:31:57 +0000 @@ -0,0 +1,93 @@ +package org.hisp.dhis.ouwt.action; + +/* + * Copyright (c) 2004-2010, 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. + */ + +import org.hisp.dhis.organisationunit.OrganisationUnit; +import org.hisp.dhis.organisationunit.OrganisationUnitService; +import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager; + +import com.opensymphony.xwork2.Action; + +/** + * @author Chau Thu Tran + * @version $Id: GetOrganisationUnitByNameAction.java 5282 2010-08-31 18:41:06Z + * $ + */ +public class GetOrganisationUnitByCodeAction + implements Action +{ + // -------------------------------------------------------------------------- + // Dependencies + // -------------------------------------------------------------------------- + + private OrganisationUnitService orguitService; + + public void setOrguitService( OrganisationUnitService orguitService ) + { + this.orguitService = orguitService; + } + + private OrganisationUnitSelectionManager orgunitSelectionManager; + + public void setOrgunitSelectionManager( OrganisationUnitSelectionManager orgunitSelectionManager ) + { + this.orgunitSelectionManager = orgunitSelectionManager; + } + + // -------------------------------------------------------------------------- + // Setter + // -------------------------------------------------------------------------- + + private String orgunitcode; + + public void setOrgunitcode( String orgunitcode ) + { + this.orgunitcode = orgunitcode; + } + + // -------------------------------------------------------------------------- + // Implementation Action + // -------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + OrganisationUnit orgunit = orguitService.getOrganisationUnitByCode( orgunitcode ); + + if ( orgunit != null ) + { + orgunitSelectionManager.setSelectedOrganisationUnit( orgunit ); + + return SUCCESS; + } + + return INPUT; + } + +} === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml 2010-09-01 16:55:23 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml 2010-09-03 04:31:57 +0000 @@ -187,7 +187,17 @@ - + + + + + + + + + + === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml' --- dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml 2010-09-01 16:55:23 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml 2010-09-03 04:31:57 +0000 @@ -210,6 +210,15 @@ /dhis-web-commons/ouwt/responseSelect.vm plainTextError + + + + /dhis-web-commons/ouwt/responseSelect.vm + + /dhis-web-commons/ouwt/responseInput.vm + plainTextError + === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/dataentryform/AutoSaveDataEntryFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/dataentryform/AutoSaveDataEntryFormAction.java 2010-08-31 14:34:31 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/dataentryform/AutoSaveDataEntryFormAction.java 2010-09-03 04:31:57 +0000 @@ -90,14 +90,14 @@ public String execute() throws Exception - { + { DataSet dataset = dataSetService.getDataSet( dataSetIdField ); DataEntryForm dataEntryForm = dataset.getDataEntryForm(); if ( dataEntryForm == null ) { - dataEntryForm = new DataEntryForm( nameField, designTextarea ); + dataEntryForm = new DataEntryForm( nameField, dataEntryFormService.prepareDataEntryFormCode( designTextarea ) ); dataEntryFormService.addDataEntryForm( dataEntryForm ); dataset.setDataEntryForm(dataEntryForm); @@ -106,11 +106,11 @@ else { dataEntryForm.setName( nameField ); - dataEntryForm.setHtmlCode( dataEntryFormService.prepareDataEntryFormCode(designTextarea )); + dataEntryForm.setHtmlCode( dataEntryFormService.prepareDataEntryFormCode( designTextarea ) ); dataEntryFormService.updateDataEntryForm( dataEntryForm ); } return SUCCESS; } - + }