Bug 16552 - Add the ability to change the default holdings sort
Summary: Add the ability to change the default holdings sort
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-19 08:14 UTC by Jonathan Druart
Modified: 2017-12-07 22:15 UTC (History)
4 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 16552: Add the ability to change the default holdings sort (13.49 KB, patch)
2016-05-19 08:57 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16552: Add the ability to change the default holdings sort (13.87 KB, patch)
2016-05-20 08:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16552: Add the ability to change the default holdings sort (13.93 KB, patch)
2016-06-01 11:50 UTC, PTFS Europe Sandboxes
Details | Diff | Splinter Review
[PASSED QA] Bug 16552: Add the ability to change the default holdings sort (14.00 KB, patch)
2016-09-18 21:32 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2016-05-19 08:14:04 UTC
This new enhancement will add the ability to change the default holdings sort on OPAC displays to be by library.
Comment 1 Jonathan Druart 2016-05-19 08:57:04 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2016-05-19 12:30:52 UTC
I ran into one problem with this. These were the combinations I tested:

OPACHoldingsDefaultSortField -> Item type
- OpacLocationBranchToDisplay -> home library - Good
- OpacLocationBranchToDisplay -> holding library - Good
- OpacLocationBranchToDisplay -> home and holding library - Good


OPACHoldingsDefaultSortField -> Home library
- OpacLocationBranchToDisplay -> home library - Sorts on third column, "Collection"
- OpacLocationBranchToDisplay -> holding library - (Not applicable)
- OpacLocationBranchToDisplay -> home and holding library - Good

OPACHoldingsDefaultSortField -> Holding library
- OpacLocationBranchToDisplay -> home library - (Not applicable)
- OpacLocationBranchToDisplay -> holding library - Good
- OpacLocationBranchToDisplay -> home and holding library - Good

When I have OPACHoldingsDefaultSortField set to "Home library" and OpacLocationBranchToDisplay  set to "home library" the sorting is on the "Collection" column instead of the home library one.
Comment 3 Jonathan Druart 2016-05-20 08:30:18 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2016-05-20 08:31:17 UTC
(In reply to Owen Leonard from comment #2)
> When I have OPACHoldingsDefaultSortField set to "Home library" and
> OpacLocationBranchToDisplay  set to "home library" the sorting is on the
> "Collection" column instead of the home library one.

Indeed, the tests are a bit more complicated :)
Thanks for testing Owen!
Comment 5 Jonathan Field 2016-06-01 10:47:55 UTC
(In reply to Jonathan Druart from comment #4)
> (In reply to Owen Leonard from comment #2)
> > When I have OPACHoldingsDefaultSortField set to "Home library" and
> > OpacLocationBranchToDisplay  set to "home library" the sorting is on the
> > "Collection" column instead of the home library one.
> 
> Indeed, the tests are a bit more complicated :)
> Thanks for testing Owen!

Unless I'm misunderstanding this, on my sandbox, it sorts correctly with

OPACHoldingsDefaultSortField -> Home library
- OpacLocationBranchToDisplay -> home library - Sorts on third column, "Collection"
- OpacLocationBranchToDisplay -> holding library - (Not applicable)
- OpacLocationBranchToDisplay -> home and holding library - Good

That is, the Home Library column is selected and active. My column layout is 
Item type, Home Library, Collection, Call #, Status, Due Date
Comment 6 PTFS Europe Sandboxes 2016-06-01 11:50:15 UTC
Patch tested with a sandbox, by Claire Gravely <c.gravely@arts.ac.uk>
Comment 7 PTFS Europe Sandboxes 2016-06-01 11:50:35 UTC
Created attachment 51943 [details] [review]
Bug 16552: Add the ability to change the default holdings sort

This new enhancement will add the ability to change the default holdings
sort on OPAC displays to be by library, instead of item type.

This patch adds a new pref OPACHoldingsDefaultSortField with 3 different
possible values:
 - Item type
 - Home library
 - Holding library

Note that if OpacLocationBranchToDisplay is set not to display home libraries,
unexpected behaviors might happen if OPACHoldingsDefaultSortField is set to
"Home library", same for "Holding library".

Test plan:
- Confirm that the default value for OPACHoldingsDefaultSortField is
  'first column' after executing the DB entry and that there is no
  change in the behavior (first column is used to sort the holdings
  table on the detail page).
- Set OpacLocationBranchToDisplay to both and play with the different
  values of OPACHoldingsDefaultSortField
  => Confrm that the default column used to sort the table is correctly
  changed
- Set the pref SeparateHoldings on
  => Confirm that both tables (Holdings and other holdings) are sorted using
  the OPACHoldingsDefaultSortField value.

Sponsored-by: University of the Arts London

Signed-off-by: Claire Gravely <c.gravely@arts.ac.uk>
Comment 8 Katrin Fischer 2016-09-18 21:30:45 UTC
This works as described. I can imagine sometime in the future multiple criteria for sorting could be desirable. For example: home library, itemtype. Or: Home library, enumchron.
Comment 9 Katrin Fischer 2016-09-18 21:32:19 UTC
Created attachment 55668 [details] [review]
[PASSED QA] Bug 16552: Add the ability to change the default holdings sort

This new enhancement will add the ability to change the default holdings
sort on OPAC displays to be by library, instead of item type.

This patch adds a new pref OPACHoldingsDefaultSortField with 3 different
possible values:
 - Item type
 - Home library
 - Holding library

Note that if OpacLocationBranchToDisplay is set not to display home libraries,
unexpected behaviors might happen if OPACHoldingsDefaultSortField is set to
"Home library", same for "Holding library".

Test plan:
- Confirm that the default value for OPACHoldingsDefaultSortField is
  'first column' after executing the DB entry and that there is no
  change in the behavior (first column is used to sort the holdings
  table on the detail page).
- Set OpacLocationBranchToDisplay to both and play with the different
  values of OPACHoldingsDefaultSortField
  => Confrm that the default column used to sort the table is correctly
  changed
- Set the pref SeparateHoldings on
  => Confirm that both tables (Holdings and other holdings) are sorted using
  the OPACHoldingsDefaultSortField value.

Sponsored-by: University of the Arts London

Signed-off-by: Claire Gravely <c.gravely@arts.ac.uk>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>
Comment 10 Kyle M Hall 2016-09-27 13:09:17 UTC
Pushed to master for 16.11, thanks Jonathan!