From: erickson Date: Tue, 2 Jan 2007 19:03:17 +0000 (+0000) Subject: updated manual hold notification to use the editor+transaction X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4063b5cc8405ac87638dea978c985bb5a7915b91;p=Evergreen.git updated manual hold notification to use the editor+transaction git-svn-id: svn://svn.open-ils.org/ILS/trunk@6714 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm index 58890b1d55..7dbf550e9b 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm @@ -670,7 +670,8 @@ __PACKAGE__->register_method ( @return ID of the new object on success, Event on error / ); -sub create_hold_notify { +=head old +sub __create_hold_notify { my( $self, $conn, $authtoken, $notification ) = @_; my( $requestor, $evt ) = $U->checkses($authtoken); return $evt if $evt; @@ -692,6 +693,26 @@ sub create_hold_notify { $logger->info("User ".$requestor->id." successfully created new hold notification $id"); return $id; } +=cut + +sub create_hold_notify { + my( $self, $conn, $auth, $note ) = @_; + my $e = new_editor(authtoken=>$auth, xact=>1); + return $e->die_event unless $e->checkauth; + + my $hold = $e->retrieve_action_hold_request($note->hold) + or return $e->die_event; + my $patron = $e->retrieve_actor_user($hold->usr) + or return $e->die_event; + + return $e->die_event unless + $e->allowed('CREATE_HOLD_NOTIFICATION', $patron->home_ou); + + $note->notify_staff($e->requestor->id); + $e->create_action_hold_notification($note) or return $e->die_event; + $e->commit; + return $note->id; +} __PACKAGE__->register_method(