LP#1692106: Z39.50 server includes prefix and suffix in 852
authorMartha Driscoll <driscoll@noblenet.org>
Thu, 25 May 2017 18:39:30 +0000 (14:39 -0400)
committerMike Rylander <mrylander@gmail.com>
Mon, 17 Jul 2017 15:01:36 +0000 (11:01 -0400)
Add the call number prefix and suffix to the 852 $k and $m when copy
information is returned by the Z39.50 server.

Signed-off-by: Martha Driscoll <driscoll@noblenet.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm

index bb1dbd6..a5fea7e 100644 (file)
@@ -2026,6 +2026,8 @@ sub sru_search {
                 my @copies;
                 for my $node ($marcxml->getElementsByTagName('holdings')) {
                     for my $volume ($node->getElementsByTagName('volume')) {
+                        my $prefix = $volume->getChildrenByTagName('call_number_prefix')->[0]->getAttribute('label');
+                        my $suffix = $volume->getChildrenByTagName('call_number_suffix')->[0]->getAttribute('label');
                         my $cn = $volume->getAttribute('label');
                         my $owning_lib = $volume->getAttribute('lib');
                         for my $copy ($volume->getElementsByTagName('copy')) {
@@ -2035,6 +2037,8 @@ sub sru_search {
                                 c => $cn,
                                 d => $copy->getChildrenByTagName('circ_lib')->[0]->getAttribute('shortname'),
                                 g => $copy->getAttribute('barcode'),
+                                k => $prefix,
+                                m => $suffix,
                                 n => $copy->getChildrenByTagName('status')->[0]->textContent
                             };
                         }
@@ -2070,6 +2074,8 @@ sub sru_search {
                             c => $copy->{c},
                             d => $copy->{d},
                             g => $copy->{g},
+                            ($copy->{k} ? (k => $copy->{k}) : ()),
+                            ($copy->{m} ? (m => $copy->{m}) : ()),
                             n => $copy->{n}
                         )
                     );