-<form name="ssubform">
+<div>
+ <label>[% l('Subscriptions owned by or below') %]</label>
+ <eg-org-selector selected="owning_ou" onchange="owning_ou_changed"
+ sticky-setting="serials.ssub_owning_lib_filter">
+ </eg-org-selector>
+ <span class="alert alert-warning" ng-show="subscriptions.length == 0">
+ [% l('No subscriptions are owned by this library') %]
+ </span>
+</div>
+<form name="ssubform" class="pad-vert">
<div class="form-inline" ng-repeat="ssub in subscriptions">
<div class="row form-inline">
<div class="form-group col-sm-2">
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
// 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,