Bugzilla – Attachment 150108 Details for
Bug 30352
"Not for loan" in result list doesn't translate in OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30352: Add a comment to the substatus translation
Bug-30352-Add-a-comment-to-the-substatus-translati.patch (text/plain), 3.93 KB, created by
David Nind
on 2023-04-22 22:39:43 UTC
(
hide
)
Description:
Bug 30352: Add a comment to the substatus translation
Filename:
MIME Type:
Creator:
David Nind
Created:
2023-04-22 22:39:43 UTC
Size:
3.93 KB
patch
obsolete
>From 7020028f4120c3f7dedfa4208f7a6fd29538a2c9 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 19 Apr 2023 14:59:15 +0000 >Subject: [PATCH] Bug 30352: Add a comment to the substatus translation > >The tric of combining the XPath union operator (|) with the >value-of instruction works as a sort of ternary operation. >The value-of only picks the string value of the first node >from the union in document order. > >So, if there is a translation, it will be the first node. If there >is no translation, the original substatus will be used. Note that >there will be no translation for authorised values like Staff >collection, etc. > >Test plan: >None. Just comments. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: David Nind <david@davidnind.com> >--- > .../opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index 78a609ef27..0c2b499049 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -1360,6 +1360,7 @@ > <xsl:with-param name="status_text"> > <xsl:value-of select="concat($currentbranch,': ')"/> > <xsl:value-of select="exsl:node-set($item_status_list)/status[@english=$current_substatus]|$current_substatus"/> >+ <!-- Note that value-of here picks string value of first node only from the union; keep in mind too that current_substatus may contain an authorised value --> > </xsl:with-param> > <xsl:with-param name="class_block" select="concat('notforloandesc_',$current_substatus)"/> > <xsl:with-param name="class_status" select="'ItemBranch'"/> >@@ -1391,7 +1392,7 @@ > <xsl:with-param name="status_text"> > <xsl:value-of select="$currentbranch"/> > <xsl:text>: </xsl:text> >- <xsl:value-of select="exsl:node-set($item_status_list)/status[@english=$current_substatus]|$current_substatus"/> >+ <xsl:value-of select="exsl:node-set($item_status_list)/status[@english=$current_substatus]|$current_substatus"/><!-- See former comment on value-of and union --> > </xsl:with-param> > <xsl:with-param name="class_block" select="concat('unavailable_',items:substatus)"/> > <xsl:with-param name="class_status" select="'ItemBranch'"/> >@@ -1410,7 +1411,7 @@ > <xsl:with-param name="items" select="$unavailable_items[items:substatus=$current_substatus]"/> > <xsl:with-param name="max" select="0"/> > <xsl:with-param name="status_text"> >- <xsl:value-of select="exsl:node-set($item_status_list)/status[@english=$current_substatus]|$current_substatus"/> >+ <xsl:value-of select="exsl:node-set($item_status_list)/status[@english=$current_substatus]|$current_substatus"/><!-- See former comment on value-of and union --> > </xsl:with-param> > <xsl:with-param name="class_block" select="concat('unavailable_',$current_substatus)"/> > <xsl:with-param name="class_status" select="UnavailableSubstatus"/> >-- >2.30.2
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 30352
:
149919
|
149920
|
150107
|
150108
|
150121
|
150122