Bugzilla – Attachment 8118 Details for
Bug 7092
Complete-subfield searches TraceCompleteSubfields syspref not working correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7092 - Complete-subfield searches TraceCompleteSubfields syspref not working correctly
Bug-7092---Complete-subfield-searches-TraceComplet.patch (text/plain), 12.10 KB, created by
Magnus Enger
on 2012-03-09 12:43:37 UTC
(
hide
)
Description:
Bug 7092 - Complete-subfield searches TraceCompleteSubfields syspref not working correctly
Filename:
MIME Type:
Creator:
Magnus Enger
Created:
2012-03-09 12:43:37 UTC
Size:
12.10 KB
patch
obsolete
>From 627479cf49dc0aab7a5f62b5257590ebcd44c460 Mon Sep 17 00:00:00 2001 >From: Magnus Enger <magnus@enger.priv.no> >Date: Mon, 5 Mar 2012 13:36:43 +0100 >Subject: [PATCH] Bug 7092 - Complete-subfield searches TraceCompleteSubfields syspref not working correctly >Content-Type: text/plain; charset="utf-8" > >This patch adds a syspref TracingQuotes for toggling between using "" and {} for quoting in >subject tracings. With normal Zebra indexing, "" must be used. With ICU Zebra indexing, {} >must be used. > >This syspref interacts with TraceCompleteSubfields and TraceSubjectSubdivisions. > >To test: > >- marcflavour = MARC21 >- make sure you have a record with a "complex subject", like > "Internet -- Law and legislation" > >Toggle TracingQuotes, TraceCompleteSubfields and TraceSubjectSubdivisions and check that you >get the expected results for the clickable links in the OPAC *and* intranet detail views: > >TraceCompleteSubfields = Don't force >TraceSubjectSubdivisions = Don't include >TracingQuotes = quotes > opac-search.pl?q=su:"Internet" >TracingQuotes = curlybrace > opac-search.pl?q=su:{Internet} > >TraceCompleteSubfields = Force >TraceSubjectSubdivisions = Don't include >TracingQuotes = quotes > opac-search.pl?q=su,complete-subfield:"Internet" >TracingQuotes = curlybrace > opac-search.pl?q=su,complete-subfield:{Internet} > >TraceCompleteSubfields = Don't force >TraceSubjectSubdivisions = Include >TracingQuotes = quotes > opac-search.pl?q=(su:"Internet") and (su:"Law and legislation.") >TracingQuotes = curlybrace > opac-search.pl?q=(su:{Internet}) and (su:{Law and legislation.}) > >TraceCompleteSubfields = Force >TraceSubjectSubdivisions = Include >TracingQuotes = quotes > opac-search.pl?q=(su,complete-subfield:"Internet") and (su,complete-subfield:"Law and legislation.") >TracingQuotes = curlybrace > opac-search.pl?q=(su,complete-subfield:{Internet}) and (su,complete-subfield:{Law and legislation.}) > >Check that clicking on the generated links gives the expected search results, bot with normal and ICU >indexing. (I have actually not tested this with ICU, so doing that before signing off is crucial.) >--- > C4/XSLT.pm | 2 +- > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 7 +++++++ > .../en/modules/admin/preferences/searching.pref | 8 ++++++++ > .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 18 +++++++++++++++--- > .../prog/en/xslt/MARC21slim2OPACDetail.xsl | 18 +++++++++++++++--- > 6 files changed, 47 insertions(+), 7 deletions(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index 06dfaf4..8da82f3 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -131,7 +131,7 @@ sub XSLTParse4Display { > my $sysxml = "<sysprefs>\n"; > foreach my $syspref ( qw/ hidelostitems OPACURLOpenInNewWindow > DisplayOPACiconsXSLT URLLinkText viewISBD >- OPACBaseURL TraceCompleteSubfields >+ OPACBaseURL TraceCompleteSubfields TracingQuotes > UseAuthoritiesForTracings TraceSubjectSubdivisions > Display856uAsImage OPACDisplay856uAsImage > UseControlNumber >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 12ee2b7..2716a29 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -315,6 +315,7 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TracingQuotes', 'quote', 'Quote character to use when tracing subjects.','quote|curlybrace','Choice'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('StaffAuthorisedValueImages','1','',NULL,'YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACDisplay856uAsImage','OFF','Display the URI in the 856u field as an image, the corresponding OPACXSLT option must be on','OFF|Details|Results|Both','Choice'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('Display856uAsImage','OFF','Display the URI in the 856u field as an image, the corresponding Staff Client XSLT option must be on','OFF|Details|Results|Both','Choice'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 06eded1..ac371c8 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -4884,6 +4884,13 @@ Date due: <<issues.date_due>><br /> > SetVersion($DBversion); > } > >+$DBversion = "3.07.00.XXX"; >+if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >+ $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('TracingQuotes ','curlybrace','Quote character to use when tracing subjects.','quote|curlybrace','Choice')"); >+ print "Upgrade to $DBversion done (Add syspref to control the quoting characters used in subject tracings)\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 12075ec..aeeec00 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 >@@ -69,6 +69,14 @@ Searching: > yes: Include > no: "Don't include" > - subdivisions for searches generated by clicking on subject tracings. >+ - >+ - Use >+ - pref: TracingQuotes >+ default: quote >+ choices: >+ quote: quotes >+ curlybrace: curly braces >+ - 'to group subjects together. Set this to curly braces if you are using Zebra with ICU indexing.' > Search Form: > - > - Show checkboxes to search by >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >index a00e3c2..1502d29 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -26,6 +26,18 @@ > <xsl:variable name="TraceSubjectSubdivisions" select="marc:sysprefs/marc:syspref[@name='TraceSubjectSubdivisions']"/> > > <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='Display856uAsImage']"/> >+ <xsl:variable name="TracingQuotesLeft"> >+ <xsl:choose> >+ <xsl:when test="marc:sysprefs/marc:syspref[@name='TracingQuotes']='curlybrace'">{</xsl:when> >+ <xsl:otherwise>"</xsl:otherwise> >+ </xsl:choose> >+ </xsl:variable> >+ <xsl:variable name="TracingQuotesRight"> >+ <xsl:choose> >+ <xsl:when test="marc:sysprefs/marc:syspref[@name='TracingQuotes']='curlybrace'">}</xsl:when> >+ <xsl:otherwise>"</xsl:otherwise> >+ </xsl:choose> >+ </xsl:variable> > <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)"/> >@@ -462,13 +474,13 @@ > <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelect"> > <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param> > <xsl:with-param name="delimeter"> and </xsl:with-param> >- <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:{</xsl:with-param> >- <xsl:with-param name="suffix">})</xsl:with-param> >+ <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param> >+ <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param> > </xsl:call-template> > </xsl:attribute> > </xsl:when> > <xsl:otherwise> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:{<xsl:value-of select="marc:subfield[@code='a']"/>}</xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/><xsl:value-of select="marc:subfield[@code='a']"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute> > </xsl:otherwise> > </xsl:choose> > <xsl:call-template name="chopPunctuation"> >diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl >index 13812f0..f756519 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl >@@ -27,6 +27,18 @@ > <xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/> > <xsl:variable name="TraceSubjectSubdivisions" select="marc:sysprefs/marc:syspref[@name='TraceSubjectSubdivisions']"/> > <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='OPACDisplay856uAsImage']"/> >+ <xsl:variable name="TracingQuotesLeft"> >+ <xsl:choose> >+ <xsl:when test="marc:sysprefs/marc:syspref[@name='TracingQuotes']='curlybrace'">{</xsl:when> >+ <xsl:otherwise>"</xsl:otherwise> >+ </xsl:choose> >+ </xsl:variable> >+ <xsl:variable name="TracingQuotesRight"> >+ <xsl:choose> >+ <xsl:when test="marc:sysprefs/marc:syspref[@name='TracingQuotes']='curlybrace'">}</xsl:when> >+ <xsl:otherwise>"</xsl:otherwise> >+ </xsl:choose> >+ </xsl:variable> > <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)"/> >@@ -474,13 +486,13 @@ > <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:call-template name="subfieldSelect"> > <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param> > <xsl:with-param name="delimeter"> and </xsl:with-param> >- <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:{</xsl:with-param> >- <xsl:with-param name="suffix">})</xsl:with-param> >+ <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param> >+ <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param> > </xsl:call-template> > </xsl:attribute> > </xsl:when> > <xsl:otherwise> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:{<xsl:value-of select="marc:subfield[@code='a']"/>}</xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/><xsl:value-of select="marc:subfield[@code='a']"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute> > </xsl:otherwise> > </xsl:choose> > <xsl:call-template name="chopPunctuation"> >-- >1.7.2.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 7092
:
8010
|
8069
|
8118
|
8139
|
8140
|
8225
|
8227