Bugzilla – Attachment 3127 Details for
Bug 5738
Display the URI in 856u as an Image
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch file - first attempt
0001-bug-5738-Display-the-URI-in-856u-as-an-Image-Enha.patch (text/plain), 12.60 KB, created by
Doug Dearden
on 2011-02-10 22:54:48 UTC
(
hide
)
Description:
Patch file - first attempt
Filename:
MIME Type:
Creator:
Doug Dearden
Created:
2011-02-10 22:54:48 UTC
Size:
12.60 KB
patch
obsolete
>From 173e34d23c39dd717cc007490844a42cc6a0f38b Mon Sep 17 00:00:00 2001 >From: Doug Dearden <dearden@sarsf.org> >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 <file>..." 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 = "<sysprefs>\n"; >- foreach my $syspref ( qw/OPACURLOpenInNewWindow DisplayOPACiconsXSLT URLLinkText viewISBD OPACBaseURL/ ) { >+ foreach my $syspref ( qw/OPACURLOpenInNewWindow DisplayOPACiconsXSLT >+URLLinkText viewISBD OPACBaseURL Display856uAsImage/ ) { > $sysxml .= "<syspref name=\"$syspref\">" . > C4::Context->preference( $syspref ) . > "</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 @@ > <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/> > <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/> > <xsl:variable name="ShowISBD" select="marc:sysprefs/marc:syspref[@name='viewISBD']"/> >+ <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='Display856uAsImage']"/> > <xsl:variable name="leader" select="marc:leader"/> > <xsl:variable name="leader6" select="substring($leader,7,1)"/> > <xsl:variable name="leader7" select="substring($leader,8,1)"/> >@@ -510,6 +511,9 @@ > <xsl:for-each select="marc:datafield[@tag=856]"> > <xsl:if test="$OPACURLOpenInNewWindow='0'"> > <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute> >+ <xsl:if test="$Show856uAsImage='Details' or $Show856uAsImage='Both'"> >+ <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="height">100</xsl:attribute></xsl:element> >+ </xsl:if> > <xsl:choose> > <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']"> > <xsl:call-template name="subfieldSelect"> >@@ -521,6 +525,9 @@ > <xsl:when test="$URLLinkText!=''"> > <xsl:value-of select="$URLLinkText"/> > </xsl:when> >+ <xsl:when test="$Show856uAsImage='Details' or $Show856uAsImage='Both'"> >+ <xsl:text></xsl:text> >+ </xsl:when> > <xsl:otherwise> > <xsl:text>Click here to access online</xsl:text> > </xsl:otherwise> >@@ -531,6 +538,9 @@ > </xsl:if> > <xsl:if test="$OPACURLOpenInNewWindow='1'"> > <a target='_blank'><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute> >+ <xsl:if test="$Show856uAsImage='Details' or $Show856uAsImage='Both'"> >+ <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="height">100</xsl:attribute></xsl:element> >+ </xsl:if> > <xsl:choose> > <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']"> > <xsl:call-template name="subfieldSelect"> >@@ -542,6 +552,9 @@ > <xsl:when test="$URLLinkText!=''"> > <xsl:value-of select="$URLLinkText"/> > </xsl:when> >+ <xsl:when test="$Show856uAsImage='Details' or $Show856uAsImage='Both'"> >+ <xsl:text></xsl:text> >+ </xsl:when> > <xsl:otherwise> > <xsl:text>Click here to access online</xsl:text> > </xsl:otherwise> >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 @@ > <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/> > <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/> > <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/> >+ <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='Display856uAsImage']"/> > <xsl:variable name="leader" select="marc:leader"/> > <xsl:variable name="leader6" select="substring($leader,7,1)"/> > <xsl:variable name="leader7" select="substring($leader,8,1)"/> >@@ -905,6 +906,9 @@ > <xsl:for-each select="marc:datafield[@tag=856]"> > <xsl:if test="$OPACURLOpenInNewWindow='0'"> > <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute> >+ <xsl:if test="$Show856uAsImage='Results' or $Show856uAsImage='Both'"> >+ <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="height">100</xsl:attribute></xsl:element> >+ </xsl:if> > <xsl:choose> > <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']"> > <xsl:call-template name="subfieldSelect"> >@@ -916,6 +920,9 @@ > <xsl:when test="$URLLinkText!=''"> > <xsl:value-of select="$URLLinkText"/> > </xsl:when> >+ <xsl:when test="$Show856uAsImage='Results' or $Show856uAsImage='Both'"> >+ <xsl:text></xsl:text> >+ </xsl:when> > <xsl:otherwise> > <xsl:text>Click here to access online</xsl:text> > </xsl:otherwise> >@@ -926,6 +933,9 @@ > </xsl:if> > <xsl:if test="$OPACURLOpenInNewWindow='1'"> > <a target='_blank'><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute> >+ <xsl:if test="$Show856uAsImage='Results' or $Show856uAsImage='Both'"> >+ <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="height">100</xsl:attribute></xsl:element> >+ </xsl:if> > <xsl:choose> > <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']"> > <xsl:call-template name="subfieldSelect"> >@@ -937,6 +947,9 @@ > <xsl:when test="$URLLinkText!=''"> > <xsl:value-of select="$URLLinkText"/> > </xsl:when> >+ <xsl:when test="$Show856uAsImage='Results' or $Show856uAsImage='Both'"> >+ <xsl:text></xsl:text> >+ </xsl:when> > <xsl:otherwise> > <xsl:text>Click here to access online</xsl:text> > </xsl:otherwise> >-- >1.5.6.5 >
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 5738
:
3127
|
3136
|
3158
|
3295
|
3297
|
3344
|
3353
|
3482
|
3540
|
3591