=== 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-08-31 12:49:17 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js 2015-09-03 20:50:06 +0000 @@ -38,6 +38,7 @@ $scope.hiddenFields = {}; $scope.errorMessages = {}; $scope.warningMessages = {}; + $scope.tableMaxNumberOfDataElements = 10; var userProfile = SessionStorageService.get('USER_PROFILE'); @@ -202,8 +203,8 @@ $scope.stagesById[stage.id] = stage; $scope.eventsByStage[stage.id] = []; - //If one of the stages has less than 7 data elements, allow sorting as table: - if (stage.programStageDataElements.length < 7) { + //If one of the stages has less than $scope.tableMaxNumberOfDataElements data elements, allow sorting as table: + if (stage.programStageDataElements.length < $scope.tableMaxNumberOfDataElements) { $scope.stagesCanBeShownAsTable = true; } }); @@ -275,7 +276,7 @@ }; $scope.stageCanBeShownAsTable = function (stage) { - if (stage.programStageDataElements && stage.programStageDataElements.length < 7) { + if (stage.programStageDataElements && stage.programStageDataElements.length < $scope.tableMaxNumberOfDataElements) { return true; } return false; @@ -284,7 +285,7 @@ $scope.toggleEventsTableDisplay = function () { $scope.showEventsAsTables = !$scope.showEventsAsTables; angular.forEach($scope.programStages, function (stage) { - if (stage.programStageDataElements.length < 7) { + if (stage.programStageDataElements.length < $scope.tableMaxNumberOfDataElements) { stage.displayEventsInTable = $scope.showEventsAsTables; if ($scope.currentStage === stage) { $scope.getDataEntryForm(); @@ -416,6 +417,12 @@ } } }; + + $scope.switchToEventRow = function (event) { + if($scope.currentEvent !== event) { + $scope.showDataEntry(event,false); + } + }; $scope.switchDataEntryForm = function () { $scope.displayCustomForm = !$scope.displayCustomForm; === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/default-form.html' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/default-form.html 2015-09-03 16:09:29 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/default-form.html 2015-09-03 20:50:06 +0000 @@ -197,14 +197,14 @@