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

Evergreen Git git at git.evergreen-ils.org
Tue Aug 20 12:06:19 EDT 2013


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  4a171d1b07ad533ceb44a0cef4193b2f9ec315ad (commit)
       via  b77db8b7e553087f962f791c169d7a4d3fac7c6f (commit)
       via  30b75ceadeeb86f50ac874000e1ca38ebed725db (commit)
       via  8c896e9524a452464042594719f1c1e34eba016e (commit)
      from  f46f187408d15065ca0972d5fcae9725aba2a88f (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 4a171d1b07ad533ceb44a0cef4193b2f9ec315ad
Author: Dan Scott <dscott at laurentian.ca>
Date:   Mon Jul 15 14:36:30 2013 -0400

    Improved copy table CSS/markup for conjoined bibs
    
    Let the library name column wrap now that it may potentially contain
    stupidly long title/author combos. Also, associate the table cells with
    their corresponding headers for improved accessibility.
    
    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/css/style.css.tt2 b/Open-ILS/src/templates/opac/css/style.css.tt2
index 4490089..39cd573 100644
--- a/Open-ILS/src/templates/opac/css/style.css.tt2
+++ b/Open-ILS/src/templates/opac/css/style.css.tt2
@@ -448,9 +448,14 @@ div.format_icon {
     padding-top: 1.5em;
 }
 
-#rdetails_status td, #rdetails_status2 td {
-    white-space:nowrap !important;
+#rdetails_status td {
     padding: 7px 0px 3px 13px;
+    white-space: nowrap;
+}
+
+#rdetails_status td[header=copy_header_library], 
+#rdetails_status td[header=copy_header_shelfloc] {
+    white-space: normal;
 }
 
 #rdetails_status thead th {
diff --git a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
index d558c85..5bab2b7 100644
--- a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
@@ -54,7 +54,7 @@ END;
     <tbody class="copy_details_table">
 [%- FOREACH peer IN ctx.foreign_copies;
         FOREACH bib IN peer.foreign_copy_maps; %]
-    <tr><td>
+    <tr><td header='copy_header_shelfloc'>
     [%- bib_lib_name = ctx.get_aou(bib.target_copy.circ_lib).name | html;
         l("[_1] (foreign item)", bib_lib_name); -%]
         <ul><li>
@@ -65,11 +65,11 @@ END;
             </a>
         </li></ul>
     </td>
-    <td>[% bib.target_copy.call_number.label | html %]</td>
-    <td>[% bib.target_copy.barcode | html %]</td>
-    <td>[% copy_info.copy_location | html %]</td>
-    <td>[% copy_info.copy_status | html %]</td>
-    <td>[% copy_info.due_date | html %]</td>
+    <td header='copy_header_callnumber'>[% bib.target_copy.call_number.label | html %]</td>
+    <td header='copy_header_barcode'>[% bib.target_copy.barcode | html %]</td>
+    <td header='copy_header_shelfloc'>[% copy_info.copy_location | html %]</td>
+    <td header='copy_header_status'>[% copy_info.copy_status | html %]</td>
+    <td header='copy_header_due_date'>[% copy_info.due_date | html %]</td>
 </tr>
    [%- END; # FOREACH peer
 END; # FOREACH bib
@@ -189,7 +189,7 @@ END; # FOREACH bib
             [% END %]
         [% END %]
 
-<tr><td>
+<tr><td header='copy_header_shelfloc'>
 [%- IF copy_info.peer_bib_marc.size > 1;
 '<ul>';
     FOREACH bib IN copy_info.peer_bib_marc;

commit b77db8b7e553087f962f791c169d7a4d3fac7c6f
Author: Dan Scott <dscott at laurentian.ca>
Date:   Mon Jul 15 11:28:21 2013 -0400

    Conjoined items / foreign items display in TPAC
    
    Foreign items now appear at the top of the copy table, no matter what
    copy page you are on. See "The two violin concertos" in the Concerto
    data set for an example; the foreign bib is linked, with a label for the
    designated peer type.
    
    The parent bib record displays all of the child records in the copy table
    underneath the pertinent copy; each title / author entry links to the
    child bib display, naturally. See "Violin concerto no. 2 ; Six duos
    (from 44 Duos)" in the Concerto data set for an example.
    
    We escape all of the text retrieved from the database to avoid XSS
    (thanks for the heads-up from Pasi Kallinen).
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    
    Now with HTML escaping for safety
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
index 0e42be0..976940f 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
@@ -88,6 +88,7 @@ sub load_record {
     $ctx->{copies} = $copy_rec->gather(1);
 
     # Add public copy notes to each copy - and while we're in there, grab peer bib records
+    my %cached_bibs = ();
     foreach my $copy (@{$ctx->{copies}}) {
         $copy->{notes} = $U->simplereq(
             'open-ils.circ',
@@ -103,18 +104,21 @@ sub load_record {
         $self->timelog("past peer bib id retrieval");
         my @peer_marc;
         foreach my $bib (@{$copy->{peer_bibs}}) {
+            next if $bib eq $ctx->{bre_id};
+            next if $cached_bibs{$bib};
             my (undef, @peer_data) = $self->get_records_and_facets(
                 [$bib], undef, {
-                    flesh => '{holdings_xml,acp,acnp,acns,exclude_invisible_acn}',
+                    flesh => '{}',
                     site => $org_name,
                     depth => $depth,
                     pref_lib => $pref_ou
             });
+            $cached_bibs{$bib} = 1;
             #$copy->{peer_bib_marc} = $peer_data[0]->{marc_xml};
             push @peer_marc, $peer_data[0]->{marc_xml};
+            $self->timelog("fetched peer bib record $bib");
         }
         $copy->{peer_bib_marc} = \@peer_marc;
-        $self->timelog("past peer bib record retrieval");
     }
 
     $self->timelog("past store copy retrieval call");
diff --git a/Open-ILS/src/templates/opac/css/style.css.tt2 b/Open-ILS/src/templates/opac/css/style.css.tt2
index fde5d43..4490089 100644
--- a/Open-ILS/src/templates/opac/css/style.css.tt2
+++ b/Open-ILS/src/templates/opac/css/style.css.tt2
@@ -1575,3 +1575,7 @@ a.preflib_change {
 .browse-public-general-note-body {
     font-style: italic;
 }
+
+.bib_peer_type {
+    font-weight: bold;
+}
diff --git a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
index 8602d3f..d558c85 100644
--- a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
@@ -52,6 +52,28 @@ END;
         </tr>
     </thead>
     <tbody class="copy_details_table">
+[%- FOREACH peer IN ctx.foreign_copies;
+        FOREACH bib IN peer.foreign_copy_maps; %]
+    <tr><td>
+    [%- bib_lib_name = ctx.get_aou(bib.target_copy.circ_lib).name | html;
+        l("[_1] (foreign item)", bib_lib_name); -%]
+        <ul><li>
+            <span class="bib_peer_type">[% bib.peer_type.name | html %]</span>:
+            <a href="[% mkurl(ctx.opac_root _ '/record/' _ bib.target_copy.call_number.record) %]">
+                <span class="bib_peer_title">[% peer.title | html %]</span> / 
+                <span class="bib_peer_author">[% peer.author | html %]</span>
+            </a>
+        </li></ul>
+    </td>
+    <td>[% bib.target_copy.call_number.label | html %]</td>
+    <td>[% bib.target_copy.barcode | html %]</td>
+    <td>[% copy_info.copy_location | html %]</td>
+    <td>[% copy_info.copy_status | html %]</td>
+    <td>[% copy_info.due_date | html %]</td>
+</tr>
+   [%- END; # FOREACH peer
+END; # FOREACH bib
+-%]
         [%- last_cn = 0;
         FOR copy_info IN copies;
             callnum = copy_info.call_number_label;
@@ -167,20 +189,6 @@ END;
             [% END %]
         [% END %]
 
-[%- FOREACH peer IN ctx.foreign_copies;
-        FOREACH bib IN peer.foreign_copy_maps; %]
-    <tr><td>
-    [%- ctx.get_aou(bib.target_copy.circ_lib).name -%]
-    </td><td>
-        <a href="[% mkurl(ctx.opac_root _ '/record/' _ bib.target_copy.call_number.record) %]">[% bib.target_copy.call_number.label %]</a>
-    </td>
-    <td>[%- bib.target_copy.barcode -%]</td>
-    <td>[%- copy_info.copy_location -%]</td>
-    <td>[%- copy_info.copy_status -%]</td>
-    <td>[%- copy_info.due_date -%]</td>
-</tr>
-   [%- END; # FOREACH peer
-[%- END; # FOREACH bib
 <tr><td>
 [%- IF copy_info.peer_bib_marc.size > 1;
 '<ul>';
@@ -188,14 +196,15 @@ END;
         attrs = {marc_xml => bib};
         PROCESS get_marc_attrs args=attrs %]
 [%- IF attrs.bibid != ctx.bre_id; %]
-    <li><a href="[% mkurl(ctx.opac_root _ '/record/' _ attrs.bibid) %]"> [% attrs.title %] / [% attrs.author %]</a></li>
-[%- END; # IF attrs.bibid
+    <li><a href="[% mkurl(ctx.opac_root _ '/record/' _ attrs.bibid) %]">[% attrs.title | html %] / [% attrs.author | html %]</a></li>
+[%- END; # IF attrs.bibid %]
 [%- END; # FOREACH bib in copy_info.peer_bib_marc
 '</ul>';
     END # IF copy_info.peer_bib_marc.size
 %]
 </td></tr>
-        [%- END %]
+[%- END; # FOR copy_info
+%]
         <tr>
         [%- IF ctx.copy_offset > 0 AND NOT serial_holdings;
             new_offset = ctx.copy_offset - ctx.copy_limit;

commit 30b75ceadeeb86f50ac874000e1ca38ebed725db
Author: Dan Scott <dscott at laurentian.ca>
Date:   Mon Jul 15 09:11:53 2013 -0400

    Whitespace and timelog entries
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
index 75de856..0e42be0 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
@@ -94,23 +94,27 @@ sub load_record {
             'open-ils.circ.copy_note.retrieve.all',
             {itemid => $copy->{id}, pub => 1 }
         );
+        $self->timelog("past copy note retrieval call");
         $copy->{peer_bibs} = $U->simplereq(
-	    'open-ils.search',
-	    'open-ils.search.multi_home.bib_ids.by_barcode',
-	    $copy->{barcode} );
-	my @peer_marc;
-    	foreach my $bib (@{$copy->{peer_bibs}}) {
-        	my (undef, @peer_data) = $self->get_records_and_facets(
-            		[$bib], undef, {
-                		flesh => '{holdings_xml,acp,acnp,acns,exclude_invisible_acn}',
-                		site => $org_name,
-				depth => $depth,
-                		pref_lib => $pref_ou
-        	});
-		#$copy->{peer_bib_marc} = $peer_data[0]->{marc_xml};
-		push @peer_marc,$peer_data[0]->{marc_xml};
-	}
-	$copy->{peer_bib_marc} = \@peer_marc;
+            'open-ils.search',
+            'open-ils.search.multi_home.bib_ids.by_barcode',
+            $copy->{barcode}
+        );
+        $self->timelog("past peer bib id retrieval");
+        my @peer_marc;
+        foreach my $bib (@{$copy->{peer_bibs}}) {
+            my (undef, @peer_data) = $self->get_records_and_facets(
+                [$bib], undef, {
+                    flesh => '{holdings_xml,acp,acnp,acns,exclude_invisible_acn}',
+                    site => $org_name,
+                    depth => $depth,
+                    pref_lib => $pref_ou
+            });
+            #$copy->{peer_bib_marc} = $peer_data[0]->{marc_xml};
+            push @peer_marc, $peer_data[0]->{marc_xml};
+        }
+        $copy->{peer_bib_marc} = \@peer_marc;
+        $self->timelog("past peer bib record retrieval");
     }
 
     $self->timelog("past store copy retrieval call");
diff --git a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
index 2740202..8602d3f 100644
--- a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
@@ -167,33 +167,34 @@ END;
             [% END %]
         [% END %]
 
-[% FOREACH peer IN ctx.foreign_copies %]
-   [% FOREACH bib IN  peer.foreign_copy_maps %]
+[%- FOREACH peer IN ctx.foreign_copies;
+        FOREACH bib IN peer.foreign_copy_maps; %]
     <tr><td>
-	[% ctx.get_aou(bib.target_copy.circ_lib).name %]
+    [%- ctx.get_aou(bib.target_copy.circ_lib).name -%]
     </td><td>
         <a href="[% mkurl(ctx.opac_root _ '/record/' _ bib.target_copy.call_number.record) %]">[% bib.target_copy.call_number.label %]</a>
-    </td><td>
-	[% bib.target_copy.barcode %]
-    </td><td>
-	[% copy_info.copy_location %]
-    </td><td>
-	[% copy_info.copy_status %]
-    </td><td>
-        [% copy_info.due_date %]
-    </td></tr>
-   [% END %]
-[% END %]
+    </td>
+    <td>[%- bib.target_copy.barcode -%]</td>
+    <td>[%- copy_info.copy_location -%]</td>
+    <td>[%- copy_info.copy_status -%]</td>
+    <td>[%- copy_info.due_date -%]</td>
+</tr>
+   [%- END; # FOREACH peer
+[%- END; # FOREACH bib
 <tr><td>
-[% FOREACH bib IN copy_info.peer_bib_marc;
+[%- IF copy_info.peer_bib_marc.size > 1;
+'<ul>';
+    FOREACH bib IN copy_info.peer_bib_marc;
         attrs = {marc_xml => bib};
         PROCESS get_marc_attrs args=attrs %]
-[% IF attrs.bibid != ctx.bre_id %]
-<a href="[% mkurl(ctx.opac_root _ '/record/' _ attrs.bibid) %]"> [% attrs.title %] / [% attrs.author %]</a><br/>
-[% END %]
-[% END %]
+[%- IF attrs.bibid != ctx.bre_id; %]
+    <li><a href="[% mkurl(ctx.opac_root _ '/record/' _ attrs.bibid) %]"> [% attrs.title %] / [% attrs.author %]</a></li>
+[%- END; # IF attrs.bibid
+[%- END; # FOREACH bib in copy_info.peer_bib_marc
+'</ul>';
+    END # IF copy_info.peer_bib_marc.size
+%]
 </td></tr>
-
         [%- END %]
         <tr>
         [%- IF ctx.copy_offset > 0 AND NOT serial_holdings;

commit 8c896e9524a452464042594719f1c1e34eba016e
Author: Bill Ott <bott at grpl.org>
Date:   Wed May 22 20:11:07 2013 -0400

    Expose conjoined bibs in TPAC
    
    This initial work is based on the GRPL need to handle eReader bib/copy display.
    The "joined" titles will display a copy record with a call_number link back to
    the "master" bib, where the master will display a set of links to individual
    titles from each "copy".
    
    TODO: consider peer_type when determining whether or not to display
    
    Signed-off-by: Bill Ott <bott at grpl.org>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
index b60031a..75de856 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
@@ -67,6 +67,13 @@ sub load_record {
         $self->mk_copy_query($rec_id, $org, $copy_depth, $copy_limit, $copy_offset, $pref_ou)
     );
 
+    # find foreign copy data
+    my $peer_rec = $U->simplereq(
+        'open-ils.search',
+        'open-ils.search.peer_bibs', $rec_id );
+
+    $ctx->{foreign_copies} = $peer_rec;
+
     my (undef, @rec_data) = $self->get_records_and_facets([$rec_id], undef, {
         flesh => '{holdings_xml,bmp,mra,acp,acnp,acns}',
         site => $org_name,
@@ -80,13 +87,30 @@ sub load_record {
 
     $ctx->{copies} = $copy_rec->gather(1);
 
-    # Add public copy notes to each copy
+    # Add public copy notes to each copy - and while we're in there, grab peer bib records
     foreach my $copy (@{$ctx->{copies}}) {
         $copy->{notes} = $U->simplereq(
             'open-ils.circ',
             'open-ils.circ.copy_note.retrieve.all',
             {itemid => $copy->{id}, pub => 1 }
         );
+        $copy->{peer_bibs} = $U->simplereq(
+	    'open-ils.search',
+	    'open-ils.search.multi_home.bib_ids.by_barcode',
+	    $copy->{barcode} );
+	my @peer_marc;
+    	foreach my $bib (@{$copy->{peer_bibs}}) {
+        	my (undef, @peer_data) = $self->get_records_and_facets(
+            		[$bib], undef, {
+                		flesh => '{holdings_xml,acp,acnp,acns,exclude_invisible_acn}',
+                		site => $org_name,
+				depth => $depth,
+                		pref_lib => $pref_ou
+        	});
+		#$copy->{peer_bib_marc} = $peer_data[0]->{marc_xml};
+		push @peer_marc,$peer_data[0]->{marc_xml};
+	}
+	$copy->{peer_bib_marc} = \@peer_marc;
     }
 
     $self->timelog("past store copy retrieval call");
diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2
index 5c18d60..3f31205 100644
--- a/Open-ILS/src/templates/opac/parts/misc_util.tt2
+++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2
@@ -413,6 +413,12 @@
                 LAST;
             END;
         END;
+	
+        args.bibid = [];
+        FOR bibid IN xml.findnodes('//*[@tag="901"]/*[@code="c"]');
+            args.bibid.push(bibid.textContent);
+        END;
+        args.bibid = args.bibid.0; 
 
     END;
 
diff --git a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
index 9a71bce..2740202 100644
--- a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
@@ -167,6 +167,33 @@ END;
             [% END %]
         [% END %]
 
+[% FOREACH peer IN ctx.foreign_copies %]
+   [% FOREACH bib IN  peer.foreign_copy_maps %]
+    <tr><td>
+	[% ctx.get_aou(bib.target_copy.circ_lib).name %]
+    </td><td>
+        <a href="[% mkurl(ctx.opac_root _ '/record/' _ bib.target_copy.call_number.record) %]">[% bib.target_copy.call_number.label %]</a>
+    </td><td>
+	[% bib.target_copy.barcode %]
+    </td><td>
+	[% copy_info.copy_location %]
+    </td><td>
+	[% copy_info.copy_status %]
+    </td><td>
+        [% copy_info.due_date %]
+    </td></tr>
+   [% END %]
+[% END %]
+<tr><td>
+[% FOREACH bib IN copy_info.peer_bib_marc;
+        attrs = {marc_xml => bib};
+        PROCESS get_marc_attrs args=attrs %]
+[% IF attrs.bibid != ctx.bre_id %]
+<a href="[% mkurl(ctx.opac_root _ '/record/' _ attrs.bibid) %]"> [% attrs.title %] / [% attrs.author %]</a><br/>
+[% END %]
+[% END %]
+</td></tr>
+
         [%- END %]
         <tr>
         [%- IF ctx.copy_offset > 0 AND NOT serial_holdings;

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

Summary of changes:
 .../perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm |   34 +++++++++++++++++-
 Open-ILS/src/templates/opac/css/style.css.tt2      |   13 ++++++-
 Open-ILS/src/templates/opac/parts/misc_util.tt2    |    6 +++
 .../src/templates/opac/parts/record/copy_table.tt2 |   39 +++++++++++++++++++-
 4 files changed, 88 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list