← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4389: (GIS) Bug fixes and GUI updates.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 4389 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2011-08-20 03:28:30 +0200
message:
  (GIS) Bug fixes and GUI updates.
added:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/centroid.png
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/clear2.png
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/edit2.png
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/filter.png
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/refresh.png
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/symbol.png
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/global.js
  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/resources/mapfish/widgets/geostat/Centroid.js
  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/Point.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.js


--
lp:dhis2
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
=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/centroid.png'
Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/centroid.png	1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/centroid.png	2011-08-20 01:22:52 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/clear2.png'
Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/clear2.png	1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/clear2.png	2011-08-20 01:22:52 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/edit2.png'
Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/edit2.png	1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/edit2.png	2011-08-20 01:22:52 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/filter.png'
Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/filter.png	1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/filter.png	2011-08-20 01:22:52 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/refresh.png'
Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/refresh.png	1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/refresh.png	2011-08-20 01:22:52 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/symbol.png'
Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/symbol.png	1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/symbol.png	2011-08-20 01:22:52 +0000 differ
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/global.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/global.js	2011-08-19 21:33:16 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/global.js	2011-08-20 01:07:01 +0000
@@ -35,8 +35,10 @@
 	combo_number_width: 65,
 	combo_number_width_small: 44,
     window_width: 251,
-    window_position_x: 55,
-    window_position_y: 41,
+    window_x_right: 55,
+    window_y_right: 41,
+    window_x_left: 70,
+    window_y_left: 45,
     adminwindow_collapsed: 54,
     adminwindow_expanded_1: Ext.isChrome || (Ext.isWindows && Ext.isGecko) ? 121 : 116,
     adminwindow_expanded_2: Ext.isChrome || (Ext.isWindows && Ext.isGecko) ? 145 : 143,
@@ -576,7 +578,7 @@
             style: 'margin-top:1px',
             widget: widget,
             enableItems: function(bool) {
-                var menuItems = [2,3,5,6,7,9];
+                var menuItems = [2,3,5,6,8];
                 for (var i = 0; i < menuItems.length; i++) {
                     if (bool) {
                         this.menu.items.items[menuItems[i]].enable();
@@ -599,7 +601,7 @@
                                 iconCls: 'menu-layeroptions-edit',
                                 scope: this,
                                 handler: function() {
-                                    this.widget.window.show();
+                                    this.widget.window.show(this.id);
                                 }
                             },
                             '-',
@@ -621,14 +623,14 @@
                                 }
                             },
                             '-',
-                            {
-                                text: 'Filter..',
-                                iconCls: 'menu-layeroptions-filter',
-                                scope: this,
-                                handler: function() {
-                                    this.widget.window.show();
-                                }
-                            },
+                            //{
+                                //text: 'Filter..',
+                                //iconCls: 'menu-layeroptions-filter',
+                                //scope: this,
+                                //handler: function() {
+                                    //this.widget.window.show();
+                                //}
+                            //},
                             {
                                 text: 'Search..',
                                 iconCls: 'menu-layeroptions-locate',
@@ -640,8 +642,7 @@
                                         allowBlank: false,
                                         width: G.conf.combo_width_fieldset,
                                         value: "#0000FF"
-                                    }),
-                                    window: null
+                                    })
                                 },
                                 showSearchWindow: function() {
                                     var layer = this.parentMenu.parent.widget.layer;
@@ -659,13 +660,13 @@
                                             sortInfo: {field: 'name', direction: 'ASC'},
                                             autoDestroy: true,
                                             data: data
-                                        });
+                                        });   
                                         
                                         if (this.cmp.window) {
                                             this.cmp.window.destroy();
-                                        }  
+                                        }
                                         
-                                        this.cmp.window = new Ext.Window({
+                                        this.window = new Ext.Window({
                                             title: '<span id="window-locate-title">Organisation unit search</span>',
                                             layout: 'fit',
                                             width: G.conf.window_width,
@@ -677,7 +678,16 @@
                                                     labelWidth: G.conf.label_width,
                                                     items: [
                                                         { html: '<div class="window-info">Locate organisation units on the map</div>' },
-                                                        this.cmp.highlightColor,
+                                                        {
+                                                            xtype: 'colorfield',
+                                                            id: 'highlightcolor',
+                                                            emptyText: G.conf.emptytext,
+                                                            labelSeparator: G.conf.labelseparator,
+                                                            fieldLabel: G.i18n.highlight_color,
+                                                            allowBlank: false,
+                                                            width: G.conf.combo_width_fieldset,
+                                                            value: "#0000FF"
+                                                        },
                                                         {
                                                             xtype: 'textfield',
                                                             emptyText: G.conf.emptytext,
@@ -718,8 +728,7 @@
                                                                                 break;
                                                                             }
                                                                         }
-                                                                        
-                                                                        var color = this.cmp.highlightColor.getValue();
+                                                                        var color = Ext.getCmp('highlightcolor').getValue();
                                                                         var symbolizer;
                                                                         
                                                                         if (feature.geometry.CLASS_NAME == G.conf.map_feature_type_multipolygon_class_name ||
@@ -750,8 +759,8 @@
                                                 }
                                             }
                                         });
-                                        this.cmp.window.setPagePosition(Ext.getCmp('east').x - (this.cmp.window.width + 15), Ext.getCmp('center').y + 41);
-                                        this.cmp.window.show();
+                                        this.window.setPagePosition(G.conf.window_x_left,G.conf.window_y_left);
+                                        this.window.show(this.parentMenu.parent.id);
                                     }
                                     else {
                                         Ext.message.msg(false, '<span class="x-msg-hl">' + layer.name + '</span>: No features rendered');
@@ -896,8 +905,8 @@
                                                     }
                                                 ]
                                             });
-                                            this.cmp.labelWindow.setPagePosition(Ext.getCmp('east').x - (this.cmp.labelWindow.width + 15), Ext.getCmp('center').y + 41);                        
-                                            this.cmp.labelWindow.show();
+                                            this.cmp.labelWindow.setPagePosition(G.conf.window_x_left,G.conf.window_y_left);
+                                            this.cmp.labelWindow.show(this.parentMenu.parent.id);
                                         }
                                     }
                                     else {

=== 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-08-19 21:17:43 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js	2011-08-20 01:20:48 +0000
@@ -2146,7 +2146,7 @@
                 iconCls: 'icon-baselayer',
                 handler: function() {
                     Ext.getCmp('baselayers_w').setPagePosition(Ext.getCmp('east').x - (Ext.getCmp('overlays_w').width + 15), Ext.getCmp('center').y + 41);
-                    Ext.getCmp('baselayers_w').show();
+                    Ext.getCmp('baselayers_w').show(this.id);
                 }
             },
             {
@@ -2156,7 +2156,7 @@
                 iconCls: 'icon-overlay',
                 handler: function() {
                     Ext.getCmp('overlays_w').setPagePosition(Ext.getCmp('east').x - (Ext.getCmp('overlays_w').width + 15), Ext.getCmp('center').y + 41);
-                    Ext.getCmp('overlays_w').show();
+                    Ext.getCmp('overlays_w').show(this.id);
                 }
             }
         ]
@@ -2233,7 +2233,7 @@
             }
         ]
     });    
-    choropleth.window.setPosition(340,45);
+    choropleth.window.setPagePosition(G.conf.window_x_left,G.conf.window_y_left);
     
     point = new mapfish.widgets.geostat.Point({
         map: G.vars.map,
@@ -2305,7 +2305,7 @@
             }
         ]
     });    
-    point.window.setPosition(340,45);
+    point.window.setPagePosition(G.conf.window_x_left,G.conf.window_y_left);
     
     symbol = new mapfish.widgets.geostat.Symbol({
         map: G.vars.map,
@@ -2377,7 +2377,7 @@
             }
         ]
     });    
-    symbol.window.setPosition(340,45);
+    symbol.window.setPagePosition(G.conf.window_x_left,G.conf.window_y_left);
     
     centroid = new mapfish.widgets.geostat.Centroid({
         map: G.vars.map,
@@ -2449,18 +2449,18 @@
             }
         ]
     });    
-    centroid.window.setPosition(340,45);
+    centroid.window.setPagePosition(G.conf.window_x_left,G.conf.window_y_left);
     
 	/* Section: map toolbar */
 	var mapLabel = new Ext.form.Label({
 		text: G.i18n.map,
 		style: 'font:bold 11px arial; color:#333;'
 	});
-	var l_l = new Ext.form.Label({
+	var layersLabel = new Ext.form.Label({
 		text: 'Layers',
 		style: 'font:bold 11px arial; color:#333;'
 	});
-	var t_l = new Ext.form.Label({
+	var toolsLabel = new Ext.form.Label({
 		text: 'Tools',
 		style: 'font:bold 11px arial; color:#333;'
 	});
@@ -2598,10 +2598,8 @@
 				favoriteWindow.hide();
 			}
 			else {
-                var x = Ext.getCmp('center').x + G.conf.window_position_x;
-                var y = Ext.getCmp('center').y + G.conf.window_position_y;    
-                favoriteWindow.setPosition(x,y);
-				favoriteWindow.show();
+                favoriteWindow.setPagePosition(G.conf.window_x_left,G.conf.window_y_left);
+				favoriteWindow.show(this.id);
 			}
 		}
 	});
@@ -2616,10 +2614,8 @@
 				predefinedMapLegendSetWindow.hide();
 			}
 			else {
-                var x = Ext.getCmp('center').x + G.conf.window_position_x;
-                var y = Ext.getCmp('center').y + G.conf.window_position_y;
-                predefinedMapLegendSetWindow.setPosition(x,y);
-				predefinedMapLegendSetWindow.show();         
+                predefinedMapLegendSetWindow.setPagePosition(G.conf.window_x_left,G.conf.window_y_left);
+				predefinedMapLegendSetWindow.show(this.id);         
                 if (!G.stores.predefinedMapLegend.isLoaded) {
                     G.stores.predefinedMapLegend.load();
                 }
@@ -2641,10 +2637,8 @@
 				exportImageWindow.hide();
 			}
 			else {
-                var x = Ext.getCmp('center').x + G.conf.window_position_x;
-                var y = Ext.getCmp('center').y + G.conf.window_position_y;			
-                exportImageWindow.setPosition(x,y);
-				exportImageWindow.show();
+                exportImageWindow.setPagePosition(G.conf.window_x_left,G.conf.window_y_left);
+				exportImageWindow.show(this.id);
 			}
 		}
 	});
@@ -2682,8 +2676,8 @@
                         }
                     });
                 }
-                control.window.setPagePosition(Ext.getCmp('east').x - (control.window.width + 15), Ext.getCmp('center').y + 41);
-                control.window.show();
+                control.window.setPagePosition(G.conf.window_x_left,G.conf.window_y_left);
+                control.window.show(this.id);
                 document.getElementById('measureDistanceDiv').innerHTML = '0 km';                
                 control.setImmediate(true);
                 control.geodesic = true;
@@ -2706,10 +2700,8 @@
                 adminWindow.hide();
             }
             else {
-                var x = Ext.getCmp('center').x + G.conf.window_position_x;
-                var y = Ext.getCmp('center').y + G.conf.window_position_y;
-                adminWindow.setPosition(x,y);
-                adminWindow.show();
+                adminWindow.setPagePosition(G.conf.window_x_left,G.conf.window_y_left);
+                adminWindow.show(this.id);
             }
 		}
 	});
@@ -2726,7 +2718,7 @@
                 var c = Ext.getCmp('center').x;
                 var e = Ext.getCmp('east').x;
                 helpWindow.setPagePosition(c+((e-c)/2)-280, Ext.getCmp('east').y + 100);
-                helpWindow.show();
+                helpWindow.show(this.id);
             }
 		}
 	});
@@ -2754,7 +2746,7 @@
             ' ',
 			'-',
 			' ',' ',' ',
-			l_l,
+			layersLabel,
 			' ',' ',
             new G.cls.vectorLayerButton('icon-thematic1', G.i18n.thematic_layer + ' 1', choropleth),
             new G.cls.vectorLayerButton('icon-thematic2', G.i18n.thematic_layer + ' 2', point),
@@ -2763,7 +2755,7 @@
             ' ',
 			'-',
 			' ',' ',' ',
-			t_l,
+			toolsLabel,
 			' ',' ',
 			favoritesButton,
             predefinedMapLegendSetButton,
@@ -2892,7 +2884,7 @@
                 G.vars.map.events.register('click', null, function(e) {
                     if (G.vars.relocate.active) {
                         var mp = document.getElementById('mouseposition');
-                        var coordinates = '[' + mp.childNodes[1].data + ',' + mp.childNodes[4].data + ']';
+                        var coordinates = '[' + mp.childNodes[1].data + ',' + mp.childNodes[3].data + ']';
                         var center = Ext.getCmp('center').x;
 	
                         Ext.Ajax.request({
@@ -2908,7 +2900,7 @@
                                 Ext.message.msg(true, '<span class="x-msg-hl">' + G.vars.relocate.feature.attributes.name + 
                                     ' </span>relocated to ' +
                                     '[<span class="x-msg-hl">' + mp.childNodes[1].data + '</span>,' + 
-                                    '<span class="x-msg-hl">' + mp.childNodes[4].data + '</span>]');
+                                    '<span class="x-msg-hl">' + mp.childNodes[3].data + '</span>]');
                             }
                         });
                     }

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Centroid.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Centroid.js	2011-08-19 21:33:16 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Centroid.js	2011-08-20 01:07:01 +0000
@@ -1010,7 +1010,7 @@
         getLegendInfo: function() {
             return {
                 name: this.valueType.isIndicator() ? this.cmp.indicator.getRawValue() : this.cmp.dataElement.getRawValue(),
-                time: G.system.mapDateType.isFixed() ? this.cmp.period.getRawValue() : this.cmp.startDate.getRawValue() + ' - ' + this.cmp.endDate.getRawValue(),
+                time: G.system.mapDateType.isFixed() ? this.cmp.period.getRawValue() : this.cmp.startDate.getRawValue() + ' to ' + this.cmp.endDate.getRawValue(),
                 map: this.organisationUnitSelection.level.name + ' / ' + this.organisationUnitSelection.parent.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	2011-08-19 21:33:16 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js	2011-08-20 01:07:01 +0000
@@ -1614,7 +1614,7 @@
         getLegendInfo: function() {
             return {
                 name: this.valueType.isIndicator() ? this.cmp.indicator.getRawValue() : this.cmp.dataElement.getRawValue(),
-                time: G.system.mapDateType.isFixed() ? this.cmp.period.getRawValue() : this.cmp.startDate.getRawValue() + ' - ' + this.cmp.endDate.getRawValue(),
+                time: G.system.mapDateType.isFixed() ? this.cmp.period.getRawValue() : this.cmp.startDate.getRawValue() + ' to ' + this.cmp.endDate.getRawValue(),
                 map: this.organisationUnitSelection.level.name + ' / ' + this.organisationUnitSelection.parent.name
             };
         },

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Point.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Point.js	2011-08-19 21:33:16 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Point.js	2011-08-20 01:07:01 +0000
@@ -1614,7 +1614,7 @@
         getLegendInfo: function() {
             return {
                 name: this.valueType.isIndicator() ? this.cmp.indicator.getRawValue() : this.cmp.dataElement.getRawValue(),
-                time: G.system.mapDateType.isFixed() ? this.cmp.period.getRawValue() : this.cmp.startDate.getRawValue() + ' - ' + this.cmp.endDate.getRawValue(),
+                time: G.system.mapDateType.isFixed() ? this.cmp.period.getRawValue() : this.cmp.startDate.getRawValue() + ' to ' + this.cmp.endDate.getRawValue(),
                 map: this.organisationUnitSelection.level.name + ' / ' + this.organisationUnitSelection.parent.name
             };
         },

=== 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-08-19 21:33:16 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.js	2011-08-20 01:07:01 +0000
@@ -765,7 +765,7 @@
             
             for (var i = 0; i < this.layer.features.length; i++) {
                 this.layer.features[i].attributes.labelString = this.layer.features[i].attributes.name;
-                this.layer.features[j].attributes.name = G.util.cutString(this.layer.features[j].attributes.name, 30);
+                this.layer.features[i].attributes.name = G.util.cutString(this.layer.features[i].attributes.name, 30);
             }
              
             this.applyValues();