[Koha-patches] [PATCH] Implementing suggested changes to patch: If itemnumber is sent to catalogue/moredetail.pl use it

Michael Hafen mdhafen at tech.washk12.org
Tue Sep 2 17:30:09 CEST 2008


Looks like the original patch got pushed up, so here is another patch to make things easier for you.

Implements some changes to the patch suggested on patches at 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
---
 catalogue/moredetail.pl                            |   10 +++++-----
 .../prog/en/modules/catalogue/moredetail.tmpl      |    3 +++
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl
index 9dea37a..6176815 100755
--- a/catalogue/moredetail.pl
+++ b/catalogue/moredetail.pl
@@ -52,7 +52,7 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user({
 my $biblionumber=$query->param('biblionumber');
 my $title=$query->param('title');
 my $itemnumber=$query->param('itemnumber');
-# my $bi=$query->param('bi');
+my $bi=$query->param('bi');
 # $bi = $biblionumber unless $bi;
 my $data=GetBiblioData($biblionumber);
 my $dewey = $data->{'dewey'};
@@ -84,11 +84,8 @@ my $itemtypes = GetItemTypes;
 
 $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}};
@@ -129,6 +126,9 @@ $template->param(ITEM_DATA => \@items);
 $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;
 
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl
index 97fec1f..4935bd2 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl
@@ -36,6 +36,9 @@
     </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" -->&amp;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>
-- 
1.5.4.3




More information about the Koha-patches mailing list