If itemnumber is sent to catalogue/moredetail.pl use it

If itemnumber is part of the url for catalogue/moredetail.pl put it to use.
This happens in members/boraccount.pl if a fine is attached to a barcode.

This patch makes moredetail.pl show only the item specified by itemnumber.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
This commit is contained in:
Michael Hafen 2008-08-21 15:55:27 -06:00 committed by Chris Cormack
parent fac72f1162
commit 04d8cfd655
1 changed files with 4 additions and 1 deletions

View File

@ -52,7 +52,6 @@ my $biblionumber=$query->param('biblionumber');
my $title=$query->param('title');
my $itemnumber=$query->param('itemnumber');
my $bi=$query->param('bi');
# $bi = $biblionumber unless $bi;
my $data=GetBiblioData($biblionumber);
my $dewey = $data->{'dewey'};
@ -85,6 +84,10 @@ $data->{'itemtypename'} = $itemtypes->{$data->{'itemtype'}}->{'description'};
$results[0]=$data;
($itemnumber) and @items = (grep {$_->{'itemnumber'} == $itemnumber} @items);
foreach my $item (@items){
if ( $itemnumber && $itemnumber != $item->{'itemnumber'} ) {
undef $item;
next;
}
$item->{itemlostloop}= GetAuthorisedValues(GetAuthValCode('items.itemlost',$fw),$item->{itemlost}) if GetAuthValCode('items.itemlost',$fw);
$item->{itemdamagedloop}= GetAuthorisedValues(GetAuthValCode('items.damaged',$fw),$item->{damaged}) if GetAuthValCode('items.damaged',$fw);
$item->{'collection'} = $ccodes->{$item->{ccode}};