=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js' --- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js 2011-03-29 11:26:20 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js 2011-03-30 10:29:53 +0000 @@ -221,28 +221,6 @@ 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); - } - } - } - } - }); - - var polygonOrganisationUnitLevelStore = new Ext.data.JsonStore({ - url: G.conf.path_mapping + 'getOrganisationUnitLevelsByFeatureType' + G.conf.type, - baseParams: {featureType: G.conf.map_feature_type_multipolygon}, - root: 'organisationUnitLevels', - fields: ['id', 'level', 'name'], - autoLoad: false, - isLoaded: false, - listeners: { 'load': G.func.storeLoadListener } }); @@ -280,19 +258,6 @@ } }); - var baseLayerStore = new Ext.data.JsonStore({ - url: G.conf.path_mapping + 'getMapLayersByType' + G.conf.type, - baseParams: {type: G.conf.map_layer_type_baselayer}, - root: 'mapLayers', - fields: ['id', 'name', 'type', 'mapSource', 'layer', 'fillColor', 'fillOpacity', 'strokeColor', 'strokeWidth'], - sortInfo: {field: 'name', direction: 'ASC'}, - autoLoad: false, - isLoaded: false, - listeners: { - 'load': G.func.storeLoadListener - } - }); - var overlayStore = new Ext.data.JsonStore({ url: G.conf.path_mapping + 'getMapLayersByType' + G.conf.type, baseParams: {type: G.conf.map_layer_type_overlay}, @@ -306,16 +271,6 @@ } }); - var userSettingStore = new Ext.data.JsonStore({ - url: G.conf.path_mapping + 'getMapUserSettings' + G.conf.type, - fields: ['mapDateType'], - autoLoad: false, - isLoaded: false, - listeners: { - 'load': G.func.storeLoadListener - } - }); - G.stores = { mapView: mapViewStore, polygonMapView: polygonMapViewStore, @@ -331,11 +286,9 @@ predefinedMapLegend: predefinedMapLegendStore, predefinedMapLegendSet: predefinedMapLegendSetStore, organisationUnitLevel: organisationUnitLevelStore, - polygonOrganisationUnitLevel: polygonOrganisationUnitLevelStore, organisationUnitsAtLevel: organisationUnitsAtLevelStore, geojsonFiles: geojsonFilesStore, wmsCapabilities: wmsCapabilitiesStore, - baseLayer: baseLayerStore, overlay: overlayStore }; @@ -2317,12 +2270,6 @@ listeners: { 'expand': function() { G.vars.activePanel.setPoint(); - - if (!this.form.findField('level').getValue()) { - if (!G.stores.organisationUnitLevel.isLoaded) { - G.stores.organisationUnitLevel.load(); - } - } }, 'afterrender': function() { this.layer.widget = this; === 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 2011-03-29 10:27:11 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js 2011-03-30 10:34:03 +0000 @@ -586,7 +586,6 @@ xtype: 'textfield', name: 'boundary', fieldLabel: G.i18n.boundary, - editable: false, emptyText: G.conf.emptytext, labelSeparator: G.conf.labelseparator, width: G.conf.combo_width, @@ -614,7 +613,6 @@ xtype: 'textfield', name: 'level', fieldLabel: G.i18n.level, - editable: false, emptyText: G.conf.emptytext, labelSeparator: G.conf.labelseparator, width: G.conf.combo_width, @@ -919,7 +917,7 @@ fieldLabel: 'Level', width: G.conf.combo_width_fieldset, minListWidth: G.conf.combo_width_fieldset, - store: G.stores.polygonOrganisationUnitLevel, + store: G.stores.organisationUnitLevel, listeners: { 'afterrender': { scope: this, @@ -968,8 +966,8 @@ ] }); - var x = Ext.getCmp('center').x + 15; - var y = Ext.getCmp('center').y + 41; + var x = Ext.getCmp('center').x + G.conf.window_position_x; + var y = Ext.getCmp('center').y + G.conf.window_position_y; w.setPosition(x,y); w.show(); this.form.findField('boundary').treeWindow = w; @@ -1430,7 +1428,7 @@ this.form.findField('bounds').reset(); this.layer.destroyFeatures(); - this.layer.setVisibility(false); + this.layer.setVisibility(false); } }, @@ -1474,7 +1472,7 @@ parentId: this.organisationUnitSelection.parent.id, level: this.organisationUnitSelection.level.level }; - + Ext.Ajax.request({ url: G.conf.path_mapping + dataUrl + G.conf.type, method: 'POST', === modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.js' --- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.js 2011-03-29 10:27:11 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.js 2011-03-30 10:34:03 +0000 @@ -585,7 +585,6 @@ xtype: 'textfield', name: 'boundary', fieldLabel: G.i18n.boundary, - editable: false, emptyText: G.conf.emptytext, labelSeparator: G.conf.labelseparator, width: G.conf.combo_width, @@ -593,7 +592,7 @@ node: {attributes: {hasChildrenWithCoordinates: false}}, selectedNode: null, treeWindow: null, - treePanel: null, + treePanel: null, listeners: { 'focus': { scope: this, @@ -613,13 +612,24 @@ xtype: 'textfield', name: 'level', fieldLabel: G.i18n.level, - disabled: true, - disabledClass: 'combo-disabled', - editable: false, emptyText: G.conf.emptytext, labelSeparator: G.conf.labelseparator, width: G.conf.combo_width, - levelComboBox: null + style: 'cursor:pointer', + levelComboBox: null, + listeners: { + 'focus': { + scope: this, + fn: function() { + if (this.form.findField('boundary').treeWindow) { + this.form.findField('boundary').treeWindow.show(); + } + else { + this.createSingletonCmp.treeWindow.call(this); + } + } + } + } }, { html: '