=== renamed file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitLevelsAction.java' => 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllOrganisationUnitLevelsAction.java' --- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitLevelsAction.java 2010-04-12 21:23:33 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllOrganisationUnitLevelsAction.java 2010-12-01 12:16:51 +0000 @@ -38,7 +38,7 @@ * @author Lars Helge Overland * @version $Id$ */ -public class GetOrganisationUnitLevelsAction +public class GetAllOrganisationUnitLevelsAction implements Action { // ------------------------------------------------------------------------- === modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml 2010-11-29 15:44:01 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml 2010-12-01 12:16:51 +0000 @@ -20,13 +20,20 @@ - + + + + === modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml 2010-11-29 15:44:01 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml 2010-12-01 12:16:51 +0000 @@ -40,12 +40,18 @@ - + /dhis-web-mapping/jsonOrganisationUnitLevels.vm + + + /dhis-web-mapping/jsonOrganisationUnitLevels.vm + + === modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/index.html' --- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/index.html 2010-10-29 13:02:44 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/index.html 2010-12-01 12:16:51 +0000 @@ -91,4 +91,4 @@ - \ No newline at end of file + === modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js' --- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js 2010-11-30 14:48:52 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js 2010-12-01 12:16:51 +0000 @@ -231,7 +231,30 @@ }); var organisationUnitLevelStore = new Ext.data.JsonStore({ - url: GLOBAL.conf.path_mapping + 'getOrganisationUnitLevels' + GLOBAL.conf.type, + url: GLOBAL.conf.path_mapping + 'getAllOrganisationUnitLevels' + GLOBAL.conf.type, + root: 'organisationUnitLevels', + fields: ['id', 'level', 'name'], + autoLoad: false, + isLoaded: false, + listeners: { + 'load': function(store) { + store.isLoaded = true; + + if (!symbol.form.findField('level').getValue()) { + if (this.isLoaded) { + var data = this.getAt(this.getTotalCount()-1).data; + symbol.organisationUnitSelection.setValues(null, null, null, data.level, data.name); + symbol.form.findField('level').setValue(data.name); + } + } + // Ext.getCmp('level_cb').mode = 'local'; + } + } + }); + + var polygonOrganisationUnitLevelStore = new Ext.data.JsonStore({ + url: GLOBAL.conf.path_mapping + 'getOrganisationUnitLevelsByFeatureType' + GLOBAL.conf.type, + baseParams: {featureType: GLOBAL.conf.map_feature_type_multipolygon}, root: 'organisationUnitLevels', fields: ['id', 'level', 'name'], autoLoad: false, @@ -348,6 +371,7 @@ predefinedMapLegend: predefinedMapLegendStore, predefinedMapLegendSet: predefinedMapLegendSetStore, organisationUnitLevel: organisationUnitLevelStore, + polygonOrganisationUnitLevel: polygonOrganisationUnitLevelStore, organisationUnitsAtLevel: organisationUnitsAtLevelStore, geojsonFiles: geojsonFilesStore, wmsCapabilities: wmsCapabilitiesStore, @@ -2081,7 +2105,7 @@ Ext.getCmp('vectorlayeroptions_w').destroy(); } - var data = []; + var data = []; for (var i = 0; i < layer.features.length; i++) { data.push([layer.features[i].data.id || i, layer.features[i].data.name]); } === modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js' --- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js 2010-11-30 18:26:00 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js 2010-12-01 12:16:51 +0000 @@ -676,7 +676,7 @@ labelSeparator: GLOBAL.conf.labelseparator, selectOnFocus: true, width: GLOBAL.conf.combo_width, - store: GLOBAL.stores.organisationUnitLevel, + store: GLOBAL.stores.polygonOrganisationUnitLevel, listeners: { 'select': { scope: this,