dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #27300
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13569: PT, DV, plugin config fixes.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 13569 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-01-03 19:02:38 +0100
message:
PT, DV, plugin config fixes.
modified:
dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js
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/core.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-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 2014-01-03 17:40:45 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js 2014-01-03 18:02:38 +0000
@@ -4803,12 +4803,12 @@
text += '<html>\n<head>\n';
text += '<link rel="stylesheet" href="http://dhis2-cdn.org/v214/ext/resources/css/ext-plugin-gray.css" />\n';
text += '<script src="http://dhis2-cdn.org/v214/ext/ext-all.js"></script>\n';
- text += '<script src="http://dhis2-cdn.org/v214/plugin/table.js"></script>\n\n';
- text += '<script>\n';
- text += 'var base = "' + ns.core.init.contextPath + '";\n\n';
- text += 'DHIS.getTable({' + JSON.stringify(ns.core.service.layout.layout2plugin(ns.app.layout, 'table1'), null, 2) + ');\n';
- text += '</script>\n</head>\n\n<body>\n';
- text += '<div id="table1"></div>\n';
+ text += '<script src="http://dhis2-cdn.org/v214/plugin/table.js"></script>\n';
+ text += '</head>\n\n<body>\n';
+ text += '<div id="table1"></div>\n\n';
+ text += '<script>\n\n';
+ text += 'DHIS.getTable(' + JSON.stringify(ns.core.service.layout.layout2plugin(ns.app.layout, 'table1'), null, 2) + ');\n';
+ text += '</script>\n\n';
text += '</body>\n</html>';
textArea = Ext.create('Ext.form.field.TextArea', {
=== 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-01-02 19:49:41 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js 2014-01-03 18:01:48 +0000
@@ -4476,11 +4476,22 @@
handler: function() {
var textArea,
window,
- text = 'DHIS.getChart(' + JSON.stringify(ns.core.service.layout.layout2plugin(ns.app.layout)) + ');';
+ text = '';
+
+ text += '<html>\n<head>\n';
+ text += '<link rel="stylesheet" href="http://dhis2-cdn.org/v214/ext/resources/css/ext-plugin-gray.css" />\n';
+ text += '<script src="http://dhis2-cdn.org/v214/ext/ext-all.js"></script>\n';
+ text += '<script src="http://dhis2-cdn.org/v214/plugin/chart.js"></script>\n';
+ text += '</head>\n\n<body>\n';
+ text += '<div id="chart1"></div>\n\n';
+ text += '<script>\n\n';
+ text += 'DHIS.getChart(' + JSON.stringify(ns.core.service.layout.layout2plugin(ns.app.layout, 'chart1'), null, 2) + ');\n';
+ text += '</script>\n\n';
+ text += '</body>\n</html>';
textArea = Ext.create('Ext.form.field.TextArea', {
- width: 400,
- height: 200,
+ width: 700,
+ height: 400,
readOnly: true,
cls: 'ns-textarea monospaced',
value: text
@@ -4496,12 +4507,6 @@
bbar: [
'->',
{
- text: 'Format',
- handler: function() {
- textArea.setValue('DHIS.getChart(' + JSON.stringify(ns.core.service.layout.layout2plugin(ns.app.layout), null, 2) + ');');
- }
- },
- {
text: 'Select',
handler: function() {
textArea.selectText();
@@ -5033,79 +5038,86 @@
success: function(r) {
var i18nArray = Ext.decode(r.responseText);
- // i18n
- requests.push({
- url: init.contextPath + '/api/i18n?package=org.hisp.dhis.visualizer',
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- 'Accepts': 'application/json'
- },
- params: Ext.encode(i18nArray),
- success: function(r) {
- NS.i18n = Ext.decode(r.responseText);
- fn();
- }
- });
-
- // root nodes
- requests.push({
- url: init.contextPath + '/api/organisationUnits.json?level=1&paging=false&links=false&viewClass=detailed',
- success: function(r) {
- init.rootNodes = Ext.decode(r.responseText).organisationUnits || [];
- fn();
- }
- });
-
- // organisation unit levels
- requests.push({
- url: init.contextPath + '/api/organisationUnitLevels.json?paging=false&links=false',
- success: function(r) {
- init.organisationUnitLevels = Ext.decode(r.responseText).organisationUnitLevels || [];
- fn();
- }
- });
-
- // user orgunits and children
- requests.push({
- url: init.contextPath + '/api/organisationUnits.json?userOnly=true&viewClass=detailed&links=false',
- success: function(r) {
- 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();
+ Ext.Ajax.request({
+ url: init.contextPath + '/api/system/context.json',
+ success: function(r) {
+ init.contextPath = Ext.decode(r.responseText).contextPath || init.contextPath;
+
+ // i18n
+ requests.push({
+ url: init.contextPath + '/api/i18n?package=org.hisp.dhis.visualizer',
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'Accepts': 'application/json'
+ },
+ params: Ext.encode(i18nArray),
+ success: function(r) {
+ NS.i18n = Ext.decode(r.responseText);
+ fn();
+ }
+ });
+
+ // root nodes
+ requests.push({
+ url: init.contextPath + '/api/organisationUnits.json?level=1&paging=false&links=false&viewClass=detailed',
+ success: function(r) {
+ init.rootNodes = Ext.decode(r.responseText).organisationUnits || [];
+ fn();
+ }
+ });
+
+ // organisation unit levels
+ requests.push({
+ url: init.contextPath + '/api/organisationUnitLevels.json?paging=false&links=false',
+ success: function(r) {
+ init.organisationUnitLevels = Ext.decode(r.responseText).organisationUnitLevels || [];
+ fn();
+ }
+ });
+
+ // user orgunits and children
+ requests.push({
+ url: init.contextPath + '/api/organisationUnits.json?userOnly=true&viewClass=detailed&links=false',
+ success: function(r) {
+ 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();
+ }
+ }
+ });
+
+ // legend sets
+ requests.push({
+ url: init.contextPath + '/api/mapLegendSets.json?viewClass=detailed&links=false&paging=false',
+ success: function(r) {
+ init.legendSets = Ext.decode(r.responseText).mapLegendSets || [];
+ fn();
+ }
+ });
+
+ // dimensions
+ requests.push({
+ url: init.contextPath + '/api/dimensions.json?links=false&paging=false',
+ success: function(r) {
+ init.dimensions = Ext.decode(r.responseText).dimensions || [];
+ fn();
+ }
+ });
+
+ for (var i = 0; i < requests.length; i++) {
+ Ext.Ajax.request(requests[i]);
}
}
});
-
- // legend sets
- requests.push({
- url: init.contextPath + '/api/mapLegendSets.json?viewClass=detailed&links=false&paging=false',
- success: function(r) {
- init.legendSets = Ext.decode(r.responseText).mapLegendSets || [];
- fn();
- }
- });
-
- // dimensions
- requests.push({
- url: init.contextPath + '/api/dimensions.json?links=false&paging=false',
- success: function(r) {
- init.dimensions = Ext.decode(r.responseText).dimensions || [];
- fn();
- }
- });
-
- for (var i = 0; i < requests.length; i++) {
- Ext.Ajax.request(requests[i]);
- }
}
});
}
=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/core.js 2014-01-02 19:49:41 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/core.js 2014-01-03 18:01:48 +0000
@@ -1217,6 +1217,7 @@
delete item.code;
delete item.created;
delete item.lastUpdated;
+ delete item.value;
}
}