From e16c8b771ecc2b57cadbc27f6677eb7fe44578e1 Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Fri, 5 Aug 2011 14:31:03 -0400 Subject: [PATCH] In a middle-layer method for returning holdable formats on a metarecord, 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 Signed-off-by: Mike Rylander --- .../src/perlmods/lib/OpenILS/Application/Search/Biblio.pm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm index 92cb75ae90..a8bcda24f1 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm @@ -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' } } } ); -- 2.11.0