← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18509: some cleanup

 

------------------------------------------------------------
revno: 18509
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-03-06 15:54:40 +0100
message:
  some cleanup
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/overdue-events-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/upcoming-events-controller.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/report/overdue-events-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/overdue-events-controller.js	2015-03-06 14:43:54 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/overdue-events-controller.js	2015-03-06 14:54:40 +0000
@@ -12,7 +12,6 @@
                 ProgramFactory,
                 CurrentSelection,
                 OptionSetService,
-                TEIService,
                 storage) {    
     $scope.today = DateUtils.getToday();
     
@@ -134,37 +133,10 @@
                 }
                     
                 angular.forEach(data.eventRows, function(row){
-                    var overdueEvent = {};
-                    TEIService.reconstructForUser(row.attributes, attributes, $scope.attributesById, $scope.optionSets)
+                    var overdueEvent = {};                    
                     angular.forEach(row.attributes, function(att){
-                        
-                        /*if(att.type === 'trueOnly'){
-                            if(att.value === 'true'){
-                                att.value = true;
-                            }
-                            else{
-                                att.value = '';
-                            }
-                        }
-                        else{
-                            var val = att.value;
-                            if(val){
-                                if(att.type === 'date'){
-                                    val = DateUtils.formatFromApiToUser(val);
-                                }
-                                if(att.type === 'optionSet' && 
-                                        attsById[att.attribute] && 
-                                        attsById[att.attribute].optionSet && 
-                                        attsById[att.attribute].optionSet.id && 
-                                        optionSets[attsById[att.attribute].optionSet.id]){   
-                                    val = OptionSetService.getName(optionSets[attsById[att.attribute].optionSet.id].options, val);                                
-                                }
-                                att.value = val;
-                            }
-                        }*/
-                        
-                        overdueEvent[att.attribute] = val;
-                        
+                        var val = AttributesFactory.formatAttributeValue(att, $scope.attributesById, $scope.optionSets, 'USER');                        
+                        overdueEvent[att.attribute] = val;                        
                     });
                     
                     overdueEvent.dueDate = DateUtils.formatFromApiToUser(row.dueDate);

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/upcoming-events-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/upcoming-events-controller.js	2015-03-06 14:43:54 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/upcoming-events-controller.js	2015-03-06 14:54:40 +0000
@@ -40,7 +40,6 @@
         });
 
         CurrentSelection.setAttributesById($scope.attributesById);
-        $scope.broadCastSelections();
     });
     
     //load programs associated with the selected org unit.
@@ -119,7 +118,8 @@
             angular.forEach(data.eventRows, function(row){
                 var upcomingEvent = {};
                 angular.forEach(row.attributes, function(att){
-                    upcomingEvent[att.attribute] = att.value;
+                    var val = AttributesFactory.formatAttributeValue(att, $scope.attributesById, $scope.optionSets, 'USER');
+                    upcomingEvent[att.attribute] = val;                        
                 });
                     
                 upcomingEvent.dueDate = DateUtils.formatFromApiToUser(row.dueDate);