Bugzilla – Attachment 176739 Details for
Bug 36188
Allow to sort lists by items.dateaccessioned of item records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36188: (QA follow-up) Tidy code
Bug-36188-QA-follow-up-Tidy-code.patch (text/plain), 3.85 KB, created by
Kyle M Hall (khall)
on 2025-01-17 14:56:40 UTC
(
hide
)
Description:
Bug 36188: (QA follow-up) Tidy code
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2025-01-17 14:56:40 UTC
Size:
3.85 KB
patch
obsolete
>From e37cdc44e94f6b74224abaeb7c0cd1810fd1e8ab Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 17 Jan 2025 09:51:17 -0500 >Subject: [PATCH] Bug 36188: (QA follow-up) Tidy code > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > opac/opac-shelves.pl | 11 +++++++---- > virtualshelves/shelves.pl | 12 +++++++++--- > 2 files changed, 16 insertions(+), 7 deletions(-) > >diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl >index 7577c963679..87037c0b966 100755 >--- a/opac/opac-shelves.pl >+++ b/opac/opac-shelves.pl >@@ -148,7 +148,8 @@ if ( $op eq 'add_form' ) { > if ( $shelf ) { > $op = $referer; > my $sortfield = $query->param('sortfield'); >- $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded dateaccessioned ); >+ $sortfield = 'title' >+ unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded dateaccessioned ); > if ( $shelf->can_be_managed( $loggedinuser ) ) { > $shelf->shelfname( scalar $query->param('shelfname') ); > $shelf->sortfield( $sortfield ); >@@ -315,12 +316,14 @@ if ( $op eq 'view' ) { > > # By default order descending if sorting by dateaccessioned > if ( $query->param('direction') ) { >- $direction = $query->param('direction'); >+ $direction = $query->param('direction'); > } elsif ( $sortfield eq 'dateaccessioned' and !$query->param('direction') ) { >- $direction = 'desc'; >+ $direction = 'desc'; > } > $direction = 'asc' if !$direction or ( $direction ne 'asc' and $direction ne 'desc' ); >- $sortfield = 'title' if !$sortfield or !grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded dateaccessioned ); >+ $sortfield = 'title' >+ if !$sortfield >+ or !grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded dateaccessioned ); > > my $rows; > if ( $query->param('print') or $query->param('rss') ) { >diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl >index ae3f58dde3b..90dc8bc8678 100755 >--- a/virtualshelves/shelves.pl >+++ b/virtualshelves/shelves.pl >@@ -120,7 +120,8 @@ if ( $op eq 'add_form' ) { > if ( $shelf ) { > $op = $referer; > my $sortfield = $query->param('sortfield'); >- $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded dateaccessioned ); >+ $sortfield = 'title' >+ unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded dateaccessioned ); > if ( $shelf->can_be_managed( $loggedinuser ) ) { > $shelf->shelfname( scalar $query->param('shelfname') ); > $shelf->sortfield( $sortfield ); >@@ -277,8 +278,13 @@ if ( $op eq 'view' ) { > $shelf = Koha::Virtualshelves->find($shelfnumber); > if ( $shelf ) { > if ( $shelf->can_be_viewed( $loggedinuser ) ) { >- my $sortfield = $query->param('sortfield') || $shelf->sortfield || 'title'; # Passed in sorting overrides default sorting >- $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded dateaccessioned ); >+ my $sortfield = >+ $query->param('sortfield') >+ || $shelf->sortfield >+ || 'title'; # Passed in sorting overrides default sorting >+ $sortfield = 'title' >+ unless grep { $_ eq $sortfield } >+ qw( title author copyrightdate itemcallnumber dateadded dateaccessioned ); > my $direction = $query->param('direction') || 'asc'; > $direction = 'asc' if $direction ne 'asc' and $direction ne 'desc'; > >-- >2.39.5 (Apple Git-154)
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 36188
:
162524
|
162525
|
162548
|
162549
|
162554
|
162555
|
162606
|
162607
|
162931
|
163100
|
163101
|
166472
|
172025
|
172026
|
172050
|
172051
|
176735
|
176736
|
176737
|
176738
| 176739