@@ -, +, @@ OPACHideOpenURLForItemTypes --- 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(-) --- a/C4/XSLT.pm +++ a/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); } } --- a/installer/data/mysql/sysprefs.sql +++ a/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') ; --- a/installer/data/mysql/updatedatabase.pl +++ a/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); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/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 - '
' - '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: --- a/opac/opac-detail.pl +++ a/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'), --- a/opac/opac-search.pl +++ a/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'}); --