[open-ils-commits] r13463 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Jun 24 23:02:05 EDT 2009
Author: erickson
Date: 2009-06-24 23:02:03 -0400 (Wed, 24 Jun 2009)
New Revision: 13463
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
Log:
added batch hold reset call
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm 2009-06-25 01:50:12 UTC (rev 13462)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm 2009-06-25 03:02:03 UTC (rev 13463)
@@ -948,13 +948,39 @@
my $reqr;
my ($hold, $evt) = $U->fetch_hold($holdid);
return $evt if $evt;
- ($reqr, $evt) = $U->checksesperm($auth, 'UPDATE_HOLD'); # XXX stronger permission
+ ($reqr, $evt) = $U->checksesperm($auth, 'UPDATE_HOLD');
return $evt if $evt;
$evt = _reset_hold($self, $reqr, $hold);
return $evt if $evt;
return 1;
}
+
+__PACKAGE__->register_method(
+ method => 'reset_hold_batch',
+ api_name => 'open-ils.circ.hold.reset.batch'
+);
+
+sub reset_hold_batch {
+ my($self, $conn, $auth, $hold_ids) = @_;
+
+ my $e = new_editor(authtoken => $auth);
+ return $e->event unless $e->checkauth;
+
+ for my $hold_id ($hold_ids) {
+
+ my $hold = $e->retrieve_action_hold_request(
+ [$hold_id, {flesh => 1, flesh_fields => {ahr => ['usr']}}])
+ or return $e->event;
+
+ next unless $e->allowed('UPDATE_HOLD', $hold->usr->home_ou);
+ _reset_hold($self, $e->requestor, $hold);
+ }
+
+ return 1;
+}
+
+
sub _reset_hold {
my ($self, $reqr, $hold) = @_;
More information about the open-ils-commits
mailing list