[open-ils-commits] [GIT] Evergreen ILS branch rel_3_4 updated. 5aa2f703e5a6c8e0c292bea55c757d9e942530e9

Evergreen Git git at git.evergreen-ils.org
Mon Jul 20 17:07:41 EDT 2020


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_3_4 has been updated
       via  5aa2f703e5a6c8e0c292bea55c757d9e942530e9 (commit)
      from  fe27ffee96efcffb0ac9f8c26599f1492e1c5c3d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5aa2f703e5a6c8e0c292bea55c757d9e942530e9
Author: Bill Erickson <berickxx at gmail.com>
Date:   Fri Apr 24 16:09:57 2020 -0400

    LP1874897 Staff catalog honors classification scheme
    
    Use the org unit setting "cat.default_classification_scheme" to
    determine which scheme to use when extracting the bib-level call number
    for display in the Angular staff catalog.
    
    This also modifies the API to look the value up so future calls to the
    API will Just Work (and it's one less bit of data the browser has to
    retrieve).
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/eg2/src/app/share/catalog/bib-record.service.ts b/Open-ILS/src/eg2/src/app/share/catalog/bib-record.service.ts
index b2058e7aed..f4e3cf76d3 100644
--- a/Open-ILS/src/eg2/src/app/share/catalog/bib-record.service.ts
+++ b/Open-ILS/src/eg2/src/app/share/catalog/bib-record.service.ts
@@ -107,13 +107,10 @@ export class BibRecordSummary {
             return Promise.resolve(this.bibCallNumber);
         }
 
-        // TODO labelClass = cat.default_classification_scheme YAOUS
-        const labelClass = 1;
-
         return this.net.request(
             'open-ils.cat',
             'open-ils.cat.biblio.record.marc_cn.retrieve',
-            this.id, labelClass
+            this.id, null, this.orgId
         ).toPromise().then(cnArray => {
             if (cnArray && cnArray.length > 0) {
                 const key1 = Object.keys(cnArray[0])[0];
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm
index 4c4d977cca..9f413b04c3 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm
@@ -500,24 +500,34 @@ __PACKAGE__->register_method(
         params => [
             {desc => 'Record ID', type => 'number'},
             {desc => '(Optional) Classification scheme ID', type => 'number'},
+            {desc => '(Optional) Context org unit ID for default classification lookup', type => 'number'},
         ]
     },
     return => {desc => 'Hash of candidate call numbers identified by tag' }
 );
 
 sub biblio_record_marc_cn {
-    my( $self, $client, $id, $class ) = @_;
+    my( $self, $client, $id, $class, $ctx_org_id ) = @_;
 
     my $e = new_editor();
-    my $marc = $e->retrieve_biblio_record_entry($id)->marc;
+    my $bre = $e->retrieve_biblio_record_entry($id);
+    my $marc = $bre->marc;
 
     my $doc = XML::LibXML->new->parse_string($marc);
     $doc->documentElement->setNamespace( "http://www.loc.gov/MARC21/slim", "marc", 1 );
 
+    if (!$class) {
+        my $ctx_org = $ctx_org_id || $bre->owner || $U->get_org_tree->id; # root org
+        $class = $U->ou_ancestor_setting_value(
+            $ctx_org, 'cat.default_classification_scheme', $e);
+    }
+
     my @fields;
     my @res;
     if ($class) {
-        @fields = split(/,/, $e->retrieve_asset_call_number_class($class)->field);
+        # be sure the class ID provided exists.
+        my $cn_class = $e->retrieve_asset_call_number_class($class) or return $e->event;
+        @fields = split(/,/, $cn_class->field);
     } else {
         @fields = qw/050ab 055ab 060ab 070ab 080ab 082ab 086ab 088ab 090 092 096 098 099/;
     }

-----------------------------------------------------------------------

Summary of changes:
 .../src/eg2/src/app/share/catalog/bib-record.service.ts  |  5 +----
 Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm     | 16 +++++++++++++---
 2 files changed, 14 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list