← Back to team overview

dhis2-devs team mailing list archive

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

 

------------------------------------------------------------
revno: 15456
committer: Abyot Asalefew Gizaw abyota@xxxxxxxxx
branch nick: dhis2
timestamp: Wed 2014-05-28 17:31:32 +0200
message:
  minor
modified:
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js
  dhis-2/dhis-web/dhis-web-tracker-capture/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-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js	2014-05-28 15:20:11 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js	2014-05-28 15:31:32 +0000
@@ -15,7 +15,9 @@
     $scope.enrollments = [];
     $scope.programs = []; 
     $scope.showEnrollmentDiv = false;
-    $scope.showSchedulingDiv = false;
+    $scope.showSchedulingDiv = false;    
+    $scope.selectedProgram = '';
+    $scope.selectedEnrollment = '';
     
     TranslationService.translate();
     $scope.selectedOrgUnit = storage.get('SELECTED_OU');
@@ -24,7 +26,7 @@
     $scope.$on('selectedEntity', function(event, args) {   
         $scope.newEnrollment = {};
         var selections = CurrentSelection.get();
-        $scope.selectedEntity = selections.tei;    
+        $scope.selectedEntity = selections.tei;      
         
         $scope.selectedOrgUnit = storage.get('SELECTED_OU');
         
@@ -39,20 +41,18 @@
             $scope.enrollments = data.enrollmentList;  
             if(selections.pr){       
                 angular.forEach($scope.programs, function(program){
-                    if(selections.pr.id === program.id){
+                    if(selections.pr === program.id){
                         $scope.selectedProgram = program;
                         $scope.loadEvents();
                     }
                 });
             }
             
-            $scope.selectedProgram = '';
-            $scope.selectedEnrollment = '';
             CurrentSelection.set({tei: $scope.selectedEntity, pr: $scope.selectedProgram.id});
             $rootScope.$broadcast('dashboard', {selectedEntity: $scope.selectedEntity,
                                                 selectedOrgUnit: $scope.selectedOrgUnit,
                                                 selectedProgramId: $scope.selectedProgram.id,
-                                                selectedEnrollment: $scope.selectedEnrollment})
+                                                selectedEnrollment: $scope.selectedEnrollment});
         });        
         
     }); 

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js	2014-05-27 14:50:29 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js	2014-05-28 15:31:32 +0000
@@ -339,7 +339,7 @@
         
         //Fetch the selected entity
         TEIService.get($scope.selectedEntityId).then(function(data){              
-            CurrentSelection.set({tei: data, pr: $scope.selectedProgram});
+            CurrentSelection.set({tei: data, pr: $scope.selectedProgram ? $scope.selectedProgram.id : null});
          
             //broadcast selected entity for dashboard controllers
             $timeout(function() {