From 8bf6e076cd818e466d41e9cae99dda81540fca5d Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 7 Aug 2006 20:22:29 +0000 Subject: [PATCH] return event if the copy circ_lib != vol->owing_lib on volume transfer. git-svn-id: svn://svn.open-ils.org/ILS/trunk@5350 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Cat.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Cat.pm b/Open-ILS/src/perlmods/OpenILS/Application/Cat.pm index 6c5d0853cd..b818a1543d 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Cat.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Cat.pm @@ -1177,6 +1177,12 @@ __PACKAGE__->register_method ( api_name => 'open-ils.cat.asset.volume.batch.transfer', ); +__PACKAGE__->register_method ( + method => 'batch_volume_transfer', + api_name => 'open-ils.cat.asset.volume.batch.transfer.override', +); + + sub batch_volume_transfer { my( $self, $conn, $auth, $args ) = @_; @@ -1206,6 +1212,18 @@ sub batch_volume_transfer { # take note of the fact that we've looked at this set of volumes push( @seen, $_->id ) for @all; + + # for each volume, see if there are any copies that have a + # remote circ_lib (circ_lib != vol->owning_lib). if so, warn them + unless( $self->api_name =~ /override/ ) { + for my $v (@all) { + $logger->debug("merge: searching for copies with remote circ_lib for volume ".$v->id); + my $copies = $e->search_asset_copy( + { call_number=>$v->id, circ_lib => { '!=' => $v->owning_lib } }, {idlist=>1}); + return OpenILS::Event->new('COPY_REMOTE_CIRC_LIB') if @$copies; + } + } + # see if there is a volume at the destination lib that # already has the requested label my $existing_vol = $e->search_asset_call_number( -- 2.11.0