LP#1053397 MR holds available formats; initial extraction
authorBill Erickson <berick@esilibrary.com>
Wed, 29 Jan 2014 22:42:15 +0000 (17:42 -0500)
committerBill Erickson <berick@esilibrary.com>
Wed, 29 Jan 2014 22:42:15 +0000 (17:42 -0500)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm

index 02b729a..b950d08 100644 (file)
@@ -790,6 +790,25 @@ sub load_place_hold {
                     record => $mr->master_record
                 }));
             }
+
+            # see which formats are available for the selected records.
+            # fetches search_label, value for each ccvm linked to the
+            # mr holds format attribute, for every record within this MR.
+            $ctx->{metarecord_formats} = $e->json_query({
+                select => {ccvm => ['id', 'value', 'search_label']},
+                from => {mraf => {
+                    cgf => {
+                        fkey => 'attr',
+                        field => 'value',
+                        filter => {name => 'opac.metarecord.holds.format_attr'}
+                    },
+                    ccvm => {
+                        fkey => 'attr',
+                        field => 'ctype'
+                    }
+                }},
+                where => {'+mraf' => {id => \@targets}}
+            });
         },
         T => sub {
             my $recs = $e->batch_retrieve_biblio_record_entry(\@targets, {substream => 1});