Bug 19039: Results of virtual shelves (lists) not sortable by date
In the staff client, when viewing the content of a list, it can be sorted by 'title', 'author' or 'call number' but not by 'date added'. Test plan: 1) In the staff client, view a list containing several items 2) Notice that you can't sort by 'date added' 3) Apply the patch 4) Repeat step 1 5) The list can now be sorted by 'date added' Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
parent
9874c902ef
commit
8713983aab
|
|
@ -183,7 +183,14 @@
|
|||
<img src="[% interface | html %]/[% theme | html %]/img/ascdesc.gif" alt="" />
|
||||
[% END %]
|
||||
</th>
|
||||
<th>Date added</th>
|
||||
<th>
|
||||
<a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber %]&sortfield=dateadded&direction=[% IF sortfield != 'dateadded' %]asc[% ELSE %][% new_direction %][% END %]">Date added</a>
|
||||
[% IF sortfield == 'dateadded' %]
|
||||
<img src="[% interface %]/[% theme %]/img/[% direction %].gif" alt="[% direction %] sort" />
|
||||
[% ELSE %]
|
||||
<img src="[% interface %]/[% theme %]/img/ascdesc.gif" alt="" />
|
||||
[% END %]
|
||||
</th>
|
||||
<th>
|
||||
<a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | html %]&sortfield=itemcallnumber&direction=[% IF sortfield != 'itemcallnumber' %]asc[% ELSE %][% new_direction | html %][% END %]">Call number</a>
|
||||
[% IF sortfield == 'itemcallnumber' %]
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ if ( $op eq 'view' ) {
|
|||
if ( $shelf ) {
|
||||
if ( $shelf->can_be_viewed( $loggedinuser ) ) {
|
||||
my $sortfield = $query->param('sortfield') || $shelf->sortfield || 'title'; # Passed in sorting overrides default sorting
|
||||
$sortfield = 'title' unless grep {/^$sortfield$/}qw( title author copyrightdate itemcallnumber );
|
||||
$sortfield = 'title' unless grep {/^$sortfield$/}qw( title author copyrightdate itemcallnumber dateadded );
|
||||
my $direction = $query->param('direction') || 'asc';
|
||||
$direction = 'asc' if $direction ne 'asc' and $direction ne 'desc';
|
||||
my ( $rows, $page );
|
||||
|
|
|
|||
Loading…
Reference in New Issue