Bug 23427 - Better sorting of previous checkouts
Summary: Better sorting of previous checkouts
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Fridolin SOMERS
QA Contact: Testopia
URL:
Keywords:
Depends on: 13908
Blocks:
  Show dependency treegraph
 
Reported: 2019-08-05 13:03 UTC by Fridolin SOMERS
Modified: 2019-11-07 13:27 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.11.00


Attachments
Bug 23427: fix previous checkouts sort order (2.26 KB, patch)
2019-08-05 13:32 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 23427: Better sorting of previous checkouts (2.07 KB, patch)
2019-08-05 13:33 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 23427: fix previous checkouts sort order (2.30 KB, patch)
2019-10-16 08:21 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 23427: Better sorting of previous checkouts (2.12 KB, patch)
2019-10-16 08:21 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 23427: fix previous checkouts sort order (2.38 KB, patch)
2019-11-07 12:37 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23427: Better sorting of previous checkouts (2.19 KB, patch)
2019-11-07 12:37 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23427: Simplify sort logic (1.16 KB, patch)
2019-11-07 12:37 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin SOMERS 2019-08-05 13:03:24 UTC
In patron circulation or details page, previous checkouts are displayed sorted by due date.
Actual sort order is not honoring system preference "previousIssuesDefaultSortOrder". Todays's checkouts is correct thanks to Bug 13908.
Many checkouts may have same due date so it would be better to sort on timestamp as second sort criteria, like todays's checkouts.
Comment 1 Fridolin SOMERS 2019-08-05 13:32:48 UTC
Created attachment 91993 [details] [review]
Bug 23427: fix previous checkouts sort order

In patron circulation or details page, previous checkouts are displayed sorted by due date.
Actual sort order is not honoring system preference "previousIssuesDefaultSortOrder". Todays's checkouts is correct thanks to Bug 13908.

Patch adds comments that refer to the text of system preferences "previousIssuesDefaultSortOrder" and "TodayIssuesDefaultSortOrder" :
  latest to earliest = asc
  earliest to latest = desc

Test plan :
1) Create for a patron two old issues with a few days between them
2) Set preference previousIssuesDefaultSortOrder = "latest to earliest"
3) Go to patron circulation page and check sort order is OK
4) Go to patron details page and check sort order is OK
5) Set preference previousIssuesDefaultSortOrder = "earliest to latest"
6) Go to patron circulation page and check sort order is OK
7) Go to patron details page and check sort order is OK
Comment 2 Fridolin SOMERS 2019-08-05 13:33:02 UTC
Created attachment 91994 [details] [review]
Bug 23427: Better sorting of previous checkouts

In patron circulation or details page, previous checkouts are displayed sorted by due date.
Many checkouts may have same due date so it would be better to sort on timestamp as second sort criteria, like todays's checkouts.

Test plan :
1) Create for a patron two issues with same due date and a few seconds between them
2) Create another issue with a different due date
3) Come back a day later
4) Set preference previousIssuesDefaultSortOrder = "latest to earliest"
5) Go to patron circulation page and check sort order is OK : sorted by "Due date" then "Cheked out on"
6) Go to patron details page and check sort order is OK : sorted by "Due date" then "Cheked out on"
7) Set preference previousIssuesDefaultSortOrder = "earliest to latest"
8) Go to patron circulation page and check sort order is OK : sorted by "Due date" then "Cheked out on"
9) Go to patron details page and check sort order is OK : sorted by "Due date" then "Cheked out on"
Comment 3 Michal Denar 2019-10-16 08:21:13 UTC
Created attachment 94259 [details] [review]
Bug 23427: fix previous checkouts sort order

In patron circulation or details page, previous checkouts are displayed sorted by due date.
Actual sort order is not honoring system preference "previousIssuesDefaultSortOrder". Todays's checkouts is correct thanks to Bug 13908.

Patch adds comments that refer to the text of system preferences "previousIssuesDefaultSortOrder" and "TodayIssuesDefaultSortOrder" :
  latest to earliest = asc
  earliest to latest = desc

Test plan :
1) Create for a patron two old issues with a few days between them
2) Set preference previousIssuesDefaultSortOrder = "latest to earliest"
3) Go to patron circulation page and check sort order is OK
4) Go to patron details page and check sort order is OK
5) Set preference previousIssuesDefaultSortOrder = "earliest to latest"
6) Go to patron circulation page and check sort order is OK
7) Go to patron details page and check sort order is OK

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 4 Michal Denar 2019-10-16 08:21:17 UTC
Created attachment 94260 [details] [review]
Bug 23427: Better sorting of previous checkouts

In patron circulation or details page, previous checkouts are displayed sorted by due date.
Many checkouts may have same due date so it would be better to sort on timestamp as second sort criteria, like todays's checkouts.

Test plan :
1) Create for a patron two issues with same due date and a few seconds between them
2) Create another issue with a different due date
3) Come back a day later
4) Set preference previousIssuesDefaultSortOrder = "latest to earliest"
5) Go to patron circulation page and check sort order is OK : sorted by "Due date" then "Cheked out on"
6) Go to patron details page and check sort order is OK : sorted by "Due date" then "Cheked out on"
7) Set preference previousIssuesDefaultSortOrder = "earliest to latest"
8) Go to patron circulation page and check sort order is OK : sorted by "Due date" then "Cheked out on"
9) Go to patron details page and check sort order is OK : sorted by "Due date" then "Cheked out on"

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 5 Jonathan Druart 2019-11-07 12:37:03 UTC
Created attachment 95149 [details] [review]
Bug 23427: fix previous checkouts sort order

In patron circulation or details page, previous checkouts are displayed sorted by due date.
Actual sort order is not honoring system preference "previousIssuesDefaultSortOrder". Todays's checkouts is correct thanks to Bug 13908.

Patch adds comments that refer to the text of system preferences "previousIssuesDefaultSortOrder" and "TodayIssuesDefaultSortOrder" :
  latest to earliest = asc
  earliest to latest = desc

Test plan :
1) Create for a patron two old issues with a few days between them
2) Set preference previousIssuesDefaultSortOrder = "latest to earliest"
3) Go to patron circulation page and check sort order is OK
4) Go to patron details page and check sort order is OK
5) Set preference previousIssuesDefaultSortOrder = "earliest to latest"
6) Go to patron circulation page and check sort order is OK
7) Go to patron details page and check sort order is OK

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Jonathan Druart 2019-11-07 12:37:08 UTC
Created attachment 95150 [details] [review]
Bug 23427: Better sorting of previous checkouts

In patron circulation or details page, previous checkouts are displayed sorted by due date.
Many checkouts may have same due date so it would be better to sort on timestamp as second sort criteria, like todays's checkouts.

Test plan :
1) Create for a patron two issues with same due date and a few seconds between them
2) Create another issue with a different due date
3) Come back a day later
4) Set preference previousIssuesDefaultSortOrder = "latest to earliest"
5) Go to patron circulation page and check sort order is OK : sorted by "Due date" then "Cheked out on"
6) Go to patron details page and check sort order is OK : sorted by "Due date" then "Cheked out on"
7) Set preference previousIssuesDefaultSortOrder = "earliest to latest"
8) Go to patron circulation page and check sort order is OK : sorted by "Due date" then "Cheked out on"
9) Go to patron details page and check sort order is OK : sorted by "Due date" then "Cheked out on"

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Jonathan Druart 2019-11-07 12:37:13 UTC
Created attachment 95151 [details] [review]
Bug 23427: Simplify sort logic

This is the usual syntax.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Martin Renvoize 2019-11-07 13:25:49 UTC
Nice bit of golfing there, thanks :)
Comment 9 Martin Renvoize 2019-11-07 13:27:17 UTC
Nice work!

Pushed to master for 19.11.00