@@ -, +, @@ Added system preference Display856uAsImage . When turned on for either the Results page, Details page, or both will display the URI from the 856u field as a clickable image instead of the default link text. This is implemented on the respective XSLT style sheets, so the corresponding OPACXSLT option must be turned on also. On branch mywork Changes to be committed: (use "git reset HEAD ..." to unstage) --- C4/XSLT.pm | 3 ++- installer/data/mysql/en/mandatory/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 6 ++++++ .../prog/en/modules/admin/preferences/opac.pref | 11 +++++++++++ .../prog/en/xslt/MARC21slim2OPACDetail.xsl | 13 +++++++++++++ .../prog/en/xslt/MARC21slim2OPACResults.xsl | 13 +++++++++++++ 6 files changed, 46 insertions(+), 1 deletions(-) --- a/C4/XSLT.pm +++ a/C4/XSLT.pm @@ -128,7 +128,8 @@ sub XSLTParse4Display { my $itemsxml = buildKohaItemsNamespace($biblionumber); my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour')); my $sysxml = "\n"; - foreach my $syspref ( qw/OPACURLOpenInNewWindow DisplayOPACiconsXSLT URLLinkText viewISBD OPACBaseURL/ ) { + foreach my $syspref ( qw/OPACURLOpenInNewWindow DisplayOPACiconsXSLT +URLLinkText viewISBD OPACBaseURL Display856uAsImage/ ) { $sysxml .= "" . C4::Context->preference( $syspref ) . "\n"; --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ a/installer/data/mysql/en/mandatory/sysprefs.sql @@ -283,3 +283,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('Display856uAsImage','OFF','Display the URI in the 856u field as an image, the corresponding OPACXSLT option must be on','OFF|Details|Results|Both','Choice'); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -3953,6 +3953,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('Display856uAsImage','OFF','Display the URI in the 856u field as an image, the corresponding OPACXSLT option must be on','OFF|Details|Results|Both','Choice')"); + print "Upgrade to $DBversion done (Add 'Display856uAsImage' syspref)\n"; + SetVersion ($DBversion); +} =head1 FUNCTIONS =head2 DropAllForeignKeys($table) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -158,6 +158,17 @@ OPAC: - pref: OPACNoResultsFound type: textarea class: code + - + - 'Display the URI in the 856u field as an image on: ' + - pref: Display856uAsImage + choices: + OFF: "Neither Details or Results pages" + Details: "Details page only" + Results: "Results page only" + Both: "Both Details and Results pages" + - 'Note: The corresponding OPACXSLT option must be turned +on.' + Features: - - pref: opacuserlogin --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl +++ a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl @@ -22,6 +22,7 @@ + @@ -510,6 +511,9 @@ + + 100 + @@ -521,6 +525,9 @@ + + + Click here to access online @@ -531,6 +538,9 @@ + + 100 + @@ -542,6 +552,9 @@ + + + Click here to access online --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl +++ a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl @@ -22,6 +22,7 @@ + @@ -905,6 +906,9 @@ + + 100 + @@ -916,6 +920,9 @@ + + + Click here to access online @@ -926,6 +933,9 @@ + + 100 + @@ -937,6 +947,9 @@ + + + Click here to access online --