Bugzilla – Attachment 95150 Details for
Bug 23427
Better sorting of previous checkouts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23427: Better sorting of previous checkouts
Bug-23427-Better-sorting-of-previous-checkouts.patch (text/plain), 2.19 KB, created by
Jonathan Druart
on 2019-11-07 12:37:08 UTC
(
hide
)
Description:
Bug 23427: Better sorting of previous checkouts
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-11-07 12:37:08 UTC
Size:
2.19 KB
patch
obsolete
>From 06694a82b0d1249950e42f1c847804c194644fa8 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Mon, 5 Aug 2019 15:25:02 +0200 >Subject: [PATCH] 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> >--- > svc/checkouts | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/svc/checkouts b/svc/checkouts >index e5d2a96aea..dc559a207f 100755 >--- a/svc/checkouts >+++ b/svc/checkouts >@@ -269,7 +269,9 @@ while ( my $c = $sth->fetchrow_hashref() ) { > @checkouts_today = reverse(@checkouts_today) > unless ( C4::Context->preference('todaysIssuesDefaultSortOrder') eq 'desc' ); # earliest to latest > >-@checkouts_previous = sort { $a->{date_due} cmp $b->{date_due} } @checkouts_previous; # latest to earliest >+@checkouts_previous = >+ sort { $a->{date_due} eq $b->{date_due} ? $a->{timestamp} cmp $b->{timestamp} : $a->{date_due} cmp $b->{date_due} } >+ @checkouts_previous; # latest to earliest > @checkouts_previous = reverse(@checkouts_previous) > unless ( C4::Context->preference('previousIssuesDefaultSortOrder') eq 'desc' ); # earliest to latest > >-- >2.11.0
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 23427
:
91993
|
91994
|
94259
|
94260
|
95149
| 95150 |
95151