=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js' --- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js 2014-06-17 07:48:20 +0000 +++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js 2014-06-19 10:07:22 +0000 @@ -1,7 +1,7 @@ trackerCapture.controller('ProfileController', function($scope, - storage, CurrentSelection, + TEService, TEIService, AttributesFactory, TranslationService) { @@ -23,20 +23,20 @@ var selections = CurrentSelection.get(); $scope.selectedEntity = selections.tei; $scope.selectedProgram = selections.pr; - - $scope.processTeiAttributes(); + + if($scope.selectedEntity){ + TEService.get($scope.selectedEntity.trackedEntity).then(function(te){ + $scope.trackedEntity = te; + }); + + $scope.processTeiAttributes(); + } }); //display only those attributes that belong the selected program //if no program, display attributesInNoProgram - $scope.processTeiAttributes = function(){ - - angular.forEach(storage.get('TRACKED_ENTITIES'), function(te){ - if($scope.selectedEntity.trackedEntity === te.id){ - $scope.trackedEntity = te; - } - }); + $scope.processTeiAttributes = function(){ angular.forEach($scope.selectedEntity.attributes, function(att){ if(att.type === 'number' && !isNaN(parseInt(att.value))){ === modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/services.js' --- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/services.js 2014-06-17 07:48:20 +0000 +++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/services.js 2014-06-19 10:07:22 +0000 @@ -203,6 +203,18 @@ }); }); return def.promise; + }, + get: function(uid){ + var def = $q.defer(); + + StorageService.currentStore.open().done(function(){ + StorageService.currentStore.get('trackedEntities', uid).done(function(te){ + $rootScope.$apply(function(){ + def.resolve(te); + }); + }); + }); + return def.promise; } }; }) === modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css' --- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css 2014-06-19 09:37:45 +0000 +++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css 2014-06-19 10:07:22 +0000 @@ -719,25 +719,11 @@ padding: 6px 12px; font-size: 14px; } -/*input[type=number], input[type=text], input[type=password], textarea { - border: 1px solid #aaa; - padding: 6px 12px; - font-size: 14px; -} - -input[type=number] { - border: 1px solid #aaa; - padding: 4px 1px; - border-radius: 3px; -} - -input[type=text], input[type=password], textarea, select { - border: 1px solid #aaa; - padding: 6px 12px; - font-size: 14px; - border-radius: 3px; -}*/ - +input[type=number], input[type=text], input[type=password], textarea { + border: 1px solid #aaa; + padding: 6px 12px; + font-size: 14px; +} /*----------------------------------------------------------------------------*/ /* Search filters