Bugzilla – Attachment 77536 Details for
Bug 19039
Results of virtual shelves (lists) not sortable by date added
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19039: (follow-up) Results of virtual shelves (lists) not sortable by date
Bug-19039-follow-up-Results-of-virtual-shelves-lis.patch (text/plain), 8.41 KB, created by
Owen Leonard
on 2018-08-07 14:26:34 UTC
(
hide
)
Description:
Bug 19039: (follow-up) Results of virtual shelves (lists) not sortable by date
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2018-08-07 14:26:34 UTC
Size:
8.41 KB
patch
obsolete
>From 10c78e3566e9c87d60d2ecf331266df0122ebd79 Mon Sep 17 00:00:00 2001 >From: Maryse Simard <maryse.simard@inlibro.com> >Date: Fri, 20 Jul 2018 17:20:23 -0400 >Subject: [PATCH] Bug 19039: (follow-up) 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'. > > This patch adds 'date added' as an option for default sorting of lists. It also makes it available as a sorting option while viewing lists. > > Test plan: > In the staff client and the opac: > 1) View a list containing several items > => Notice that you can't sort by 'date added' > 2) Try to edit the list or create a new one > => Notice you can't choose date added as the default sort order > 3) Apply the patch > 4) When viewing the list you should now be able to sort by date added > => Make sure it orders correctly > 5) Edit or create a list and choose date added as default sorting order > => Make sure it uses date added as default > => On the staff client: test that the filter for 'sort by' works for date added > => On the opac: test that, while viewing the contents, choosing 'default sorting' in the dropdown menu sorts correctly > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt | 2 ++ > .../prog/en/modules/virtualshelves/tables/shelves_results.tt | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 11 +++++++++++ > opac/opac-shelves.pl | 4 ++-- > virtualshelves/shelves.pl | 2 +- > 5 files changed, 17 insertions(+), 4 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 760e6b9..ec505d6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -296,6 +296,7 @@ > [% IF shelf.sortfield == "author" %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %] > [% IF shelf.sortfield == "copyrightdate" %]<option value="copyrightdate" selected="selected">Copyrightdate</option>[% ELSE %]<option value="copyrightdate">Copyrightdate</option>[% END %] > [% IF shelf.sortfield == "itemcallnumber" %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %] >+ [% IF shelf.sortfield == "dateadded" %]<option value="dateadded" selected="selected">Date added</option>[% ELSE %]<option value="dateadded">Date added</option>[% END %] > </select></li> > <li><label for="category">Category: </label> > <select id="category" name="category" onchange="AdjustRemark()"> >@@ -368,6 +369,7 @@ > <option value="author">Author</option> > <option value="copyrightdate">Copyrightdate</option> > <option value="itemcallnumber">Call number</option> >+ <option value="dateadded">Date added</option> > </select> > </th> > <th></th> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt >index 2593a7a..e2a7c81 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt >@@ -18,7 +18,7 @@ > "dt_owner": > "<a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.owner %]'>[% data.firstname %] [% data.surname %]</a>", > "dt_sortby": >- [% IF data.sortby == "author" %]"Author"[% ELSIF data.sortby == "copyrightdate" %]"Year"[% ELSIF data.sortby == "itemcallnumber" %]"Call number"[% ELSE %]"Title"[% END %], >+ [% IF data.sortby == "author" %]"Author"[% ELSIF data.sortby == "copyrightdate" %]"Year"[% ELSIF data.sortby == "itemcallnumber" %]"Call number"[% ELSIF data.sortby == "dateadded" %]"Date added"[% ELSE %]"Title"[% END %], > "dt_created_on": > "[% data.created_on | $KohaDates %]", > "dt_modification_time": >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >index 1d99214..0f47226 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >@@ -229,6 +229,12 @@ > [% ELSE %] > <option value="copyrightdate">Copyright date</option> > [% END %] >+ >+ [% IF sortfield == "dateadded" %] >+ <option value="dateadded" selected="selected">Date added</option> >+ [% ELSE %] >+ <option value="dateadded">Date added</option> >+ [% END %] > </select> > > <select name="direction" class="resort" onchange="$('#sorting-form').submit()"> >@@ -580,6 +586,11 @@ > [% ELSE %] > <option value="itemcallnumber">Call number</option> > [% END %] >+ [% IF shelf.sortfield == "dateadded" %] >+ <option value="dateadded" selected="selected">Date added</option> >+ [% ELSE %] >+ <option value="dateadded">Date added</option> >+ [% END %] > </select> > </li> > [% IF Koha.Preference('OpacAllowPublicListCreation') OR category == PUBLIC %] >diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl >index b2799ea..4fc4efb 100755 >--- a/opac/opac-shelves.pl >+++ b/opac/opac-shelves.pl >@@ -114,7 +114,7 @@ if ( $op eq 'add_form' ) { > if ( $shelf ) { > $op = $referer; > my $sortfield = $query->param('sortfield'); >- $sortfield = 'title' unless grep {/^$sortfield$/}qw( title author copyrightdate itemcallnumber ); >+ $sortfield = 'title' unless grep {/^$sortfield$/}qw( title author copyrightdate itemcallnumber dateadded ); > if ( $shelf->can_be_managed( $loggedinuser ) ) { > $shelf->shelfname( scalar $query->param('shelfname') ); > $shelf->sortfield( $sortfield ); >@@ -235,7 +235,7 @@ if ( $op eq 'view' ) { > if ( $shelf->can_be_viewed( $loggedinuser ) ) { > $category = $shelf->category; > my $sortfield = $query->param('sortfield') || $shelf->sortfield; # 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 ( $page, $rows ); >diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl >index bc54559..2758720 100755 >--- a/virtualshelves/shelves.pl >+++ b/virtualshelves/shelves.pl >@@ -101,7 +101,7 @@ if ( $op eq 'add_form' ) { > if ( $shelf ) { > $op = $referer; > my $sortfield = $query->param('sortfield'); >- $sortfield = 'title' unless grep {/^$sortfield$/}qw( title author copyrightdate itemcallnumber ); >+ $sortfield = 'title' unless grep {/^$sortfield$/}qw( title author copyrightdate itemcallnumber dateadded ); > if ( $shelf->can_be_managed( $loggedinuser ) ) { > $shelf->shelfname( scalar $query->param('shelfname') ); > $shelf->sortfield( $sortfield ); >-- >2.1.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 19039
:
76313
|
76663
|
77319
|
77535
|
77536
|
77669
|
77670