← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16222: tracker capture - bug fix in reseting selected program

 

------------------------------------------------------------
revno: 16222
committer: Abyot Asalefew Gizaw abyota@xxxxxxxxx
branch nick: dhis2
timestamp: Wed 2014-07-23 15:33:13 +0200
message:
  tracker capture - bug fix in reseting selected program
modified:
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html
  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/profile/profile.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html	2014-07-23 12:21:33 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html	2014-07-23 13:33:13 +0000
@@ -18,7 +18,7 @@
             <table class="table-borderless table-striped">
                 <tr ng-repeat="attribute in selectedTei.attributes" ng-show="attribute.show">
                     <td>
-                        {{attribute.displayName}} - {{attribute.mandatory}}
+                        {{attribute.displayName}}
                     </td>
                     <td>
                         <ng-form name="innerForm">

=== 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-07-18 16:47:49 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js	2014-07-23 13:33:13 +0000
@@ -17,9 +17,7 @@
                 EntityQueryFactory,
                 TEIGridService,
                 TEIService) {  
-    
-    $scope.dashboardProgramId = ($location.search()).program; 
-            
+                    
     //Selection
     $scope.ouModes = [{name: 'SELECTED'}, {name: 'CHILDREN'}, {name: 'DESCENDANTS'}, {name: 'ACCESSIBLE'}];         
     $scope.selectedOuMode = $scope.ouModes[0];
@@ -82,23 +80,19 @@
         }
     });
     
-    //watch for program feedback (this is when coming back from dashboar)
-    $scope.$watch('dashboardProgramId', function() {           
-        
-        if( !angular.isUndefined($scope.dashboardProgramId) && $scope.dashboardProgramId){               
-            $scope.selectedOrgUnit = storage.get('SELECTED_OU');            
-            
-            ProgramFactory.get($scope.dashboardProgramId).then(function(program){
-                $scope.selectedProgram = program;
-                AttributesFactory.getByProgram($scope.selectedProgram).then(function(atts){
-                    $scope.attributes = atts;   
-                    $scope.attributes = $scope.generateAttributeFilters($scope.attributes);
-                    $scope.gridColumns = TEIGridService.generateGridColumns(atts, $scope.selectedOuMode.name);      
-                    $scope.getProgramAttributes($scope.selectedProgram);
-                });              
-            });
-        }
-    });
+    //watch for program feedback (this is when coming back from dashboard)
+    if($scope.dashboardProgramId && $scope.dashboardProgramId !== 'null'){
+        $scope.selectedOrgUnit = storage.get('SELECTED_OU');            
+        ProgramFactory.get($scope.dashboardProgramId).then(function(program){
+            $scope.selectedProgram = program;
+            AttributesFactory.getByProgram($scope.selectedProgram).then(function(atts){
+                $scope.attributes = atts;   
+                $scope.attributes = $scope.generateAttributeFilters($scope.attributes);
+                $scope.gridColumns = TEIGridService.generateGridColumns(atts, $scope.selectedOuMode.name);      
+                $scope.getProgramAttributes($scope.selectedProgram);
+            });              
+        });
+    }
     
     //load programs associated with the selected org unit.
     $scope.loadPrograms = function(orgUnit) {