From 9f0258b8408e4418caeffd79595d49fe28397b16 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 14 Dec 2005 22:03:52 +0000 Subject: [PATCH] fixed some bugs/typos git-svn-id: svn://svn.open-ils.org/ILS/trunk@2382 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/AppUtils.pm | 21 +++++++++++++++---- .../OpenILS/Application/Circ/Holds.pm | 6 +++--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm index f9697265b4..63833c5ad8 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm @@ -305,11 +305,14 @@ sub fetch_user { my( $self, $userid ) = @_; my( $user, $evt ); + $logger->debug("Fetching user $userid from storage"); + $user = $self->simplereq( 'open-ils.storage', 'open-ils.storage.direct.actor.user.retrieve', $userid ); if(!$user) { + $logger->info("User $userid not found in the db"); $evt = OpenILS::Event->new('USER_NOT_FOUND'); } @@ -339,10 +342,8 @@ sub checkrequestor { $logger->debug("checkrequestor(): requestor => " . $staffobj->id . ", target => $userid"); if( $userid ne $staffobj->id ) { - if( ! ($user = $self->fetch_user($userid)) ) { - $evt = OpenILS::Event->new('USER_NOT_FOUND'); - return (undef, $evt); - } + ($user, $evt) = $self->fetch_user($userid); + return (undef, $evt) if $evt; $evt = $self->check_perms( $staffobj->id, $user->home_ou, @perms ); } else { @@ -367,6 +368,8 @@ sub fetch_copy { my( $self, $copyid ) = @_; my( $copy, $evt ); + $logger->debug("Fetching copy $copyid from storage"); + $copy = $self->simplereq( 'open-ils.storage', 'open-ils.storage.direct.asset.copy.retrieve', $copyid ); @@ -382,6 +385,8 @@ sub fetch_circulation { my( $self, $circid ) = @_; my $circ; my $evt; + $logger->debug("Fetching circ $circid from storage"); + $circ = $self->simplereq( 'open-ils.storage', "open-ils.storage.direct.action.circulation.retrieve", $circid ); @@ -397,6 +402,8 @@ sub fetch_record_by_copy { my( $self, $copyid ) = @_; my( $record, $evt ); + $logger->debug("Fetching record by copy $copyid from storage"); + $record = $self->simplereq( 'open-ils.storage', 'open-ils.storage.fleshed.biblio.record_entry.retrieve_by_copy', $copyid ); @@ -422,6 +429,8 @@ sub fetch_hold { my( $self, $holdid ) = @_; my( $hold, $evt ); + $logger->debug("Fetching hold $holdid from storage"); + $hold = $self->simplereq( 'open-ils.storage', 'open-ils.storage.direct.action.hold_request.retrieve', $holdid); @@ -436,6 +445,8 @@ sub fetch_hold_transit_by_hold { my( $self, $holdid ) = @_; my( $transit, $evt ); + $logger->debug("Fetching transit by hold $holdid from storage"); + $transit = $self->simplereq( 'open-ils.storage', 'open-ils.storage.direct.action.hold_transit_copy.search.hold', $holdid ); @@ -450,6 +461,8 @@ sub fetch_copy_by_barcode { my( $self, $barcode ) = $_; my( $copy, $evt ); + $logger->debug("Fetching copy by barcode $barcode from storage"); + $copy = $self->simplereq( 'open-ils.storage', 'open-ils.storage.direct.asset.copy.search.barcode', $barcode ); diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm index 7c0e04f3d0..c9abb12689 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm @@ -176,7 +176,7 @@ __PACKAGE__->register_method( notes => <checkses_requestor( - $login_session, $user_id, 'VIEW_HOLDS' ); + $login_session, $user_id, 'VIEW_HOLD' ); return $evt if $evt; return $apputils->simplereq( @@ -259,7 +259,7 @@ __PACKAGE__->register_method( api_name => "open-ils.circ.hold.status.retrieve", notes => <<" NOTE"); Calculates the current status of the hold. - the requestor must have VIEW_HOLDS permissions if the hold is for a user + the requestor must have VIEW_HOLD permissions if the hold is for a user other than the requestor. Returns -1 on error (for now) Returns 1 for 'waiting for copy to become available' -- 2.43.2