Bugzilla – Attachment 86610 Details for
Bug 8995
Show OpenURL links in OPAC search results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8995: (follow-up) Tak system preference item-level_itypes into account
Bug-8995-follow-up-Tak-system-preference-item-leve.patch (text/plain), 1.72 KB, created by
Magnus Enger
on 2019-03-14 13:37:54 UTC
(
hide
)
Description:
Bug 8995: (follow-up) Tak system preference item-level_itypes into account
Filename:
MIME Type:
Creator:
Magnus Enger
Created:
2019-03-14 13:37:54 UTC
Size:
1.72 KB
patch
obsolete
>From 46020284de29408ff32339295c7cab9fe61e2ae3 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Thu, 14 Mar 2019 13:23:19 +0000 >Subject: [PATCH] Bug 8995: (follow-up) Tak system preference item-level_itypes > into account > >Signed-off-by: Magnus Enger <magnus@libriotech.no> >Tested with all 9 current patches. Works as advertised, including >OPACURLOpenInNewWindow. If a record has no items, no OpenURL link >is displayed. All the suggested tests pass. I did not test with >XSLT turned off. >--- > C4/XSLT.pm | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index b18ccda9a1..d7aee656ce 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -247,11 +247,18 @@ sub XSLTParse4Display { > > $variables ||= {}; > if (C4::Context->preference('OPACShowOpenURL')) { >- my $biblio_object = Koha::Biblios->find($biblionumber); >- my $biblio = $biblio_object->biblioitem->unblessed; >+ my @biblio_itemtypes; >+ my $biblio = Koha::Biblios->find($biblionumber); >+ if (C4::Context->preference('item-level_itypes')) { >+ @biblio_itemtypes = $biblio->items->get_column("itype"); >+ } else { >+ push @biblio_itemtypes, $biblio->biblioitem->itemtype; >+ } > my @itypes = split( /\s/, C4::Context->preference('OPACOpenURLItemTypes') ); >- if (grep /^$biblio->{itemtype}$/, @itypes) { >- $variables->{OpenURLResolverURL} = $biblio_object->get_openurl; >+ my %original = (); >+ map { $original{$_} = 1 } @biblio_itemtypes; >+ if ( grep { $original{$_} } @itypes ) { >+ $variables->{OpenURLResolverURL} = $biblio->get_openurl; > } > } > my $varxml = "<variables>\n"; >-- >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 8995
:
13141
|
22753
|
23625
|
23626
|
23627
|
24087
|
24088
|
24089
|
26899
|
26900
|
26901
|
29357
|
29358
|
29359
|
30385
|
30386
|
30387
|
30388
|
30389
|
30390
|
35747
|
35916
|
40647
|
44639
|
48371
|
48372
|
55131
|
55132
|
55133
|
55134
|
55135
|
55136
|
55882
|
64513
|
64514
|
64515
|
64516
|
64517
|
64518
|
64519
|
64532
|
64533
|
64534
|
64535
|
64536
|
64537
|
64538
|
86483
|
86484
|
86485
|
86486
|
86487
|
86488
|
86489
|
86490
|
86491
|
86492
|
86541
|
86542
|
86557
|
86558
|
86559
|
86601
|
86602
|
86603
|
86604
|
86605
|
86606
|
86607
|
86608
|
86609
|
86610
|
88665
|
88666
|
88667
|
88668
|
88669
|
88670
|
88671
|
88672
|
88673
|
88735
|
88736
|
88737
|
88738
|
88739
|
88740
|
88741
|
88742
|
88743
|
88744
|
89012
|
89013
|
89014
|
89015
|
89120