=== 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-09-04 08:21:14 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/widgets.css 2010-09-06 04:44:47 +0000
@@ -4,11 +4,10 @@
.searchOrgunit
{
- display:none;
- position:absolute;
- width: 15.5em;
- margin-left:1em;
- margin-top:-1.5em;
+ display: none;
+ position: absolute;
+ width: 200px;
+ margin-left: 22px;
z-index: 9999;
}
=== 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 2010-09-04 07:26:32 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/orgunittree.vm 2010-09-06 04:44:47 +0000
@@ -1,16 +1,16 @@
-
-
+
+
#macro( parseNode $node )
#if( $node.hasChildren )
@@ -48,4 +48,4 @@
#end
-#end
+#end
\ No newline at end of file
=== 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-09-03 04:31:57 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js 2010-09-06 04:44:47 +0000
@@ -41,7 +41,7 @@
this.select = function( unitId )
{
- var unitTag = document.getElementById( getTagId( unitId ));
+ var unitTag = document.getElementById( getTagId( unitId ) );
var linkTags = unitTag.getElementsByTagName( 'a' );
if ( linkTags[0].className == 'selected' )
@@ -344,13 +344,12 @@
}
function getOrgunitByCode(code)
-{
- $.post(organisationUnitTreePath + "setOrgunitByCode.action",{
- orgunitcode:code
- }, function (data){
- data = data.getElementsByTagName( "message" );;
- if ( data.length == 0 ){
- window.location.reload();
- }
- },'xml');
+{
+ $.getJSON(organisationUnitTreePath + 'getOrganisationUnitByCode.action?code=' + $( '#searchField' ).val(), function (data){
+ if ( data.response == "success" ) {
+ window.location.reload();
+ } else {
+ $( '#searchField' ).css( "background-color", "#ffc5c5" );
+ }
+ } );
}
=== removed 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 2010-09-03 04:31:57 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/responseInput.vm 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-
-$encoder.xmlEncode( $!message )
=== modified 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 2010-09-03 04:31:57 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/action/GetOrganisationUnitByCodeAction.java 2010-09-06 04:44:47 +0000
@@ -45,29 +45,29 @@
// 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;
+ private OrganisationUnitService organisationUnitService;
+
+ public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+ {
+ this.organisationUnitService = organisationUnitService;
+ }
+
+ private OrganisationUnitSelectionManager selectionManager;
+
+ public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
+ {
+ this.selectionManager = selectionManager;
+ }
+
+ // --------------------------------------------------------------------------
+ // Input
+ // --------------------------------------------------------------------------
+
+ private String code;
+
+ public void setCode( String code )
+ {
+ this.code = code;
}
// --------------------------------------------------------------------------
@@ -78,16 +78,15 @@
public String execute()
throws Exception
{
- OrganisationUnit orgunit = orguitService.getOrganisationUnitByCode( orgunitcode );
-
- if ( orgunit != null )
+ OrganisationUnit unit = organisationUnitService.getOrganisationUnitByCode( code );
+
+ if ( unit != null )
{
- orgunitSelectionManager.setSelectedOrganisationUnit( orgunit );
+ selectionManager.setSelectedOrganisationUnit( unit );
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-03 04:31:57 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml 2010-09-06 04:44:47 +0000
@@ -190,12 +190,12 @@
-
+
-
-
-
+
+
+
=== 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-04 08:21:14 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml 2010-09-06 04:44:47 +0000
@@ -211,13 +211,12 @@
plainTextError
-
-
- /dhis-web-commons/ouwt/responseSuccess.vm
-
- /dhis-web-commons/ouwt/responseInput.vm
- plainTextError
+
+ /dhis-web-commons/ajax/jsonResponseSuccess.vm
+
+ /dhis-web-commons/ajax/jsonResponseInput.vm