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

Evergreen Git git at git.evergreen-ils.org
Mon Nov 21 15:01:59 EST 2011


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  04d57bca29380bfd648d38c28f5071f64118d293 (commit)
       via  209b870d5edf0981cdc78d06ee480c51318b9614 (commit)
      from  910e31cfa9e5cf79a5938c8d41316444af7098a0 (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 04d57bca29380bfd648d38c28f5071f64118d293
Author: Jason Stephenson <jstephenson at mvlc.org>
Date:   Mon Nov 21 13:47:30 2011 -0500

    Limit display to 856 with ind1 = 4 and ind2 = 0 or 1.
    
    Minor modification to Open-ILS/src/templates/opac/parts/
    misc_util.tt2 that limits the display of 856 urls to that have
    indicator 1 equal to 4 and indicator 2 equal to 0 or 1. These should
    be those that point directly to the resource.
    
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2
index 1657bd6..db30d6b 100644
--- a/Open-ILS/src/templates/opac/parts/misc_util.tt2
+++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2
@@ -39,7 +39,7 @@
 
         # Extract the 856 URLs that are not otherwise represented by asset.uri's
         args.online_res = [];
-        FOR node IN xml.findnodes('//*[@tag="856"]');
+        FOR node IN xml.findnodes('//*[@tag="856" and @ind1="4" and (@ind2="0" or @ind2="1")]');
             IF node.findnodes('./*[@code="9" or @code="w" or @code="n"]'); NEXT; END; # asset.uri's
             label = node.findnodes('./*[@code="y"]');
             notes = node.findnodes('./*[@code="z" or @code="3"]');

commit 209b870d5edf0981cdc78d06ee480c51318b9614
Author: Bill Erickson <berick at esilibrary.com>
Date:   Mon Oct 3 16:31:45 2011 -0400

    TPac: show non-asset.uri 856 URLs on detail page
    
    Display "global" 856 URLs in record detail page.  A "global" URL in this
    case is one that has no ownership and has not been extracted out as an
    asset.uri.  As of right now, this is any 856 that has no $9, $w, or $n
    subfield data.
    
    Links are displayed directly after asset.uri links using the same style.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2
index 3089984..1657bd6 100644
--- a/Open-ILS/src/templates/opac/parts/misc_util.tt2
+++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2
@@ -37,6 +37,26 @@
         # clean up the ISBN
         args.isbn_clean = args.isbns.0.replace('\ .*', '');
 
+        # Extract the 856 URLs that are not otherwise represented by asset.uri's
+        args.online_res = [];
+        FOR node IN xml.findnodes('//*[@tag="856"]');
+            IF node.findnodes('./*[@code="9" or @code="w" or @code="n"]'); NEXT; END; # asset.uri's
+            label = node.findnodes('./*[@code="y"]');
+            notes = node.findnodes('./*[@code="z" or @code="3"]');
+            FOR href IN node.findnodes('./*[@code="u"]');
+                NEXT UNLESS href;
+                # it's possible for multiple $u's to exist within 1 856 tag.
+                # in that case, honor the label/notes data for the first $u, but
+                # leave any subsequent $u's as unadorned href's. 
+                # use href/link/note keys to be consistent with args.uri's
+                args.online_res.push({
+                    href => href.textContent, 
+                    link => (loop.first AND label) ? label.textContent : href.textContent,
+                    note => (loop.first) ? notes.textContent : ''
+                });
+            END;
+        END;
+ 
         args.holdings = [];
         args.uris = [];
         args.issns = [];
diff --git a/Open-ILS/src/templates/opac/parts/record/summary.tt2 b/Open-ILS/src/templates/opac/parts/record/summary.tt2
index bbfb1c1..125546c 100644
--- a/Open-ILS/src/templates/opac/parts/record/summary.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/summary.tt2
@@ -73,7 +73,7 @@
 [%- IF sfx.size && sfx.0 != '' %]
     </div>    
 [%- END %]
-[%- FOR uri IN args.uris; %]
+[%- FOR uri IN args.uris.merge(args.online_res); %]
 <div class="rdetail_uri">
     <a href="[% uri.href %]">[% uri.link %]</a>[% ' - ' _ uri.note IF uri.note %]
 </div>

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

Summary of changes:
 Open-ILS/src/templates/opac/parts/misc_util.tt2    |   20 ++++++++++++++++++++
 .../src/templates/opac/parts/record/summary.tt2    |    2 +-
 2 files changed, 21 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list