Bugzilla – Attachment 17256 Details for
Bug 9984
The hold ratios table uses a server-side sort
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 9984: Remove server-side sort on the hold ratios table
PASSED-QA-Bug-9984-Remove-server-side-sort-on-the-.patch (text/plain), 7.62 KB, created by
Katrin Fischer
on 2013-04-07 12:55:49 UTC
(
hide
)
Description:
[PASSED QA] Bug 9984: Remove server-side sort on the hold ratios table
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2013-04-07 12:55:49 UTC
Size:
7.62 KB
patch
obsolete
>From 450966dab1462f69345f564c8b7a2c01d268a61e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 3 Apr 2013 15:31:08 +0200 >Subject: [PATCH] [PASSED QA] Bug 9984: Remove server-side sort on the hold > ratios table > >JS is a requirement for the staff client, so the sort link on header is >useless. > >Test plan: >Check that there is no regression (sort, data, etc.) on the hold ratios >table. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >Tested on top of patch for bug 9459. >All tests and QA script pass. >--- > circ/reserveratios.pl | 28 ++------ > .../prog/en/modules/circ/reserveratios.tt | 68 ++++++++------------ > 2 files changed, 32 insertions(+), 64 deletions(-) > >diff --git a/circ/reserveratios.pl b/circ/reserveratios.pl >index 209a09e..91d1f6a 100755 >--- a/circ/reserveratios.pl >+++ b/circ/reserveratios.pl >@@ -32,7 +32,6 @@ use C4::Debug; > use C4::Biblio qw/GetMarcBiblio GetRecordValue GetFrameworkCode/; > > my $input = new CGI; >-my $order = $input->param('order') || ''; > my $startdate = $input->param('from'); > my $enddate = $input->param('to'); > my $ratio = $input->param('ratio'); >@@ -72,7 +71,7 @@ if ($ratio <= 0) { > } > > my $dbh = C4::Context->dbh; >-my ($sqlorderby, $sqldatewhere) = ("",""); >+my $sqldatewhere = ""; > $debug and warn format_date_in_iso($startdate) . "\n" . format_date_in_iso($enddate); > my @query_params = (); > if ($startdate) { >@@ -84,23 +83,6 @@ if ($enddate) { > push @query_params, format_date_in_iso($enddate); > } > >-if ($order eq "biblio") { >- $sqlorderby = " ORDER BY biblio.title, holdingbranch, listcall, l_location "; >-} elsif ($order eq "callnumber") { >- $sqlorderby = " ORDER BY listcall, holdingbranch, l_location "; >-} elsif ($order eq "itemcount") { >- $sqlorderby = " ORDER BY itemcount, reservecount "; >-} elsif ($order eq "itype") { >- $sqlorderby = " ORDER BY l_itype, holdingbranch, listcall "; >-} elsif ($order eq "location") { >- $sqlorderby = " ORDER BY l_location, holdingbranch, listcall "; >-} elsif ($order eq "reservecount") { >- $sqlorderby = " ORDER BY reservecount DESC "; >-} elsif ($order eq "branch") { >- $sqlorderby = " ORDER BY holdingbranch, l_location, listcall "; >-} else { >- $sqlorderby = " ORDER BY reservecount DESC "; >-} > my $strsth = > "SELECT reservedate, > reserves.borrowernumber as borrowernumber, >@@ -126,17 +108,17 @@ my $strsth = > FROM reserves > LEFT JOIN items ON items.biblionumber=reserves.biblionumber > LEFT JOIN biblio ON reserves.biblionumber=biblio.biblionumber >- WHERE >-notforloan = 0 AND damaged = 0 AND itemlost = 0 AND wthdrawn = 0 >+ WHERE >+ notforloan = 0 AND damaged = 0 AND itemlost = 0 AND wthdrawn = 0 > $sqldatewhere > "; > > if (C4::Context->preference('IndependantBranches')){ >- $strsth .= " AND items.holdingbranch=? "; >+ $strsth .= " AND items.holdingbranch=? "; > push @query_params, C4::Context->userenv->{'branch'}; > } > >-$strsth .= " GROUP BY reserves.biblionumber " . $sqlorderby; >+$strsth .= " GROUP BY reserves.biblionumber ORDER BY reservecount DESC"; > > $template->param(sql => $strsth); > my $sth = $dbh->prepare($strsth); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt >index 8a52193..d55382e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt >@@ -8,12 +8,11 @@ > <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script> > <script type="text/javascript"> > //<![CDATA[ >- $(document).ready(function() { >- $("th a").hide(); >- $(".ratiolimit").click(function () { >+ $(document).ready(function() { >+ $(".ratiolimit").click(function () { > $("#ratio").val($(this).html()); > }); >- $(".ratiolimit").hover( >+ $(".ratiolimit").hover( > function () { $(this).toggleClass("ulined") }, > function () { $(this).toggleClass("ulined") } > ); >@@ -25,7 +24,7 @@ > "iDisplayLength": 20, > "sPaginationType": "four_button" > })); >- }); >+ }); > //]]> > </script> > <style type="text/css"> >@@ -41,50 +40,36 @@ > <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> › Hold ratios</div> > > <div id="doc3" class="yui-t2"> >- > <div id="bd"> >- <div id="yui-main"> >- <div class="yui-b"> >+ <div id="yui-main"> >+ <div class="yui-b"> > <h1>Hold ratios to calculate items needed</h1> > <h3>Calculated on [% todaysdate %]. From [% from %] >- to [% to %]</h3> >+ to [% to %]</h3> > <p>These items have a hold ratio ≥ [% ratio %].</p> > <div class="sql">[% sql %]</div> > > [% IF ( reserveloop ) %] > <table id="holdst"> >-<thead> <tr> >- <th>Holds >- <a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&order=reservecount&from=[% from %]&to=[% to %]">Sort</a> >- </th> >- <th>Items >- <a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&order=itemcount&from=[% from %]&to=[% to %]">Sort</a> >- </th> >- <th>Hold ratio</th> >- <th>Title >- <a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&order=biblio&from=[% from %]&to=[% to %]">Sort</a> >- </th> >- <th>Holding libraries >- <a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&order=branch&from=[% from %]&to=[% to %]">Sort</a> >- </th> >- <th>Location >- <a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&order=location&from=[% from %]&to=[% to %]">Sort</a> >- </th> >- <th>Itype >- <a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&order=itype&from=[% from %]&to=[% to %]">Sort</a> >- </th> >- <th>Call numbers >- <a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&order=callnumber&from=[% from %]&to=[% to %]">Sort</a> >- </th> >- <th>Items needed >- </th> >- </tr></thead> >- >- <tbody>[% FOREACH reserveloo IN reserveloop %] >+ <thead> > <tr> >- <td><p>[% reserveloo.reservecount %]</p></td> >- <td><p>[% reserveloo.itemcount %]</p></td> >- <td><p class="ratiolimit">[% reserveloo.thisratio %]</p></td> >+ <th>Holds</th> >+ <th>Items</th> >+ <th>Hold ratio</th> >+ <th>Title</th> >+ <th>Holding libraries</th> >+ <th>Location</th> >+ <th>Itype</th> >+ <th>Call numbers</th> >+ <th>Items needed</th> >+ </tr> >+ </thead> >+ <tbody> >+ [% FOREACH reserveloo IN reserveloop %] >+ <tr> >+ <td><p>[% reserveloo.reservecount %]</p></td> >+ <td><p>[% reserveloo.itemcount %]</p></td> >+ <td><p class="ratiolimit">[% reserveloo.thisratio %]</p></td> > <td> [% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %][% reserveloo.title |html %] [% IF ( reserveloo.subtitle ) %][% FOREACH subtitl IN reserveloo.subtitle %][% subtitl.subfield %][% END %][% END %]</a>[% IF ( reserveloo.author ) %] by [% reserveloo.author %][% END %] > </td> > <td><p>[% reserveloo.listbranch %]</p></td> >@@ -93,7 +78,8 @@ > <td><p>[% reserveloo.listcall %]</p></td> > <td>[% IF ( reserveloo.thisratio_atleast1 ) %]<p><b>[% reserveloo.ratiocalc %] to order</b></p>[% END %]</td> > </tr> >- [% END %]</tbody> >+ [% END %] >+ </tbody> > </table> > [% ELSE %] > <b>No items found.</b> >-- >1.7.9.5
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 9984
:
17168
|
17213
| 17256