Whitespace and timelog entries
authorDan Scott <dscott@laurentian.ca>
Mon, 15 Jul 2013 13:11:53 +0000 (09:11 -0400)
committerBen Shum <bshum@biblio.org>
Tue, 20 Aug 2013 15:30:20 +0000 (11:30 -0400)
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
Open-ILS/src/templates/opac/parts/record/copy_table.tt2

index 75de856..0e42be0 100644 (file)
@@ -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");
index 2740202..8602d3f 100644 (file)
@@ -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;