From 251d873b82bce4b869d2a6351b832e49e957d2c2 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Sat, 29 Oct 2011 08:49:20 +1300 Subject: [PATCH] Bug 6947 : opac-topissues.pl wasn't respecting item live itemtypes Signed-off-by: Katrin Fischer The search was only looking for bib level itypes independent from the settings for item-level_itypes. After patch the system preference setting is respected and search works accordingly. Signed-off-by: Paul Poulain --- opac/opac-topissues.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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, -- 2.20.1