← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15177: PT, value color coding + ER, download bug fixed.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 15177 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-05-06 14:46:22 +0200
message:
  PT, value color coding + ER, download bug fixed.
modified:
  dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/app.js
  dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/core.js
  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/app/scripts/plugin.js
  dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js
  dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/plugin.js
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.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-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/app.js	2014-05-01 17:07:09 +0000
+++ dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/app.js	2014-05-06 12:23:34 +0000
@@ -6170,7 +6170,7 @@
 						iconCls: 'ns-menu-item-datasource',
 						handler: function() {
 							if (ns.core.init.contextPath && ns.app.paramString) {
-								window.open(ns.core.init.contextPath + ns.core.web.analytics.getParamString(ns.app.layout, 'html'), '_blank');
+								window.open(ns.core.init.contextPath + ns.core.web.analytics.getParamString(ns.app.layout, 'html', true), '_blank');
 							}
 						}
 					},
@@ -6179,7 +6179,7 @@
 						iconCls: 'ns-menu-item-datasource',
 						handler: function() {
 							if (ns.core.init.contextPath && ns.app.paramString) {
-								window.open(ns.core.init.contextPath + ns.core.web.analytics.getParamString(ns.app.layout, 'json'), '_blank');
+								window.open(ns.core.init.contextPath + ns.core.web.analytics.getParamString(ns.app.layout, 'json', true), '_blank');
 							}
 						}
 					},
@@ -6188,7 +6188,7 @@
 						iconCls: 'ns-menu-item-datasource',
 						handler: function() {
 							if (ns.core.init.contextPath && ns.app.paramString) {
-								window.open(ns.core.init.contextPath + ns.core.web.analytics.getParamString(ns.app.layout, 'xml'), '_blank');
+								window.open(ns.core.init.contextPath + ns.core.web.analytics.getParamString(ns.app.layout, 'xml', true), '_blank');
 							}
 						}
 					},
@@ -6197,7 +6197,7 @@
 						iconCls: 'ns-menu-item-datasource',
 						handler: function() {
 							if (ns.core.init.contextPath && ns.app.paramString) {
-								window.open(ns.core.init.contextPath + ns.core.web.analytics.getParamString(ns.app.layout, 'xls'), '_blank');
+								window.open(ns.core.init.contextPath + ns.core.web.analytics.getParamString(ns.app.layout, 'xls', true), '_blank');
 							}
 						}
 					},
@@ -6206,7 +6206,7 @@
 						iconCls: 'ns-menu-item-datasource',
 						handler: function() {
 							if (ns.core.init.contextPath && ns.app.paramString) {
-								window.open(ns.core.init.contextPath + ns.core.web.analytics.getParamString(ns.app.layout, 'csv'), '_blank');
+								window.open(ns.core.init.contextPath + ns.core.web.analytics.getParamString(ns.app.layout, 'csv', true), '_blank');
 							}
 						}
 					}
@@ -6444,8 +6444,6 @@
 			}
 		});
 
-
-
         getLayoutWindow = function(dataType) {
             if (dataType === 'aggregated_values') {
                 return ns.app.aggregateLayoutWindow;

=== modified file 'dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/core.js	2014-05-01 11:03:40 +0000
+++ dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/core.js	2014-05-06 12:23:34 +0000
@@ -1790,7 +1790,7 @@
 			// analytics
 			web.analytics = {};
 
-			web.analytics.getParamString = function(view, format) {
+			web.analytics.getParamString = function(view, format, skipPaging) {
                 var paramString,
                     dimensions = Ext.Array.clean([].concat(view.columns || [], view.rows || [])),
                     ignoreKeys = ['longitude', 'latitude'],
@@ -1864,7 +1864,7 @@
                 }
 
                 // paging
-                if (view.dataType === 'individual_cases' && view.paging) {
+                if (view.dataType === 'individual_cases' && view.paging && !skipPaging) {
                     paramString += view.paging.pageSize ? '&pageSize=' + view.paging.pageSize : '';
                     paramString += view.paging.page ? '&page=' + view.paging.page : '';
                 }

=== 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	2014-04-05 11:52:49 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js	2014-05-05 18:42:32 +0000
@@ -8114,7 +8114,7 @@
 							viewport.favoriteWindow.show();
 						}
 					});
-					if (gis.init.user.isAdmin) {
+					//if (gis.init.user.isAdmin) {
 						a.push({
 							text: GIS.i18n.legend,
 							menu: {},
@@ -8127,7 +8127,7 @@
 								viewport.legendSetWindow.show();
 							}
 						});
-					}
+					//}
 					a.push({
 						xtype: 'tbseparator',
 						height: 18,

=== 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	2014-05-03 11:20:30 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js	2014-05-05 18:42:32 +0000
@@ -13,6 +13,7 @@
 		isSessionStorage: 'sessionStorage' in window && window['sessionStorage'] !== null,
 		logg: []
 	};
+inst = GIS.core.instances;
 
 	GIS.core.getOLMap = function(gis) {
 		var olmap,
@@ -681,6 +682,13 @@
 
 		selectHandlers = new OpenLayers.Control.newSelectFeature(layer, options);
 
+        // workaround
+        //selectHandlers.selectStyle = {
+            //fillOpacity: 0.5,
+            //strokeWidth: 1,
+            //strokeColor: '#444'
+        //};
+
 		gis.olmap.addControl(selectHandlers);
 		selectHandlers.activate();
 	};
@@ -1087,7 +1095,7 @@
                     }
 
                     // name-column map
-                    map = Ext.clone(r.metaData.names);
+                    map = r.metaData.names;
 
                     for (var i = 0; i < r.headers.length; i++) {
                         map[r.headers[i].name] = r.headers[i].column;
@@ -1512,7 +1520,10 @@
 				success: function(r) {
 					var geojson = gis.util.geojson.decode(r),
 						format = new OpenLayers.Format.GeoJSON(),
-						features = gis.util.map.getTransformedFeatureArray(format.read(geojson));
+						features = gis.util.map.getTransformedFeatureArray(format.read(geojson)),
+                        colors = ['black', 'blue', 'red', 'green', 'yellow'],
+                        levels = [],
+                        levelObjectMap = {};
 
 					if (!Ext.isArray(features)) {
 						olmap.mask.hide();
@@ -1526,6 +1537,44 @@
 						return;
 					}
 
+                    //// get levels, colors, map
+                    //for (var i = 0; i < features.length; i++) {
+                        //levels.push(parseFloat(features[i].attributes.level));
+                    //}
+
+                    //levels = Ext.Array.unique(levels).sort();
+
+                    //for (var i = 0; i < levels.length; i++) {
+                        //levelObjectMap[levels[i]] = {
+                            //strokeColor: colors[i],
+                            //strokeWidth: levels.length - i
+                        //};
+//console.log(levels.length - i);
+                    //}
+
+                    //// style
+                    //for (var i = 0, feature, obj; i < features.length; i++) {
+                        //feature = features[i];
+                        //obj = levelObjectMap[feature.attributes.level];
+
+                        //feature.style = {
+                            //strokeColor: obj.strokeColor || 'black',
+                            //strokeWidth: obj.strokeWidth || 1,
+                            //fillOpacity: 0
+                        //};
+                    //}
+
+
+
+
+
+
+
+
+
+
+
+
 					layer.core.featureStore.loadFeatures(features.slice(0));
 
 					loadData(view, features);
@@ -2918,6 +2967,8 @@
 		gis.olmap.addLayers(layers);
 
 		GIS.core.instances.push(gis);
+g = gis;
+b = gis.layer.boundary;
 
 		return gis;
 	};

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/plugin.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/plugin.js	2014-05-04 10:49:11 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/plugin.js	2014-05-05 09:55:43 +0000
@@ -3153,7 +3153,6 @@
 		gis.olmap.addLayers(layers);
 
 		GIS.core.instances.push(gis);
-e = gis.layer.event;
 
 		return gis;
 	};

=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js	2014-05-01 10:38:21 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js	2014-05-05 18:42:32 +0000
@@ -175,7 +175,7 @@
 				},
 				displayDensity: {
 					'compact': '3px',
-					'normal': '5px',
+					'normal': '6px',
 					'comfortable': '10px',
 				},
 				fontSize: {
@@ -1996,7 +1996,7 @@
                     tdCount = tdCount + 1;
 
 					// background color from legend set
-					if (isNumeric && xLayout.legendSet) {
+					if (isValue && xLayout.legendSet) {
 						var value = parseFloat(config.value);
 						mapLegends = xLayout.legendSet.mapLegends;
 
@@ -2017,7 +2017,8 @@
 					cls += config.hidden ? ' td-hidden' : '';
 					cls += config.collapsed ? ' td-collapsed' : '';
 					cls += isValue ? ' pointer' : '';
-					cls += bgColor ? ' legend' : (config.cls ? ' ' + config.cls : '');
+					//cls += bgColor ? ' legend' : (config.cls ? ' ' + config.cls : '');
+                    cls += config.cls ? ' ' + config.cls : '';
 
 					// if sorting
 					if (Ext.isString(metaDataId)) {
@@ -2030,19 +2031,20 @@
 					}
 
 					html += '<td ' + (config.uuid ? ('id="' + config.uuid + '" ') : '');
-					html += ' class="' + cls + '" ' + colSpan + rowSpan
+					html += ' class="' + cls + '" ' + colSpan + rowSpan;
 
-					if (bgColor) {
-						html += '>';
-						html += '<div class="legendCt">';
-						html += '<div class="number ' + config.cls + '" style="padding:' + displayDensity + '; padding-right:3px; font-size:' + fontSize + '">' + htmlValue + '</div>';
-						html += '<div class="arrowCt ' + config.cls + '">';
-						html += '<div class="arrow" style="border-bottom:8px solid transparent; border-right:8px solid ' + bgColor + '">&nbsp;</div>';
-						html += '</div></div></div></td>';
-					}
-					else {
-						html += 'style="padding:' + displayDensity + '; font-size:' + fontSize + ';"' + '>' + htmlValue + '</td>';
-					}
+					//if (bgColor && isValue) {
+                        //html += 'style="color:' + bgColor + ';padding:' + displayDensity + '; font-size:' + fontSize + ';"' + '>' + htmlValue + '</td>';
+						//html += '>';
+						//html += '<div class="legendCt">';
+						//html += '<div class="number ' + config.cls + '" style="padding:' + displayDensity + '; padding-right:3px; font-size:' + fontSize + '">' + htmlValue + '</div>';
+						//html += '<div class="arrowCt ' + config.cls + '">';
+						//html += '<div class="arrow" style="border-bottom:8px solid transparent; border-right:8px solid ' + bgColor + '">&nbsp;</div>';
+						//html += '</div></div></div></td>';
+					//}
+					//else {
+						html += 'style="' + (bgColor && isValue ? 'color:' + bgColor + '; ' : '') + 'padding:' + displayDensity + '; font-size:' + fontSize + ';"' + '>' + htmlValue + '</td>';
+					//}
 
 					return html;
 				};

=== 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	2014-05-03 13:51:53 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/plugin.js	2014-05-05 09:55:43 +0000
@@ -1079,7 +1079,6 @@
 
 					getUpdatedAxis = function(axis) {
 						var dimension;
-						axis = Ext.clone(axis);
 
 						for (var i = 0; i < axis.length; i++) {
 							if (axis[i].dimension === objectName) {

=== 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	2014-04-21 16:49:18 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js	2014-05-05 09:55:43 +0000
@@ -1892,6 +1892,10 @@
 				web.mask.hide(ns.app.centerRegion);
 
 				if (NS.isDebug) {
+                    console.log("layout", ns.app.layout);
+                    console.log("xLayout", ns.app.xLayout);
+                    console.log("response", ns.app.response);
+                    console.log("xResponse", ns.app.xResponse);
 					console.log("core", ns.core);
 					console.log("app", ns.app);
 				}