=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/plugin.html' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/plugin.html 2015-09-11 18:29:34 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/plugin.html 2015-09-11 21:01:00 +0000 @@ -28,8 +28,7 @@ DHIS.getEventChart({ url: url, el: 'report1', - id: 'W2ECFMopmyp', - completedOnly: true + id: 'W2ECFMopmyp' }); //DHIS.getEventChart({ === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js 2015-09-11 20:48:21 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js 2015-09-11 21:01:00 +0000 @@ -7997,6 +7997,7 @@ var requests = [], callbacks = 0, init = {}, + appConfig, fn; fn = function() { === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/core.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/core.js 2015-09-11 20:48:21 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/core.js 2015-09-11 21:01:00 +0000 @@ -3330,7 +3330,7 @@ } trendLineFields.push(regressionKey); - xResponse.metaData.names[regressionKey] = NS.i18n.trend + (ns.dashboard ? '' : ' (' + xResponse.metaData.names[failSafeColumnIds[i]] + ')'); + xResponse.metaData.names[regressionKey] = NS.i18n.trend + (appConfig.dashboard ? '' : ' (' + xResponse.metaData.names[failSafeColumnIds[i]] + ')'); } } } @@ -3654,8 +3654,8 @@ }; getFormatedSeriesTitle = function(titles) { - var itemLength = ns.dashboard ? 23 : 30, - charLength = ns.dashboard ? 5 : 6, + var itemLength = appConfig.dashboard ? 23 : 30, + charLength = appConfig.dashboard ? 5 : 6, numberOfItems = titles.length, numberOfChars, totalItemLength = numberOfItems * itemLength, @@ -3912,8 +3912,8 @@ }; getDefaultLegend = function(store, chartConfig) { - var itemLength = ns.dashboard ? 24 : 30, - charLength = ns.dashboard ? 4 : 6, + var itemLength = appConfig.dashboard ? 24 : 30, + charLength = appConfig.dashboard ? 4 : 6, numberOfItems = 0, numberOfChars = 0, width, @@ -4010,7 +4010,7 @@ text = xLayout.startDate + ' - ' + xLayout.endDate; } - if (ns.dashboard && Ext.isString(xLayout.name)) { + if (appConfig.dashboard && Ext.isString(xLayout.name)) { text = xLayout.name; } else if (xLayout.title) { @@ -4097,7 +4097,7 @@ } // aggregation type - if (!ns.dashboard && Ext.isObject(layout.value) && layout.value.id && layout.aggregationType) { + if (!appConfig.dashboard && Ext.isObject(layout.value) && layout.value.id && layout.aggregationType) { var value = layout.value.id; text += text.length ? ', ' : ''; @@ -4130,7 +4130,7 @@ font: titleFont, fill: titleColor, height: 20, - y: ns.dashboard ? 7 : 20 + y: appConfig.dashboard ? 7 : 20 }); }; @@ -4140,9 +4140,9 @@ height = ns.app.centerRegion.getHeight(); this.animate = false; - this.setWidth(ns.dashboard ? width : width - 15); - this.setHeight(ns.dashboard ? height : height - 40); - this.animate = !ns.dashboard; + this.setWidth(appConfig.dashboard ? width : width - 15); + this.setHeight(appConfig.dashboard ? height : height - 40); + this.animate = !appConfig.dashboard; }; }; @@ -4182,15 +4182,15 @@ //animate: true, animate: false, shadow: false, - insetPadding: ns.dashboard ? 17 : 35, + insetPadding: appConfig.dashboard ? 17 : 35, insetPaddingObject: { - top: ns.dashboard ? 12 : 32, - right: ns.dashboard ? (isLineBased ? 5 : 3) : (isLineBased ? 25 : 15), - bottom: ns.dashboard ? 2 : 10, - left: ns.dashboard ? (isLineBased ? 15 : 7) : (isLineBased ? 70 : 50) + top: appConfig.dashboard ? 12 : 32, + right: appConfig.dashboard ? (isLineBased ? 5 : 3) : (isLineBased ? 25 : 15), + bottom: appConfig.dashboard ? 2 : 10, + left: appConfig.dashboard ? (isLineBased ? 15 : 7) : (isLineBased ? 70 : 50) }, - width: ns.dashboard ? width : width - 15, - height: ns.dashboard ? height : height - 40, + width: appConfig.dashboard ? width : width - 15, + height: appConfig.dashboard ? height : height - 40, theme: 'dv1' }; @@ -4199,15 +4199,15 @@ defaultConfig.legend = getDefaultLegend(store, config); if (defaultConfig.legend.position === 'right') { - defaultConfig.insetPaddingObject.top = ns.dashboard ? 22 : 40; - defaultConfig.insetPaddingObject.right = ns.dashboard ? 5 : 40; + defaultConfig.insetPaddingObject.top = appConfig.dashboard ? 22 : 40; + defaultConfig.insetPaddingObject.right = appConfig.dashboard ? 5 : 40; } } // title if (xLayout.hideTitle) { - defaultConfig.insetPadding = ns.dashboard ? 1 : 10; - defaultConfig.insetPaddingObject.top = ns.dashboard ? 3 : 10; + defaultConfig.insetPadding = appConfig.dashboard ? 1 : 10; + defaultConfig.insetPaddingObject.top = appConfig.dashboard ? 3 : 10; } else { defaultConfig.items = [getDefaultChartTitle(store)]; @@ -4386,7 +4386,7 @@ }, markerConfig: { type: 'circle', - radius: ns.dashboard ? 3 : 4 + radius: appConfig.dashboard ? 3 : 4 }, tips: getDefaultTips(), title: seriesTitles[i] @@ -4568,10 +4568,10 @@ store: store, series: series, insetPaddingObject: { - top: ns.dashboard ? 15 : 40, - right: ns.dashboard ? 2 : 30, - bottom: ns.dashboard ? 13: 30, - left: ns.dashboard ? 7 : 30 + top: appConfig.dashboard ? 15 : 40, + right: appConfig.dashboard ? 2 : 30, + bottom: appConfig.dashboard ? 13: 30, + left: appConfig.dashboard ? 7 : 30 } }); === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/eventchart.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/eventchart.js 2015-09-11 20:48:21 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/eventchart.js 2015-09-11 21:01:00 +0000 @@ -948,7 +948,7 @@ // sortOrder: number - // outputType: string ('EVENT') - 'EVENT', 'TRACKED_ENTITY_IEVTANCE', 'ENROLLMENT' + // outputType: string ('EVENT') - 'EVENT', 'TRACKED_ENTITY_INSTANCE', 'ENROLLMENT' // rangeAxisMaxValue: number @@ -3016,7 +3016,7 @@ config.html += obj.message + (obj.message.substr(obj.message.length - 1) === '.' ? '' : '.'); // bodyStyle - config.bodyStyle = 'padding: 12px; background: #fff; max-width: 600px; max-height: ' + ns.app.centerRegion.getHeight() / 2 + 'px'; + config.bodyStyle = 'padding: 12px; background: #fff; max-width: 600px; max-height: ' + app.getCenterRegionHeight() / 2 + 'px'; // destroy handler config.modal = true; @@ -3387,7 +3387,7 @@ } trendLineFields.push(regressionKey); - xResponse.metaData.names[regressionKey] = EV.i18n.trend + (ns.dashboard ? '' : ' (' + xResponse.metaData.names[failSafeColumnIds[i]] + ')'); + xResponse.metaData.names[regressionKey] = EV.i18n.trend + (appConfig.dashboard ? '' : ' (' + xResponse.metaData.names[failSafeColumnIds[i]] + ')'); } } } @@ -3711,15 +3711,15 @@ }; getFormatedSeriesTitle = function(titles) { - var itemLength = ns.dashboard ? 23 : 30, - charLength = ns.dashboard ? 5 : 6, + var itemLength = appConfig.dashboard ? 23 : 30, + charLength = appConfig.dashboard ? 5 : 6, numberOfItems = titles.length, numberOfChars, totalItemLength = numberOfItems * itemLength, //minLength = 5, maxLength = support.prototype.array.getMaxLength(titles), fallbackLength = 10, - maxWidth = ns.app.centerRegion.getWidth(), + maxWidth = app.getCenterRegionWidth(), width, validateTitles; @@ -3969,8 +3969,8 @@ }; getDefaultLegend = function(store, chartConfig) { - var itemLength = ns.dashboard ? 24 : 30, - charLength = ns.dashboard ? 4 : 6, + var itemLength = appConfig.dashboard ? 24 : 30, + charLength = appConfig.dashboard ? 4 : 6, numberOfItems = 0, numberOfChars = 0, width, @@ -3999,7 +3999,7 @@ width = (numberOfItems * itemLength) + (numberOfChars * charLength); - if (width > ns.app.centerRegion.getWidth() - 6) { + if (width > app.getCenterRegionWidth() - 6) { position = 'right'; } @@ -4067,7 +4067,7 @@ text = xLayout.startDate + ' - ' + xLayout.endDate; } - if (ns.dashboard && Ext.isString(xLayout.name)) { + if (appConfig.dashboard && Ext.isString(xLayout.name)) { text = xLayout.name; } else if (xLayout.title) { @@ -4154,7 +4154,7 @@ } // aggregation type - if (!ns.dashboard && Ext.isObject(layout.value) && layout.value.id && layout.aggregationType) { + if (!appConfig.dashboard && Ext.isObject(layout.value) && layout.value.id && layout.aggregationType) { var value = layout.value.id; text += text.length ? ', ' : ''; @@ -4187,19 +4187,19 @@ font: titleFont, fill: titleColor, height: 20, - y: ns.dashboard ? 7 : 20 + y: appConfig.dashboard ? 7 : 20 }); }; getDefaultChartSizeHandler = function() { return function() { - var width = ns.app.centerRegion.getWidth(), - height = ns.app.centerRegion.getHeight(); + var width = app.getCenterRegionWidth(), + height = app.getCenterRegionHeight(); this.animate = false; - this.setWidth(ns.dashboard ? width : width - 15); - this.setHeight(ns.dashboard ? height : height - 40); - this.animate = !ns.dashboard; + this.setWidth(appConfig.dashboard ? width : width - 15); + this.setHeight(appConfig.dashboard ? height : height - 40); + this.animate = !appConfig.dashboard; }; }; @@ -4232,22 +4232,22 @@ getDefaultChart = function(config) { var chart, store = config.store || {}, - width = ns.app.centerRegion.getWidth(), - height = ns.app.centerRegion.getHeight(), + width = app.getCenterRegionWidth(), + height = app.getCenterRegionHeight(), isLineBased = Ext.Array.contains(['line', 'area'], xLayout.type), defaultConfig = { //animate: true, animate: false, shadow: false, - insetPadding: ns.dashboard ? 17 : 35, + insetPadding: appConfig.dashboard ? 17 : 35, insetPaddingObject: { - top: ns.dashboard ? 12 : 32, - right: ns.dashboard ? (isLineBased ? 5 : 3) : (isLineBased ? 25 : 15), - bottom: ns.dashboard ? 2 : 10, - left: ns.dashboard ? (isLineBased ? 15 : 7) : (isLineBased ? 70 : 50) + top: appConfig.dashboard ? 12 : 32, + right: appConfig.dashboard ? (isLineBased ? 5 : 3) : (isLineBased ? 25 : 15), + bottom: appConfig.dashboard ? 2 : 10, + left: appConfig.dashboard ? (isLineBased ? 15 : 7) : (isLineBased ? 70 : 50) }, - width: ns.dashboard ? width : width - 15, - height: ns.dashboard ? height : height - 40, + width: appConfig.dashboard ? width : width - 15, + height: appConfig.dashboard ? height : height - 40, theme: 'dv1' }; @@ -4256,15 +4256,15 @@ defaultConfig.legend = getDefaultLegend(store, config); if (defaultConfig.legend.position === 'right') { - defaultConfig.insetPaddingObject.top = ns.dashboard ? 22 : 40; - defaultConfig.insetPaddingObject.right = ns.dashboard ? 5 : 40; + defaultConfig.insetPaddingObject.top = appConfig.dashboard ? 22 : 40; + defaultConfig.insetPaddingObject.right = appConfig.dashboard ? 5 : 40; } } // title if (xLayout.hideTitle) { - defaultConfig.insetPadding = ns.dashboard ? 1 : 10; - defaultConfig.insetPaddingObject.top = ns.dashboard ? 3 : 10; + defaultConfig.insetPadding = appConfig.dashboard ? 1 : 10; + defaultConfig.insetPaddingObject.top = appConfig.dashboard ? 3 : 10; } else { defaultConfig.items = [getDefaultChartTitle(store)]; @@ -4443,7 +4443,7 @@ }, markerConfig: { type: 'circle', - radius: ns.dashboard ? 3 : 4 + radius: appConfig.dashboard ? 3 : 4 }, tips: getDefaultTips(), title: seriesTitles[i] @@ -4625,10 +4625,10 @@ store: store, series: series, insetPaddingObject: { - top: ns.dashboard ? 15 : 40, - right: ns.dashboard ? 2 : 30, - bottom: ns.dashboard ? 13: 30, - left: ns.dashboard ? 7 : 30 + top: appConfig.dashboard ? 15 : 40, + right: appConfig.dashboard ? 2 : 30, + bottom: appConfig.dashboard ? 13: 30, + left: appConfig.dashboard ? 7 : 30 } }); @@ -5384,13 +5384,13 @@ applyCss(); // core - ns.core = ER.getCore(init, appConfig); + ns.core = EV.getCore(init, appConfig); extendInstance(ns, appConfig); ns.app.viewport = createViewport(); ns.app.centerRegion = ns.app.viewport.centerRegion; - ER.instances.push(ns); + EV.instances.push(ns); if (el) { el.setViewportWidth = function(width) {