Bugzilla – Attachment 115528 Details for
Bug 27507
Search host record using control number identifier / organization code
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27507: Specify organization code when searching host record
Bug-27507-Specify-organization-code-when-searching.patch (text/plain), 3.74 KB, created by
Joonas Kylmälä
on 2021-01-21 11:12:20 UTC
(
hide
)
Description:
Bug 27507: Specify organization code when searching host record
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2021-01-21 11:12:20 UTC
Size:
3.74 KB
patch
obsolete
>From eafed047b04e16f70d9a10cabbb4eccb665aec14 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@helsinki.fi> >Date: Thu, 21 Jan 2021 12:56:23 +0200 >Subject: [PATCH] Bug 27507: Specify organization code when searching host > record > >This allows now importing records to Koha database from multiple >different organizations and keeps the "In: XXX" links in the >catalogue/detail.pl page unique. > >To test: > 1) Add host record with 001 and 003 values of "1234" and "TEST" > 2) Add host record with 001 and 003 values of "1234" and "TEST2" > 2) Add component record with 773w value of (TEST)1234 > 3) Notice the link in the component record goes to search page with > two results > 4) Apply patch > 5) Notice the link in the component record goes directly to the first > host record created with 001 = 1234 and 003 = TEST > 6) Test also that if you modify the 773w link with just the value of > "1234" the search will still work and give you two results >--- > .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 2 +- > koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl | 15 +++++++++++++++ > 2 files changed, 16 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >index ea90b2b90c..f1dcbae4c9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -1063,7 +1063,7 @@ > </xsl:variable> > <xsl:choose> > <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']"> >- <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute> >+ <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template> AND cni:"<xsl:call-template name="extractCNI"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template>"</xsl:attribute> > <xsl:value-of select="translate($f773, '()', '')"/> > </a> > </xsl:when> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >index 84027021f2..b101ea45c3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >@@ -147,6 +147,21 @@ > </xsl:choose> > </xsl:template> > >+ <!-- Function extractCNI is used to extract the control number identifier (OrgCode) from MARC tags 773/80/85 [etc.] subfield $w. >+ Parameter: control number string. >+ Assumes LOC convention: (OrgCode)recordNumber. >+ If OrgCode is not present, return empty string. >+ Returns the value URI-encoded. >+ --> >+ <xsl:template name="extractCNI"> >+ <xsl:param name="subfieldW"/> >+ <xsl:choose> >+ <xsl:when test="contains($subfieldW,'(') and contains($subfieldW,')')"> >+ <xsl:value-of select="str:encode-uri(substring-before(substring-after($subfieldW,'('), ')'), true())"/> >+ </xsl:when> >+ </xsl:choose> >+ </xsl:template> >+ > <!-- Function m880Select: Display Alternate Graphic Representation (MARC 880) for selected latin "base"tags > - should be called immediately before the corresonding latin tags are processed > - tags in right-to-left languages are displayed floating right >-- >2.11.0
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 27507
:
115528
|
119904
|
145063