From 8713983aaba42ae6bbe3668cb231b58d031f5f71 Mon Sep 17 00:00:00 2001 From: Maryse Simard Date: Tue, 12 Jun 2018 13:42:23 -0400 Subject: [PATCH] Bug 19039: Results of virtual shelves (lists) not sortable by date MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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é Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- .../prog/en/modules/virtualshelves/shelves.tt | 9 ++++++++- virtualshelves/shelves.pl | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) 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 0c7ee12777..68b47d7473 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -183,7 +183,14 @@ [% END %] - Date added + + Date added + [% IF sortfield == 'dateadded' %] + [% direction %] sort + [% ELSE %] + + [% END %] + Call number [% IF sortfield == 'itemcallnumber' %] diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl index 192580f857..bc54559073 100755 --- a/virtualshelves/shelves.pl +++ b/virtualshelves/shelves.pl @@ -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 ); -- 2.39.5