From: Michael Hafen Date: Thu, 21 Aug 2008 21:55:27 +0000 (-0600) Subject: If itemnumber is sent to catalogue/moredetail.pl use it X-Git-Tag: v3.00.04~659 X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=04d8cfd65593eef42541a0510ae2d5b21b2ba962;p=koha.git 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 Signed-off-by: Chris Cormack --- diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index 6f626616f7..eeb5b29e2f 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -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}};