diff --git a/frontend/app/scripts/controllers/case/CaseListCtrl.js b/frontend/app/scripts/controllers/case/CaseListCtrl.js index f55b8aa2b0..2d1202f50f 100644 --- a/frontend/app/scripts/controllers/case/CaseListCtrl.js +++ b/frontend/app/scripts/controllers/case/CaseListCtrl.js @@ -227,6 +227,44 @@ }); }; + this.filterMyOrgCases = function() { + this.filtering.clearFilters() + .then(function() { + var currentUser = AuthenticationSrv.currentUser; + self.filtering.addFilter({ + field: 'owningOrganisation', + type: 'string', + value: { + operator: 'all', + list: [{ + text: currentUser.organisation, + label: currentUser.organisation + }] + } + }); + self.search(); + }); + }; + + this.filterSharedWithMyOrg = function() { + this.filtering.clearFilters() + .then(function() { + var currentUser = AuthenticationSrv.currentUser; + self.filtering.addFilter({ + field: 'owningOrganisation', + type: 'string', + value: { + operator: 'none', + list: [{ + text: currentUser.organisation, + label: currentUser.organisation + }] + } + }); + self.search(); + }); + }; + this.filterMyOpenCases = function() { this.filtering.clearFilters() .then(function() { diff --git a/frontend/app/views/partials/case/case.list.html b/frontend/app/views/partials/case/case.list.html index 87082cb127..04dc3a3e6e 100644 --- a/frontend/app/views/partials/case/case.list.html +++ b/frontend/app/views/partials/case/case.list.html @@ -199,6 +199,13 @@