← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 210: Minor bugs fixed. Combostores sorted.

 

------------------------------------------------------------
revno: 210
committer: Jan Henrik Overland janhenrik.overland@xxxxxxxxx
branch nick: trunk
timestamp: Tue 2009-04-21 12:54:29 +0200
message:
  Minor bugs fixed. Combostores sorted.
modified:
  gis/dhis-web-mapping/src/main/webapp/demos/geostat/geostat.js
  gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Choropleth.js
  gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Mapping.js

=== modified file 'gis/dhis-web-mapping/src/main/webapp/demos/geostat/geostat.js'
--- gis/dhis-web-mapping/src/main/webapp/demos/geostat/geostat.js	2009-04-20 18:49:25 +0000
+++ gis/dhis-web-mapping/src/main/webapp/demos/geostat/geostat.js	2009-04-21 10:54:29 +0000
@@ -13,6 +13,8 @@
     features = null;
     features_choropleth = null;
     features_mapping = null;
+    
+    url = null;
 
     var jpl_wms = new OpenLayers.Layer.WMS("Satellite",
                                            "http://labs.metacarta.com/wms-c/Basic.py?";, 
@@ -311,39 +313,12 @@
                 Ext.MessageBox.alert('Error', 'Form is not complete');
                 return;
             }
-/*            
-            Ext.Ajax.request(
-            {
-                url: path + 'getMapByMapLayerPath' + type,
-                method: 'GET',
-                params: { mapLayerPath: em },
-
-                success: function( responseObject )
-                {
-                    Ext.Msg.show({
-                        title:'Register shapefiles',
-                        msg: '<p style="padding-top:8px">The map <b>' + mlp + '</b> was successfully updated!</b></p>',
-                        buttons: Ext.Msg.OK,
-                        animEl: 'elId',
-                        minWidth: 400,
-                        icon: Ext.MessageBox.INFO
-                    });
-                    
-                    Ext.getCmp('map_cb').getStore().reload();
-                    Ext.getCmp('maps_cb').getStore().reload();
-                },
-                failure: function()
-                {
-                    alert( 'Status', 'Error while saving data' );
-                }
-            });
-*/            
-            Ext.Ajax.request(
-            {
-                url: path + 'addOrUpdateMap' + type,
-                method: 'GET',
-                params: { mapLayerPath: em, organisationUnitId: oui, organisationUnitLevelId: ouli, uniqueColumn: uc, nameColumn: nc,
-                          longitude: lon, latitude: lat, zoom: zoom},
+           
+            Ext.Ajax.request(
+            {
+                url: path + 'updateMap' + type,
+                method: 'GET',
+                params: { mapLayerPath: em, uniqueColumn: uc, nameColumn: nc, longitude: lon, latitude: lat, zoom: zoom },
 
                 success: function( responseObject )
                 {
@@ -890,7 +865,7 @@
             var south_panel = Ext.getCmp('south-panel');
             south_panel.body.dom.innerHTML = organisationUnit + '<font color="#444444"> assigned to </font>' + featureId + "!";
             
-            setMapData('assignment');
+            loadMapData('assignment');
         },
         failure: function()
         {
@@ -970,7 +945,7 @@
     {
         url: path + 'getMapByMapLayerPath' + type,
         method: 'GET',
-        params: { mapLayerPath: choropleth.currentUrl, format: 'json' },
+        params: { mapLayerPath: url, format: 'json' },
 
         success: function( responseObject )
         {
@@ -987,7 +962,7 @@
         },
         failure: function()
         {
-            alert( 'Error while retrieving map data: setMapData' );
+            alert( 'Error while retrieving map data: loadMapData' );
         } 
     });
 }

=== modified file 'gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Choropleth.js'
--- gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Choropleth.js	2009-04-20 18:49:25 +0000
+++ gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Choropleth.js	2009-04-21 10:54:29 +0000
@@ -148,6 +148,7 @@
             baseParams: { format: 'json' },
             root: 'indicatorGroups',
             fields: ['id', 'name'],
+            sortInfo: { field: 'name', direction: 'ASC' },
             autoLoad: true
         });
         
@@ -155,6 +156,7 @@
             url: path + 'getIndicatorsByIndicatorGroup' + type,
             root: 'indicators',
             fields: ['id', 'name'],
+            sortInfo: { field: 'name', direction: 'ASC' },
             autoLoad: false
         });
         
@@ -179,6 +181,7 @@
             baseParams: { format: 'jsonmin' },
             root: 'maps',
             fields: ['id', 'mapLayerPath', 'organisationUnitLevel'],
+            sortInfo: { field: 'mapLayerPath', direction: 'ASC' },
             autoLoad: true
         }); 
             
@@ -495,9 +498,9 @@
         }
         
         if (this.newUrl) {
-            this.currentUrl = this.newUrl;
+            url = this.newUrl;
             this.newUrl = false;
-            this.setUrl('../../../geoserver/wfs?request=GetFeature&typename=' + this.currentUrl + '&outputformat=json&version=1.0.0');
+            this.setUrl('../../../geoserver/wfs?request=GetFeature&typename=' + url + '&outputformat=json&version=1.0.0');
         }
         
         if (!Ext.getCmp('indicator_cb').getValue() ||

=== modified file 'gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Mapping.js'
--- gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Mapping.js	2009-04-20 18:49:25 +0000
+++ gis/dhis-web-mapping/src/main/webapp/mfbase/mapfish/widgets/geostat/Mapping.js	2009-04-21 10:54:29 +0000
@@ -149,7 +149,7 @@
             root: 'maps',
             fields: ['id', 'mapLayerPath', 'organisationUnitLevel'],
             autoLoad: true
-        });    
+        });
             
         gridStore = new Ext.data.JsonStore({
             url: path + 'getAvailableMapOrganisationUnitRelations' + type,
@@ -160,6 +160,7 @@
 
         gridView = new Ext.grid.GridView({ 
             forceFit: true,
+            draggable: true,
             sortClasses: ['sort-asc'],
             getRowClass: function (row, index){
                 var cls = ''; 
@@ -191,8 +192,8 @@
                 triggerAction: 'all',
                 emptyText: 'Required',
                 selectOnFocus: true,
-                width: 133,
-                minListWidth: combo_width + 26,
+                width: 130,
+                minListWidth: combo_width,
                 store: mapStore,
                 listeners: {
                     'select': {
@@ -301,9 +302,9 @@
         }
         
         if (this.newUrl) {
-            this.currentUrl = this.newUrl;
+            url = this.newUrl;
             this.newUrl = false;
-            this.setUrl('../../../geoserver/wfs?request=GetFeature&typename=' + this.currentUrl + '&outputformat=json&version=1.0.0');
+            this.setUrl('../../../geoserver/wfs?request=GetFeature&typename=' + url + '&outputformat=json&version=1.0.0');
         }
         
         if (!Ext.getCmp('maps_cb').getValue()) {
@@ -313,7 +314,7 @@
                 return;
         }
         
-        loadMapData('assignment');
+        loadMapData('assignment', url);
         
         var options = {};
         



--
Trunk
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription.