Bugzilla – Attachment 1314 Details for
Bug 3459
topissues doesn't take care of ccode.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
bugfix
0001--bug-3459-fix-opac-topissue-to-take-care-of-ccode.patch (text/plain), 3.93 KB, created by
Chris Cormack
on 2009-07-31 15:06:00 UTC
(
hide
)
Description:
bugfix
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2009-07-31 15:06:00 UTC
Size:
3.93 KB
patch
obsolete
>From 86a208e5e98eaa9512425a1cf6d0402887a4dc5f Mon Sep 17 00:00:00 2001 >From: Nahuel ANGELINETTI <nahuel.angelinetti@biblibre.com> >Date: Fri, 31 Jul 2009 17:05:27 +0200 >Subject: [PATCH] (bug #3459) fix opac-topissue to take care of ccode >Content-Type: text/plain; charset="utf-8" > >This bugfix, add a conditionnal sql request, that get the "ccode" document type if AdvancedSearchTypes is positionned to ccode. >--- > opac/opac-topissues.pl | 59 +++++++++++++++++++++++++++++++---------------- > 1 files changed, 39 insertions(+), 20 deletions(-) > >diff --git a/opac/opac-topissues.pl b/opac/opac-topissues.pl >index 3371d1d..905a541 100755 >--- a/opac/opac-topissues.pl >+++ b/opac/opac-topissues.pl >@@ -56,27 +56,46 @@ my $branch = $input->param('branch'); > my $itemtype = $input->param('itemtype'); > 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.datecreated) <= '.($timeLimit*30).' AND ' if $timeLimit < 999; >+$whereclause .= ' AND items.homebranch='.$dbh->quote($branch) if ($branch); >+$whereclause .= ' AND TO_DAYS(NOW()) - TO_DAYS(biblio.datecreated) <= '.($timeLimit*30) if $timeLimit < 999; > $whereclause =~ s/ AND $//; >-$whereclause = " WHERE ".$whereclause if $whereclause; >- >-my $query = "SELECT datecreated, biblio.biblionumber, title, >- author, sum( items.issues ) AS tot, biblioitems.itemtype, >- biblioitems.publishercode,biblioitems.publicationyear, >- itemtypes.description >- FROM biblio >- LEFT JOIN items USING (biblionumber) >- LEFT JOIN biblioitems USING (biblionumber) >- LEFT JOIN itemtypes ON itemtypes.itemtype = biblioitems.itemtype >- $whereclause >- GROUP BY biblio.biblionumber >- HAVING tot >0 >- ORDER BY tot DESC >- LIMIT $limit >- "; >- >+my $query; >+if(C4::Context->preference('AdvancedSearchTypes') eq 'ccode'){ >+ $whereclause .= ' AND authorised_values.authorised_value='.$dbh->quote($itemtype) if $itemtype; >+ $query = "SELECT datecreated, biblio.biblionumber, title, >+ author, sum( items.issues ) AS tot, biblioitems.itemtype, >+ biblioitems.publishercode,biblioitems.publicationyear, >+ authorised_values.lib as description >+ FROM biblio >+ LEFT JOIN items USING (biblionumber) >+ LEFT JOIN biblioitems USING (biblionumber) >+ LEFT JOIN authorised_values ON items.ccode = authorised_values.authorised_value >+ WHERE 1 >+ $whereclause >+ AND authorised_values.category = 'ccode' >+ GROUP BY biblio.biblionumber >+ HAVING tot >0 >+ ORDER BY tot DESC >+ LIMIT $limit >+ "; >+}else{ >+ $whereclause .= ' AND biblioitems.itemtype='.$dbh->quote($itemtype) if $itemtype; >+ $query = "SELECT datecreated, biblio.biblionumber, title, >+ author, sum( items.issues ) AS tot, biblioitems.itemtype, >+ biblioitems.publishercode,biblioitems.publicationyear, >+ itemtypes.description >+ FROM biblio >+ LEFT JOIN items USING (biblionumber) >+ LEFT JOIN biblioitems USING (biblionumber) >+ LEFT JOIN itemtypes ON itemtypes.itemtype = biblioitems.itemtype >+ WHERE 1 >+ $whereclause >+ GROUP BY biblio.biblionumber >+ HAVING tot >0 >+ ORDER BY tot DESC >+ LIMIT $limit >+ "; >+} > my $sth = $dbh->prepare($query); > $sth->execute(); > my @results; >-- >1.6.0.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 3459
:
1314
|
2295