Bug 7016: CanBookBeReserved uses GetItemsInfo unnecessarily
CanBookBeReserved uses the very heavy-weight function GetItemsInfo to simply retrieve the itemnumbers attached to a given biblio. The function get_itemnumbers_of() is much lighter-weight and returns the required information; switching to it will reduce the overall system resource cost of placing a hold. Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
parent
a46cbc03ee
commit
823b807ac9
1 changed files with 7 additions and 9 deletions
|
@ -383,17 +383,15 @@ sub GetReservesFromBorrowernumber {
|
|||
sub CanBookBeReserved{
|
||||
my ($borrowernumber, $biblionumber) = @_;
|
||||
|
||||
my @items = GetItemsInfo($biblionumber);
|
||||
|
||||
#get items linked via host records
|
||||
my $marcrecord= GetMarcBiblio($biblionumber);
|
||||
my @hostitemInfos = GetHostItemsInfo($marcrecord);
|
||||
if (@hostitemInfos){
|
||||
push (@items,@hostitemInfos);
|
||||
}
|
||||
my @items = get_itemnumbers_of($biblionumber);
|
||||
#get items linked via host records
|
||||
my @hostitems = get_hostitemnumbers_of($biblionumber);
|
||||
if (@hostitems){
|
||||
push (@items,@hostitems);
|
||||
}
|
||||
|
||||
foreach my $item (@items){
|
||||
return 1 if CanItemBeReserved($borrowernumber, $item->{itemnumber});
|
||||
return 1 if CanItemBeReserved($borrowernumber, $item);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue