=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js 2015-02-19 15:42:18 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js 2015-02-24 11:08:22 +0000 @@ -14,6 +14,7 @@ EnrollmentService, ProgramFactory, DashboardLayoutService, + AttributesFactory, CurrentSelection) { //selections $scope.selectedTeiId = ($location.search()).tei; @@ -86,7 +87,16 @@ $scope.dashboardWidgetsOrder.smallerWidgets.push(w.title); }); - $scope.broadCastSelections(); + AttributesFactory.getAll().then(function(atts){ + $scope.attributes = []; + $scope.attributesById = []; + angular.forEach(atts, function(att){ + $scope.attributesById[att.id] = att; + }); + + CurrentSelection.setAttributesById($scope.attributesById); + $scope.broadCastSelections(); + }); }); }; === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js 2015-02-20 15:06:35 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js 2015-02-24 11:08:22 +0000 @@ -17,17 +17,7 @@ DialogService) { $scope.today = DateUtils.getToday(); - $scope.selectedOrgUnit = storage.get('SELECTED_OU'); - - AttributesFactory.getAll().then(function(atts){ - $scope.attributes = []; - $scope.attributesById = []; - angular.forEach(atts, function(att){ - $scope.attributesById[att.id] = att; - }); - - CurrentSelection.setAttributesById($scope.attributesById); - }); + $scope.selectedOrgUnit = storage.get('SELECTED_OU'); //listen for the selected items var selections = {}; === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js 2015-02-20 12:08:37 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js 2015-02-24 11:08:22 +0000 @@ -12,15 +12,6 @@ $scope.enrollmentEditing = false; $scope.widget = 'PROFILE'; - //attributes for profile - $scope.attributes = []; - $scope.attributesById = []; - AttributesFactory.getAll().then(function(atts){ - angular.forEach(atts, function(att){ - $scope.attributesById[att.id] = att; - }); - }); - //listen for the selected entity var selections = {}; $scope.$on('dashboardWidgets', function(event, args) { @@ -33,6 +24,7 @@ $scope.trackedEntityForm = null; $scope.customForm = null; $scope.attributes = []; + $scope.attributesById = CurrentSelection.getAttributesById(); //display only those attributes that belong to the selected program //if no program, display attributesInNoProgram === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/add-relationship.html' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/add-relationship.html 2015-01-20 11:51:34 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/add-relationship.html 2015-02-24 11:08:22 +0000 @@ -16,7 +16,14 @@