Bugzilla – Attachment 30389 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: Change meaning and name of syspref OPACHideOpenURLForItemTypes
Bug-8995-Change-meaning-and-name-of-syspref-OPACHi.patch (text/plain), 5.93 KB, created by
Julian Maurice
on 2014-07-31 09:32:01 UTC
(
hide
)
Description:
Bug 8995: Change meaning and name of syspref OPACHideOpenURLForItemTypes
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2014-07-31 09:32:01 UTC
Size:
5.93 KB
patch
obsolete
>From 1dc2bc04951d6a825948846e229755439a7dac49 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Thu, 31 Jul 2014 11:26:28 +0200 >Subject: [PATCH] Bug 8995: Change meaning and name of syspref > OPACHideOpenURLForItemTypes > >OPACHideOpenURLForItemTypes is now named OPACOpenURLItemTypes and do the >exact opposite as before: it shows OpenURL link only if the biblio >itemtype is in the syspref. >--- > C4/XSLT.pm | 4 ++-- > installer/data/mysql/sysprefs.sql | 2 +- > installer/data/mysql/updatedatabase.pl | 2 +- > .../intranet-tmpl/prog/en/modules/admin/preferences/opac.pref | 4 ++-- > opac/opac-detail.pl | 4 ++-- > opac/opac-search.pl | 6 +++--- > 6 files changed, 11 insertions(+), 11 deletions(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index 63316fc..a578127 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -219,8 +219,8 @@ sub XSLTParse4Display { > $variables ||= {}; > if (C4::Context->preference('OPACShowOpenURL')) { > my ($biblio) = GetBiblioItemByBiblioNumber($biblionumber); >- my @itypes = split( /\s/, C4::Context->preference('OPACHideOpenURLForItemTypes') ); >- if (not grep /^$biblio->{itemtype}$/, @itypes) { >+ my @itypes = split( /\s/, C4::Context->preference('OPACOpenURLItemTypes') ); >+ if (grep /^$biblio->{itemtype}$/, @itypes) { > $variables->{COinS} = C4::Biblio::GetCOinSBiblio($orig_record); > } > } >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 507884e..ba0d83c 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -447,5 +447,5 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('OpenURLText', '', NULL, 'Text of OpenURL links (or image title if OpenURLImageLocation is defined)', 'Free') > ('OpenURLImageLocation', '', NULL, 'Location of image for OpenURL links', 'Free') > ('OPACShowOpenURL', '', NULL, 'Enable display of OpenURL links in OPAC search results and detail page', 'YesNo') >-('OPACHideOpenURLForItemTypes', '', NULL, 'Allow hiding the OpenURL link for some item types', 'Free') >+('OPACOpenURLItemTypes', '', NULL, 'Show the OpenURL link only for these item types', 'Free') > ; >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index c61457c..58df454 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -8609,7 +8609,7 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > "); > $dbh->do(" > INSERT INTO systempreferences (variable,value,explanation,options,type) >- VALUES('OPACHideOpenURLForItemTypes', '', 'Allow hiding the OpenURL link for some item types', NULL, 'Free'); >+ VALUES('OPACOpenURLItemTypes', '', 'Show the OpenURL link only for these item types', NULL, 'Free'); > "); > print "Upgrade to $DBversion done (Bug 8995 - Add sysprefs for OpenURL)\n"; > SetVersion($DBversion); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index ca4f044..ab116cc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -335,8 +335,8 @@ OPAC: > no: Disable > - 'display of OpenURL link in OPAC search results and detail page.' > - >- - 'List of item type codes (separated by spaces) for those you do not want to show the OpenURL link:' >- - pref: OPACHideOpenURLForItemTypes >+ - 'List of item type codes (separated by spaces) for those you want to show the OpenURL link:' >+ - pref: OPACOpenURLItemTypes > - '<br />' > - 'It uses biblioitems.itemtype field, so if you map a MARC field to it, and link this MARC field to a list of authorised values (for example CCODE), you can use these values for system preference value.' > Features: >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index f4046d0..fa9c896 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -1139,8 +1139,8 @@ $template->param( > # OpenURL > if (C4::Context->preference('OPACShowOpenURL')) { > my ($biblio) = GetBiblioItemByBiblioNumber($biblionumber); >- my @itypes = split( /\s/, C4::Context->preference('OPACHideOpenURLForItemTypes') ); >- if (not grep /^$biblio->{itemtype}$/, @itypes) { >+ my @itypes = split( /\s/, C4::Context->preference('OPACOpenURLItemTypes') ); >+ if (grep /^$biblio->{itemtype}$/, @itypes) { > $template->param( > OPACShowOpenURL => 1, > OpenURLResolverURL => C4::Context->preference('OpenURLResolverURL'), >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index ace05dd..572cc19 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -490,9 +490,9 @@ if (C4::Context->preference('OpacSuppression')) { > } > > # OpenURL >-my @OpenURL_itypes_to_hide; >+my @OpenURL_itypes; > if (C4::Context->preference('OPACShowOpenURL')) { >- @OpenURL_itypes_to_hide = split( /\s/, C4::Context->preference('OPACHideOpenURLForItemTypes') ); >+ @OpenURL_itypes = split( /\s/, C4::Context->preference('OPACOpenURLItemTypes') ); > $template->param( > OPACShowOpenURL => 1, > OpenURLResolverURL => C4::Context->preference('OpenURLResolverURL'), >@@ -585,7 +585,7 @@ for (my $i=0;$i<@servers;$i++) { > > if (C4::Context->preference('COinSinOPACResults') > or C4::Context->preference('OPACShowOpenURL')) { >- if (not grep /^$res->{itemtype}$/, @OpenURL_itypes_to_hide) { >+ if (grep /^$res->{itemtype}$/, @OpenURL_itypes) { > $res->{ShowOpenURL} = 1; > } > my $record = GetMarcBiblio($res->{'biblionumber'}); >-- >1.7.10.4
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