In a middle-layer method for returning holdable formats on a metarecord,
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 5 Aug 2011 18:31:03 +0000 (14:31 -0400)
committerMike Rylander <mrylander@gmail.com>
Mon, 8 Aug 2011 16:08:00 +0000 (12:08 -0400)
Do a better test of copy holdability than we were doing previously.
We can't do a perfect test: we don't really know what patron we're doing
this for, and even if we did, from here it's nontrivial to figure out
whether we're doing indb holds or script-based, much less run the tests.

Still, we can test whether a copy's in a holdable status, a holdable
location, and is itself not explicitly marked unholdable.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>

Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm

index 92cb75a..a8bcda2 100644 (file)
@@ -2610,13 +2610,24 @@ sub rec_to_mr_rec_descriptors {
         my $good_records = $e->json_query(
             { distinct => 1,
               select   => { 'bre' => ['id'] },
-              from     => { 'bre' => { 'acn' => { 'join' => { 'acp' } } } },
+              from     => {
+                  'bre' => {
+                      'acn' => {
+                          'join' => {
+                              'acp' => {"join" => {"acpl" => {}, "ccs" => {}}}
+                            }
+                        }
+                   }
+              },
               where    => {
                 '+bre' => { id => \@recs },
                 '+acp' => {
+                    holdable => 't',
                     circ_lib => [ map { $_->{id} } @$orgs ],
                     deleted  => 'f'
-                }
+                },
+                "+ccs" => { holdable => 't' },
+                "+acpl" => { holdable => 't' }
               }
             }
         );