← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18172: tracker-capture: custom forms are now available in registration, enrollment and profile edit widgets

 

------------------------------------------------------------
revno: 18172
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-02-04 13:53:26 +0100
message:
  tracker-capture: custom forms are now available in registration, enrollment and profile edit widgets
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/components/dataentry/dataentry-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/default-registration-form.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/enrollment-dates-form.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/tei.html
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.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-01-05 10:20:46 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js	2015-02-04 12:53:26 +0000
@@ -61,7 +61,7 @@
                     EnrollmentService.getByEntity($scope.selectedTeiId).then(function(response){                    
 
                         var selectedEnrollment = null;
-                        if(response.enrollments.length === 1 && response.enrollments[0].status === 'ACTIVE'){
+                        if(angular.isObject(response) && response.enrollments && response.enrollments.length === 1 && response.enrollments[0].status === 'ACTIVE'){
                             selectedEnrollment = response.enrollments[0];
                         }
                         

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2015-01-26 09:43:10 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2015-02-04 12:53:26 +0000
@@ -50,7 +50,7 @@
             
         $scope.allowEventCreation = false;
         $scope.repeatableStages = [];        
-        $scope.dhis2Events = null;
+        $scope.dhis2Events = [];
         
         var selections = CurrentSelection.get();          
         $scope.selectedOrgUnit = storage.get('SELECTED_OU');
@@ -77,8 +77,8 @@
     });
     
     $scope.getEvents = function(){
-        $scope.dhis2Events = [];
         DHIS2EventFactory.getEventsByProgram($scope.selectedEntity.trackedEntityInstance, $scope.selectedOrgUnit.id, $scope.selectedProgram.id).then(function(events){
+            $scope.dhis2Events = [];
             if(angular.isObject(events)){
                 angular.forEach(events, function(dhis2Event){                    
                     if(dhis2Event.enrollment === $scope.selectedEnrollment.enrollment){

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js	2015-02-03 17:12:51 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js	2015-02-04 12:53:26 +0000
@@ -31,7 +31,6 @@
     var selections = {};
     $scope.$on('selectedItems', function(event, args) {   
         $scope.attributes = [];
-        $scope.enrollments = [];
         $scope.historicalEnrollments = [];
         $scope.showEnrollmentDiv = false;
         $scope.showEnrollmentHistoryDiv = false;
@@ -41,20 +40,15 @@
         var selectedEnrollment = null;
         $scope.newEnrollment = {};
         
-        selections = CurrentSelection.get();
-        
-        $scope.selectedTei = angular.copy(selections.tei); 
-        angular.forEach($scope.selectedTei.attributes, function(att){
-            $scope.selectedTei[att.attribute] = att.value;
-        });
-        delete $scope.selectedTei.attributes;
+        selections = CurrentSelection.get();        
+        processSelectedTei();       
         
         $scope.selectedEntity = selections.te;
         $scope.selectedProgram = selections.pr;
         $scope.optionSets = selections.optionSets;
         $scope.programs = selections.prs;
         selectedEnrollment = selections.selectedEnrollment;
-        $scope.enrollments = selections.enrollments;
+        $scope.enrollments = selections.enrollments ? selections.enrollments : [];
         
         if(selectedEnrollment){//enrollment exists
             selectedEnrollment.dateOfIncident = DateUtils.formatFromApiToUser(selectedEnrollment.dateOfIncident);
@@ -93,12 +87,10 @@
             }
             else{
                 $scope.selectedEnrollment = null;
-                $scope.broadCastSelections('dashboardWidgets');
             }
         }
-        else{
-            $scope.broadCastSelections('dashboardWidgets');
-        }
+        
+        $scope.broadCastSelections('dashboardWidgets');
         
     });
     
@@ -109,7 +101,7 @@
         $scope.showEnrollmentHistoryDiv = false;
         $scope.selectedEnrollment = enrollment;
         
-        if(!$scope.selectedEnrollment){//prepare for possible enrollment
+        if(!$scope.selectedEnrollment.enrollment){//prepare for possible enrollment
             AttributesFactory.getByProgram($scope.selectedProgram).then(function(atts){
                 $scope.attributes = atts;                
                 $scope.selectedProgram.hasCustomForm = false;               
@@ -123,8 +115,6 @@
                 });
             });                
         }
-        
-        $scope.broadCastSelections('dashboardWidgets');
     };
         
     $scope.showNewEnrollment = function(){       
@@ -139,7 +129,7 @@
             $scope.showEnrollmentHistoryDiv = false;
             
             //load new enrollment details
-            $scope.selectedEnrollment = null;            
+            $scope.selectedEnrollment = {};            
             $scope.loadEnrollmentDetails($scope.selectedEnrollment);
             
             //check custom form for enrollment
@@ -152,7 +142,6 @@
                 }                
                 $scope.selectedProgram.displayCustomForm = $scope.selectedProgram.hasCustomForm ? true:false;
             });
-            
             $scope.broadCastSelections('dashboardWidgets');
         }
     };
@@ -178,18 +167,19 @@
         }
         
         //form is valid, continue with enrollment
-        var tei = angular.copy($scope.selectedTei);
+        var result = getProcessedForm();
+        $scope.formEmpty = result.formEmpty;
+        var tei = result.tei;
         
-        //get enrollment attributes and their values - new attributes because of enrollment
-        angular.forEach($scope.attributesForEnrollment, function(attribute){            
-            tei.attributes.push({attribute: attribute.id, value: attribute.value, type: attribute.valueType, displayName: attribute.name});                        
-        });
+        if($scope.formEmpty){//form is empty
+            return false;
+        }
         
         var enrollment = {trackedEntityInstance: tei.trackedEntityInstance,
                             program: $scope.selectedProgram.id,
                             status: 'ACTIVE',
-                            dateOfEnrollment: DateUtils.formatFromUserToApi($scope.newEnrollment.dateOfEnrollment),
-                            dateOfIncident: $scope.newEnrollment.dateOfIncident ? DateUtils.formatFromUserToApi($scope.newEnrollment.dateOfIncident) : DateUtils.formatFromUserToApi($scope.newEnrollment.dateOfEnrollment)
+                            dateOfEnrollment: DateUtils.formatFromUserToApi($scope.selectedEnrollment.dateOfEnrollment),
+                            dateOfIncident: $scope.newEnrollment.dateOfIncident ? DateUtils.formatFromUserToApi($scope.selectedEnrollment.dateOfIncident) : DateUtils.formatFromUserToApi($scope.selectedEnrollment.dateOfEnrollment)
                         };
                         
         TEIService.update(tei, $scope.optionSets).then(function(updateResponse){            
@@ -207,20 +197,15 @@
                         return;
                     }
                     
-                    //update tei attributes without refetching from the server
-                    $scope.selectedTei.attributes = tei.attributes;
-                    
                     enrollment.enrollment = enrollmentResponse.reference;
                     $scope.selectedEnrollment = enrollment;
-                    $scope.selectedEnrollment.dateOfEnrollment = DateUtils.formatFromApiToUser(enrollment.dateOfEnrollment);
-                    $scope.selectedEnrollment.dateOfIncident = DateUtils.formatFromApiToUser(enrollment.dateOfIncident);
                     $scope.enrollments.push($scope.selectedEnrollment);
                     
-                    $scope.autoGenerateEvents();                    
-                    $scope.broadCastSelections('dashboardWidgets'); 
+                    $scope.autoGenerateEvents();
                     
                     $scope.showEnrollmentDiv = false;
                     $scope.outerForm.submitted = false;      
+                    $scope.broadCastSelections('dashboardWidgets');
                 });
             }
             else{
@@ -236,19 +221,39 @@
     };
     
     $scope.broadCastSelections = function(listeners){
-        
+        var tei = getProcessedForm().tei;
+        var enrollment = null;      
+        if($scope.selectedEnrollment && $scope.selectedEnrollment.enrollment){
+            enrollment = $scope.selectedEnrollment;
+        }
+            
+        CurrentSelection.set({tei: tei, te: $scope.selectedEntity, prs: $scope.programs, pr: $scope.selectedProgram, enrollments: $scope.enrollments, selectedEnrollment: enrollment, optionSets: $scope.optionSets});
+        $timeout(function(){
+            $rootScope.$broadcast(listeners, {});
+        }, 200);
+    };    
+    
+    var getProcessedForm = function(){
         var tei = angular.copy(selections.tei);
         tei.attributes = [];
+        var formEmpty = true;
         for(var k in $scope.attributesById){
             if( $scope.selectedTei[k] ){
                 tei.attributes.push({attribute: $scope.attributesById[k].id, value: $scope.selectedTei[k], type: $scope.attributesById[k].valueType});
+                formEmpty = false;
             }
         }
         
-        CurrentSelection.set({tei: tei, te: $scope.selectedEntity, prs: $scope.programs, pr: $scope.selectedProgram, enrollments: $scope.enrollments, selectedEnrollment: $scope.selectedEnrollment, optionSets: $scope.optionSets});
-        $timeout(function(){
-            $rootScope.$broadcast(listeners, {});
-        }, 100);
+        return {tei: tei, formEmpty: formEmpty};
+    };
+    
+    var processSelectedTei = function(){
+        $scope.selectedTei = null;
+        $scope.selectedTei = angular.copy(selections.tei); 
+        angular.forEach($scope.selectedTei.attributes, function(att){
+            $scope.selectedTei[att.attribute] = att.value;
+        });
+        delete $scope.selectedTei.attributes;
     };
     
     $scope.hideEnrollmentDiv = function(){
@@ -259,6 +264,7 @@
          * has already fetched the programs. With the ID passed to it, it will
          * pass back the actual program than ID. 
          */
+        processSelectedTei();
         $scope.selectedProgram = ($location.search()).program;
         $scope.broadCastSelections('mainDashboard'); 
     };

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html	2015-02-03 17:12:51 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html	2015-02-04 12:53:26 +0000
@@ -26,7 +26,7 @@
     <div ng-show="enrollmentWidget.expand" class="panel-body dashboard-widget-container">
         
         <!-- operations on selected enrollment begins -->
-        <div ng-if="selectedEnrollment">
+        <div ng-if="selectedEnrollment.enrollment">
 
             <table class="table-borderless table-striped">
                 <tr class="col-md-12">

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js	2015-02-03 15:59:38 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js	2015-02-04 12:53:26 +0000
@@ -10,6 +10,7 @@
     
     $scope.editingDisabled = true;
     $scope.enrollmentEditing = false;
+    $scope.widget = 'PROFILE';
     
     //attributes for profile    
     $scope.attributes = []; 
@@ -22,7 +23,8 @@
     
     //listen for the selected entity
     var selections = {};
-    $scope.$on('dashboardWidgets', function(event, args) { 
+    $scope.$on('dashboardWidgets', function(event, args) {
+        $scope.enrollmentEditing = args.enrollmentEditing;
         selections = CurrentSelection.get();
         $scope.selectedTei = angular.copy(selections.tei);
         $scope.trackedEntity = selections.te;
@@ -50,7 +52,7 @@
                         $scope.selectedProgram.hasCustomForm = true;
                         $scope.selectedProgram.displayCustomForm = $scope.selectedProgram.hasCustomForm ? true:false;
                         $scope.trackedEntityForm = teForm;
-                        $scope.customForm = CustomFormService.getForTrackedEntity($scope.trackedEntityForm, 'PROFILE');
+                        $scope.customForm = CustomFormService.getForTrackedEntity($scope.trackedEntityForm, $scope.widget);
                     }                    
                 });
             });                
@@ -88,7 +90,7 @@
         var tei = angular.copy(selections.tei);
         tei.attributes = [];
         for(var k in $scope.attributesById){
-            if( $scope.selectedTei[k] ){
+            if( $scope.selectedTei.hasOwnProperty(k) && $scope.selectedTei[k] ){
                 tei.attributes.push({attribute: $scope.attributesById[k].id, value: $scope.selectedTei[k], type: $scope.attributesById[k].valueType});
                 $scope.formEmpty = false;
             }

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js	2015-02-03 17:46:00 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js	2015-02-04 12:53:26 +0000
@@ -21,7 +21,8 @@
     $scope.trackedEntityForm = null;
     $scope.customForm = null;
     $scope.optionSets = CurrentSelection.getOptionSets();
-    $scope.attributesById = [];    
+    $scope.attributesById = [];
+    $scope.selectedTei = {};
     AttributesFactory.getAll().then(function(atts){
         angular.forEach(atts, function(att){
             $scope.attributesById[att.id] = att;
@@ -94,22 +95,26 @@
         //get tei attributes and their values
         //but there could be a case where attributes are non-mandatory and
         //registration form comes empty, in this case enforce at least one value        
-        var result = TEIService.reconstructForWebApi($scope.attributes, $scope.attributesById, $scope.optionSets);        
-        $scope.formEmpty = result.formEmpty;
+        $scope.formEmpty = true;        
+        $scope.tei = {trackedEntity: selectedTrackedEntity, orgUnit: $scope.selectedOrgUnit.id, attributes: [] };
+        for(var k in $scope.attributesById){
+            if( $scope.selectedTei.hasOwnProperty(k) && $scope.selectedTei[k] ){
+                var val = $scope.selectedTei[k];
+                $scope.tei.attributes.push({attribute: $scope.attributesById[k].id, value: val, type: $scope.attributesById[k].valueType});
+                $scope.formEmpty = false;
+            }
+        }
         
-        if($scope.formEmpty){
-            //registration form is empty
+        if($scope.formEmpty){//registration form is empty
             return false;
         }
         
-        //prepare tei model and do registration
-        $scope.tei = {trackedEntity: selectedTrackedEntity, orgUnit: $scope.selectedOrgUnit.id, attributes: result.attributes };   
         var teiId = '';
-        TEIService.register($scope.tei).then(function(tei){
+        TEIService.register($scope.tei, $scope.optionSets).then(function(response){
             
-            if(tei.status === 'SUCCESS'){
+            if(response.status === 'SUCCESS'){
                 
-                teiId = tei.reference;
+                teiId = response.reference;
                 
                 //registration is successful and check for enrollment
                 if($scope.selectedProgram){    
@@ -132,7 +137,7 @@
                         }
                         else{
                             enrollment.enrollment = data.reference;
-                            $scope.autoGenerateEvents(teiId,$scope.selectedProgram, $scope.selectedOrgUnit, $scope.selectedEnrollment);                          
+                            $scope.autoGenerateEvents(teiId,$scope.selectedProgram, $scope.selectedOrgUnit, enrollment);                          
                         }
                     });
                 }
@@ -141,7 +146,7 @@
                 //registration has failed
                 var dialogOptions = {
                         headerText: 'registration_error',
-                        bodyText: tei.description
+                        bodyText: response.description
                     };
                 DialogService.showDialog({}, dialogOptions);
                 return;
@@ -149,14 +154,9 @@
             
             $timeout(function() { 
                 //reset form
-                angular.forEach($scope.attributes, function(attribute){
-                    delete attribute.value;                
-                });            
-
-                $scope.selectedEnrollment.dateOfEnrollment = '';
-                $scope.selectedEnrollment.dateOfIncident =  '';
-                $scope.outerForm.submitted = false; 
-
+                $scope.selectedTei = {};
+                $scope.selectedEnrollment = {};
+                $scope.outerForm.submitted = false;
 
                 if(destination === 'DASHBOARD') {
                     $location.path('/dashboard').search({tei: teiId,                                            

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration.html	2015-02-03 17:46:00 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration.html	2015-02-04 12:53:26 +0000
@@ -8,6 +8,7 @@
                 <span class="primary pull-right"><i class="fa fa-file-text fa-2x"></i></span>
             </a>
         </div>
+        
         <!--custom registration form begins-->
         <div class="row col-sm-12 vertical-spacing" ng-if="selectedProgram && selectedProgram.displayCustomForm">
             <div ng-if="!customForm.hasProgramDate">
@@ -22,7 +23,7 @@
                                    name="dateOfEnrollment" 
                                    class="form-control" 
                                    d2-date 
-                                   ng-model="enrollment.dateOfEnrollment" 
+                                   ng-model="selectedEnrollment.dateOfEnrollment" 
                                    max-date="selectedProgram.selectEnrollmentDatesInFuture ? '' : 0"
                                    min-date=""
                                    ng-required="true"/>
@@ -41,7 +42,7 @@
                                    d2-date 
                                    max-date="selectedProgram.selectIncidentDatesInFuture ? '' : 0"
                                    min-date=""
-                                   ng-model="enrollment.dateOfIncident"/>
+                                   ng-model="selectedEnrollment.dateOfIncident"/>
                         </td>
                     </tr>
                 </table>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js	2015-02-03 15:59:38 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js	2015-02-04 12:53:26 +0000
@@ -549,16 +549,18 @@
                 });
             });
             
-            return def.promise;       
+            return def.promise;
         },
-        register: function(tei){
-            
+        register: function(tei, optionSets){            
             var url = '../api/trackedEntityInstances';
+            var def = $q.defer();
             
-            var promise = $http.post(url, tei).then(function(response){
-                return response.data;
+            this.convertFromUserToApi(tei, optionSets).then(function(formattedTei){
+                $http.post(url, formattedTei).then(function(response){
+                    def.resolve( response.data );
+                });
             });
-            return promise;
+            return def.promise;
         },
         processAttributes: function(selectedTei, selectedProgram, selectedEnrollment){
             var def = $q.defer();            

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/default-registration-form.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/default-registration-form.html	2015-02-03 17:12:51 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/default-registration-form.html	2015-02-04 12:53:26 +0000
@@ -1,4 +1,4 @@
-<h3>{{'profile'| translate}}</h3>
+<h3 ng-if="widget !== 'PROFILE'">{{'profile'| translate}}</h3>
 <table class="table-borderless table-striped">
     <tr ng-repeat="attribute in attributes">
         <td>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/enrollment-dates-form.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/enrollment-dates-form.html	2015-02-03 17:12:51 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/enrollment-dates-form.html	2015-02-04 12:53:26 +0000
@@ -9,7 +9,7 @@
                    name="dateOfEnrollment" 
                    class="form-control" 
                    d2-date 
-                   ng-model="enrollment.dateOfEnrollment" 
+                   ng-model="selectedEnrollment.dateOfEnrollment" 
                    max-date="selectedProgram.selectEnrollmentDatesInFuture ? '' : 0"
                    min-date=""
                    ng-required="true"/>
@@ -28,7 +28,7 @@
                    d2-date 
                    max-date="selectedProgram.selectIncidentDatesInFuture ? '' : 0"
                    min-date=""
-                   ng-model="enrollment.dateOfIncident"/>
+                   ng-model="selectedEnrollment.dateOfIncident"/>
         </td>
     </tr>
 </table>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/tei.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/tei.html	2015-01-14 14:02:44 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/tei.html	2015-02-04 12:53:26 +0000
@@ -26,8 +26,17 @@
                         ng-click="showDashboard(trackedEntity)"
                         title="{{'go_to_dashboard'| translate}}">
                         <td ng-show="gridColumn.show"                                            
-                            ng-repeat="gridColumn in gridColumns">                                                
-                            {{trackedEntity[gridColumn.id]}}                                                
+                            ng-repeat="gridColumn in gridColumns">
+                            <span ng-switch="gridColumn.valueType">
+                                <span ng-switch-when="bool">
+                                    <span ng-if="trackedEntity[gridColumn.id] === 'true'">{{'yes' | translate}}</span>
+                                    <span ng-if="trackedEntity[gridColumn.id] === 'false'">{{ 'no' | translate}}</span>
+                                </span>
+                                <span ng-switch-when="trueOnly">
+                                    <span ng-if="trackedEntity[gridColumn.id] === 'true'"><i class="fa fa-check"></i></span>
+                                </span>
+                                <span ng-switch-default>{{trackedEntity[gridColumn.id]}}</span>
+                            </span>                            
                         </td>
                     </tr>
                 </tbody>        

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js	2015-02-02 13:42:37 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js	2015-02-04 12:53:26 +0000
@@ -14,10 +14,10 @@
             url = 'i18n/i18n_app_' + locale + '.properties';
         }
 
-        var tx = {locale: locale};
+        var tx = {};
 
         var promise = $http.get(url).then(function(response){
-            tx= {locale: locale, keys: dhis2.util.parseJavaProperties(response.data)};
+            tx = {locale: locale, keys: dhis2.util.parseJavaProperties(response.data)};
             return tx;
         }, function(){
             var dialogOptions = {
@@ -27,7 +27,7 @@
 
             DialogService.showDialog({}, dialogOptions);
             var p = $http.get(defaultUrl).then(function(response){
-                tx= {locale: locale, keys: dhis2.util.parseJavaProperties(response.data)};
+                tx = {locale: locale, keys: dhis2.util.parseJavaProperties(response.data)};
                 return tx;
             });
             return p;