Revert "LP1908743 Staff catalog honors org-not-pickup-lib"
authorChris Sharp <csharp@georgialibraries.org>
Tue, 12 Jan 2021 16:20:14 +0000 (11:20 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Tue, 12 Jan 2021 16:20:14 +0000 (11:20 -0500)
This reverts commit 1ceb81675e8fb3835e41a0e70602f4b1eb763de2.

Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.html
Open-ILS/src/eg2/src/app/staff/catalog/hold/hold.component.ts
Open-ILS/src/perlmods/lib/OpenILS/Application/Actor/Settings.pm

index 375333a..fa8e655 100644 (file)
@@ -78,7 +78,7 @@
           <label i18n>Pickup Location: </label>
         </div>
         <div class="col-lg-6">
-          <eg-org-select [hideOrgs]="hideOrgs" [applyOrgId]="pickupLib"></eg-org-select>
+          <eg-org-select [applyOrgId]="pickupLib"></eg-org-select>
         </div>
       </div>
       <div class="row mt-2">
index b6ce572..02f9a4e 100644 (file)
@@ -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];
         }
index b538af3..f627a16 100644 (file)
@@ -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;