LP#1053397 tpac show icons for all selected MR formats in patron holds list
authorBill Erickson <berick@esilibrary.com>
Fri, 7 Feb 2014 16:09:01 +0000 (11:09 -0500)
committerBill Erickson <berick@esilibrary.com>
Mon, 10 Feb 2014 16:02:29 +0000 (11:02 -0500)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
Open-ILS/src/templates/opac/myopac/holds.tt2

index 6d63aa2..4f56877 100644 (file)
@@ -4252,6 +4252,7 @@ sub mr_hold_filter_attrs {
     # helper sub for fetching ccvms for a batch of record IDs
     sub get_batch_ccvms {
         my ($e, $attr, $bre_ids) = @_;
+        return [] unless $bre_ids and @$bre_ids;
         my $vals = $e->search_metabib_record_attr_flat({
             attr => $attr,
             id => $bre_ids
index eb99180..040966d 100644 (file)
@@ -571,10 +571,7 @@ sub fetch_user_holds {
 
         if(@collected) {
             while(my $blob = pop(@collected)) {
-                my (undef, @data) = $self->get_records_and_facets(
-                    [$blob->{hold}->{bre_id}], undef, {flesh => '{mra}'}
-                );
-                $blob->{marc_xml} = $data[0]->{marc_xml};
+                my @data;
 
                 # in the holds edit UI, we need to know what formats and
                 # languages the user selected for this hold, plus what
@@ -582,6 +579,10 @@ sub fetch_user_holds {
                 if ($blob->{hold}{hold}->hold_type eq 'M') {
                     my $hold = $blob->{hold}->{hold};
 
+                    # for MR, fetch the combined MR unapi blob
+                    (undef, @data) = $self->get_records_and_facets(
+                        [$hold->target], undef, {flesh => '{mra}', metarecord => 1});
+
                     my $filter_data = $U->simplereq(
                         'open-ils.circ',
                         'open-ils.circ.mmr.holds.filters.authoritative.atomic', 
@@ -592,7 +593,14 @@ sub fetch_user_holds {
                         $filter_data->[0]->{metarecord};
                     $blob->{metarecord_selected_filters} = 
                         $filter_data->[1]->{hold};
+                } else {
+
+                    (undef, @data) = $self->get_records_and_facets(
+                        [$blob->{hold}->{bre_id}], undef, {flesh => '{mra}'}
+                    );
                 }
+
+                $blob->{marc_xml} = $data[0]->{marc_xml};
                 push(@holds, $blob);
             }
         }
index 18eadc2..98e9804 100644 (file)
                     </td>
                     <td>
                         <div class="format_icon">
-                            [% IF attrs.format_icon %]
-                            <img title="[% attrs.format_label | html %]" alt="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
+                            [% IF attrs.all_formats.size %]
+                                [% FOR format IN attrs.all_formats %]
+                                <img title="[% format.label | html %]" alt="[% format.label | html %]" src="[% format.icon %]" />
+                                [% END %]
                             [% END %]
                         </div>
                     </td>