← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18007: optionset bug fix in event capture

 

------------------------------------------------------------
revno: 18007
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-01-15 16:29:08 +0100
message:
  optionset bug fix in event capture
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/i18n/i18n_app.properties
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-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-apps/src/main/webapp/dhis-web-event-capture/i18n/i18n_app.properties'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/i18n/i18n_app.properties	2015-01-13 17:31:37 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/i18n/i18n_app.properties	2015-01-15 15:29:08 +0000
@@ -115,7 +115,7 @@
 missing_translation_using_default=No translation file is found for the selected locale. Using default translation (English).
 value_must_be=Value must be
 number=Number
-value_must_be_Number=Value must be number
+value_must_be_number=Value must be number
 value_must_be_posInt=Value must be positive integer
 value_must_be_negInt=Value must be negative integer
 value_must_be_zeroPositiveInt=Value must be zero or positive integer

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js	2015-01-14 14:06:51 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js	2015-01-15 15:29:08 +0000
@@ -57,17 +57,17 @@
     //watch for selection of org unit from tree
     $scope.$watch('selectedOrgUnit', function() {
         $scope.dhis2Events = [];
+        $scope.currentEvent = {};
+        
         if( angular.isObject($scope.selectedOrgUnit)){
-            
-            if(!$scope.optionSets){
+            if($scope.optionSets.length < 1){
                 $scope.optionSets = [];
                 OptionSetService.getAll().then(function(optionSets){
                     angular.forEach(optionSets, function(optionSet){                        
                         $scope.optionSets[optionSet.id] = optionSet;
                     });                    
                 });
-            }
-            
+            }            
             $scope.loadPrograms();
         }
     });
@@ -648,8 +648,8 @@
         if( newValue != oldValue ){
             
             if($scope.prStDes[dataElement].dataElement.type === 'string'){
-                if($scope.prStDes[dataElement].dataElement.optionSet){                    
-                    newValue = OptionSetService.getCode($scope.optionSets[$scope.prStDes[dataElement].dataElement.optionSet.id].options, newValue);//$scope.optionCodesByName[  '"' + newValue + '"'];
+                if($scope.prStDes[dataElement].dataElement.optionSet){
+                    newValue = OptionSetService.getCode($scope.optionSets[$scope.prStDes[dataElement].dataElement.optionSet.id].options, newValue);
                 }
             }            
             if($scope.prStDes[dataElement].dataElement.type === 'date'){