dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #36207
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18538: PT DV output id scheme download options implemented.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 18538 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-03-09 16:05:23 +0100
message:
PT DV output id scheme download options implemented.
added:
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/images/dl_scheme.png
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/images/dl_scheme.png
modified:
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/i18n/i18n_app.properties
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/styles/style.css
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/i18n/i18n_app.properties
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/styles/style.css
--
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-apps/src/main/webapp/dhis-web-pivot/i18n/i18n_app.properties'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/i18n/i18n_app.properties 2015-03-05 17:32:21 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/i18n/i18n_app.properties 2015-03-09 13:00:44 +0000
@@ -175,3 +175,4 @@
this_financial_year=This financial year
user_sub_units=User sub-units
user_sub_x2_units=User sub-x2-units
+metadata_id_scheme=Meta-data ID scheme
=== added file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/images/dl_scheme.png'
Binary files dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/images/dl_scheme.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/images/dl_scheme.png 2015-03-09 13:00:44 +0000 differ
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js 2015-03-05 17:32:21 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js 2015-03-09 13:15:43 +0000
@@ -2708,6 +2708,7 @@
favoriteButton,
getParamString,
openTableLayoutTab,
+ openPlainDataSource,
downloadButton,
interpretationItem,
pluginItem,
@@ -5454,8 +5455,16 @@
}
};
+ openPlainDataSource = function(url, isNewTab) {
+ if (url) {
+ if (ns.core.init.contextPath && ns.app.paramString) {
+ window.open(url, isNewTab ? '_blank' : '_top');
+ }
+ }
+ };
+
downloadButton = Ext.create('Ext.button.Button', {
- text: 'Download',
+ text: NS.i18n.download,
disabled: true,
menu: {},
handler: function(b) {
@@ -5501,45 +5510,147 @@
text: 'JSON',
iconCls: 'ns-menu-item-datasource',
handler: function() {
- if (ns.core.init.contextPath && ns.app.paramString) {
- window.open(ns.core.init.contextPath + '/api/analytics.json' + getParamString(), '_blank');
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.json' + getParamString(), true);
+ },
+ menu: [
+ {
+ xtype: 'label',
+ text: NS.i18n.metadata_id_scheme,
+ style: 'padding:7px 18px 5px 7px; font-weight:bold; color:#333'
+ },
+ {
+ text: 'ID',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.json' + getParamString() + '&outputIdScheme=ID', true);
+ }
+ },
+ {
+ text: 'Code',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.json' + getParamString() + '&outputIdScheme=CODE', true);
+ }
+ },
+ {
+ text: 'Name',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.json' + getParamString() + '&outputIdScheme=NAME', true);
+ }
}
- }
+ ]
},
{
text: 'XML',
iconCls: 'ns-menu-item-datasource',
handler: function() {
- if (ns.core.init.contextPath && ns.app.paramString) {
- window.open(ns.core.init.contextPath + '/api/analytics.xml' + getParamString(), '_blank');
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.xml' + getParamString(), true);
+ },
+ menu: [
+ {
+ xtype: 'label',
+ text: NS.i18n.metadata_id_scheme,
+ style: 'padding:7px 18px 5px 7px; font-weight:bold; color:#333'
+ },
+ {
+ text: 'ID',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.xml' + getParamString() + '&outputIdScheme=ID', true);
+ }
+ },
+ {
+ text: 'Code',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.xml' + getParamString() + '&outputIdScheme=CODE', true);
+ }
+ },
+ {
+ text: 'Name',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.xml' + getParamString() + '&outputIdScheme=NAME', true);
+ }
}
- }
+ ]
},
{
text: 'Microsoft Excel',
iconCls: 'ns-menu-item-datasource',
handler: function() {
- if (ns.core.init.contextPath && ns.app.paramString) {
- window.location.href = ns.core.init.contextPath + '/api/analytics.xls' + getParamString();
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.xls' + getParamString());
+ },
+ menu: [
+ {
+ xtype: 'label',
+ text: NS.i18n.metadata_id_scheme,
+ style: 'padding:7px 18px 5px 7px; font-weight:bold; color:#333'
+ },
+ {
+ text: 'ID',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.xls' + getParamString() + '&outputIdScheme=ID');
+ }
+ },
+ {
+ text: 'Code',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.xls' + getParamString() + '&outputIdScheme=CODE');
+ }
+ },
+ {
+ text: 'Name',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.xls' + getParamString() + '&outputIdScheme=NAME');
+ }
}
- }
+ ]
},
{
text: 'CSV',
iconCls: 'ns-menu-item-datasource',
handler: function() {
- if (ns.core.init.contextPath && ns.app.paramString) {
- window.location.href = ns.core.init.contextPath + '/api/analytics.csv' + getParamString();
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.csv' + getParamString());
+ },
+ menu: [
+ {
+ xtype: 'label',
+ text: NS.i18n.metadata_id_scheme,
+ style: 'padding:7px 18px 5px 7px; font-weight:bold; color:#333'
+ },
+ {
+ text: 'ID',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.csv' + getParamString() + '&outputIdScheme=ID');
+ }
+ },
+ {
+ text: 'Code',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.csv' + getParamString() + '&outputIdScheme=CODE');
+ }
+ },
+ {
+ text: 'Name',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.csv' + getParamString() + '&outputIdScheme=NAME');
+ }
}
- }
+ ]
},
{
text: 'JRXML',
iconCls: 'ns-menu-item-datasource',
handler: function() {
- if (ns.core.init.contextPath && ns.app.paramString) {
- window.open(ns.core.init.contextPath + '/api/analytics.jrxml' + getParamString(), '_blank');
- }
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.jrxml' + getParamString(), true);
}
}
];
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/styles/style.css'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/styles/style.css 2015-02-25 14:23:23 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/styles/style.css 2015-03-09 13:00:44 +0000
@@ -604,26 +604,33 @@
padding-left: 10px;
}
+.ns-menu-item-image,
+.ns-menu-item-tablelayout,
+.ns-menu-item-datasource,
+.ns-menu-item-scheme,
+.ns-menu-item-selected,
+.ns-menu-item-unselected {
+ padding-left: 18px;
+}
+
.ns-menu-item-image {
background-image:url('../images/dl_image.png');
- padding-left: 18px;
}
.ns-menu-item-tablelayout {
background-image:url('../images/dl_tablelayout.png');
- padding-left: 18px;
}
.ns-menu-item-datasource {
background-image:url('../images/dl_datasource.png');
- padding-left: 18px;
+}
+.ns-menu-item-scheme {
+ background-image:url('../images/dl_scheme.png');
}
.ns-menu-item-selected {
background-image:url('../images/check.png');
- padding-left: 18px;
}
.ns-menu-item-unselected {
background-image:url('../images/check-un.png');
- padding-left: 18px;
}
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/i18n/i18n_app.properties'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/i18n/i18n_app.properties 2015-03-05 17:32:21 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/i18n/i18n_app.properties 2015-03-09 13:15:43 +0000
@@ -248,3 +248,4 @@
this_financial_year=This financial year
user_sub_units=User sub-units
user_sub_x2_units=User sub-x2-units
+metadata_id_scheme=Meta-data ID scheme
=== added file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/images/dl_scheme.png'
Binary files dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/images/dl_scheme.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/images/dl_scheme.png 2015-03-09 13:15:43 +0000 differ
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js 2015-03-05 17:32:21 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js 2015-03-09 13:15:43 +0000
@@ -2642,6 +2642,7 @@
favoriteButton,
getParamString,
openTableLayoutTab,
+ openPlainDataSource,
downloadButton,
interpretationItem,
pluginItem,
@@ -5510,6 +5511,16 @@
}
});
+ getParamString = function() {
+ var paramString = ns.core.web.analytics.getParamString(ns.core.service.layout.getExtendedLayout(ns.app.layout));
+
+ //if (ns.app.layout.showHierarchy) {
+ //paramString += '&showHierarchy=true';
+ //}
+
+ return paramString;
+ };
+
openTableLayoutTab = function(type, isNewTab) {
if (ns.core.init.contextPath && ns.app.paramString) {
var url = ns.core.init.contextPath + '/api/analytics.' + type + ns.core.web.analytics.getParamString(ns.app.xLayout);
@@ -5519,82 +5530,213 @@
}
};
+ openPlainDataSource = function(url, isNewTab) {
+ if (url) {
+ if (ns.core.init.contextPath && ns.app.paramString) {
+ window.open(url, isNewTab ? '_blank' : '_top');
+ }
+ }
+ };
+
downloadButton = Ext.create('Ext.button.Button', {
text: NS.i18n.download,
disabled: true,
- menu: {
- cls: 'ns-menu',
- shadow: false,
- showSeparator: false,
- items: [
- {
- xtype: 'label',
- text: NS.i18n.graphics,
- style: 'padding:7px 5px 5px 7px; font-weight:bold'
- },
- {
- text: NS.i18n.image_png + ' (.png)',
- iconCls: 'ns-menu-item-image',
- handler: function() {
- ns.core.support.svg.submitForm('png');
- }
- },
- {
- text: 'PDF (.pdf)',
- iconCls: 'ns-menu-item-image',
- handler: function() {
- ns.core.support.svg.submitForm('pdf');
- }
- },
- {
- xtype: 'label',
- text: NS.i18n.plain_data_sources,
- style: 'padding:7px 5px 5px 7px; font-weight:bold'
- },
- {
- text: 'JSON',
- iconCls: 'ns-menu-item-datasource',
- handler: function() {
- if (ns.core.init.contextPath && ns.app.paramString) {
- window.open(ns.core.init.contextPath + '/api/analytics.json' + ns.core.web.analytics.getParamString(ns.app.xLayout, true));
- }
- }
- },
- {
- text: 'XML',
- iconCls: 'ns-menu-item-datasource',
- handler: function() {
- if (ns.core.init.contextPath && ns.app.paramString) {
- window.open(ns.core.init.contextPath + '/api/analytics.xml' + ns.core.web.analytics.getParamString(ns.app.xLayout, true));
- }
- }
- },
- {
- text: 'Microsoft Excel',
- iconCls: 'ns-menu-item-datasource',
- handler: function() {
- if (ns.core.init.contextPath && ns.app.paramString) {
- window.location.href = ns.core.init.contextPath + '/api/analytics.xls' + ns.core.web.analytics.getParamString(ns.app.xLayout, true);
- }
- }
- },
- {
- text: 'CSV',
- iconCls: 'ns-menu-item-datasource',
- handler: function() {
- if (ns.core.init.contextPath && ns.app.paramString) {
- window.location.href = ns.core.init.contextPath + '/api/analytics.csv' + ns.core.web.analytics.getParamString(ns.app.xLayout, true);
- }
- }
- }
- ],
- listeners: {
- afterrender: function() {
- this.getEl().addCls('ns-toolbar-btn-menu');
- }
- }
- }
- });
+ menu: {},
+ handler: function(b) {
+ b.menu = Ext.create('Ext.menu.Menu', {
+ closeAction: 'destroy',
+ //cls: 'ns-menu',
+ shadow: false,
+ showSeparator: false,
+ items: function() {
+ var items = [
+ {
+ xtype: 'label',
+ text: NS.i18n.graphics,
+ style: 'padding:7px 5px 5px 7px; font-weight:bold'
+ },
+ {
+ text: NS.i18n.image_png + ' (.png)',
+ iconCls: 'ns-menu-item-image',
+ handler: function() {
+ ns.core.support.svg.submitForm('png');
+ }
+ },
+ {
+ text: 'PDF (.pdf)',
+ iconCls: 'ns-menu-item-image',
+ handler: function() {
+ ns.core.support.svg.submitForm('pdf');
+ }
+ },
+ {
+ xtype: 'label',
+ text: NS.i18n.plain_data_sources,
+ style: 'padding:7px 5px 5px 7px; font-weight:bold'
+ },
+ {
+ text: 'JSON',
+ iconCls: 'ns-menu-item-datasource',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.json' + getParamString(), true);
+ },
+ menu: [
+ {
+ xtype: 'label',
+ text: NS.i18n.metadata_id_scheme,
+ style: 'padding:7px 18px 5px 7px; font-weight:bold; color:#333'
+ },
+ {
+ text: 'ID',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.json' + getParamString() + '&outputIdScheme=ID', true);
+ }
+ },
+ {
+ text: 'Code',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.json' + getParamString() + '&outputIdScheme=CODE', true);
+ }
+ },
+ {
+ text: 'Name',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.json' + getParamString() + '&outputIdScheme=NAME', true);
+ }
+ }
+ ]
+ },
+ {
+ text: 'XML',
+ iconCls: 'ns-menu-item-datasource',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.xml' + getParamString(), true);
+ },
+ menu: [
+ {
+ xtype: 'label',
+ text: NS.i18n.metadata_id_scheme,
+ style: 'padding:7px 18px 5px 7px; font-weight:bold; color:#333'
+ },
+ {
+ text: 'ID',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.xml' + getParamString() + '&outputIdScheme=ID', true);
+ }
+ },
+ {
+ text: 'Code',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.xml' + getParamString() + '&outputIdScheme=CODE', true);
+ }
+ },
+ {
+ text: 'Name',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.xml' + getParamString() + '&outputIdScheme=NAME', true);
+ }
+ }
+ ]
+ },
+ {
+ text: 'Microsoft Excel',
+ iconCls: 'ns-menu-item-datasource',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.xls' + getParamString());
+ },
+ menu: [
+ {
+ xtype: 'label',
+ text: NS.i18n.metadata_id_scheme,
+ style: 'padding:7px 18px 5px 7px; font-weight:bold; color:#333'
+ },
+ {
+ text: 'ID',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.xls' + getParamString() + '&outputIdScheme=ID');
+ }
+ },
+ {
+ text: 'Code',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.xls' + getParamString() + '&outputIdScheme=CODE');
+ }
+ },
+ {
+ text: 'Name',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.xls' + getParamString() + '&outputIdScheme=NAME');
+ }
+ }
+ ]
+ },
+ {
+ text: 'CSV',
+ iconCls: 'ns-menu-item-datasource',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.csv' + getParamString());
+ },
+ menu: [
+ {
+ xtype: 'label',
+ text: NS.i18n.metadata_id_scheme,
+ style: 'padding:7px 18px 5px 7px; font-weight:bold; color:#333'
+ },
+ {
+ text: 'ID',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.csv' + getParamString() + '&outputIdScheme=ID');
+ }
+ },
+ {
+ text: 'Code',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.csv' + getParamString() + '&outputIdScheme=CODE');
+ }
+ },
+ {
+ text: 'Name',
+ iconCls: 'ns-menu-item-scheme',
+ handler: function() {
+ openPlainDataSource(ns.core.init.contextPath + '/api/analytics.csv' + getParamString() + '&outputIdScheme=NAME');
+ }
+ }
+ ]
+ }
+ ];
+
+ return items;
+ }(),
+ listeners: {
+ added: function() {
+ ns.app.downloadButton = this;
+ },
+ show: function() {
+ ns.core.web.window.setAnchorPosition(b.menu, b);
+ },
+ hide: function() {
+ b.menu.destroy();
+ },
+ destroy: function(m) {
+ b.menu = null;
+ }
+ }
+ });
+
+ this.menu.show();
+ }
+ });
interpretationItem = Ext.create('Ext.menu.Item', {
text: 'Write interpretation' + ' ',
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/styles/style.css'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/styles/style.css 2015-02-25 14:51:26 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/styles/style.css 2015-03-09 13:15:43 +0000
@@ -435,26 +435,33 @@
padding-left: 10px;
}
+.ns-menu-item-image,
+.ns-menu-item-tablelayout,
+.ns-menu-item-datasource,
+.ns-menu-item-scheme,
+.ns-menu-item-selected,
+.ns-menu-item-unselected {
+ padding-left: 18px;
+}
+
.ns-menu-item-image {
background-image:url('../images/dl_image.png');
- padding-left: 18px;
}
.ns-menu-item-tablelayout {
background-image:url('../images/dl_tablelayout.png');
- padding-left: 18px;
}
.ns-menu-item-datasource {
background-image:url('../images/dl_datasource.png');
- padding-left: 18px;
+}
+.ns-menu-item-scheme {
+ background-image:url('../images/dl_scheme.png');
}
.ns-menu-item-selected {
background-image:url('../images/check.png');
- padding-left: 18px;
}
.ns-menu-item-unselected {
background-image:url('../images/check-un.png');
- padding-left: 18px;
}
/* Menu align */