[open-ils-commits] ***SPAM*** [GIT] Evergreen ILS branch rel_2_7 updated. 66e56a7cb7c005382cdc512b7fa3b3fe0ee57b95

Evergreen Git git at git.evergreen-ils.org
Tue Dec 16 15:37:13 EST 2014


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_2_7 has been updated
       via  66e56a7cb7c005382cdc512b7fa3b3fe0ee57b95 (commit)
      from  f33b4737878ab0fdf77c23b4d090808406c8ff08 (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 66e56a7cb7c005382cdc512b7fa3b3fe0ee57b95
Author: Dan Scott <dscott at laurentian.ca>
Date:   Mon Dec 15 23:23:49 2014 -0500

    LP#1402905 Use stricter matching for UPC values
    
    Per http://www.loc.gov/marc/bibliographic/bd024.html we
    should be checking to see if either the ind1 is "1" or
    if there's a subfield 2 with a value of "upc" before
    assuming that any "Other standard identifier" 024 field
    is a UPC value.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2
index 32717b8..da7c958 100644
--- a/Open-ILS/src/templates/opac/parts/misc_util.tt2
+++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2
@@ -137,10 +137,17 @@
             args.isbns.push(isbn.textContent);
         END;
 
+        # UPCs can be identified either by ind1="1" or subfield 2 of "upc"
         args.upcs = [];
-        FOR upc IN xml.findnodes('//*[@tag="024"]/*[@code="a"]');
+        FOR upc IN xml.findnodes('//*[@tag="024" and @ind="1"]/*[@code="a"]');
             args.upcs.push(upc.textContent);
         END;
+        FOR upcfield IN xml.findnodes('//*[@tag="024"]/*[@code="2" and text()="upc"]');
+            my_parent = upcfield.parentNode();
+            FOR upc IN my_parent.findnodes('./*[@code="a"]');
+                args.upcs.push(upc.textContent);
+            END;
+        END;
         args.upc = args.upcs.0; # use first UPC as the default
 
         args.issns = [];

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

Summary of changes:
 Open-ILS/src/templates/opac/parts/misc_util.tt2 |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list