← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2380: (GIS) Improved orgunit tree window behavior and layout.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 2380 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2010-12-15 10:56:55 +0100
message:
  (GIS) Improved orgunit tree window behavior and layout.
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/css/style.css
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/globals.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/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
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/css/style.css'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/css/style.css	2010-12-14 14:31:39 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/css/style.css	2010-12-15 09:01:00 +0000
@@ -255,7 +255,7 @@
 
 /* Ext ComboBox */
 .combo-disabled {
-    opacity:0.75;
+    opacity:0.70;
     color:#000000;
     border-color:#9ca1b8;
     cursor: default;

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/globals.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/globals.js	2010-12-14 15:14:50 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/globals.js	2010-12-15 09:01:00 +0000
@@ -8,10 +8,6 @@
     path_commons: '../../dhis-web-commons-ajax-json/',
     type: '.action',
 	
-	ows: 'ows?service=WMS&request=GetCapabilities',
-	wfs: 'wfs?request=GetFeature&typename=',	
-	output: '&outputformat=json&version=1.0.0',
-	
 //	Help strings
     
     setup: 'gisSetup',

=== 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-12-14 13:24:31 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js	2010-12-15 09:08:13 +0000
@@ -598,33 +598,43 @@
                 'focus': {
                     scope: this,
                     fn: function(tf) {
-                        function showTree() {
-                            var value, rawvalue;
-                            var w = new Ext.Window({
-                                id: 'tree_w',
-                                title: 'Boundary and level',
-                                closeAction: 'hide',
-                                autoScroll: true,
-                                height: 'auto',
-                                autoHeight: true,
-                                width: 280,
-                                boxMaxWidth: 280,
-                                items: [
-                                    {
-                                        xtype: 'panel',
-                                        layout: 'fit',
-                                        bodyStyle: 'padding:4px 4px 0px 4px; background-color:#f8f8f8',
+                        if (GLOBAL.vars.topLevelUnit) {
+                            Ext.getCmp('tree_w').show();
+                        }
+                        else {
+                            Ext.Ajax.request({
+                                url: GLOBAL.conf.path_commons + 'getOrganisationUnits' + GLOBAL.conf.type,
+                                params: {level: 1},
+                                method: 'POST',
+                                scope: this,
+                                success: function(r) {
+                                    var rootNode = Ext.util.JSON.decode(r.responseText).organisationUnits[0];
+                                    GLOBAL.vars.topLevelUnit = {
+                                        id: rootNode.id,
+                                        name: rootNode.name,
+                                        hasChildrenWithCoordinates: rootNode.hasChildrenWithCoordinates
+                                    };
+                                    
+                                    var w = new Ext.Window({
+                                        id: 'tree_w',
+                                        title: 'Boundary and level',
+                                        closeAction: 'hide',
+                                        autoScroll: true,
+                                        height: 'auto',
+                                        autoHeight: true,
+                                        width: GLOBAL.conf.window_width,
                                         items: [
                                             {
-                                                xtype: 'fieldset',
-                                                title: '&nbsp;&nbsp;<span class="panel-tab-title">Boundary</span>&nbsp;&nbsp;',
-                                                bodyStyle: 'margin-bottom:3px',
-                                                autoHeight: true,
+                                                xtype: 'panel',
+                                                bodyStyle: 'padding:8px; background-color:#ffffff',
                                                 items: [
+                                                    {html: '<div class="window-info">Select outer boundary</div>'},
                                                     {
                                                         xtype: 'treepanel',
+                                                        bodyStyle: 'background-color:#ffffff',
                                                         height: screen.height / 3,
                                                         autoScroll: true,
+                                                        lines: false,
                                                         loader: new Ext.tree.TreeLoader({
                                                             dataUrl: GLOBAL.conf.path_mapping + 'getOrganisationUnitChildren' + GLOBAL.conf.type
                                                         }),
@@ -647,35 +657,29 @@
                                                         }
                                                     }
                                                 ]
-                                            }
-                                        ]
-                                    },
-                                    {
-                                        xtype: 'panel',
-                                        layout: 'fit',
-                                        bodyStyle: 'padding:4px 4px 0px 4px; background-color:#f8f8f8',
-                                        items: [
+                                            },
                                             {
-                                                xtype: 'fieldset',
-                                                title: '&nbsp;&nbsp;<span class="panel-tab-title">Level</span>&nbsp;&nbsp;',
-                                                autoHeight: true,
-                                                layout: 'anchor',
+                                                xtype: 'panel',
+                                                layout: 'form',
+                                                bodyStyle: 'padding:8px; background-color:#ffffff',
                                                 items: [
+                                                    {html: '<div class="window-info">Select organisation unit level</div>'},
                                                     {
                                                         xtype: 'combo',
                                                         id: 'level_cb',
                                                         fieldLabel: i18n_level,
-                                                        typeAhead: true,
                                                         editable: false,
                                                         valueField: 'level',
                                                         displayField: 'name',
                                                         mode: 'remote',
                                                         forceSelection: true,
                                                         triggerAction: 'all',
+                                                        selectOnFocus: true,
                                                         emptyText: GLOBAL.conf.emptytext,
                                                         labelSeparator: GLOBAL.conf.labelseparator,
-                                                        selectOnFocus: true,
-                                                        width: GLOBAL.conf.combo_width,
+                                                        fieldLabel: 'Level',
+                                                        width: GLOBAL.conf.combo_width_fieldset,
+                                                        minListWidth: GLOBAL.conf.combo_width_fieldset,
                                                         store: GLOBAL.stores.polygonOrganisationUnitLevel,
                                                         listeners: {
                                                             'select': {
@@ -689,16 +693,13 @@
                                                     }
                                                 ]
                                             }
-                                        ]
-                                    },
-                                    {
-                                        xtype: 'panel',
-                                        layout: 'table',
-                                        items: [
+                                        ],
+                                        bbar: [
+                                            '->',
                                             {
                                                 xtype: 'button',
                                                 text: i18n_select,
-                                                width: 133,
+                                                iconCls: 'icon-assign',
                                                 scope: this,
                                                 handler: function() {
                                                     var node = this.form.findField('boundary').selectedNode;
@@ -725,44 +726,14 @@
                                                     
                                                     this.loadGeoJson();
                                                 }
-                                            },
-                                            {
-                                                xtype: 'button',
-                                                text: i18n_cancel,
-                                                width: 133,
-                                                scope: this,
-                                                handler: function() {
-                                                    Ext.getCmp('tree_w').hide();
-                                                }
                                             }
                                         ]
-                                    }
-                                ]
-                            });
-                            
-                            var x = Ext.getCmp('center').x + 15;
-                            var y = Ext.getCmp('center').y + 41;
-                            w.setPosition(x,y);
-                            w.show();
-                        }
-
-                        if (GLOBAL.vars.topLevelUnit) {
-                            showTree.call(this);
-                        }
-                        else {
-                            Ext.Ajax.request({
-                                url: GLOBAL.conf.path_commons + 'getOrganisationUnits' + GLOBAL.conf.type,
-                                params: {level: 1},
-                                method: 'POST',
-                                scope: this,
-                                success: function(r) {
-                                    var rootNode = Ext.util.JSON.decode(r.responseText).organisationUnits[0];
-                                    GLOBAL.vars.topLevelUnit = {
-                                        id: rootNode.id,
-                                        name: rootNode.name,
-                                        hasChildrenWithCoordinates: rootNode.hasChildrenWithCoordinates
-                                    };
-                                    showTree.call(this);
+                                    });
+                                    
+                                    var x = Ext.getCmp('center').x + 15;
+                                    var y = Ext.getCmp('center').y + 41;
+                                    w.setPosition(x,y);
+                                    w.show();
                                 }
                             });
                         }

=== 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	2010-12-14 13:24:31 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.js	2010-12-15 09:55:19 +0000
@@ -597,95 +597,8 @@
                 'focus': {
                     scope: this,
                     fn: function(tf) {
-                        function showTree() {
-                            var value, rawvalue;
-                            var w = new Ext.Window({
-                                id: 'tree_w2',
-                                title: 'Boundary',
-                                closeAction: 'hide',
-                                autoScroll: true,
-                                height: 'auto',
-                                autoHeight: true,
-                                width: 280,
-                                boxMaxWidth: 280,
-                                items: [
-									{
-										xtype: 'treepanel',
-										height: screen.height / 3,
-										bodyStyle: 'padding: 8px',
-										autoScroll: true,
-										loader: new Ext.tree.TreeLoader({
-											dataUrl: GLOBAL.conf.path_mapping + 'getOrganisationUnitChildren' + GLOBAL.conf.type
-										}),
-										root: {
-											id: GLOBAL.vars.topLevelUnit.id,
-											text: GLOBAL.vars.topLevelUnit.name,
-											hasChildrenWithCoordinates: GLOBAL.vars.topLevelUnit.hasChildrenWithCoordinates,
-											nodeType: 'async',
-											draggable: false,
-											expanded: true
-										},
-										clickedNode: null,
-										listeners: {
-											'click': {
-												scope: this,
-												fn: function(n) {
-													this.form.findField('boundary').selectedNode = n;
-												}
-											}
-										}
-									},
-                                    {
-                                        xtype: 'panel',
-                                        layout: 'table',
-                                        items: [
-                                            {
-                                                xtype: 'button',
-                                                text: i18n_select,
-                                                width: 133,
-                                                scope: this,
-                                                handler: function() {
-                                                    var node = this.form.findField('boundary').selectedNode;
-                                                    if (!node) {
-                                                        return;
-                                                    }
-
-                                                    if (Ext.getCmp('locatefeature_w')) {
-                                                        Ext.getCmp('locatefeature_w').destroy();
-                                                    }
-                                                    
-                                                    this.form.findField('mapview').clearValue();
-                                                    this.updateValues = true;
-                                                    this.organisationUnitSelection.setValues(node.attributes.id, node.attributes.text, node.attributes.level, null, null);
-                                                    
-                                                    this.form.findField('boundary').setValue(node.attributes.text);
-                                                    Ext.getCmp('tree_w2').hide();
-                                                    
-                                                    this.loadGeoJson();
-                                                }
-                                            },
-                                            {
-                                                xtype: 'button',
-                                                text: i18n_cancel,
-                                                width: 133,
-                                                scope: this,
-                                                handler: function() {
-                                                    Ext.getCmp('tree_w2').hide();
-                                                }
-                                            }
-                                        ]
-                                    }
-                                ]
-                            });
-                            
-                            var x = Ext.getCmp('center').x + 15;
-                            var y = Ext.getCmp('center').y + 41;
-                            w.setPosition(x,y);
-                            w.show();
-                        }
-
                         if (GLOBAL.vars.topLevelUnit) {
-                            showTree.call(this);
+                            Ext.getCmp('tree_w2').show();
                         }
                         else {
                             Ext.Ajax.request({
@@ -700,7 +613,85 @@
                                         name: rootNode.name,
                                         hasChildrenWithCoordinates: rootNode.hasChildrenWithCoordinates
                                     };
-                                    showTree.call(this);
+                                    
+                                    var w = new Ext.Window({
+                                        id: 'tree_w2',
+                                        title: 'Boundary',
+                                        closeAction: 'hide',
+                                        autoScroll: true,
+                                        height: 'auto',
+                                        autoHeight: true,
+                                        width: GLOBAL.conf.window_width,
+                                        items: [
+                                            {
+                                                xtype: 'panel',
+                                                bodyStyle: 'padding:8px; background-color:#ffffff',
+                                                items: [
+                                                    {html: '<div class="window-info">Select outer boundary</div>'},
+                                                    {
+                                                        xtype: 'treepanel',
+                                                        bodyStyle: 'background-color:#ffffff',
+                                                        height: screen.height / 3,
+                                                        autoScroll: true,
+                                                        lines: false,
+                                                        loader: new Ext.tree.TreeLoader({
+                                                            dataUrl: GLOBAL.conf.path_mapping + 'getOrganisationUnitChildren' + GLOBAL.conf.type
+                                                        }),
+                                                        root: {
+                                                            id: GLOBAL.vars.topLevelUnit.id,
+                                                            text: GLOBAL.vars.topLevelUnit.name,
+                                                            hasChildrenWithCoordinates: GLOBAL.vars.topLevelUnit.hasChildrenWithCoordinates,
+                                                            nodeType: 'async',
+                                                            draggable: false,
+                                                            expanded: true
+                                                        },
+                                                        clickedNode: null,
+                                                        listeners: {
+                                                            'click': {
+                                                                scope: this,
+                                                                fn: function(n) {
+                                                                    this.form.findField('boundary').selectedNode = n;
+                                                                }
+                                                            }
+                                                        }
+                                                    }
+                                                ]
+                                            }
+                                        ],
+                                        bbar: [
+                                            '->',
+                                            {
+                                                xtype: 'button',
+                                                text: i18n_select,
+                                                iconCls: 'icon-assign',
+                                                scope: this,
+                                                handler: function() {
+                                                    var node = this.form.findField('boundary').selectedNode;
+                                                    if (!node) {
+                                                        return;
+                                                    }
+
+                                                    if (Ext.getCmp('locatefeature_w')) {
+                                                        Ext.getCmp('locatefeature_w').destroy();
+                                                    }
+                                                    
+                                                    this.form.findField('mapview').clearValue();
+                                                    this.updateValues = true;
+                                                    this.organisationUnitSelection.setValues(node.attributes.id, node.attributes.text, node.attributes.level, null, null);
+                                                    
+                                                    this.form.findField('boundary').setValue(node.attributes.text);
+                                                    Ext.getCmp('tree_w2').hide();
+                                                    
+                                                    this.loadGeoJson();
+                                                }
+                                            }
+                                        ]
+                                    });
+                                    
+                                    var x = Ext.getCmp('center').x + 15;
+                                    var y = Ext.getCmp('center').y + 41;
+                                    w.setPosition(x,y);
+                                    w.show();
                                 }
                             });
                         }