dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #33025
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16806: GIS event layer options synced with api + Minor gui fix.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 16806 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-09-24 18:07:05 +0200
message:
GIS event layer options synced with api + Minor gui fix.
modified:
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js
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-mapping/scripts/app.js
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-visualizer/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-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js 2014-09-16 00:11:41 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js 2014-09-24 12:43:11 +0000
@@ -4371,6 +4371,7 @@
text: NS.i18n.prev_year,
style: 'border-radius:1px; margin-right:1px',
height: 24,
+ width: 62,
handler: function() {
if (periodType.getValue()) {
periodType.periodOffset--;
@@ -4383,6 +4384,7 @@
text: NS.i18n.next_year,
style: 'border-radius:1px',
height: 24,
+ width: 62,
handler: function() {
if (periodType.getValue()) {
periodType.periodOffset++;
=== 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 2014-09-16 00:11:41 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js 2014-09-24 12:43:11 +0000
@@ -3992,6 +3992,7 @@
text: NS.i18n.prev_year,
style: 'border-radius:1px; margin-right:1px',
height: 24,
+ width: 62,
handler: function() {
if (periodType.getValue()) {
periodType.periodOffset--;
@@ -4004,6 +4005,7 @@
text: NS.i18n.next_year,
style: 'border-radius:1px',
height: 24,
+ width: 62,
handler: function() {
if (periodType.getValue()) {
periodType.periodOffset++;
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js 2014-09-10 20:32:01 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js 2014-09-24 16:04:53 +0000
@@ -1487,29 +1487,27 @@
var store = this,
params = {};
- params['max'] = pageSize || 15;
+ optionSetId = optionSetId || container.dataElement.optionSet.id;
if (key) {
params['key'] = key;
}
+ params['max'] = pageSize || 15;
+
Ext.Ajax.request({
url: gis.init.contextPath + '/api/optionSets/' + optionSetId + '/options.json',
params: params,
disableCaching: false,
success: function(r) {
- var options = Ext.decode(r.responseText).options,
- data = [];
-
- Ext.each(options, function(option) {
- data.push({
- id: option,
- name: option
- });
- });
-
+ var options = Ext.decode(r.responseText).options;
+
+ for (var i = 0; i < options.length; i++) {
+ options[i].id = options[i].name;
+ }
+
store.removeAll();
- store.add(data);
+ store.loadData(options);
}
});
},
@@ -1577,27 +1575,7 @@
container.valueStore.add(Ext.clone(b.storage));
}
else {
- Ext.Ajax.request({
- url: gis.init.contextPath + '/api/optionSets/' + container.dataElement.optionSet.id + '/options.json',
- params: {
- 'max': 14
- },
- success: function(r) {
- var options = Ext.decode(r.responseText).options,
- data = [];
-
- Ext.each(options, function(option) {
- data.push({
- id: option,
- name: option
- });
- });
-
- b.storage = Ext.clone(data);
- container.valueStore.removeAll();
- container.valueStore.add(data);
- }
- });
+ container.valueStore.loadOptionSet();
}
}
});
@@ -4198,7 +4176,7 @@
}
else {
Ext.Ajax.request({
- url: gis.init.contextPath + '/api/programs.json?filter=id:eq:' + programId + '&fields=programStages[id,name],programTrackedEntityAttributes[attribute[id,name,valueType,optionSet[id,name]]]&paging=false',
+ url: gis.init.contextPath + '/api/programs.json?filter=id:eq:' + programId + '&fields=programStages[id,name],programTrackedEntityAttributes[trackedEntityAttribute[id,name,valueType,optionSet[id,name]]]&paging=false',
success: function(r) {
var program = Ext.decode(r.responseText).programs[0],
stages,
@@ -4210,7 +4188,7 @@
}
stages = program.programStages;
- attributes = Ext.Array.pluck(program.programTrackedEntityAttributes, 'attribute');
+ attributes = Ext.Array.pluck(program.programTrackedEntityAttributes, 'trackedEntityAttribute');
// attributes cache
if (Ext.isArray(attributes) && attributes.length) {
=== 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 2014-09-24 11:07:10 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js 2014-09-24 12:43:11 +0000
@@ -4319,6 +4319,7 @@
text: NS.i18n.prev_year,
style: 'margin-left:1px; border-radius:2px',
height: 24,
+ width: 62,
handler: function() {
if (periodType.getValue()) {
periodType.periodOffset--;
@@ -4331,6 +4332,7 @@
text: NS.i18n.next_year,
style: 'margin-left:1px; border-radius:2px',
height: 24,
+ width: 62,
handler: function() {
if (periodType.getValue()) {
periodType.periodOffset++;
=== 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 2014-09-24 11:07:10 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js 2014-09-24 12:43:11 +0000
@@ -4292,6 +4292,7 @@
text: NS.i18n.prev_year,
style: 'margin-left:1px; border-radius:2px',
height: 24,
+ width: 62,
handler: function() {
if (periodType.getValue()) {
periodType.periodOffset--;
@@ -4304,6 +4305,7 @@
text: NS.i18n.next_year,
style: 'margin-left:1px; border-radius:2px',
height: 24,
+ width: 62,
handler: function() {
if (periodType.getValue()) {
periodType.periodOffset++;