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.
Implements some changes to the patch suggested on
patches@koha.org
give visual cue on UI and a link out.
More friendly pruning of the other items.
Thanks to Galen Charlton and Joe Atzberger
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
my $biblionumber=$query->param('biblionumber');
my $title=$query->param('title');
my $biblionumber=$query->param('biblionumber');
my $title=$query->param('title');
-# my $bi=$query->param('bi');
+my $itemnumber=$query->param('itemnumber');
+my $bi=$query->param('bi');
# $bi = $biblionumber unless $bi;
my $data=GetBiblioData($biblionumber);
my $dewey = $data->{'dewey'};
# $bi = $biblionumber unless $bi;
my $data=GetBiblioData($biblionumber);
my $dewey = $data->{'dewey'};
$data->{'itemtypename'} = $itemtypes->{$data->{'itemtype'}}->{'description'};
$results[0]=$data;
$data->{'itemtypename'} = $itemtypes->{$data->{'itemtype'}}->{'description'};
$results[0]=$data;
+($itemnumber) and @items = (grep {$_->{'itemnumber'} == $itemnumber} @items);
foreach my $item (@items){
$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);
foreach my $item (@items){
$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);
$template->param(moredetailview => 1);
$template->param(loggedinuser => $loggedinuser);
$template->param(biblionumber => $biblionumber);
$template->param(moredetailview => 1);
$template->param(loggedinuser => $loggedinuser);
$template->param(biblionumber => $biblionumber);
+$template->param(biblioitemnumber => $bi);
+$template->param(itemnumber => $itemnumber);
+$template->param(ONLY_ONE => 1) if ( $itemnumber && $count != @items );
output_html_with_http_headers $query, $cookie, $template->output;
output_html_with_http_headers $query, $cookie, $template->output;
</ol>
<!-- /TMPL_LOOP -->
<br clear="all" />
</ol>
<!-- /TMPL_LOOP -->
<br clear="all" />
+ <!-- TMPL_IF NAME="ONLY_ONE" -->
+ <div class="alert">You are only viewing one item. <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&bi=<!-- TMPL_VAR NAME="biblioitemnumber" -->#item<!-- TMPL_VAR NAME="itemnumber">">View All</a></div>
+ <!-- /TMPL_IF -->
<!-- TMPL_LOOP NAME="ITEM_DATA" -->
<div class="yui-g">
<h3 id="item<!-- TMPL_VAR NAME="itemnumber" -->">Barcode <!-- TMPL_VAR NAME="barcode" --> <!-- TMPL_IF name="notforloantext" --><!-- TMPL_VAR name="notforloantext" --> <!-- /TMPL_IF --></h3>
<!-- TMPL_LOOP NAME="ITEM_DATA" -->
<div class="yui-g">
<h3 id="item<!-- TMPL_VAR NAME="itemnumber" -->">Barcode <!-- TMPL_VAR NAME="barcode" --> <!-- TMPL_IF name="notforloantext" --><!-- TMPL_VAR name="notforloantext" --> <!-- /TMPL_IF --></h3>