From d5e98bdc7dba2585d02a50600acbad4594c79e8e Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Tue, 9 Oct 2007 16:46:48 -0500 Subject: [PATCH] (minor) bugfixing topissues (no limit query) Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- koha-tmpl/opac-tmpl/prog/en/opac-topissues.tmpl | 2 +- opac/opac-topissues.pl | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/opac-topissues.tmpl b/koha-tmpl/opac-tmpl/prog/en/opac-topissues.tmpl index e59d4d50bf..f7adf4c776 100644 --- a/koha-tmpl/opac-tmpl/prog/en/opac-topissues.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/opac-topissues.tmpl @@ -44,7 +44,7 @@ function Dopop(link) { - +

diff --git a/opac/opac-topissues.pl b/opac/opac-topissues.pl index 6f483658c6..1e8b1952b4 100755 --- a/opac/opac-topissues.pl +++ b/opac/opac-topissues.pl @@ -59,10 +59,11 @@ my $timeLimit = $input->param('timeLimit') || 3; my $whereclause; $whereclause .= 'items.homebranch='.$dbh->quote($branch)." AND " if ($branch); $whereclause .= 'biblioitems.itemtype='.$dbh->quote($itemtype)." AND " if $itemtype; -$whereclause .= 'TO_DAYS(NOW()) - TO_DAYS(biblio.timestamp) <= '.$timeLimit*30 if $timeLimit; +$whereclause .= 'TO_DAYS(NOW()) - TO_DAYS(biblio.datecreated) <= '.$timeLimit*30 if $timeLimit < 999; $whereclause =~ s/ AND $//; $whereclause = " WHERE ".$whereclause if $whereclause; -my $query = "SELECT biblio.timestamp, biblio.biblionumber, title, + +my $query = "SELECT datecreated, biblio.biblionumber, title, author, sum( items.issues ) AS tot, biblioitems.itemtype, biblioitems.publishercode,biblioitems.publicationyear, itemtypes.description @@ -72,6 +73,7 @@ my $query = "SELECT biblio.timestamp, biblio.biblionumber, title, LEFT JOIN itemtypes ON itemtypes.itemtype = biblioitems.itemtype $whereclause GROUP BY biblio.biblionumber + HAVING tot >0 ORDER BY tot DESC LIMIT $limit "; -- 2.39.5