← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6626: (DV) User orgunit children fix.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 6626 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-04-17 18:01:46 +0200
message:
  (DV) User orgunit children fix.
modified:
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/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-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js	2012-04-17 14:23:08 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js	2012-04-17 15:59:59 +0000
@@ -606,8 +606,8 @@
             organisationunit: {
                 getObjects: function() {
                     var a = [],
-                        tp = DV.cmp.dimension.organisationunit.treepanel,
-                        selection = tp.getSelectionModel().getSelection();
+					tp = DV.cmp.dimension.organisationunit.treepanel,
+	                selection = tp.getSelectionModel().getSelection();
 					if (!selection.length) {
 						selection = [tp.getRootNode()];
 						tp.selectRoot();
@@ -630,12 +630,14 @@
 						if (DV.c.userorganisationunit || DV.c.userorganisationunitchildren) {
 							if (DV.c.userorganisationunit) {
 								a.push(DV.init.user.organisationunit.name);
+								DV.cmp.dimension.organisationunit.treepanel.addToStorage([DV.init.user.organisationunit]);
 							}
 							if (DV.c.userorganisationunitchildren) {
-								var c = DV.init.user.organisationunitchildren;
-								for (var i = 0; i < c.length; i++) {
-									a.push(c[i].name);
+								var ouc = DV.init.user.organisationunitchildren;
+								for (var i = 0; i < ouc.length; i++) {
+									a.push(ouc[i].name);
 								}
+								DV.cmp.dimension.organisationunit.treepanel.addToStorage(DV.init.user.organisationunitchildren);
 							}
 						}
 						else {
@@ -1660,7 +1662,7 @@
 			p.hideLegend = DV.c.hidelegend;
 			p.trendLine = DV.c.trendline;
 			p.userOrganisationUnit = DV.c.userorganisationunit;
-			p.userOrganisationUnitChildren = DV.c.userorganisationunitChildren;
+			p.userOrganisationUnitChildren = DV.c.userorganisationunitchildren;
 			if (DV.c.domainaxislabel) {
 				p.domainAxisLabel = DV.c.domainaxislabel;
 			}
@@ -1917,7 +1919,7 @@
                 url: baseurl,
                 disableCaching: false,
                 success: function(r) {
-                    DV.value.values = DV.util.value.jsonfy(r);                    
+                    DV.value.values = DV.util.value.jsonfy(r);
                     
                     if (!DV.state.validation.value()) {
 						return;