From 3d7a6f86f214055bb1b57260e3a6feef66955da5 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 12 Jul 2017 17:01:52 -0400 Subject: [PATCH] webstaff serials: add context OU selector for subscription Signed-off-by: Galen Charlton --- .../src/templates/staff/serials/t_subscription_manager.tt2 | 11 ++++++++++- .../default/staff/serials/directives/subscription_manager.js | 8 +++++++- Open-ILS/web/js/ui/default/staff/serials/services/core.js | 3 +-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/templates/staff/serials/t_subscription_manager.tt2 b/Open-ILS/src/templates/staff/serials/t_subscription_manager.tt2 index 8f610455f3..803f443f1f 100644 --- a/Open-ILS/src/templates/staff/serials/t_subscription_manager.tt2 +++ b/Open-ILS/src/templates/staff/serials/t_subscription_manager.tt2 @@ -1,4 +1,13 @@ -
+
+ + + + + [% l('No subscriptions are owned by this library') %] + +
+
diff --git a/Open-ILS/web/js/ui/default/staff/serials/directives/subscription_manager.js b/Open-ILS/web/js/ui/default/staff/serials/directives/subscription_manager.js index 9f0d049957..9407b633cb 100644 --- a/Open-ILS/web/js/ui/default/staff/serials/directives/subscription_manager.js +++ b/Open-ILS/web/js/ui/default/staff/serials/directives/subscription_manager.js @@ -14,8 +14,14 @@ angular.module('egSerialsAppDep') function($scope , $q , egSerialsCoreSvc , egCore , egGridDataProvider , $uibModal , ngToast , egConfirmDialog ) { + $scope.selected_owning_ou = null; + $scope.owning_ou_changed = function(org) { + $scope.selected_owning_ou = org.id(); + reload(); + } + function reload() { - egSerialsCoreSvc.fetch($scope.bibId).then(function() { + egSerialsCoreSvc.fetch($scope.bibId, $scope.selected_owning_ou).then(function() { $scope.subscriptions = egCore.idl.toTypedHash(egSerialsCoreSvc.subTree); // un-flesh receive unit template so that we can use // it as a model of a select diff --git a/Open-ILS/web/js/ui/default/staff/serials/services/core.js b/Open-ILS/web/js/ui/default/staff/serials/services/core.js index faa411eb65..b2ea80bed2 100644 --- a/Open-ILS/web/js/ui/default/staff/serials/services/core.js +++ b/Open-ILS/web/js/ui/default/staff/serials/services/core.js @@ -151,10 +151,9 @@ function(egCore , orderByFilter , $q , $filter , $uibModal , ngToast , egConfirm // fetch subscription, distributions, streams, captions, // and notes associated with the indicated bib service.fetch = function(bibId, contextOrg) { - // TODO filter by contextOrg var filter = { record_entry : bibId }; - if (contextOrg) filter.owning_lib = contextOrg; + if (contextOrg) filter.owning_lib = egCore.org.descendants(contextOrg, true); return egCore.pcrud.search('ssub', filter, { flesh : 5, -- 2.11.0