=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/oust.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/oust.js 2012-03-02 09:08:35 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/oust.js 2012-03-02 11:49:40 +0000 @@ -40,10 +40,15 @@ { return selectedOrganisationUnit; }; + + this.isSelected = function() + { + return selectedOrganisationUnit && selectedOrganisationUnit.length > 0; + } this.select = function( unitId ) { - if ( onSelectFunction ) + if ( onSelectFunction ) { onSelectFunction(); } @@ -88,11 +93,6 @@ function responseReceived( json ) { - if ( !listenerFunction ) - { - return; - } - selectedOrganisationUnit = new Array(); var unitIds = new Array(); @@ -104,7 +104,11 @@ } jQuery("body").trigger("oust.selected", selectedOrganisationUnit); - listenerFunction( unitIds ); + + if ( listenerFunction ) + { + listenerFunction( unitIds ); + } } function getTagId( unitId ) @@ -123,8 +127,7 @@ { $.ajax({ url: selectionTreePath + "clearSelectedOrganisationUnits.action", - async: false, - dataType: "xml" + async: false }); }; === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/inputReportParamsForm.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/inputReportParamsForm.vm 2012-02-12 12:21:49 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/inputReportParamsForm.vm 2012-03-02 11:49:40 +0000 @@ -1,13 +1,17 @@

$i18n.getString( "report_table_parameters" )

@@ -48,13 +52,7 @@ -
- +
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/generateReport.js' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/generateReport.js 2012-02-12 12:21:49 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/generateReport.js 2012-03-02 11:49:40 +0000 @@ -2,23 +2,12 @@ var MODE_TABLE = "table"; // ----------------------------------------------------------------------------- -// Report params -// ----------------------------------------------------------------------------- - -var paramOrganisationUnit = null; - -function paramOrganisationUnitSet( id ) -{ - paramOrganisationUnit = id; -} - -// ----------------------------------------------------------------------------- // Validation // ----------------------------------------------------------------------------- function validationError() { - if ( $( "#selectionTree" ).length && paramOrganisationUnit == null ) + if ( $( "#selectionTree" ).length && !selectionTreeSelection.isSelected() ) { setMessage( i18n_please_select_unit ); return true; @@ -63,9 +52,9 @@ url += "&reportingPeriod=" + $( "#reportingPeriod" ).val(); } - if ( paramOrganisationUnit != null ) + if ( selectionTreeSelection.isSelected() ) { - url += "&organisationUnitId=" + paramOrganisationUnit; + url += "&organisationUnitId=" + selectedOrganisationUnit[0]; } return url;