Bugzilla – Attachment 136763 Details for
Bug 30430
UNIMARC XSLT : displaying field B_214
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30430: (QA follow-up) Several fixes
Bug-30430-QA-follow-up-Several-fixes.patch (text/plain), 17.43 KB, created by
Fridolin Somers
on 2022-06-30 05:06:04 UTC
(
hide
)
Description:
Bug 30430: (QA follow-up) Several fixes
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2022-06-30 05:06:04 UTC
Size:
17.43 KB
patch
obsolete
>From 5acd7b0c909d73e028c6aaff3368b68a4615e69d Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Wed, 29 Jun 2022 18:40:35 -1000 >Subject: [PATCH] Bug 30430: (QA follow-up) Several fixes > >Several fixes : > >- Replace tab with spaces > >tag_210 : >- Class 'value' and not 'valeur' >- Loop on subfields must restrict to abcdg otherwise last() may not be > correct (ie 214r and 214s) > >tag_214 : >- Condition for coma after b should be same as after a : "position() != last()" > >tag_210 and tag_214 : >- Space before ':' like in other fields >- ':' before c or g does not exist in opac, removed from intranet file >- Search links in intranet fixed (where composed with opac-search ^^) >- Search links using 'str:encode-uri' like other places >- Simplify title attribute with only 'Search for publisher' => Bad idea > to use double quotes in a text > >tag_214_s and tag_214_r : >- Loop on field+subfield otherwise last() may not be correct > >I've fixed intranet and copied to OPAC (only adapted search links) > >Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> >--- > .../prog/en/xslt/UNIMARCslimUtils.xsl | 103 ++++++-------- > .../bootstrap/en/xslt/UNIMARCslimUtils.xsl | 130 ++++++++---------- > 2 files changed, 103 insertions(+), 130 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl >index 408fceb70a..8860317cbf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl >@@ -31,13 +31,13 @@ > <xsl:template name="tag_210-214"> > <xsl:choose> > <xsl:when test="marc:datafield[@tag=210] and marc:datafield[@tag=214]"> >- <xsl:call-template name="tag_214" /> >+ <xsl:call-template name="tag_214" /> > </xsl:when> > <xsl:when test="marc:datafield[@tag=214]"> >- <xsl:call-template name="tag_214" /> >+ <xsl:call-template name="tag_214" /> > </xsl:when> > <xsl:when test="marc:datafield[@tag=210]"> >- <xsl:call-template name="tag_210" /> >+ <xsl:call-template name="tag_210" /> > </xsl:when> > </xsl:choose> > </xsl:template> >@@ -46,17 +46,17 @@ > <span class="results_summary publication"> > <span class="label">Publication: </span> > <xsl:for-each select="marc:datafield[@tag=210]"> >- <xsl:if test="not (position() = 1)"> >+ <xsl:if test="not(position() = 1)"> > <br/> > </xsl:if> >- <span class="valeur"> >+ <span class="value"> > <xsl:call-template name="addClassRtl" /> >- <xsl:for-each select="marc:subfield"> >+ <xsl:for-each select="marc:subfield[@code='a' or @code='b' or @code='c' or @code='d' or @code='g']"> > <xsl:choose> > <xsl:when test="@code='a'"> > <xsl:value-of select="."/> > <xsl:if test="position() != last()"> >- <xsl:text>: </xsl:text> >+ <xsl:text> : </xsl:text> > </xsl:if> > </xsl:when> > <xsl:when test="@code='b'"> >@@ -66,15 +66,9 @@ > </xsl:if> > </xsl:when> > <xsl:when test="@code='c' or @code='g'"> >- <xsl:if test="position()>1"> >- <xsl:text> : </xsl:text> >- </xsl:if> > <a> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?idx=pb&q=<xsl:value-of select="."/> >- </xsl:attribute> >- <xsl:attribute name="title"> Search for publisher "<xsl:value-of select="."/> >- <xsl:text>"</xsl:text> >- </xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=pb:<xsl:value-of select="str:encode-uri(., true())"/></xsl:attribute> >+ <xsl:attribute name="title">Search for publisher</xsl:attribute> > <xsl:value-of select="."/> > </a> > <xsl:if test="position() != last()"> >@@ -100,24 +94,17 @@ > <span class="results_summary publication"> > <span class="label"> > <xsl:choose> >- <xsl:when test="@ind2=1">Production: >- </xsl:when> >- <xsl:when test="@ind2=2">Distribution: >- </xsl:when> >- <xsl:when test="@ind2=3">Manufacture: >- </xsl:when> >+ <xsl:when test="@ind2=1">Production: </xsl:when> >+ <xsl:when test="@ind2=2">Distribution: </xsl:when> >+ <xsl:when test="@ind2=3">Manufacture: </xsl:when> > <xsl:when test="@ind2=4"> > <xsl:choose> >- <xsl:when test="substring(marc:subfield[@code='d'],1,1)='C'">Copyright date: >- </xsl:when> >- <xsl:when test="substring(marc:subfield[@code='d'],1,1)='P'">Protection date: >- </xsl:when> >- <xsl:otherwise>Copyright date / protection date: >- </xsl:otherwise> >+ <xsl:when test="substring(marc:subfield[@code='d'],1,1)='C'">Copyright date: </xsl:when> >+ <xsl:when test="substring(marc:subfield[@code='d'],1,1)='P'">Protection date: </xsl:when> >+ <xsl:otherwise>Copyright date / protection date: </xsl:otherwise> > </xsl:choose> > </xsl:when> >- <xsl:otherwise>Publication: >- </xsl:otherwise> >+ <xsl:otherwise>Publication: </xsl:otherwise> > </xsl:choose> > </span> > <span> >@@ -127,22 +114,19 @@ > <xsl:when test="@code='a'"> > <xsl:value-of select="."/> > <xsl:if test="position() != last()"> >- <xsl:text>: </xsl:text> >+ <xsl:text> : </xsl:text> > </xsl:if> > </xsl:when> > <xsl:when test="@code='b'"> > <xsl:value-of select="."/> >- <xsl:if test="not(position()=1)"> >+ <xsl:if test="position() != last()"> > <xsl:text>, </xsl:text> > </xsl:if> > </xsl:when> > <xsl:when test="@code='c'"> > <a> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?idx=pb&q=<xsl:value-of select="."/> >- </xsl:attribute> >- <xsl:attribute name="title"> Search for publisher "<xsl:value-of select="."/> >- <xsl:text>"</xsl:text> >- </xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=pb:<xsl:value-of select="str:encode-uri(., true())"/></xsl:attribute> >+ <xsl:attribute name="title">Search for publisher</xsl:attribute> > <xsl:value-of select="."/> > </a> > </xsl:when> >@@ -174,17 +158,18 @@ > <xsl:template name="tag_214_s"> > <xsl:if test="marc:datafield[@tag=214]/marc:subfield[@code='s']"> > <span class="results_summary tag_214_s"> >- <span class="label">Printing and/or Publishing Information Transcribed as Found in the Colophon: </span> >- <xsl:for-each select="marc:datafield[@tag=214]"> >- <xsl:value-of select="marc:subfield[@code='s']"/> >- <xsl:choose> >- <xsl:when test="position()=last()"> >- <xsl:text>.</xsl:text> >- </xsl:when> >- <xsl:otherwise><xsl:text>, </xsl:text> >- </xsl:otherwise> >- </xsl:choose> >- </xsl:for-each> >+ <span class="label">Printing and/or Publishing Information Transcribed as Found in the Colophon: </span> >+ <xsl:for-each select="marc:datafield[@tag=214]/marc:subfield[@code='s']"> >+ <xsl:value-of select="."/> >+ <xsl:choose> >+ <xsl:when test="position()=last()"> >+ <xsl:text>.</xsl:text> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:text>, </xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:for-each> > </span> > </xsl:if> > </xsl:template> >@@ -192,18 +177,18 @@ > <xsl:template name="tag_214_r"> > <xsl:if test="marc:datafield[@tag=214]/marc:subfield[@code='r']"> > <span class="results_summary tag_214_r"> >- <span class="label">Printing and/or Publishing Information Transcribed as Found in the Main Source of >- Information: </span> >- <xsl:for-each select="marc:datafield[@tag=214]"> >- <xsl:value-of select="marc:subfield[@code='r']"/> >- <xsl:choose> >- <xsl:when test="position()=last()"> >- <xsl:text>.</xsl:text> >- </xsl:when> >- <xsl:otherwise><xsl:text>, </xsl:text> >- </xsl:otherwise> >- </xsl:choose> >- </xsl:for-each> >+ <span class="label">Printing and/or Publishing Information Transcribed as Found in the Main Source of Information: </span> >+ <xsl:for-each select="marc:datafield[@tag=214]/marc:subfield[@code='r']"> >+ <xsl:value-of select="."/> >+ <xsl:choose> >+ <xsl:when test="position()=last()"> >+ <xsl:text>.</xsl:text> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:text>, </xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:for-each> > </span> > </xsl:if> > </xsl:template> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslimUtils.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslimUtils.xsl >index b5a970a2c7..dc02e6fc8e 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslimUtils.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslimUtils.xsl >@@ -192,13 +192,13 @@ > <xsl:template name="tag_210-214"> > <xsl:choose> > <xsl:when test="marc:datafield[@tag=210] and marc:datafield[@tag=214]"> >- <xsl:call-template name="tag_214" /> >+ <xsl:call-template name="tag_214" /> > </xsl:when> > <xsl:when test="marc:datafield[@tag=214]"> >- <xsl:call-template name="tag_214" /> >+ <xsl:call-template name="tag_214" /> > </xsl:when> > <xsl:when test="marc:datafield[@tag=210]"> >- <xsl:call-template name="tag_210" /> >+ <xsl:call-template name="tag_210" /> > </xsl:when> > </xsl:choose> > </xsl:template> >@@ -207,47 +207,44 @@ > <span class="results_summary publication"> > <span class="label">Publication: </span> > <xsl:for-each select="marc:datafield[@tag=210]"> >- <xsl:if test="not (position() = 1)"> >+ <xsl:if test="not(position() = 1)"> > <br/> >- </xsl:if> >- <span class="valeur"> >+ </xsl:if> >+ <span class="value"> > <xsl:call-template name="addClassRtl" /> >- <xsl:for-each select="marc:subfield"> >+ <xsl:for-each select="marc:subfield[@code='a' or @code='b' or @code='c' or @code='d' or @code='g']"> > <xsl:choose> > <xsl:when test="@code='a'"> >- <xsl:value-of select="."/> >- <xsl:if test="position() != last()"> >- <xsl:text>: </xsl:text> >- </xsl:if> >+ <xsl:value-of select="."/> >+ <xsl:if test="position() != last()"> >+ <xsl:text> : </xsl:text> >+ </xsl:if> > </xsl:when> > <xsl:when test="@code='b'"> >- <xsl:value-of select="."/> >- <xsl:if test="position() != last()"> >+ <xsl:value-of select="."/> >+ <xsl:if test="position() != last()"> > <xsl:text>, </xsl:text> >- </xsl:if> >+ </xsl:if> > </xsl:when> > <xsl:when test="@code='c' or @code='g'"> >- <a> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?idx=pb&q=<xsl:value-of select="."/> >- </xsl:attribute> >- <xsl:attribute name="title"> Search for publisher "<xsl:value-of select="."/> >- <xsl:text>"</xsl:text> >- </xsl:attribute> >+ <a> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=pb:<xsl:value-of select="str:encode-uri(., true())"/></xsl:attribute> >+ <xsl:attribute name="title">Search for publisher</xsl:attribute> > <xsl:value-of select="."/> >- </a> >- <xsl:if test="position() != last()"> >+ </a> >+ <xsl:if test="position() != last()"> > <xsl:text>, </xsl:text> >- </xsl:if> >+ </xsl:if> > </xsl:when> > <xsl:when test="@code='d'"> >- <xsl:value-of select="."/> >- <xsl:if test="position() != last()"> >+ <xsl:value-of select="."/> >+ <xsl:if test="position() != last()"> > <xsl:text>, </xsl:text> >- </xsl:if> >+ </xsl:if> > </xsl:when> > </xsl:choose> > </xsl:for-each> >- </span> >+ </span> > </xsl:for-each> > </span> > </xsl:template> >@@ -258,24 +255,17 @@ > <span class="results_summary publication"> > <span class="label"> > <xsl:choose> >- <xsl:when test="@ind2=1">Production: >- </xsl:when> >- <xsl:when test="@ind2=2">Distribution: >- </xsl:when> >- <xsl:when test="@ind2=3">Manufacture: >- </xsl:when> >+ <xsl:when test="@ind2=1">Production: </xsl:when> >+ <xsl:when test="@ind2=2">Distribution: </xsl:when> >+ <xsl:when test="@ind2=3">Manufacture: </xsl:when> > <xsl:when test="@ind2=4"> > <xsl:choose> >- <xsl:when test="substring(marc:subfield[@code='d'],1,1)='C'">Copyright date: >- </xsl:when> >- <xsl:when test="substring(marc:subfield[@code='d'],1,1)='P'">Protection date: >- </xsl:when> >- <xsl:otherwise>Copyright date / protection date: >- </xsl:otherwise> >+ <xsl:when test="substring(marc:subfield[@code='d'],1,1)='C'">Copyright date: </xsl:when> >+ <xsl:when test="substring(marc:subfield[@code='d'],1,1)='P'">Protection date: </xsl:when> >+ <xsl:otherwise>Copyright date / protection date: </xsl:otherwise> > </xsl:choose> > </xsl:when> >- <xsl:otherwise>Publication: >- </xsl:otherwise> >+ <xsl:otherwise>Publication: </xsl:otherwise> > </xsl:choose> > </span> > <span> >@@ -285,22 +275,19 @@ > <xsl:when test="@code='a'"> > <xsl:value-of select="."/> > <xsl:if test="position() != last()"> >- <xsl:text>: </xsl:text> >+ <xsl:text> : </xsl:text> > </xsl:if> > </xsl:when> > <xsl:when test="@code='b'"> > <xsl:value-of select="."/> >- <xsl:if test="not(position()=1)"> >+ <xsl:if test="position() != last()"> > <xsl:text>, </xsl:text> > </xsl:if> > </xsl:when> > <xsl:when test="@code='c'"> > <a> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?idx=pb&q=<xsl:value-of select="."/> >- </xsl:attribute> >- <xsl:attribute name="title"> Search for publisher "<xsl:value-of select="."/> >- <xsl:text>"</xsl:text> >- </xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=pb:<xsl:value-of select="str:encode-uri(., true())"/></xsl:attribute> >+ <xsl:attribute name="title">Search for publisher</xsl:attribute> > <xsl:value-of select="."/> > </a> > </xsl:when> >@@ -332,17 +319,18 @@ > <xsl:template name="tag_214_s"> > <xsl:if test="marc:datafield[@tag=214]/marc:subfield[@code='s']"> > <span class="results_summary tag_214_s"> >- <span class="label">Printing and/or Publishing Information Transcribed as Found in the Colophon: </span> >- <xsl:for-each select="marc:datafield[@tag=214]"> >- <xsl:value-of select="marc:subfield[@code='s']"/> >- <xsl:choose> >- <xsl:when test="position()=last()"> >- <xsl:text>.</xsl:text> >- </xsl:when> >- <xsl:otherwise><xsl:text>, </xsl:text> >- </xsl:otherwise> >- </xsl:choose> >- </xsl:for-each> >+ <span class="label">Printing and/or Publishing Information Transcribed as Found in the Colophon: </span> >+ <xsl:for-each select="marc:datafield[@tag=214]/marc:subfield[@code='s']"> >+ <xsl:value-of select="."/> >+ <xsl:choose> >+ <xsl:when test="position()=last()"> >+ <xsl:text>.</xsl:text> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:text>, </xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:for-each> > </span> > </xsl:if> > </xsl:template> >@@ -350,18 +338,18 @@ > <xsl:template name="tag_214_r"> > <xsl:if test="marc:datafield[@tag=214]/marc:subfield[@code='r']"> > <span class="results_summary tag_214_r"> >- <span class="label">Printing and/or Publishing Information Transcribed as Found in the Main Source of >- formation: </span> >- <xsl:for-each select="marc:datafield[@tag=214]"> >- <xsl:value-of select="marc:subfield[@code='r']"/> >- <xsl:choose> >- <xsl:when test="position()=last()"> >- <xsl:text>.</xsl:text> >- </xsl:when> >- <xsl:otherwise><xsl:text>, </xsl:text> >- </xsl:otherwise> >- </xsl:choose> >- </xsl:for-each> >+ <span class="label">Printing and/or Publishing Information Transcribed as Found in the Main Source of Information: </span> >+ <xsl:for-each select="marc:datafield[@tag=214]/marc:subfield[@code='r']"> >+ <xsl:value-of select="."/> >+ <xsl:choose> >+ <xsl:when test="position()=last()"> >+ <xsl:text>.</xsl:text> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:text>, </xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:for-each> > </span> > </xsl:if> > </xsl:template> >-- >2.35.3
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 30430
:
132842
|
132864
|
132872
|
133235
|
134560
|
134652
|
134653
|
134667
|
134668
|
136758
|
136759
|
136760
|
136761
|
136762
| 136763