Bug 24456: change default sort orders/make wording clearer
authorLucas Gass <lucas@bywatersolutions.com>
Fri, 17 Jan 2020 22:12:11 +0000 (22:12 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 18 Mar 2020 08:44:12 +0000 (08:44 +0000)
TEST PLAN:
1. Apply patch
2. Have some checkout from today and some from multiple previous days.
3. Set todaysIssuesDefaultSortOrder & previousIssuesDefaultSortOrder to 'earliest to latest' and confirm it sorts correctly.
4. Reverse the 2 system preferences and see that it is now sorting the opposite way.
5. Also look at the wording of each system prefence and make sure it makes sense

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
svc/checkouts

index 3134f23..fefa8e7 100644 (file)
@@ -50,7 +50,7 @@ Circulation:
               choices:
                   asc: earliest to latest
                   desc: latest to earliest
-            - due date.
+            - checkout time.
         -
             - pref: SpecifyDueDate
               choices:
index a749494..fa470b3 100755 (executable)
@@ -267,13 +267,13 @@ while ( my $c = $sth->fetchrow_hashref() ) {
 
 @checkouts_today = sort { $a->{timestamp} cmp $b->{timestamp} } @checkouts_today;    # latest to earliest
 @checkouts_today = reverse(@checkouts_today)
-  unless ( C4::Context->preference('todaysIssuesDefaultSortOrder') eq 'desc' );      # earliest to latest
+  if ( C4::Context->preference('todaysIssuesDefaultSortOrder') eq 'desc' );      # earliest to latest
 
 @checkouts_previous =
   sort { $a->{date_due} cmp $b->{date_due} || $a->{timestamp} cmp $b->{timestamp} }
   @checkouts_previous;                                                               # latest to earliest
 @checkouts_previous = reverse(@checkouts_previous)
-  unless ( C4::Context->preference('previousIssuesDefaultSortOrder') eq 'desc' );    # earliest to latest
+  if ( C4::Context->preference('previousIssuesDefaultSortOrder') eq 'desc' );    # earliest to latest
 
 my @checkouts = ( @checkouts_today, @checkouts_previous );