[open-ils-commits] [GIT] Evergreen ILS branch master updated. f0f88695d5fe6184a9bfb94fdee4c8a9c53dd3ec

Evergreen Git git at git.evergreen-ils.org
Wed Aug 2 14:35:16 EDT 2017


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, master has been updated
       via  f0f88695d5fe6184a9bfb94fdee4c8a9c53dd3ec (commit)
       via  41f9a3b8caaf901d2cbe05cfb60461114ffe8e3d (commit)
       via  9720422e9d46e656f0d0d944babadad74e18478d (commit)
      from  ccb7382c52346f513c4a14d8b15d3506f042531a (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 f0f88695d5fe6184a9bfb94fdee4c8a9c53dd3ec
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Wed Aug 2 14:45:49 2017 -0400

    LP#1705478: add release notes
    
    These release notes also refer to the enhancement
    made in bug 1692106.
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/docs/RELEASE_NOTES_NEXT/Cataloging/Export_Call_Number_Affixes.adoc b/docs/RELEASE_NOTES_NEXT/Cataloging/Export_Call_Number_Affixes.adoc
new file mode 100644
index 0000000..a766a7a
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Cataloging/Export_Call_Number_Affixes.adoc
@@ -0,0 +1,7 @@
+Include Call Number Prefixes and Suffixes in Export and Z39.50 output
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+The call number prefix and suffix, when present, are now included in
+subfields $k and $m of the 852 field when running `marc_export` with
+the `--items` switch. Similarly, when using Evergreen as a Z39.50
+server configured to embed item data in 852 fields, the affixes are now
+included in subfields $k and $m.

commit 41f9a3b8caaf901d2cbe05cfb60461114ffe8e3d
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Wed Aug 2 14:39:23 2017 -0400

    LP#1705478: (follow-up) emit prefix subfield before call number
    
    This patch reorders the subfields so that the prefix (if present)
    is emitted in 852$k /before/ the call number subfield ($j); that way,
    MARC parsers return subfields in their order in the field (and
    humans) will see the components of the call number in their
    expected order.
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/support-scripts/marc_export.in b/Open-ILS/src/support-scripts/marc_export.in
index 604a2ab..d7c21d1 100755
--- a/Open-ILS/src/support-scripts/marc_export.in
+++ b/Open-ILS/src/support-scripts/marc_export.in
@@ -512,8 +512,8 @@ sub next {
                                 b => Encode::decode_utf8($acp->call_number()->owning_lib()->shortname()),
                                 b => Encode::decode_utf8($acp->circ_lib()->shortname()),
                                 c => Encode::decode_utf8($acp->location()->name()),
-                                j => Encode::decode_utf8($acp->call_number()->label()),
                                 ($prefix ? (k => Encode::decode_utf8($prefix)) : ()),
+                                j => Encode::decode_utf8($acp->call_number()->label()),
                                 ($suffix ? (m => Encode::decode_utf8($suffix)) : ()),
                                 ($acp->circ_modifier() ? (g => Encode::decode_utf8($acp->circ_modifier())) : ()),
                                 p => Encode::decode_utf8($acp->barcode()),

commit 9720422e9d46e656f0d0d944babadad74e18478d
Author: Martha Driscoll <driscoll at noblenet.org>
Date:   Thu Jul 20 14:19:56 2017 -0400

    LP#1705478: Marc_export should include call number prefix and suffix
    
    This commit adds the call number prefix and suffix, when present,
    to the 852 $k and $m respectively when the --items option is used
    in marc_export.
    
    Signed-off-by: Martha Driscoll <driscoll at noblenet.org>
    Signed-off-by: Dan Pearl <dpearl at cwmars.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/support-scripts/marc_export.in b/Open-ILS/src/support-scripts/marc_export.in
index b693d03..604a2ab 100755
--- a/Open-ILS/src/support-scripts/marc_export.in
+++ b/Open-ILS/src/support-scripts/marc_export.in
@@ -327,6 +327,8 @@ sub new {
     $self->{acnClass} = Fieldmapper::class_for_hint('acn');
     $self->{acpClass} = Fieldmapper::class_for_hint('acp');
     $self->{sreClass} = Fieldmapper::class_for_hint('sre');
+    $self->{acnpClass} = Fieldmapper::class_for_hint('acnp');
+    $self->{acnsClass} = Fieldmapper::class_for_hint('acns');
 
     # Make an arrayref of shortname ids if the library option was
     # specified:
@@ -369,6 +371,8 @@ sub build_query {
     my @breFields = map {$breTable . '.' . $_} $self->{breClass}->real_fields();
     my $acnTable = $self->{acnClass}->Table();
     my $acpTable = $self->{acpClass}->Table();
+    my $acnpTable = $self->{acnpClass}->Table();
+    my $acnsTable = $self->{acnsClass}->Table();
 
     # Now we build the query in pieces:
 
@@ -401,6 +405,8 @@ ACN_JOIN
         }
         $from .= "\njoin $acpTable on $acpTable.call_number = $acnTable.id";
         $from .= "\nand $acpTable.deleted = 'f'" unless ($Marque::config->option_value('since'));
+        $from .= "\nleft outer join $acnpTable on $acnTable.prefix = $acnpTable.id";
+        $from .= "\nleft outer join $acnsTable on $acnTable.suffix = $acnsTable.id";
     }
 
     # The where really depends on a few options:
@@ -491,6 +497,8 @@ sub next {
                         next unless ($acp);
                         my $location = $Marque::config->option_value('location');
                         my $price = ($acp->price() ? $Marque::config->option_value('money').$acp->price() : '');
+                        my $prefix = $acp->call_number()->prefix()->label();
+                        my $suffix = $acp->call_number()->suffix()->label();
                         eval {
                             local $SIG{__WARN__} = sub {
                                 my $message = "Warning from bibliographic record " . $r->id() . ": "
@@ -505,6 +513,8 @@ sub next {
                                 b => Encode::decode_utf8($acp->circ_lib()->shortname()),
                                 c => Encode::decode_utf8($acp->location()->name()),
                                 j => Encode::decode_utf8($acp->call_number()->label()),
+                                ($prefix ? (k => Encode::decode_utf8($prefix)) : ()),
+                                ($suffix ? (m => Encode::decode_utf8($suffix)) : ()),
                                 ($acp->circ_modifier() ? (g => Encode::decode_utf8($acp->circ_modifier())) : ()),
                                 p => Encode::decode_utf8($acp->barcode()),
                                 ($price ? (y => Encode::decode_utf8($price)) : ()),
@@ -620,6 +630,42 @@ sub shelves {
     return @{$self->{shelves}};
 }
 
+# Returns an array of acnp objects.
+sub prefixes {
+    my $self = shift;
+
+    unless ($self->{prefixes} && @{$self->{prefixes}}) {
+        my $fmClass = Fieldmapper::class_for_hint('acnp');
+        my @classFields = $fmClass->real_fields();
+        my $classTable = $fmClass->Table();
+        my $query = 'select ' . join(',', @classFields);
+        $query .= "\nfrom $classTable";
+        my $result = $self->{handle}->selectall_arrayref($query, {Slice=>{}});
+        my @prefixes = map {$fmClass->from_bare_hash($_)} @{$result};
+        $self->{prefixes} = \@prefixes;
+    }
+
+    return @{$self->{prefixes}};
+}
+
+# Returns an array of acns objects.
+sub suffixes {
+    my $self = shift;
+
+    unless ($self->{suffixes} && @{$self->{suffixes}}) {
+        my $fmClass = Fieldmapper::class_for_hint('acns');
+        my @classFields = $fmClass->real_fields();
+        my $classTable = $fmClass->Table();
+        my $query = 'select ' . join(',', @classFields);
+        $query .= "\nfrom $classTable";
+        my $result = $self->{handle}->selectall_arrayref($query, {Slice=>{}});
+        my @suffixes = map {$fmClass->from_bare_hash($_)} @{$result};
+        $self->{suffixes} = \@suffixes;
+    }
+
+    return @{$self->{suffixes}};
+}
+
 # Returns an array of acn objects for a given bre object or id.
 sub acns_for_bre {
     my $self = shift;
@@ -655,6 +701,8 @@ sub acps_for_bre {
 
     my @orgs = $self->orgs();
     my @locations = $self->shelves();
+    my @prefixes = $self->prefixes();
+    my @suffixes = $self->suffixes();
 
     my @acns = $self->acns_for_bre($bre);
     if (@acns) {
@@ -675,11 +723,17 @@ sub acps_for_bre {
                 my ($acn) = grep {$_->id() == $cn} @acns;
                 my ($location) = grep {$_->id() == $loc} @locations;
                 my $olib = $acn->owning_lib();
+                my $pre = $acn->prefix();
+                my $suf = $acn->suffix();
+                my ($acnp) = grep {$_->id() == $pre} @prefixes;
+                my ($acns) = grep {$_->id() == $suf} @suffixes;
                 my ($owner) = grep {$_->id() == $olib} @orgs;
                 $acn->owning_lib($owner);
                 $_->call_number($acn);
                 $_->circ_lib($org);
                 $_->location($location);
+                $_->call_number->prefix($acnp);
+                $_->call_number->suffix($acns);
             }
             return @acps;
         }

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

Summary of changes:
 Open-ILS/src/support-scripts/marc_export.in        |   54 ++++++++++++++++++++
 .../Cataloging/Export_Call_Number_Affixes.adoc     |    7 +++
 2 files changed, 61 insertions(+), 0 deletions(-)
 create mode 100644 docs/RELEASE_NOTES_NEXT/Cataloging/Export_Call_Number_Affixes.adoc


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list