← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19113: ER option set fix.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 19113 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-05-08 21:32:08 +0200
message:
  ER option set 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


--
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	2015-05-08 00:20:01 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js	2015-05-08 19:21:23 +0000
@@ -7027,7 +7027,7 @@
                     var optionSetHeaders = [];
 
                     for (var i = 0; i < xResponse.headers.length; i++) {
-                        if (Ext.isString(xResponse.headers[i].optionSet)) {
+                        if (xResponse.headers[i].optionSet) {
                             optionSetHeaders.push(xResponse.headers[i]);
                         }
                     }
@@ -7055,10 +7055,12 @@
                         // execute
                         for (var i = 0, header, optionSetId, dataElementId; i < optionSetHeaders.length; i++) {
                             header = optionSetHeaders[i];
-                            optionSetId = header.optionSet;
+                            optionSetIds = Ext.Array.from(header.optionSet);
                             dataElementId = header.name;
 
-                            getOptions(optionSetId, dataElementId);
+                            for (var j = 0; j < optionSetIds.length; j++) {
+                                getOptions(optionSetIds[j], dataElementId);
+                            }
                         }
                     }
                     else {

=== 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-05-07 15:52:11 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js	2015-05-08 19:24:50 +0000
@@ -6672,7 +6672,7 @@
                     var optionSetHeaders = [];
 
                     for (var i = 0; i < xResponse.headers.length; i++) {
-                        if (Ext.isString(xResponse.headers[i].optionSet)) {
+                        if (xResponse.headers[i].optionSet) {
                             optionSetHeaders.push(xResponse.headers[i]);
                         }
                     }
@@ -6700,10 +6700,12 @@
                         // execute
                         for (var i = 0, header, optionSetId, dataElementId; i < optionSetHeaders.length; i++) {
                             header = optionSetHeaders[i];
-                            optionSetId = header.optionSet;
+                            optionSetIds = Ext.Array.from(header.optionSet);
                             dataElementId = header.name;
 
-                            getOptions(optionSetId, dataElementId);
+                            for (var j = 0; j < optionSetIds.length; j++) {
+                                getOptions(optionSetIds[j], dataElementId);
+                            }
                         }
                     }
                     else {
@@ -6712,7 +6714,7 @@
                 };
 
                 success = function() {
-                    
+
                     // timing
                     ns.app.dateTotal = new Date();
 
@@ -6762,7 +6764,7 @@
                     ns.app.centerRegion.removeAll(true);
                     ns.app.centerRegion.add(chart);
 
-                    success();                    
+                    success();
                 };
 
                 getSXLayout = function() {