Bugzilla – Attachment 7907 Details for
Bug 7611
Show the NOT_LOAN authorised values for item status in XSLT OPAC search results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
New version of the initial patch
0001-XSLT-Results-template-improvement-Use-the-NOT_LOAN-a.patch (text/plain), 7.02 KB, created by
Frédérick Capovilla
on 2012-02-27 18:19:30 UTC
(
hide
)
Description:
New version of the initial patch
Filename:
MIME Type:
Creator:
Frédérick Capovilla
Created:
2012-02-27 18:19:30 UTC
Size:
7.02 KB
patch
obsolete
>From d35c96c07d9daf7afd0659bc26ee2b1b544d1e3d Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9rick=20Capovilla?= <frederick.capovilla@libeo.com> >Date: Fri, 24 Feb 2012 16:17:03 -0500 >Subject: [PATCH] XSLT Results template improvement : Use the NOT_LOAN authorised values > >Improved the MARC21slim2OPACResults.xsl file to use the authorised values >instead of just showing these items as "unavailable" >--- > C4/XSLT.pm | 7 ++ > .../prog/en/xslt/MARC21slim2OPACResults.xsl | 82 ++++++++++---------- > 2 files changed, 47 insertions(+), 42 deletions(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index 8bc4000..103bc37 100755 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -184,6 +184,7 @@ sub buildKohaItemsNamespace { > my @items = C4::Items::GetItemsInfo($biblionumber); > my $branches = GetBranches(); > my $itemtypes = GetItemTypes(); >+ my $not_loan_values = GetKohaAuthorisedValues('items.notforloan', '', 1); > my $xml = ''; > for my $item (@items) { > my $status; >@@ -200,6 +201,12 @@ sub buildKohaItemsNamespace { > if ( $item->{itemnotforloan} > 0 || $item->{notforloan} > 0 || $itemtypes->{ $item->{itype} }->{notforloan} == 1 ) { > $status = "reference"; > } >+ if($item->{itemnotforloan} and defined $not_loan_values->{$item->{itemnotforloan}}){ >+ $status = $not_loan_values->{$item->{itemnotforloan}}; >+ } >+ if($item->{notforloan} and defined $not_loan_values->{$item->{notforloan}}) { >+ $status = $not_loan_values->{$item->{notforloan}}; >+ } > if ($item->{onloan}) { > $status = "Checked out"; > } >diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl >index 9c6c307..0eaf262 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl >@@ -1023,49 +1023,47 @@ > </xsl:when> > </xsl:choose> > >- <xsl:if test="count(key('item-by-status', 'Checked out'))>0"> >- <span class="unavailable"> >- <xsl:text>Checked out (</xsl:text> >- <xsl:value-of select="count(key('item-by-status', 'Checked out'))"/> >- <xsl:text>). </xsl:text> >- </span> >- </xsl:if> >- <xsl:if test="count(key('item-by-status', 'Withdrawn'))>0"> >- <span class="unavailable"> >- <xsl:text>Withdrawn (</xsl:text> >- <xsl:value-of select="count(key('item-by-status', 'Withdrawn'))"/> >- <xsl:text>). </xsl:text> </span> >- </xsl:if> >- <xsl:if test="$hidelostitems='0' and count(key('item-by-status', 'Lost'))>0"> >- <span class="unavailable"> >- <xsl:text>Lost (</xsl:text> >- <xsl:value-of select="count(key('item-by-status', 'Lost'))"/> >- <xsl:text>). </xsl:text> </span> >- </xsl:if> >- <xsl:if test="count(key('item-by-status', 'Damaged'))>0"> >- <span class="unavailable"> >- <xsl:text>Damaged (</xsl:text> >- <xsl:value-of select="count(key('item-by-status', 'Damaged'))"/> >- <xsl:text>). </xsl:text> </span> >- </xsl:if> >- <xsl:if test="count(key('item-by-status', 'On order'))>0"> >- <span class="unavailable"> >- <xsl:text>On order (</xsl:text> >- <xsl:value-of select="count(key('item-by-status', 'On order'))"/> >- <xsl:text>). </xsl:text> </span> >- </xsl:if> >- <xsl:if test="count(key('item-by-status', 'In transit'))>0"> >- <span class="unavailable"> >- <xsl:text>In transit (</xsl:text> >- <xsl:value-of select="count(key('item-by-status', 'In transit'))"/> >- <xsl:text>). </xsl:text> </span> >- </xsl:if> >- <xsl:if test="count(key('item-by-status', 'Waiting'))>0"> >- <span class="unavailable"> >- <xsl:text>On hold (</xsl:text> >- <xsl:value-of select="count(key('item-by-status', 'Waiting'))"/> >- <xsl:text>). </xsl:text> </span> >+ <xsl:for-each select="//items:item[generate-id() = generate-id(key('item-by-status', items:status)[1])]"> >+ <xsl:if test="items:status != 'available' and items:status != 'reference' and items:status != 'Lost'"> >+ <span class="unavailable"> >+ <xsl:choose> >+ <xsl:when test="items:status = 'Checked out'"> >+ <xsl:text>Checked out (</xsl:text> >+ </xsl:when> >+ <xsl:when test="items:status = 'Withdrawn'"> >+ <xsl:text>Withdrawn (</xsl:text> >+ </xsl:when> >+ <xsl:when test="items:status = 'Damaged'"> >+ <xsl:text>Damaged (</xsl:text> >+ </xsl:when> >+ <xsl:when test="items:status = 'On order'"> >+ <xsl:text>On order (</xsl:text> >+ </xsl:when> >+ <xsl:when test="items:status = 'In transit'"> >+ <xsl:text>In transit (</xsl:text> >+ </xsl:when> >+ <xsl:when test="items:status = 'Waiting'"> >+ <xsl:text>On hold (</xsl:text> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:value-of select="items:status"/> >+ <xsl:text> (</xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ <xsl:value-of select="count(key('item-by-status', items:status))"/> >+ <xsl:text>). </xsl:text> >+ </span> >+ </xsl:if> >+ </xsl:for-each> >+ >+ <xsl:if test="$hidelostitems='0' and count(key('item-by-status', 'Lost'))>0"> >+ <span class="unavailable"> >+ <xsl:text>Lost (</xsl:text> >+ <xsl:value-of select="count(key('item-by-status', 'Lost'))"/> >+ <xsl:text>). </xsl:text> </span> > </xsl:if> >+ >+ > </span> > </xsl:template> > >-- >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 7611
:
7905
|
7906
|
7907
|
60816
|
62930
|
62931
|
85115
|
92495
|
92496
|
94026
|
94212
|
95060
|
95061
|
95235
|
95236
|
95237
|
95238
|
95239
|
95240
|
97804
|
97805
|
97806
|
97807
|
97808
|
99074
|
99075
|
99076
|
99077
|
99078
|
99163