← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12985: (PT, DV, GIS) Orgunit tree bugs fixed + Input fields automatically focused + Share button enablin...

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 12985 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-11-20 11:47:51 +0100
message:
  (PT, DV, GIS) Orgunit tree bugs fixed + Input fields automatically focused + Share button enabling bug fixed + Period types i18n + (GIS) Filter removed from facility layer menu as it is no longer needed + API link extension fixed + Cirle layer bug fixed + Widget reset bug fixed + Data element details url fix + Integration bug fixed.
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module.properties
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/plugin.html
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/i18n.vm
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonInitialize.vm
  dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js
  dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/plugin.js
  dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/jsonInitialize.vm
  dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/manifest.webapp
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonInitialize.vm


--
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/resources/org/hisp/dhis/mapping/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module.properties	2013-11-01 15:43:02 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module.properties	2013-11-06 19:01:46 +0000
@@ -399,4 +399,5 @@
 financial_oct=Financial October
 financial_july=Financial July
 financial_april=Financial April
-relative=Relative
\ No newline at end of file
+relative=Relative
+reporting_rates=Reporting rates
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/plugin.html'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/plugin.html	2013-10-13 21:03:02 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/plugin.html	2013-11-12 22:04:09 +0000
@@ -1,9 +1,7 @@
 <!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
 
 <head>
     <title>DHIS2 GIS Plugin</title>
-	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 
     <link rel="stylesheet" type="text/css" href="http://localhost:8080/dhis-web-commons/javascripts/ext/resources/css/ext-all-gray.css"/>
     <script src="http://localhost:8080/dhis-web-commons/javascripts/ext/ext-all.js";></script>

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js	2013-10-15 18:58:30 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js	2013-11-20 10:41:54 +0000
@@ -175,13 +175,13 @@
 					if (id !== gis.layer.boundary.id && id !== gis.layer.facility.id) {
 						what = '<g id="indicator" style="display: block; visibility: visible;">' +
 							   '<text id="indicator" x="' + x + '" y="' + y + '" font-size="12">' +
-							   '<tspan>' + layer.core.view.columns[0].items[0].name + '</tspan></text></g>';
+							   '<tspan>' + Ext.htmlEncode(layer.core.view.columns[0].items[0].name) + '</tspan></text></g>';
 
 						y += 15;
 
 						when = '<g id="period" style="display: block; visibility: visible;">' +
 							   '<text id="period" x="' + x + '" y="' + y + '" font-size="12">' +
-							   '<tspan>' + layer.core.view.filters[0].items[0].name + '</tspan></text></g>';
+							   '<tspan>' + Ext.htmlEncode(layer.core.view.filters[0].items[0].name) + '</tspan></text></g>';
 
 						y += 8;
 
@@ -193,10 +193,10 @@
 							}
 
 							legend += '<rect x="' + x + '" y="' + y + '" height="15" width="30" ' +
-									  'fill="' + imageLegendConfig[j].color + '" stroke="#000000" stroke-width="1"/>';
+									  'fill="' + Ext.htmlEncode(imageLegendConfig[j].color) + '" stroke="#000000" stroke-width="1"/>';
 
 							legend += '<text id="label" x="' + (x + 40) + '" y="' + (y + 12) + '" font-size="12">' +
-									  '<tspan>' + imageLegendConfig[j].label + '</tspan></text>';
+									  '<tspan>' + Ext.htmlEncode(imageLegendConfig[j].label) + '</tspan></text>';
 						}
 
 						legend += '</g>';
@@ -308,7 +308,7 @@
 						id = view.layer;
 
 						if (gis.layer.hasOwnProperty(id) && gis.layer[id].layerCategory === gis.conf.finals.layer.category_thematic) {
-							layout = gis.api.layout.Layout(Ext.clone(view));
+							layout = gis.api.layout.Layout(view);
 
 							if (layout) {
 								return layout;
@@ -320,7 +320,7 @@
 					for (var key in gis.layer) {
 						if (gis.layer.hasOwnProperty(key) && gis.layer[key].layerCategory === gis.conf.finals.layer.category_thematic && gis.layer[key].core.view) {
 							layer = gis.layer[key];
-							layout = gis.api.layout.Layout(Ext.clone(layer.core.view));
+							layout = gis.api.layout.Layout(layer.core.view);
 
 							if (layout) {
 								if (!layout.parentGraphMap && layer.widget) {
@@ -855,7 +855,7 @@
 		};
 		items.push(item);
 
-		if (layer.id !== gis.layer.boundary.id) {
+		if (!(layer.id === gis.layer.boundary.id || layer.id === gis.layer.facility.id)) {
 			item = {
 				text: GIS.i18n.filter + '..',
 				iconCls: 'gis-menu-item-icon-filter',
@@ -1884,7 +1884,7 @@
 			nameTextfield = Ext.create('Ext.form.field.Text', {
 				height: 26,
 				width: 371,
-				fieldStyle: 'padding-left: 6px; border-radius: 1px; border-color: #bbb; font-size:11px',
+				fieldStyle: 'padding-left: 5px; border-radius: 1px; border-color: #bbb; font-size:11px',
 				style: 'margin-bottom:0',
 				emptyText: 'Favorite name',
 				value: id ? record.data.name : '',
@@ -2007,6 +2007,8 @@
 				listeners: {
 					show: function() {
 						this.setPosition(favoriteWindow.x + 14, favoriteWindow.y + 67);
+
+						nameTextfield.focus(false, 500);
 					}
 				}
 			});
@@ -2029,7 +2031,7 @@
 		searchTextfield = Ext.create('Ext.form.field.Text', {
 			width: windowCmpWidth - addButton.width - 11,
 			height: 26,
-			fieldStyle: 'padding-right: 0; padding-left: 6px; border-radius: 1px; border-color: #bbb; font-size:11px',
+			fieldStyle: 'padding-right: 0; padding-left: 5px; border-radius: 1px; border-color: #bbb; font-size:11px',
 			emptyText: GIS.i18n.search_for_favorites,
 			enableKeyEvents: true,
 			currentValue: '',
@@ -2403,6 +2405,8 @@
 				show: function() {
 					this.setPosition(115, 33);
 				}
+
+				searchTextfield.focus(false, 500);
 			}
 		});
 
@@ -3191,7 +3195,7 @@
 			cls: 'gis-container-inner',
 			html: function() {
 				var moduleUrl = gis.init.contextPath + '/dhis-web-mapping/app/index.html?id=' + gis.map.id,
-					apiUrl = gis.init.contextPath + '/api/maps/' + gis.map.id + '/data.html',
+					apiUrl = gis.init.contextPath + '/api/maps/' + gis.map.id + '/data',
 					html = '';
 
 				html += '<div><b>GIS link: </b><span class="user-select"><a href="' + moduleUrl + '" target="_blank">' + moduleUrl + '</a></span></div>';
@@ -3740,6 +3744,7 @@
 			layer.item.setValue(false);
 
 			if (!layer.window.isRendered) {
+				layer.core.view = null;
 				return;
 			}
 
@@ -4075,7 +4080,7 @@
 				if (Ext.isString(uid)) {
 					this.setProxy({
 						type: 'ajax',
-						url: gis.conf.finals.url.path_commons + 'getOperands.action?uid=' + uid,
+						url: gis.init.contextPath + '/dhis-web-commons-ajax-json/getOperands.action?uid=' + uid,
 						reader: {
 							type: 'json',
 							root: 'operands'
@@ -4257,7 +4262,7 @@
 				data: [
 					[dimConf.indicator.objectName, GIS.i18n.indicator],
 					[dimConf.dataElement.objectName, GIS.i18n.dataelement],
-					[dimConf.dataSet.objectName, GIS.i18n.dataset]
+					[dimConf.dataSet.objectName, GIS.i18n.reporting_rates]
 				]
 			}),
 			listeners: {
@@ -5114,6 +5119,7 @@
 
 			// Components
 			if (!layer.window.isRendered) {
+				layer.core.view = null;
 				return;
 			}
 
@@ -5204,7 +5210,7 @@
 				objectNameCmpMap[dxDim.dimension].setValue(dxDim.items[0].id);
 
 				// Period
-				period.store.add(peDim.items[0])
+				period.store.add(gis.conf.period.relativePeriodsMap[peDim.items[0].id] ? gis.conf.period.relativePeriodsMap[peDim.items[0].id] : peDim.items[0]);
 				period.setValue(peDim.items[0].id);
 
 				// Legend
@@ -5883,13 +5889,14 @@
 				layer.labelWindow = null;
 			}
 
-			if (layer.circleLayer) {
+			if (layer.circleLayer & !skipTree) {
 				layer.circleLayer.deactivateControls();
 				layer.circleLayer = null;
 			}
 
 			// Components
 			if (!layer.window.isRendered) {
+				layer.core.view = null;
 				return;
 			}
 

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js	2013-11-01 15:43:02 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js	2013-11-20 10:41:54 +0000
@@ -799,10 +799,16 @@
 				}
 			}
 
-			if (gis.viewport.interpretationButton) {
+			// interpretation button
+			if (gis.map.id && gis.viewport.interpretationButton) {
 				gis.viewport.interpretationButton.enable();
 			}
 
+			// session storage
+			if (GIS.isSessionStorage) {
+				gis.util.layout.setSessionStorage('map', gis.util.layout.getAnalytical());
+			}
+
 			gis.olmap.mask.hide();
 		};
 
@@ -1314,8 +1320,9 @@
 			addNames = function(response) {
 
 				// All dimensions
-				var dimensions = [].concat(view.columns || [], view.rows || [], view.filters || []),
-					metaData = response.metaData;
+				var dimensions = Ext.Array.clean([].concat(view.columns || [], view.rows || [], view.filters || [])),
+					metaData = response.metaData,
+					peIds = metaData[dimConf.period.objectName];
 
 				for (var i = 0, dimension; i < dimensions.length; i++) {
 					dimension = dimensions[i];
@@ -1334,7 +1341,7 @@
 				}
 
 				// Period name without changing the id
-				view.filters[0].items[0].name = metaData.names[gis.response.metaData[dimConf.period.objectName][0]];
+				view.filters[0].items[0].name = metaData.names[peIds[peIds.length - 1]];
 			};
 
 			fn = function() {
@@ -1444,6 +1451,11 @@
 					gis.viewport.interpretationButton.disable();
 				}
 			}
+
+			// session storage
+			if (GIS.isSessionStorage) {
+				gis.util.layout.setSessionStorage('map', gis.util.layout.getAnalytical());
+			}
 		};
 
 		loader = {
@@ -1851,7 +1863,36 @@
 					{id: 'LAST_FINANCIAL_YEAR', name: GIS.i18n.last_financial_year},
 					{id: 'THIS_YEAR', name: GIS.i18n.this_year},
 					{id: 'LAST_YEAR', name: GIS.i18n.last_year}
-				]
+				],
+				relativePeriodsMap: {
+					'LAST_WEEK': {id: 'LAST_WEEK', name: GIS.i18n.last_week},
+					'LAST_MONTH': {id: 'LAST_MONTH', name: GIS.i18n.last_month},
+					'LAST_BIMONTH': {id: 'LAST_BIMONTH', name: GIS.i18n.last_bimonth},
+					'LAST_QUARTER': {id: 'LAST_QUARTER', name: GIS.i18n.last_quarter},
+					'LAST_SIX_MONTH': {id: 'LAST_SIX_MONTH', name: GIS.i18n.last_sixmonth},
+					'LAST_FINANCIAL_YEAR': {id: 'LAST_FINANCIAL_YEAR', name: GIS.i18n.last_financial_year},
+					'THIS_YEAR': {id: 'THIS_YEAR', name: GIS.i18n.this_year},
+					'LAST_YEAR': {id: 'LAST_YEAR', name: GIS.i18n.last_year}
+				},
+				integratedRelativePeriodsMap: {
+					'LAST_WEEK': 'LAST_WEEK',
+					'LAST_4_WEEKS': 'LAST_WEEK',
+					'LAST_12_WEEKS': 'LAST_WEEK',
+					'LAST_MONTH': 'LAST_MONTH',
+					'LAST_3_MONTHS': 'LAST_MONTH',
+					'LAST_12_MONTHS': 'LAST_MONTH',
+					'LAST_BIMONTH': 'LAST_BIMONTH',
+					'LAST_6_BIMONTHS': 'LAST_BIMONTH',
+					'LAST_QUARTER': 'LAST_QUARTER',
+					'LAST_4_QUARTERS': 'LAST_QUARTER',
+					'LAST_SIX_MONTH': 'LAST_SIX_MONTH',
+					'LAST_2_SIXMONTHS': 'LAST_SIX_MONTH',
+					'LAST_FINANCIAL_YEAR': 'LAST_FINANCIAL_YEAR',
+					'LAST_5_FINANCIAL_YEARS': 'LAST_FINANCIAL_YEAR',
+					'THIS_YEAR': 'THIS_YEAR',
+					'LAST_YEAR': 'LAST_YEAR',
+					'LAST_5_YEARS': 'LAST_YEAR'
+				}
 			};
 		}());
 
@@ -2066,7 +2107,8 @@
 			};
 
 			api.layout.Layout = function(config) {
-				var layout = {},
+				var config = Ext.clone(config),
+					layout = {},
 					getValidatedDimensionArray,
 					validateSpecialCases;
 
@@ -2115,7 +2157,7 @@
 				};
 
 				validateSpecialCases = function(config) {
-					var dimensions = [].concat(config.columns || [], config.rows || [], config.filters || []),
+					var dimensions = Ext.Array.clean([].concat(config.columns || [], config.rows || [], config.filters || [])),
 						dxDim,
 						peDim,
 						ouDim;
@@ -2137,6 +2179,20 @@
 						}
 					}
 
+					if (!ouDim) {
+						alert('No organisation units specified');
+						return;
+					}
+
+					if (dxDim) {
+						dxDim.items = [dxDim.items[0]];
+					}
+
+					if (peDim) {
+						peDim.items = [peDim.items[0]];
+						peDim.items[0].id = map[peDim.items[0].id] ? map[peDim.items[0].id] : peDim.items[0].id;
+					}
+
 					config.columns = [dxDim];
 					config.rows = [ouDim];
 					config.filters = [peDim];
@@ -2154,13 +2210,16 @@
 
 					config = validateSpecialCases(config);
 
+					if (!config) {
+						return;
+					}
+
 					config.columns = getValidatedDimensionArray(config.columns);
 					config.rows = getValidatedDimensionArray(config.rows);
 					config.filters = getValidatedDimensionArray(config.filters);
 
-					// At least one dimension
-					if (!(config.columns || config.rows || config.filters)) {
-						alert(gis.el + ': At least one dimension required');
+					if (!config.rows) {
+						console.log('Organisation unit dimension is invalid');
 						return;
 					}
 
@@ -2218,7 +2277,7 @@
 					layout.organisationUnitGroupSet = config.organisationUnitGroupSet;
 					layout.areaRadius = config.areaRadius;
 
-					return Ext.clone(layout);
+					return layout;
 				}();
 			};
 

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/i18n.vm'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/i18n.vm	2013-11-01 15:43:02 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/i18n.vm	2013-11-06 19:01:46 +0000
@@ -423,5 +423,6 @@
 "financial_oct": "$encoder.jsEscape($i18n.getString( 'financial_oct' ) , "'")",
 "financial_july": "$encoder.jsEscape($i18n.getString( 'financial_july' ) , "'")",
 "financial_april": "$encoder.jsEscape($i18n.getString( 'financial_april' ) , "'")",
-"relative": "$encoder.jsEscape($i18n.getString( 'relative' ) , "'")"
+"relative": "$encoder.jsEscape($i18n.getString( 'relative' ) , "'")",
+"reporting_rates": "$encoder.jsEscape($i18n.getString( 'reporting_rates' ) , "'")"
 };
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonInitialize.vm'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonInitialize.vm	2013-11-01 15:43:02 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonInitialize.vm	2013-11-06 19:01:46 +0000
@@ -441,7 +441,8 @@
 "financial_oct": "$encoder.jsEscape($i18n.getString( 'financial_oct' ) , "'")",
 "financial_july": "$encoder.jsEscape($i18n.getString( 'financial_july' ) , "'")",
 "financial_april": "$encoder.jsEscape($i18n.getString( 'financial_april' ) , "'")",
-"relative": "$encoder.jsEscape($i18n.getString( 'relative' ) , "'")"
+"relative": "$encoder.jsEscape($i18n.getString( 'relative' ) , "'")",
+"reporting_rates": "$encoder.jsEscape($i18n.getString( 'reporting_rates' ) , "'")"
 }
 }
 #if($callback)

=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js	2013-11-01 14:50:56 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js	2013-11-20 10:41:54 +0000
@@ -845,7 +845,7 @@
 			nameTextfield = Ext.create('Ext.form.field.Text', {
 				height: 26,
 				width: 371,
-				fieldStyle: 'padding-left: 6px; border-radius: 1px; border-color: #bbb; font-size:11px',
+				fieldStyle: 'padding-left: 5px; border-radius: 1px; border-color: #bbb; font-size:11px',
 				style: 'margin-bottom:0',
 				emptyText: 'Favorite name',
 				value: id ? record.data.name : '',
@@ -967,6 +967,8 @@
 						}
 
 						ns.app.favoriteWindow.destroyOnBlur = false;
+
+						nameTextfield.focus(false, 500);
 					},
 					destroy: function() {
 						ns.app.favoriteWindow.destroyOnBlur = true;
@@ -993,7 +995,7 @@
 		searchTextfield = Ext.create('Ext.form.field.Text', {
 			width: windowCmpWidth - addButton.width - 11,
 			height: 26,
-			fieldStyle: 'padding-right: 0; padding-left: 6px; border-radius: 1px; border-color: #bbb; font-size:11px',
+			fieldStyle: 'padding-right: 0; padding-left: 5px; border-radius: 1px; border-color: #bbb; font-size:11px',
 			emptyText: NS.i18n.search_for_favorites,
 			enableKeyEvents: true,
 			currentValue: '',
@@ -1312,6 +1314,8 @@
 					if (!w.hasDestroyOnBlurHandler) {
 						ns.core.web.window.addDestroyOnBlurHandler(w);
 					}
+
+					searchTextfield.focus(false, 500);
 				}
 			}
 		});
@@ -3711,31 +3715,34 @@
 					return node;
 				}
 			},
-			numberOfRecords: 0,
+			isPending: false,
 			recordsToSelect: [],
-			multipleSelectIf: function(doUpdate) {
-				if (this.recordsToSelect.length === this.numberOfRecords) {
+			recordsToRestore: [],
+			multipleSelectIf: function(map, doUpdate) {
+				if (this.recordsToSelect.length === ns.core.support.prototype.object.getLength(map)) {
 					this.getSelectionModel().select(this.recordsToSelect);
 					this.recordsToSelect = [];
-					this.numberOfRecords = 0;
+					this.isPending = false;
 
 					if (doUpdate) {
 						update();
 					}
 				}
 			},
-			multipleExpand: function(id, path, doUpdate) {
-				var rootId = ns.core.conf.finals.root.id;
+			multipleExpand: function(id, map, doUpdate) {
+				var that = this,
+					rootId = ns.core.conf.finals.root.id,
+					path = map[id];
 
 				if (path.substr(0, rootId.length + 1) !== ('/' + rootId)) {
 					path = '/' + rootId + path;
 				}
 
-				this.expandPath('/' + path, 'id', '/', function() {
-					var record = this.getRootNode().findChild('id', id, true);
-					this.recordsToSelect.push(record);
-					this.multipleSelectIf(doUpdate);
-				}, this);
+				that.expandPath(path, 'id', '/', function() {
+					record = Ext.clone(that.getRootNode().findChild('id', id, true));
+					that.recordsToSelect.push(record);
+					that.multipleSelectIf(map, doUpdate);
+				});
 			},
             select: function(url, params) {
                 if (!params) {
@@ -3768,24 +3775,18 @@
 
 				return map;
 			},
-			selectGraphMap: function(map, doUpdate) {
-				this.numberOfRecords = ns.core.support.prototype.object.getLength(map);
+			selectGraphMap: function(map, update) {
+				if (!ns.core.support.prototype.object.getLength(map)) {
+					return;
+				}
+
+				this.isPending = true;
 
 				for (var key in map) {
 					if (map.hasOwnProperty(key)) {
-						treePanel.multipleExpand(key, map[key], doUpdate);
-					}
-				}
-			},
-			xable: function(values) {
-				for (var i = 0; i < values.length; i++) {
-					if (!!values[i]) {
-						this.disable();
-						return;
-					}
-				}
-
-				this.enable();
+						treePanel.multipleExpand(key, map, update);
+					}
+				}
 			},
 			store: Ext.create('Ext.data.TreeStore', {
 				fields: ['id', 'name'],
@@ -3810,21 +3811,29 @@
 					id: ns.core.conf.finals.root.id,
 					expanded: true,
 					children: ns.core.init.rootNodes
-				},
-				listeners: {
-					load: function() {
-						//console.log(arguments);
-					}
 				}
 			}),
+			xable: function(values) {
+				for (var i = 0; i < values.length; i++) {
+					if (!!values[i]) {
+						this.disable();
+						return;
+					}
+				}
+
+				this.enable();
+			},
 			listeners: {
-				load: function() {
-					if (treePanel.tmpSelection) {
-						treePanel.selectGraphMap(treePanel.tmpSelection);
-					}
-				},
 				beforeitemexpand: function() {
-					treePanel.tmpSelection = treePanel.getParentGraphMap();
+					if (!treePanel.isPending) {
+						treePanel.recordsToRestore = treePanel.getSelectionModel().getSelection();
+					}
+				},
+				itemexpand: function() {
+					if (!treePanel.isPending && treePanel.recordsToRestore.length) {
+						treePanel.getSelectionModel().select(treePanel.recordsToRestore);
+						treePanel.recordsToRestore = [];
+					}
 				},
 				render: function() {
 					this.rendered = true;
@@ -4800,7 +4809,7 @@
 										cls: 'ns-menu-item-noicon',
 										disabled: !(NS.isSessionStorage && JSON.parse(sessionStorage.getItem('dhis2')) && JSON.parse(sessionStorage.getItem('dhis2'))['map']),
 										handler: function() {
-											window.location.href = ns.core.init.contextPath + '/dhis-web-mapping/app/index.html?s=chart';
+											window.location.href = ns.core.init.contextPath + '/dhis-web-mapping/app/index.html?s=map';
 										}
 									}
 								],
@@ -5045,26 +5054,26 @@
 						orgunits.push(ouRecords[i].id);
 					}
 				}
-			}
-
-			if (levels.length) {
-				toolMenu.clickHandler('level');
-				organisationUnitLevel.setValue(levels);
-			}
-			else if (groups.length) {
-				toolMenu.clickHandler('group');
-				organisationUnitGroup.setValue(groups);
-			}
-			else {
-				toolMenu.clickHandler('orgunit');
-				userOrganisationUnit.setValue(isOu);
-				userOrganisationUnitChildren.setValue(isOuc);
-				userOrganisationUnitGrandChildren.setValue(isOugc);
-			}
-
-			if (!(isOu || isOuc || isOugc)) {
-				if (Ext.isObject(graphMap)) {
-					treePanel.selectGraphMap(graphMap);
+
+				if (levels.length) {
+					toolMenu.clickHandler('level');
+					organisationUnitLevel.setValue(levels);
+				}
+				else if (groups.length) {
+					toolMenu.clickHandler('group');
+					organisationUnitGroup.setValue(groups);
+				}
+				else {
+					toolMenu.clickHandler('orgunit');
+					userOrganisationUnit.setValue(isOu);
+					userOrganisationUnitChildren.setValue(isOuc);
+					userOrganisationUnitGrandChildren.setValue(isOugc);
+				}
+
+				if (!(isOu || isOuc || isOugc)) {
+					if (Ext.isObject(graphMap)) {
+						treePanel.selectGraphMap(graphMap);
+					}
 				}
 			}
 			else {
@@ -5194,9 +5203,9 @@
 
 				// root nodes
 				requests.push({
-					url: init.contextPath + '/api/organisationUnits.json?level=1&paging=false&links=false',
+					url: init.contextPath + '/api/organisationUnits.json?level=1&paging=false&links=false&viewClass=detailed',
 					success: function(r) {
-						init.rootNodes = Ext.decode(r.responseText).organisationUnits;
+						init.rootNodes = Ext.decode(r.responseText).organisationUnits || [];
 						fn();
 					}
 				});
@@ -5205,7 +5214,7 @@
 				requests.push({
 					url: init.contextPath + '/api/organisationUnitLevels.json?paging=false&links=false',
 					success: function(r) {
-						init.organisationUnitLevels = Ext.decode(r.responseText).organisationUnitLevels;
+						init.organisationUnitLevels = Ext.decode(r.responseText).organisationUnitLevels || [];
 						fn();
 					}
 				});
@@ -5214,12 +5223,18 @@
 				requests.push({
 					url: init.contextPath + '/api/organisationUnits.json?userOnly=true&viewClass=detailed&links=false',
 					success: function(r) {
-						var ou = Ext.decode(r.responseText).organisationUnits[0];
-						init.user = {
-							ou: ou.id,
-							ouc: Ext.Array.pluck(ou.children, 'id')
-						};
-						fn();
+						var organisationUnits = Ext.decode(r.responseText).organisationUnits || [];
+
+						if (organisationUnits.length) {
+							var ou = organisationUnits[0];
+
+							init.user = {
+								ou: ou.id,
+								ouc: Ext.Array.pluck(ou.children, 'id')
+							};
+
+							fn();
+						}
 					}
 				});
 
@@ -5227,7 +5242,7 @@
 				requests.push({
 					url: init.contextPath + '/api/mapLegendSets.json?viewClass=detailed&links=false&paging=false',
 					success: function(r) {
-						init.legendSets = Ext.decode(r.responseText).mapLegendSets;
+						init.legendSets = Ext.decode(r.responseText).mapLegendSets || [];
 						fn();
 					}
 				});
@@ -5236,7 +5251,7 @@
 				requests.push({
 					url: init.contextPath + '/api/dimensions.json?links=false&paging=false',
 					success: function(r) {
-						init.dimensions = Ext.decode(r.responseText).dimensions;
+						init.dimensions = Ext.decode(r.responseText).dimensions || [];
 						fn();
 					}
 				});

=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/plugin.js'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/plugin.js	2013-10-28 20:17:38 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/plugin.js	2013-11-19 15:01:32 +0000
@@ -200,7 +200,7 @@
 	//if (ns.isPlugin) {
 
 		//// Resize render elements
-		//var baseEl = Ext.get(ns.init.el),
+		//var baseEl = Ext.get(ns.core.init.el),
 			//baseElBorderW = parseInt(baseEl.getStyle('border-left-width')) + parseInt(baseEl.getStyle('border-right-width')),
 			//baseElBorderH = parseInt(baseEl.getStyle('border-top-width')) + parseInt(baseEl.getStyle('border-bottom-width')),
 			//baseElPaddingW = parseInt(baseEl.getStyle('padding-left')) + parseInt(baseEl.getStyle('padding-right')),

=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/jsonInitialize.vm'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/jsonInitialize.vm	2013-10-17 09:20:36 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/jsonInitialize.vm	2013-11-19 15:01:32 +0000
@@ -11,7 +11,7 @@
   "ou":"$currentUser.getOrganisationUnit().uid",
   "ouc":[#foreach($ou in $currentUser.getOrganisationUnit().getSortedChildren())"$ou.uid"#if($velocityCount < $oucSize),#end#end]
  },
-"rootNodes":[#foreach($node in $rootNodes){"id": "$!{node.uid}","text": "$!encoder.jsonEncode( ${node.name} )","level": 1,"hasChildrenWithCoordinates": $!{node.hasChildrenWithCoordinates()},"expanded": true}#if($velocityCount<$rootNodes.size()),#end#end],
+"rootNodes":[#foreach($node in $rootNodes){"id": "$!{node.uid}","text": "$!encoder.jsonEncode( ${node.name} )","level": 1,"hasChildrenWithCoordinates": $!{node.hasChildrenWithCoordinates()},"expanded": false}#if($velocityCount<$rootNodes.size()),#end#end],
 "dimensions":[#foreach($dim in $dimensions){"id":"$!{dim.uid}","name":"$!encoder.jsonEncode($!{dim.name})"}#if($velocityCount<$dimensions.size()),#end#end],
 "legendSets":[#foreach($set in $legendSets){"id":"$!{set.uid}","name":"$!encoder.jsonEncode($!{set.name})", "mapLegends":[#foreach($legend in $set.mapLegends){"id":"$!{legend.uid}","name":"$!{legend.name}","sv":"$!{legend.startValue}", "ev":"$!{legend.endValue}", "color":"$!{legend.color}"}#if($velocityCount<$set.mapLegends.size()),#end#end]}#if($velocityCount<$legendSets.size()),#end#end],
 "organisationUnitLevels":[#foreach($level in $levels){"id":"$!{level.uid}","name":"$!encoder.jsonEncode($!{level.name})","level":"$!{level.level}"}#if($velocityCount<$levels.size()),#end#end],

=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/manifest.webapp'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/manifest.webapp	2013-10-23 18:30:28 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/manifest.webapp	2013-11-20 09:29:31 +0000
@@ -15,7 +15,7 @@
     "default_locale": "en",
     "activities": {
         "dhis": {
-            "href": ".."
+            "href": "*"
         }
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js	2013-10-15 12:40:49 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js	2013-11-20 10:41:54 +0000
@@ -1148,7 +1148,7 @@
 			nameTextfield = Ext.create('Ext.form.field.Text', {
 				height: 26,
 				width: 371,
-				fieldStyle: 'padding-left: 6px; border-radius: 1px; border-color: #bbb; font-size:11px',
+				fieldStyle: 'padding-left: 5px; border-radius: 1px; border-color: #bbb; font-size:11px',
 				style: 'margin-bottom:0',
 				emptyText: 'Favorite name',
 				value: id ? record.data.name : '',
@@ -1257,6 +1257,8 @@
 						}
 
 						dv.viewport.favoriteWindow.destroyOnBlur = false;
+
+						nameTextfield.focus(false, 500);
 					},
 					destroy: function() {
 						dv.viewport.favoriteWindow.destroyOnBlur = true;
@@ -1283,7 +1285,7 @@
 		searchTextfield = Ext.create('Ext.form.field.Text', {
 			width: windowCmpWidth - addButton.width - 11,
 			height: 26,
-			fieldStyle: 'padding-right: 0; padding-left: 6px; border-radius: 1px; border-color: #bbb; font-size:11px',
+			fieldStyle: 'padding-right: 0; padding-left: 5px; border-radius: 1px; border-color: #bbb; font-size:11px',
 			emptyText: DV.i18n.search_for_favorites,
 			enableKeyEvents: true,
 			currentValue: '',
@@ -1599,6 +1601,8 @@
 					if (!w.hasDestroyOnBlurHandler) {
 						dv.util.window.addDestroyOnBlurHandler(w);
 					}
+
+					searchTextfield.focus(false, 500);
 				}
 			}
 		});
@@ -4610,6 +4614,9 @@
 			}
 
             // Set gui
+            if (!updateGui) {
+				return;
+			}
 
             // Indicators
             dv.store.indicatorSelected.removeAll();

=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonInitialize.vm'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonInitialize.vm	2013-11-01 15:43:02 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonInitialize.vm	2013-11-12 22:04:09 +0000
@@ -213,7 +213,7 @@
 "select_boundaries_and_groups": "$encoder.jsEscape($i18n.getString( 'select_boundaries_and_groups' ) , "'")",
 "select_organisation_unit_groups": "$encoder.jsEscape($i18n.getString( 'select_organisation_unit_groups' ) , "'")",
 "user_organisation_unit_grandchildren": "$encoder.jsEscape($i18n.getString( 'user_organisation_unit_grandchildren' ) , "'")",
-"allow_external_access": "$encoder.jsEscape($i18n.getString( 'allow_external_access' ) , "'")'",
+"allow_external_access": "$encoder.jsEscape($i18n.getString( 'allow_external_access' ) , "'")",
 "daily": "$encoder.jsEscape($i18n.getString( 'daily' ) , "'")",
 "weekly": "$encoder.jsEscape($i18n.getString( 'weekly' ) , "'")",
 "monthly": "$encoder.jsEscape($i18n.getString( 'monthly' ) , "'")",