=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonOrganisationUnitGroup.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonOrganisationUnitGroup.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonOrganisationUnitGroup.vm 2011-09-27 08:37:54 +0000
@@ -0,0 +1,7 @@
+{ "organisationUnitGroup":
+ {
+ "id": "$!{organisationUnitGroup.id}",
+ "name": "$!encoder.jsonEncode( ${organisationUnitGroup.name} )",
+ "memberCount": "$!{organisationUnitGroup.members.size()}"
+ }
+}
=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonOrganisationUnitGroupSet.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonOrganisationUnitGroupSet.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonOrganisationUnitGroupSet.vm 2011-09-27 08:37:54 +0000
@@ -0,0 +1,9 @@
+{ "organisationUnitGroupSet":
+ {
+ "id": "${organisationUnitGroupSet.id}",
+ "name": "$!encoder.jsonEncode( ${organisationUnitGroupSet.name} )",
+ "description": "$!encoder.jsonEncode( ${organisationUnitGroupSet.description} )",
+ "compulsory": "$!{organisationUnitGroupSet.compulsory}",
+ "memberCount": "$!{memberCount}"
+ }
+}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/struts.xml 2011-09-14 10:14:11 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/struts.xml 2011-09-27 08:37:54 +0000
@@ -106,8 +106,8 @@
-
- /dhis-web-maintenance-organisationunit/responseOrganisationUnitGroupObject.vm
+
+ /dhis-web-commons/ajax/jsonOrganisationUnitGroup.vm
plainTextError
@@ -166,8 +166,8 @@
-
- /dhis-web-maintenance-organisationunit/responseOrganisationUnitGroupSetObject.vm
+
+ /dhis-web-commons/ajax/jsonOrganisationUnitGroupSet.vm
plainTextError
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js 2011-09-26 09:31:56 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js 2011-09-27 08:37:54 +0000
@@ -29,37 +29,32 @@
function showOrganisationUnitDetails( unitId )
{
- var request = new Request();
- request.setResponseTypeXML( 'organisationUnit' );
- request.setCallbackSuccess( organisationUnitReceived );
- request.send( '../dhis-web-commons-ajax/getOrganisationUnit.action?id=' + unitId );
-}
-
-function organisationUnitReceived( unitElement )
-{
- setInnerHTML( 'nameField', getElementValue( unitElement, 'name' ) );
- setInnerHTML( 'shortNameField', getElementValue( unitElement, 'shortName' ) );
- setInnerHTML( 'openingDateField', getElementValue( unitElement, 'openingDate' ) );
-
- var orgUnitCode = getElementValue( unitElement, 'code' );
- setInnerHTML( 'codeField', orgUnitCode ? orgUnitCode : '[' + none + ']' );
-
- var closedDate = getElementValue( unitElement, 'closedDate' );
- setInnerHTML( 'closedDateField', closedDate ? closedDate : '[' + none + ']' );
-
- var commentValue = getElementValue( unitElement, 'comment' );
- setInnerHTML( 'commentField', commentValue ? commentValue.replace( /\n/g, '
' ) : '[' + none + ']' );
-
- var active = getElementValue( unitElement, 'active' );
- setInnerHTML( 'activeField', active == 'true' ? yes : no );
-
- var url = getElementValue( unitElement, 'url' );
- setInnerHTML( 'urlField', url ? '' + url + '' : '[' + none + ']' );
-
- var lastUpdated = getElementValue( unitElement, 'lastUpdated' );
- setInnerHTML( 'lastUpdatedField', lastUpdated ? lastUpdated : '[' + none + ']' );
-
- showDetails();
+ jQuery.post( '../dhis-web-commons-ajax-json/getOrganisationUnit.action',
+ { id: unitId }, function ( json ) {
+ setInnerHTML( 'nameField', json.organisationUnit.name );
+ setInnerHTML( 'shortNameField', json.organisationUnit.shortName );
+ setInnerHTML( 'openingDateField', json.organisationUnit.openingDate );
+
+ var orgUnitCode = json.organisationUnit.code;
+ setInnerHTML( 'codeField', orgUnitCode ? orgUnitCode : '[' + none + ']' );
+
+ var closedDate = json.organisationUnit.closedDate;
+ setInnerHTML( 'closedDateField', closedDate ? closedDate : '[' + none + ']' );
+
+ var commentValue = json.organisationUnit.comment;
+ setInnerHTML( 'commentField', commentValue ? commentValue.replace( /\n/g, '
' ) : '[' + none + ']' );
+
+ var active = json.organisationUnit.active;
+ setInnerHTML( 'activeField', active == 'true' ? yes : no );
+
+ var url = json.organisationUnit.url;
+ setInnerHTML( 'urlField', url ? '' + url + '' : '[' + none + ']' );
+
+ var lastUpdated = json.organisationUnit.lastUpdated;
+ setInnerHTML( 'lastUpdatedField', lastUpdated ? lastUpdated : '[' + none + ']' );
+
+ showDetails();
+ });
}
// -----------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnitGroup.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnitGroup.js 2010-09-09 09:38:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnitGroup.js 2011-09-27 08:37:54 +0000
@@ -5,18 +5,13 @@
function showOrganisationUnitGroupDetails( unitId )
{
- var request = new Request();
- request.setResponseTypeXML( 'organisationUnitGroup' );
- request.setCallbackSuccess( organisationUnitGroupReceived );
- request.send( 'getOrganisationUnitGroup.action?id=' + unitId );
-}
-
-function organisationUnitGroupReceived( unitGroupElement )
-{
- setInnerHTML( 'nameField', getElementValue( unitGroupElement, 'name' ) );
- setInnerHTML( 'memberCountField', getElementValue( unitGroupElement, 'memberCount' ) );
-
- showDetails();
+ jQuery.post( 'getOrganisationUnitGroup.action', { id: unitId },
+ function ( json ) {
+ setInnerHTML( 'nameField', json.organisationUnitGroup.name );
+ setInnerHTML( 'memberCountField', json.organisationUnitGroup.memberCount );
+
+ showDetails();
+ });
}
// -----------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnitGroupSet.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnitGroupSet.js 2010-12-21 07:10:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnitGroupSet.js 2011-09-27 08:37:54 +0000
@@ -8,31 +8,18 @@
function showOrganisationUnitGroupSetDetails( groupSetId )
{
- var request = new Request();
- request.setResponseTypeXML( 'organisationUnitGroupSet' );
- request.setCallbackSuccess( organisationUnitGroupSetReceived );
- request.send( 'getOrganisationUnitGroupSet.action?id=' + groupSetId );
-}
-
-function organisationUnitGroupSetReceived( unitElement )
-{
- setInnerHTML( 'nameField', getElementValue( unitElement, 'name' ) );
- setInnerHTML( 'descriptionField', getElementValue( unitElement, 'description' ) );
-
- var compulsory = getElementValue( unitElement, 'compulsory' );
-
- if ( compulsory == "true" )
- {
- setInnerHTML( 'compulsoryField', i18n_yes );
- }
- else
- {
- setInnerHTML( 'compulsoryField', i18n_no );
- }
-
- setInnerHTML( 'memberCountField', getElementValue( unitElement, 'memberCount' ) );
-
- showDetails();
+ jQuery.post( 'getOrganisationUnitGroupSet.action', { id: groupSetId },
+ function ( json ) {
+ setInnerHTML( 'nameField', json.organisationUnitGroupSet.name );
+ setInnerHTML( 'descriptionField', json.organisationUnitGroupSet.description );
+
+ var compulsory = json.organisationUnitGroupSet.compulsory;
+
+ setInnerHTML( 'compulsoryField', compulsory == "true" ? i18n_yes : i18n_no );
+ setInnerHTML( 'memberCountField', json.organisationUnitGroupSet.memberCount );
+
+ showDetails();
+ });
}
// -----------------------------------------------------------------------------
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/responseOrganisationUnitGroupObject.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/responseOrganisationUnitGroupObject.vm 2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/responseOrganisationUnitGroupObject.vm 1970-01-01 00:00:00 +0000
@@ -1,6 +0,0 @@
-
-
- $organisationUnitGroup.id
- $encoder.xmlEncode( $organisationUnitGroup.name )
- $memberCount
-
\ No newline at end of file
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/responseOrganisationUnitGroupSetObject.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/responseOrganisationUnitGroupSetObject.vm 2010-02-10 19:12:22 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/responseOrganisationUnitGroupSetObject.vm 1970-01-01 00:00:00 +0000
@@ -1,8 +0,0 @@
-
-
- $organisationUnitGroupSet.id
- $encoder.xmlEncode( $organisationUnitGroupSet.name )
- $encoder.xmlEncode( $organisationUnitGroupSet.description )
- $organisationUnitGroupSet.compulsory
- $memberCount
-
\ No newline at end of file