Tpac; repair format icon display in holds lists
authorBill Erickson <berick@esilibrary.com>
Thu, 20 Oct 2011 14:37:39 +0000 (10:37 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 20 Oct 2011 15:28:47 +0000 (11:28 -0400)
* Fetch MARC XML from unapi to pick up metabib::record_attr's for each
record.

* Update format icon code in holds list to use new-style precompiled
format_icon

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@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/hold_history.tt2
Open-ILS/src/templates/opac/myopac/holds.tt2

index 3265ae3..8a0674a 100644 (file)
@@ -3049,7 +3049,8 @@ sub uber_hold_impl {
     my $details = retrieve_hold_queue_status_impl($e, $hold);
 
     my $resp = {
-        hold           => $hold,
+        hold    => $hold,
+        bre_id  => $bre->id,
         ($copy     ? (copy           => $copy)     : ()),
         ($volume   ? (volume         => $volume)   : ()),
         ($issuance ? (issuance       => $issuance) : ()),
index 59bc862..fe0da83 100644 (file)
@@ -368,8 +368,7 @@ sub fetch_user_holds {
         suppress_notices => 1,
         suppress_transits => 1,
         suppress_mvr => 1,
-        suppress_patron_details => 1,
-        include_bre => $flesh ? 1 : 0
+        suppress_patron_details => 1
     };
 
     # ----------------------------------------------------------------
@@ -405,7 +404,10 @@ sub fetch_user_holds {
                 @collected = grep { $_->{hold}->{status} == 4 } @collected;
             }
             while(my $blob = pop(@collected)) {
-                $blob->{marc_xml} = XML::LibXML->new->parse_string($blob->{hold}->{bre}->marc) if $flesh;
+                my (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 d57fd63..314741d 100644 (file)
                     <td width="64">
                         <div style="width:26px;height:23px;margin-top:6px;margin-bottom:6px;">
                             [% IF attrs.format_icon %]
-                            <img src="[% ctx.media_prefix %]/images/[% attrs.form_icon %]"
-                                title="[% attrs.format %]" alt="[% attrs.format %]" />
-                            [% ELSE;
-                                attrs.format;
-                               END %]
+                            <img title="[% attrs.format_label | html %]" alt="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
+                            [% END %]
                         </div>
                     </td>
                     <td width="136">
index f008fb7..3c43ab2 100644 (file)
                     <td width="64">
                         <div style="width:26px;height:23px;margin-top:6px;margin-bottom:6px;">
                             [% IF attrs.format_icon %]
-                            <img src="[% ctx.media_prefix %]/images/[% attrs.form_icon %]"
-                                title="[% attrs.format %]" alt="[% attrs.format %]" />
-                            [% ELSE;
-                                attrs.format;
-                               END %]
+                            <img title="[% attrs.format_label | html %]" alt="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
+                            [% END %]
                         </div>
                     </td>
                     <td width="136">