[open-ils-commits] r8825 -
trunk/Open-ILS/src/perlmods/OpenILS/Application/Cat
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Feb 22 14:22:09 EST 2008
Author: erickson
Date: 2008-02-22 13:51:26 -0500 (Fri, 22 Feb 2008)
New Revision: 8825
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Cat/Merge.pm
Log:
added support for volume-level holds migration during volume merging
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Cat/Merge.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Cat/Merge.pm 2008-02-22 18:51:15 UTC (rev 8824)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Cat/Merge.pm 2008-02-22 18:51:26 UTC (rev 8825)
@@ -218,6 +218,7 @@
$_->edit_date('now');
return (undef,$editor->die_event) unless $editor->allowed('UPDATE_VOLUME', $_->owning_lib);
$editor->update_asset_call_number($_) or return (undef, $editor->die_event);
+ merge_volume_holds($editor, $bigcn, $_->id);
}
my ($mvol) = grep { $_->id == $bigcn } @$volumes;
@@ -225,7 +226,33 @@
return ($mvol);
}
+sub merge_volume_holds {
+ my($e, $master_id, $vol_id) = @_;
+ my $holds = $e->search_action_hold_request(
+ { cancel_time => undef,
+ fulfillment_time => undef,
+ hold_type => 'V',
+ target => $vol_id
+ }
+ );
+
+ for my $hold (@$holds) {
+
+ $logger->info("Changing hold ".$hold->id.
+ " target from ".$hold->target." to $master_id in volume merge");
+
+ $hold->target($master_id);
+ unless($e->update_action_hold_request($hold)) {
+ my $evt = $e->event;
+ $logger->error("Error updating hold ". $evt->textcode .":". $evt->desc .":". $evt->stacktrace);
+ }
+ }
+
+ return undef;
+}
+
+
1;
More information about the open-ils-commits
mailing list