From 659965130ff4a601b769d796d831c9800274267d Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 29 Mar 2018 17:06:16 -0400 Subject: [PATCH] LP#1729934 Webstaff display org-scoped penalties Consistent with the XUL client, only display patron standing penalties (AKA Messages) that are linked to an org unit which is an ancestor, matching, or descendant org unit of the workstation (e.g. the full path). To test: [1] Create a patron Message which applies to a branch using a branch or null-depth penalty (e.g. at BR1). [2] Create a second message that links to the root org unit (e.g. CONS) via depth=0 penalty. [2] Log out and back in to the browser client at a workstation under a different section of the org unit tree (e.g. BR3) and confirm the Messages created at BR1 do not display, but the messages created at CONS do. Signed-off-by: Bill Erickson --- Open-ILS/web/js/ui/default/staff/circ/patron/app.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js index f054e6ce9d..240c349ed1 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js @@ -721,6 +721,7 @@ function($scope, $q, $routeParams, $timeout, $window, $location, egCore , function($scope , $q , $routeParams, egCore , $uibModal , patronSvc , egCirc) { $scope.initTab('messages', $routeParams.id); var usr_id = $routeParams.id; + var org_ids = egCore.org.fullPath(egCore.auth.user().ws_ou(), true); // setup date filters var start = new Date(); // now - 1 year @@ -747,6 +748,7 @@ function($scope , $q , $routeParams, egCore , $uibModal , patronSvc , egCirc) { setQuery : function() { return { usr : usr_id, + org_unit : org_ids, '-or' : [ {stop_date : null}, {stop_date : {'>' : 'now'}} @@ -762,6 +764,7 @@ function($scope , $q , $routeParams, egCore , $uibModal , patronSvc , egCirc) { setQuery : function() { return { usr : usr_id, + org_unit : org_ids, stop_date : {'<=' : 'now'}, set_date : {between : date_range()} }; -- 2.11.0