=== 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 2016-01-19 09:31:27 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js 2016-01-20 22:27:09 +0000 @@ -1120,6 +1120,19 @@ return dhis2.validation.isNumber(val) ? val : ''; }; + //check if field is hidden + $scope.isHidden = function(id) { + //In case the field contains a value, we cant hide it. + //If we hid a field with a value, it would falsely seem the user was aware that the value was entered in the UI. + if($scope.currentEvent[id]) { + return false; + } + else { + return $scope.hiddenFields[id]; + } + }; + + $scope.saveDatavalue = function(){ $scope.executeRules(); };