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.
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
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"
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>
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>
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>
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>
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>
Nice bit of golfing there, thanks :)
Nice work! Pushed to master for 19.11.00
backported to 19.05.x for 19.05.06