From: Chris Sharp Date: Fri, 5 Feb 2021 20:30:31 +0000 (-0500) Subject: Revert "LP1908743 Staff catalog honors org-not-pickup-lib" X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=851c27c2971ee537ab4e10e5776ed2cd2b0477fb;p=evergreen%2Fpines.git Revert "LP1908743 Staff catalog honors org-not-pickup-lib" This reverts commit ba99417a1b289593cabffd554a70f2f62aefc323. --- diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.html b/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.html index 8af15ca72a..9559072a19 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.html +++ b/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.html @@ -79,7 +79,7 @@
+ [applyOrgId]="pickupLib">
diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.ts index b6ce572852..02f9a4e333 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.ts @@ -86,9 +86,6 @@ export class HoldComponent implements OnInit { puLibWsFallback = false; - // Orgs which are not valid pickup locations - hideOrgs: number[] = []; - @ViewChild('patronSearch', {static: false}) patronSearch: PatronSearchDialogComponent; @@ -135,13 +132,6 @@ export class HoldComponent implements OnInit { this.store.getItem('circ.staff_placed_holds_fallback_to_ws_ou') .then(setting => this.puLibWsFallback = setting === true); - this.net.request('open-ils.actor', - 'open-ils.actor.settings.value_for_all_orgs', - null, 'opac.holds.org_unit_not_pickup_lib' - ).subscribe(resp => { - if (resp.summary.value) { this.hideOrgs.push(resp.org_unit); } - }); - if (!Array.isArray(this.holdTargets)) { this.holdTargets = [this.holdTargets]; } diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor/Settings.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor/Settings.pm index b538af377e..f627a1638f 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor/Settings.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor/Settings.pm @@ -314,74 +314,5 @@ sub applied_settings { } -__PACKAGE__->register_method ( - method => 'setting_value_for_all_orgs', - api_name => 'open-ils.actor.settings.value_for_all_orgs', - stream => 1, - signature => { - desc => q/ - Returns the value applied to all org units for a given org unit - setting. - - No auth token is required to access publicly visible org - unit settings. An auth token and necesessary permissions - are required to view protected settings. - /, - params => [ - {desc => 'authtoken. Optional', type => 'string'}, - {desc => 'setting', type => 'string'}, - ], - return => { - desc => q/ - Returns a stream of {org_unit => id, summary => summary} - hashes, one per org unit. The summary is a - actor.cascade_setting_summary hash. - /, - type => 'object' - } - } -); - -sub setting_value_for_all_orgs { - my ($self, $client, $auth, $setting) = @_; - - my $e = new_editor(); - my $user_id; - - if ($auth) { - # Not required for publicly visible org unit setting values. - # If one is provided, though, it should be valid. - $e->authtoken($auth); - return $e->event unless $e->checkauth; - $user_id = $e->requestor->id; - } - - # Setting names may only contain letters, numbers, unders, and dots. - $setting =~ s/$name_regex//g; - - my $org_ids = $e->json_query({select => {aou => ['id']}, from => 'aou'}); - - for my $org_id (map { $_->{id} } @$org_ids) { - - # Use actor.get_cascade_setting since it performs the necessary - # permission checks for us. - my $summary = $e->json_query({from => [ - 'actor.get_cascade_setting', $setting, $org_id, $user_id, undef]})->[0]; - - # It makes no sense to call this API with user/workstation settings. - return OpenILS::Event->new('BAD_PARAMS', - desc => 'This API does not support user/workstation settings' - ) if ( - ($summary->{has_user_setting} || '') eq 't' || - ($summary->{has_workstation_setting} || '') eq 't' - ); - - $client->respond({org_unit => $org_id, summary => $summary}); - } - - return undef; -} - - 1;