From 173e34d23c39dd717cc007490844a42cc6a0f38b Mon Sep 17 00:00:00 2001 From: Doug Dearden Date: Thu, 10 Feb 2011 15:20:37 -0700 Subject: [PATCH] bug 5738: Display the URI in 856u as an Image - Enhancment 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) Content-Type: text/plain; charset="utf-8" modified: C4/XSLT.pm modified: installer/data/mysql/en/mandatory/sysprefs.sql modified: installer/data/mysql/updatedatabase.pl modified: koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref modified: koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl modified: koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl --- 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(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 7844330..b48e6f5 100644 --- a/C4/XSLT.pm +++ b/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"; diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index b597b02..86721a2 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/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'); \ No newline at end of file diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index d11a494..3a14509 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/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) 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 8707c25..c2fd3ab 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 @@ -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 diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl index 5703059..2c42039 100755 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl +++ b/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 diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl index b3f61e5..03ae40f 100644 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl +++ b/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 -- 1.5.6.5