If itemnumber is sent to catalogue/moredetail.pl use it
authorMichael Hafen <mdhafen@tech.washk12.org>
Thu, 21 Aug 2008 21:55:27 +0000 (15:55 -0600)
committerChris Cormack <chris@bigballofwax.co.nz>
Thu, 3 Sep 2009 23:10:30 +0000 (11:10 +1200)
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>
catalogue/moredetail.pl

index 6f62661..eeb5b29 100755 (executable)
@@ -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}};