[open-ils-commits] [GIT] Evergreen ILS branch rel_2_0 updated. 7b6b3d30eebdbeb7f9b47435c21017a190c27f75

Evergreen Git git at git.evergreen-ils.org
Mon Aug 8 13:34:50 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_0 has been updated
       via  7b6b3d30eebdbeb7f9b47435c21017a190c27f75 (commit)
      from  f19e78bb8538c0da8f0612c3b2085b11f9f7dae1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7b6b3d30eebdbeb7f9b47435c21017a190c27f75
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Mon Aug 8 13:22:05 2011 -0400

    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 <lebbeous at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
index e12ccb1..05c5d4d 100644
--- a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
+++ b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
@@ -2416,6 +2416,40 @@ sub rec_to_mr_rec_descriptors {
 
 	my $desc = $e->search_metabib_record_descriptor($search);
 
+	my $query = {
+		distinct => 1,
+		select   => { 'bre' => ['id'] },
+		from	 => {
+			'bre' => {
+				'acn' => {
+					'join' => {
+						'acp' => {"join" => {"acpl" => {}, "ccs" => {}}}
+					  }
+				  }
+			 }
+		},
+		where => {
+			'+bre' => { id => \@recs },
+			'+acp' => {
+				holdable => 't',
+				deleted  => 'f'
+			},
+			"+ccs" => { holdable => 't' },
+			"+acpl" => { holdable => 't' }
+		}
+	};
+
+	my $good_records = $e->json_query($query) or return $e->die_event;
+
+	my @keep;
+	for my $d (@$desc) {
+		if ( grep { $d->record == $_->{id} } @$good_records ) {
+			push @keep, $d;
+		}
+	}
+
+	$desc = \@keep;
+
 	return { metarecord => $mrec, descriptors => $desc };
 }
 

-----------------------------------------------------------------------

Summary of changes:
 .../perlmods/OpenILS/Application/Search/Biblio.pm  |   34 ++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list