← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21344: tracker-capture: filter enrollments based on programs that are assigned to selected orgunit and u...

 

------------------------------------------------------------
revno: 21344
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-12-04 18:03:20 +0100
message:
  tracker-capture: filter enrollments based on programs that are assigned to selected orgunit and user combination
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.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-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-12-03 09:41:52 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js	2015-12-04 17:03:20 +0000
@@ -216,6 +216,14 @@
                                     }                                
                                 });
                                 
+                                //filter those enrollments that belong to available programs
+                                var len = enrollments.length;
+                                while(len--){
+                                    if(enrollments[len].program && !$scope.programNames[enrollments[len].program]){
+                                        enrollments.splice(len,1);
+                                    }
+                                }
+                                
                                 DHIS2EventFactory.getEventsByProgram($scope.selectedTeiId, null).then(function(events){                                        
                                     //prepare selected items for broadcast
                                     CurrentSelection.setSelectedTeiEvents(events);