Bugzilla – Attachment 3268 Details for
Bug 5842
Cross-Reference links to authorized fields give incomplete search results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch file for OPAC XSLT and syspref fix
0001-Bug-5842-Cross-Reference-links-to-authorized-fields.patch (text/plain), 18.80 KB, created by
Jane Wagner
on 2011-03-08 16:44:59 UTC
(
hide
)
Description:
patch file for OPAC XSLT and syspref fix
Filename:
MIME Type:
Creator:
Jane Wagner
Created:
2011-03-08 16:44:59 UTC
Size:
18.80 KB
patch
obsolete
>From dd1cc12e5ce0e3056afce14839538934c0c2e600 Mon Sep 17 00:00:00 2001 >From: Jane Wagner <jwagner@ptfs.com> >Date: Tue, 8 Mar 2011 11:42:21 -0500 >Subject: [PATCH] Bug 5842 Cross-Reference links to authorized fields give incomplete search results > >Adds a system preference to force cross-reference searches to use the zebra >indexes rather than titles linked to the authority record >--- > C4/XSLT.pm | 2 +- > admin/systempreferences.pl | 1 + > installer/data/mysql/de-DE/mandatory/sysprefs.sql | 1 + > installer/data/mysql/en/mandatory/sysprefs.sql | 1 + > .../1-Obligatoire/unimarc_standard_systemprefs.sql | 2 +- > installer/data/mysql/pl-PL/mandatory/sysprefs.sql | 3 ++- > ...m_preferences_full_optimal_for_install_only.sql | 1 + > ...m_preferences_full_optimal_for_install_only.sql | 1 + > installer/data/mysql/updatedatabase.pl | 6 ++++++ > .../en/modules/admin/preferences/searching.pref | 12 ++++++++++++ > .../prog/en/xslt/MARC21slim2OPACDetail.xsl | 9 +++++---- > .../opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl | 2 +- > 12 files changed, 33 insertions(+), 8 deletions(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index f1c5293..1587f3f 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -128,7 +128,7 @@ 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 CrossRefsUseAuthorities/ ) { > my $sp = C4::Context->preference( $syspref ); > next unless defined($sp); > $sysxml .= "<syspref name=\"$syspref\">$sp</syspref>\n"; >diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl >index b33c7ec..5783f95 100755 >--- a/admin/systempreferences.pl >+++ b/admin/systempreferences.pl >@@ -249,6 +249,7 @@ $tabsysprefs{opaclanguagesdisplay} = "I18N/L10N"; > $tabsysprefs{language} = "I18N/L10N"; > > # Searching >+$tabsysprefs{CrossRefsUseAuthorities} = "Searching"; > $tabsysprefs{defaultSortField} = "Searching"; > $tabsysprefs{defaultSortOrder} = "Searching"; > $tabsysprefs{numSearchResults} = "Searching"; >diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql b/installer/data/mysql/de-DE/mandatory/sysprefs.sql >index b752919..1f1fcfa 100644 >--- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql >+++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql >@@ -288,4 +288,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); >+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('CrossRefsUseAuthorities','1','If on, author and subject cross-references from title displays will use authority record to find related titles in staff and OPAC XSLT title display. If off, forces author and subject cross-reference searches to use the zebra indexes rather than the authority indexes; needed when BiblioAddsAuthorities is on but not all records have authorities (or there are multiple authority records). In that situation, a cross-reference search on the authority entry will not retrieve all titles.','','YesNo'); > >diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql >index 3e03cad..d7b3cb3 100644 >--- a/installer/data/mysql/en/mandatory/sysprefs.sql >+++ b/installer/data/mysql/en/mandatory/sysprefs.sql >@@ -289,3 +289,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','0','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); >+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('CrossRefsUseAuthorities','1','If on, author and subject cross-references from title displays will use authority record to find related titles in staff and OPAC XSLT title display. If off, forces author and subject cross-reference searches to use the zebra indexes rather than the authority indexes; needed when BiblioAddsAuthorities is on but not all records have authorities (or there are multiple authority records). In that situation, a cross-reference search on the authority entry will not retrieve all titles.','','YesNo'); >diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql >index db61881..66cb749 100644 >--- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql >+++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql >@@ -290,4 +290,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); >- >+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('CrossRefsUseAuthorities','1','If on, author and subject cross-references from title displays will use authority record to find related titles in staff and OPAC XSLT title display. If off, forces author and subject cross-reference searches to use the zebra indexes rather than the authority indexes; needed when BiblioAddsAuthorities is on but not all records have authorities (or there are multiple authority records). In that situation, a cross-reference search on the authority entry will not retrieve all titles.','','YesNo'); >diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql >index 2743698..c19ddad 100644 >--- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql >+++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql >@@ -286,4 +286,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( > 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 ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); >-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); >\ No newline at end of file >+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); >+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('CrossRefsUseAuthorities','1','If on, author and subject cross-references from title displays will use authority record to find related titles in staff and OPAC XSLT title display. If off, forces author and subject cross-reference searches to use the zebra indexes rather than the authority indexes; needed when BiblioAddsAuthorities is on but not all records have authorities (or there are multiple authority records). In that situation, a cross-reference search on the authority entry will not retrieve all titles.','','YesNo'); >diff --git a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql >index b00c1e7..dc8cb4e 100644 >--- a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql >+++ b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql >@@ -342,3 +342,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); >+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('CrossRefsUseAuthorities','1','If on, author and subject cross-references from title displays will use authority record to find related titles in staff and OPAC XSLT title display. If off, forces author and subject cross-reference searches to use the zebra indexes rather than the authority indexes; needed when BiblioAddsAuthorities is on but not all records have authorities (or there are multiple authority records). In that situation, a cross-reference search on the authority entry will not retrieve all titles.','','YesNo'); >diff --git a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql >index b9e1ca8..a8f89dc 100644 >--- a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql >+++ b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql >@@ -367,3 +367,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','YesNo'); >+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('CrossRefsUseAuthorities','1','If on, author and subject cross-references from title displays will use authority record to find related titles in staff and OPAC XSLT title display. If off, forces author and subject cross-reference searches to use the zebra indexes rather than the authority indexes; needed when BiblioAddsAuthorities is on but not all records have authorities (or there are multiple authority records). In that situation, a cross-reference search on the authority entry will not retrieve all titles.','','YesNo'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index d6b7322..a76b693 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -4051,6 +4051,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > SetVersion ($DBversion); > } > >+$DBversion = '3.03.00.023'; >+if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >+ $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('CrossRefsUseAuthorities','1','If on, author and subject cross-references from title displays will use authority record to find related titles in staff and OPAC XSLT title display. If off, forces author and subject cross-reference searches to use the zebra indexes rather than the authority indexes; needed when BiblioAddsAuthorities is on but not all records have authorities (or there are multiple authority records). In that situation, a cross-reference search on the authority entry will not retrieve all titles.','','YesNo');"); >+ print "Upgrade to $DBversion done (Add AuthoritiesLog syspref)\n"; >+ SetVersion ($DBversion); >+} > =head1 FUNCTIONS > > =head2 DropAllForeignKeys($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >index cd924dc..cbb34b8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >@@ -1,6 +1,18 @@ > Searching: > Features: > - >+ - pref: CrossRefsUseAuthorities >+ choices: >+ yes: "Use" >+ no: Don't use >+ - authority records for searches. If on, author and subject cross-references from title displays will use authority record to find related titles in staff and OPAC XSLT title display. If off, forces author and subject cross-reference searches to use the zebra indexes rather than the authority indexes; needed when BiblioAddsAuthorities is on but not all records have authorities (or there are multiple authority records). In that situation, a cross-reference search on the authority entry will not retrieve all titles. >+ - >+ - When Zebra is not in use, translate the following MARC fields to the following indexes (each line should look something like <code>'indexname' => '100a,245a,500*',</code>): >+ - pref: NoZebraIndexes >+ type: textarea >+ class: list >+ - >+ - > - pref: NoZebra > choices: > yes: "Don't use" >diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl >index 5703059..a720f5a 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="CrossRefsUseAuthorities" select="marc:sysprefs/marc:syspref[@name='CrossRefsUseAuthorities']"/> > <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)"/> >@@ -128,7 +129,7 @@ > <xsl:for-each select="marc:datafield[@tag=100 or @tag=700]"> > <a> > <xsl:choose> >- <xsl:when test="marc:subfield[@code=9]"> >+ <xsl:when test="marc:subfield[@code=9] and $CrossRefsUseAuthorities!='0'"> > <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> > </xsl:when> > <xsl:otherwise> >@@ -143,7 +144,7 @@ > <xsl:for-each select="marc:datafield[@tag=110 or @tag=710]"> > <a> > <xsl:choose> >- <xsl:when test="marc:subfield[@code=9]"> >+ <xsl:when test="marc:subfield[@code=9] and $CrossRefsUseAuthorities!='0'"> > <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> > </xsl:when> > <xsl:otherwise> >@@ -165,7 +166,7 @@ > </xsl:choose> > <a> > <xsl:choose> >- <xsl:when test="marc:subfield[@code=9]"> >+ <xsl:when test="marc:subfield[@code=9] and $CrossRefsUseAuthorities!='0'"> > <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> > </xsl:when> > <xsl:otherwise> >@@ -479,7 +480,7 @@ > <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']"> > <a> > <xsl:choose> >- <xsl:when test="marc:subfield[@code=9]"> >+ <xsl:when test="marc:subfield[@code=9] and $CrossRefsUseAuthorities!='0'"> > <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> > </xsl:when> > <xsl:otherwise> >diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl >index d101723..b09007a 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl >@@ -127,7 +127,7 @@ > <xsl:value-of select="$str"/> > </a> > </xsl:when> >- <xsl:when test="boolean($index) and boolean(marc:subfield[@code=9])"> >+ <xsl:when test="boolean($index) and boolean(marc:subfield[@code=9]) and $CrossRefsUseAuthorities!='0'"> > <a> > <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> > <xsl:value-of select="$str"/> >-- >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 5842
:
3268