Skip to content

Commit

Permalink
Accept-only user fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Markionium committed Oct 26, 2015
1 parent 6a5a8a2 commit 7ed77d6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/main/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ function appController(periodService, $scope, currentUser, mechanismsService,
self.tabs.submit.access = false;
self.tabs.submit.name = ['Unaccept'];
self.tabs.submit.action = ['unaccept'];
self.tabs.unsubmit.access = true;
self.tabs.unsubmit.name = ['Return submission'];
self.tabs.unsubmit.action = ['unaccept'];
}
} else {
if ((permissions.contains('F_APPROVE_DATA') || permissions.contains('F_APPROVE_DATA_LOWER_LEVELS'))) {
Expand Down Expand Up @@ -618,7 +621,14 @@ function submittedTableViewController($scope, $controller) {
jQuery.extend(this, $controller('tableViewController', {$scope: $scope}));

var filterOnLevel = function (item) {
if ($scope.approvalLevel && item.level === $scope.approvalLevel.level && item.mayUnapprove === true) {
// User does not have an approval level so, everything is false
if (!$scope.approvalLevel) {
return false;
}

var onLowerLevelAndAccepted = ((parseInt(item.level, 10) === parseInt($scope.approvalLevel.level, 10) + 1) && item.accepted);

if (((item.level === $scope.approvalLevel.level) || onLowerLevelAndAccepted) && item.mayUnapprove === true) {
return true;
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/main/manifest.webapp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"0.4.7","name":"Data Approval","description":"Approvals app for PEPFAR","icons":{"48":"img/icons/dataapproval.png"},"developer":{"url":"http://www.dhis2.org","name":"Mark Polak","company":"DHIS2 Core Team","email":"markpo@ifi.uio.no"},"launch_path":"index.html?v=0.4.7","default_locale":"en","activities":{"dhis":{"href":"*"}}}
{"version":"0.4.8","name":"Data Approval","description":"Approvals app for PEPFAR","icons":{"48":"img/icons/dataapproval.png"},"developer":{"url":"http://www.dhis2.org","name":"Mark Polak","company":"DHIS2 Core Team","email":"markpo@ifi.uio.no"},"launch_path":"index.html?v=0.4.8","default_locale":"en","activities":{"dhis":{"href":"*"}}}

0 comments on commit 7ed77d6

Please sign in to comment.