Bug 13685

Summary: Sorting Patron Reading History
Product: Koha Reporter: Amy Schapiro <amy>
Component: OPACAssignee: Aleisha Amohia <aleisha>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: aleisha, jonathan.druart, jzairo, kyle, mtompset, p.thrasher, sally.healey
Version: master   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 18108    
Attachments: Bug 13865: Columns configuration - Orders search
Bug 13685: Sorting by author in opac reading history
Bug 13685: Sorting by author in opac reading history
Bug 13685: Sorting by author in opac reading history
[SIGNED-OFF] Bug 13685: Sorting by author in opac reading history
Bug 13685: Sorting by author in opac reading history

Description Amy Schapiro 2015-02-09 17:47:04 UTC
Librarian requested we add for patrons the option to sort by author and title to patron check out history on the patron's detail screen in opac.
Comment 1 Owen Leonard 2015-02-10 14:42:10 UTC
Does this bug refer to /cgi-bin/koha/opac-readingrecord.pl? That page can already sort by title. Do you mean sorting by title and author together?
Comment 2 Nicole C. Engard 2015-03-30 13:34:55 UTC Comment hidden (obsolete)
Comment 3 Nicole C. Engard 2015-03-30 13:35:31 UTC
Comment on attachment 37370 [details] [review]
Bug 13865: Columns configuration - Orders search

Sorry attached to the wrong bug.
Comment 4 Jessie Zairo 2016-03-09 16:03:53 UTC
(In reply to Owen Leonard from comment #1)
Yes, this bug refers to /cgi-bin/koha/opac-readingrecord.pl It would be nice to have the availability for the patron to sort by author. For users who have read several titles by the same author, their list tends become to long. Having the ability to sort a column by author would be a great enhancement.
Comment 5 Aleisha Amohia 2016-03-13 23:45:26 UTC
Is this still valid?
Comment 6 Owen Leonard 2016-03-15 16:32:24 UTC
(In reply to Aleisha Amohia from comment #5)

> Is this still valid?

Yes. /cgi-bin/koha/opac-readingrecord.pl has a single column which contains title and author information, so sorting can't be done by author.

If someone decides to take this on it'd be great to give the page a more thorough overhaul. The "Show last 50 items" versus "Show all items" options are strange. Why not just do real pagination?
Comment 7 Sally 2017-02-06 14:50:19 UTC
Sorting by author would be a great addition to this feature on the OPAC.
Comment 8 Aleisha Amohia 2017-02-06 21:54:16 UTC
Created attachment 59956 [details] [review]
Bug 13685: Sorting by author in opac reading history

To test:
1) Log into OPAC, go to your raeding history
2) Notice 'author' is in Title column, therefore unable to sort by
author
3) Apply patch and refresh page
4) Notice author has now been moved into Author column
5) Confirm sorting by author works as expected and sorting of all other
columns works as expected

Sponsored-by: Catalyst IT
Comment 9 Mark Tompsett 2017-02-12 23:05:03 UTC
Might I also recommend doing the same kind of split for the summary page too? Not that affects this bug, but it might be another one to think about.
Comment 10 Mark Tompsett 2017-02-12 23:05:45 UTC
Created attachment 60134 [details] [review]
Bug 13685: Sorting by author in opac reading history

To test:
1) Log into OPAC, go to your raeding history
2) Notice 'author' is in Title column, therefore unable to sort by
author
3) Apply patch and refresh page
4) Notice author has now been moved into Author column
5) Confirm sorting by author works as expected and sorting of all other
columns works as expected

Sponsored-by: Catalyst IT

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 11 Aleisha Amohia 2017-02-14 01:22:27 UTC
(In reply to M. Tompsett from comment #9)
> Might I also recommend doing the same kind of split for the summary page
> too? Not that affects this bug, but it might be another one to think about.

Have implemented this fix in bug 18108
Comment 12 Jonathan Druart 2017-02-14 08:49:29 UTC
I do not think this patch answers to the initial need.
What I understand is that we would like to add a new entry to the "order by" dropdown list, to order the checkout history by author.
Your solution will not work if the patron has already checked out more than 50 items.
Moreover it seems that we use to display the author close to the title, see "Your summary" tab > "Holds".
Comment 13 Aleisha Amohia 2017-02-14 19:44:17 UTC
Created attachment 60222 [details] [review]
Bug 13685: Sorting by author in opac reading history

opac-readingrecord.pl was actually already set up to do this, the option
to sort by author was just not put into the tt file. This patch adds
that.

To test:
1) Log into OPAC, go to your reading history
2) Confirm that 'Order by author' shows in the dropdown
3) Confirm it works as expected

Sponsored-by: Catalyst IT
Comment 14 Mark Tompsett 2017-02-15 00:10:52 UTC
Strangely, orderbyauthor code was already in the perl script, but finding where it may have been deleted is difficult. But this fix is good. And as the layout doesn't change, I think bug 18108 could be closed (unless we foresee people signing out a large number of books at the same time, in which case we should add this drop-down). I was worried about consistency of appearance.
Comment 15 Mark Tompsett 2017-02-15 00:11:27 UTC
Created attachment 60226 [details] [review]
[SIGNED-OFF] Bug 13685: Sorting by author in opac reading history

opac-readingrecord.pl was actually already set up to do this, the option
to sort by author was just not put into the tt file. This patch adds
that.

To test:
1) Log into OPAC, go to your reading history
2) Confirm that 'Order by author' shows in the dropdown
3) Confirm it works as expected

Sponsored-by: Catalyst IT

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 16 Jonathan Druart 2017-02-20 13:51:23 UTC
Created attachment 60464 [details] [review]
Bug 13685: Sorting by author in opac reading history

opac-readingrecord.pl was actually already set up to do this, the option
to sort by author was just not put into the tt file. This patch adds
that.

To test:
1) Log into OPAC, go to your reading history
2) Confirm that 'Order by author' shows in the dropdown
3) Confirm it works as expected

Sponsored-by: Catalyst IT

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 17 Kyle M Hall 2017-03-03 18:14:23 UTC
Pushed to master for 17.05, thanks Aleisha!