← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18285: minor

 

------------------------------------------------------------
revno: 18285
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-02-16 15:00:26 +0100
message:
  minor
modified:
  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/scripts/controllers.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-02-13 11:45:18 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js	2015-02-16 14:00:26 +0000
@@ -119,16 +119,17 @@
                             $scope.programs = [];
 
                             $scope.programNames = [];  
-                            $scope.programStageNames = [];                            
+                            $scope.programStageNames = [];        
+                            
                             //get programs valid for the selected ou and tei
                             angular.forEach(programs, function(program){
+                                $scope.programNames[program.id] = {id: program.id, name: program.name};
+                                angular.forEach(program.programStages, function(stage){                
+                                    $scope.programStageNames[stage.id] = {id: stage.id, name: stage.name};
+                                });
                                 if(program.organisationUnits.hasOwnProperty($scope.selectedOrgUnit.id) &&
                                    program.trackedEntity.id === $scope.selectedTei.trackedEntity){
-                                    $scope.programs.push(program);
-                                    $scope.programNames[program.id] = {id: program.id, name: program.name};
-                                    angular.forEach(program.programStages, function(stage){                
-                                        $scope.programStageNames[stage.id] = {id: stage.id, name: stage.name};
-                                    });
+                                    $scope.programs.push(program);                                    
                                 }
 
                                 if($scope.selectedProgramId && program.id === $scope.selectedProgramId || selectedEnrollment && selectedEnrollment.program === program.id){

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js	2015-02-12 10:51:40 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js	2015-02-16 14:00:26 +0000
@@ -137,6 +137,13 @@
     };
     
     $scope.getProgramAttributes = function(program){ 
+        
+        if($scope.selectedProgram){
+            $location.path('/').search({program: $scope.selectedProgramId});
+        }
+        else{
+            $location.path('/').search({});
+        }
 
         $scope.trackedEntityList = null; 
         $scope.selectedProgram = program;