Bugzilla – Attachment 15545 Details for
Bug 9458
Add sorting to lists
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9458 - Add sorting to lists - QA Followup
Bug-9458---Add-sorting-to-lists---QA-Followup.patch (text/plain), 5.39 KB, created by
Kyle M Hall (khall)
on 2013-02-19 13:54:19 UTC
(
hide
)
Description:
Bug 9458 - Add sorting to lists - QA Followup
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-02-19 13:54:19 UTC
Size:
5.39 KB
patch
obsolete
>From 27482fc41a2c50bcff59f7121055cc555c14e629 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 19 Feb 2013 08:42:11 -0500 >Subject: [PATCH] Bug 9458 - Add sorting to lists - QA Followup > >--- > C4/VirtualShelves.pm | 2 +- > C4/VirtualShelves/Page.pm | 10 +++++--- > .../prog/en/modules/virtualshelves/shelves.tt | 6 +++++ > .../opac-tmpl/prog/en/modules/opac-shelves.tt | 22 +++++++++++++++++++- > 4 files changed, 34 insertions(+), 6 deletions(-) > >diff --git a/C4/VirtualShelves.pm b/C4/VirtualShelves.pm >index f632416..37babc1 100644 >--- a/C4/VirtualShelves.pm >+++ b/C4/VirtualShelves.pm >@@ -277,7 +277,7 @@ sub GetShelfContents { > my @params = ($shelfnumber); > if($sortfield) { > $query .= " ORDER BY " . $sortfield; >- $query .= " DESC " if ( ( $sortfield eq 'copyrightdate' ) || ( $sort_direction eq 'desc' ) ); >+ $query .= " DESC " if ( $sort_direction eq 'desc' ); > } > if($row_count){ > $query .= " LIMIT ?, ? "; >diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm >index ab807da..3dfbe60 100644 >--- a/C4/VirtualShelves/Page.pm >+++ b/C4/VirtualShelves/Page.pm >@@ -249,8 +249,12 @@ sub shelfpage { > my $items; > my $tag_quantity; > my $sortfield = ( $sorton ? $sorton : 'title' ); >- $sortfield = $query->param('sort') || $sortfield; ## Passed in sorting overrides default sorting >- my $direction = $query->param('direction'); >+ $sortfield = $query->param('sort') || $sortfield || 'title'; ## Passed in sorting overrides default sorting >+ my $direction = $query->param('direction') || 'asc'; >+ $template->param( >+ sort => $sortfield, >+ direction => $direction, >+ ); > ( $items, $totitems ) = GetShelfContents( $shelfnumber, $shelflimit, $shelfoffset, $sortfield, $direction ); > for my $this_item (@$items) { > my $biblionumber = $this_item->{'biblionumber'}; >@@ -461,8 +465,6 @@ sub shelfpage { > barshelvesloop => $barshelves, > pubshelves => $total->{pubtotal}, > pubshelvesloop => $pubshelves, >- sort => $query->param('sort'), >- direction => $query->param('direction'), > ); > > output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >index e9f3994..6a82e2d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -219,6 +219,8 @@ function placeHold () { > [% ELSIF direction == 'desc' %] > <img src="/intranet-tmpl/prog/img/desc.gif" /> > [% END %] >+ [% ELSE %] >+ <img src="/intranet-tmpl/prog/img/ascdesc.gif" /> > [% END %] > </th> > <th> >@@ -229,6 +231,8 @@ function placeHold () { > [% ELSIF direction == 'desc' %] > <img src="/intranet-tmpl/prog/img/desc.gif" /> > [% END %] >+ [% ELSE %] >+ <img src="/intranet-tmpl/prog/img/ascdesc.gif" /> > [% END %] > </th> > <th>Date added</th> >@@ -240,6 +244,8 @@ function placeHold () { > [% ELSIF direction == 'desc' %] > <img src="/intranet-tmpl/prog/img/desc.gif" /> > [% END %] >+ [% ELSE %] >+ <img src="/intranet-tmpl/prog/img/ascdesc.gif" /> > [% END %] > </th> > <th> </th> >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt >index 59bedc7..3ad295d 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt >@@ -317,8 +317,28 @@ $(document).ready(function() { > <option value="itemcallnumber">Call number</option> > [% END %] > >- <input type="submit" id="sort-submit" value="Resort list" /> >+ [% IF sort == 'copyrightdate' %] >+ <option value="copyrightdate" selected="selected">Copyright date</option> >+ [% ELSE %] >+ <option value="copyrightdate">Copyright date</option> >+ [% END %] >+ </select> >+ >+ <select name="direction" onchange="$('#sorting-form').submit()"> >+ [% IF direction == 'asc' %] >+ <option value="asc" selected="selected">Ascending</option> >+ [% ELSE %] >+ <option value="asc">Ascending</option> >+ [% END %] >+ >+ [% IF direction == 'desc' %] >+ <option value="desc" selected="selected">Descending</option> >+ [% ELSE %] >+ <option value="desc">Descending</option> >+ [% END %] > </select> >+ >+ <input type="submit" id="sort-submit" value="Resort list" /> > </form> > > [% IF ( manageshelf ) %] <span class="sep">|</span> <form method="get" action="opac-shelves.pl"><input type="hidden" name="op" value="modif" /> >-- >1.7.2.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 9458
:
14781
|
14790
|
14791
|
14792
|
15363
|
15543
|
15545
|
15554
|
15674
|
15675
|
15694
|
15891
|
15952
|
16031