X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=opac%2Fopac-topissues.pl;h=05b7a278d1c4ee17d8e46acf7a4c7c2c70042a27;hb=ce046f9a732a74a7b6a5ddca228d2579c08d288d;hp=6899215cc7cb9cd40d44e074faf8cd1e571ca3fd;hpb=8f21144fb154b68747d004eecca53fe84a020f22;p=koha.git diff --git a/opac/opac-topissues.pl b/opac/opac-topissues.pl index 6899215cc7..05b7a278d1 100755 --- a/opac/opac-topissues.pl +++ b/opac/opac-topissues.pl @@ -2,6 +2,7 @@ # Copyright 2000-2002 Katipo Communications +# Parts Copyright Catalyst IT 2011 # # This file is part of Koha. # @@ -83,7 +84,14 @@ if($advanced_search_types eq 'ccode'){ "; $template->param(ccodesearch => 1); }else{ - $whereclause .= ' AND biblioitems.itemtype='.$dbh->quote($itemtype) if $itemtype; + if ($itemtype){ + if (C4::Context->preference('item-level_itypes')){ + $whereclause .= ' AND items.itype = ' . $dbh->quote($itemtype); + } + else { + $whereclause .= ' AND biblioitems.itemtype='.$dbh->quote($itemtype); + } + } $query = "SELECT datecreated, biblio.biblionumber, title, author, sum( items.issues ) AS tot, biblioitems.itemtype, biblioitems.publishercode,biblioitems.publicationyear,