Bugzilla – Attachment 169997 Details for
Bug 37434
Lists are incorrectly sorted in UNIMARC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37434: Sort by publicationyear when copyrightdate is set in UNIMARC
Bug-37434-Sort-by-publicationyear-when-copyrightda.patch (text/plain), 3.11 KB, created by
Baptiste Wojtkowski (bwoj)
on 2024-08-02 11:53:22 UTC
(
hide
)
Description:
Bug 37434: Sort by publicationyear when copyrightdate is set in UNIMARC
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2024-08-02 11:53:22 UTC
Size:
3.11 KB
patch
obsolete
>From bc3f2f45c9aa2180e5ddd6f4f2424f4f0b23d8d3 Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <bski@laposte.net> >Date: Wed, 31 Jul 2024 14:47:28 +0200 >Subject: [PATCH] Bug 37434: Sort by publicationyear when copyrightdate is set > in UNIMARC > >--- > .../prog/en/modules/virtualshelves/shelves.tt | 2 ++ > virtualshelves/shelves.pl | 10 ++++++++-- > 2 files changed, 10 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >index e82cf2f..e9504fa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -439,6 +439,8 @@ > [% END %] > [% IF shelf.sortfield == "copyrightdate" %] > <option value="copyrightdate" selected="selected">Copyrightdate</option> >+ [% ELSIF shelf.sortfield == "publicationyear" %] >+ <option value="publicationyear" selected="selected">Copyrightdate</option> > [% ELSE %] > <option value="copyrightdate">Copyrightdate</option> > [% END %] >diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl >index badd78f..2161ab1 100755 >--- a/virtualshelves/shelves.pl >+++ b/virtualshelves/shelves.pl >@@ -114,7 +114,10 @@ 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 ); >+ $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate publicationyear itemcallnumber dateadded ); >+ if ($sortfield == 'copyrightdate' and C4::Context->preference('marcflavour')=='UNIMARC'){ >+ $sortfield = 'publicationyear'; >+ } > if ( $shelf->can_be_managed( $loggedinuser ) ) { > $shelf->shelfname( scalar $query->param('shelfname') ); > $shelf->sortfield( $sortfield ); >@@ -272,7 +275,10 @@ if ( $op eq 'view' ) { > 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 ); >+ $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate publicationyear itemcallnumber dateadded ); >+ if ($sortfield == 'copyrightdate' and C4::Context->preference('marcflavour')=='UNIMARC'){ >+ $sortfield = 'publicationyear'; >+ } > my $direction = $query->param('direction') || 'asc'; > $direction = 'asc' if $direction ne 'asc' and $direction ne 'desc'; > my $rows; >-- >2.43.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 37434
:
169885
|
169886
|
169888
|
169889
|
169891
|
169892
|
169997
|
169998
|
170614