Bugzilla – Attachment 123647 Details for
Bug 26302
OPAC XSLT Results: List variable number of itemcallnumbers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26302: Refactor Availability block in OPAC results xslt
Bug-26302-Refactor-Availability-block-in-OPAC-resu.patch (text/plain), 34.70 KB, created by
Nick Clemens (kidclamp)
on 2021-08-09 13:03:13 UTC
(
hide
)
Description:
Bug 26302: Refactor Availability block in OPAC results xslt
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-08-09 13:03:13 UTC
Size:
34.70 KB
patch
obsolete
>From 9519882800e094f58446c1fead524fc4f6698c15 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 5 Aug 2021 11:43:16 +0000 >Subject: [PATCH] Bug 26302: Refactor Availability block in OPAC results xslt > >Decided finally to do a larger refactor here. Hopefully we improved >consistency and removed some redundancy. And the two new prefs provide >additional functionality. > >Most significant changes: >[1] Clearer distinction of the Availability line in three parts: > Available, Reference and Unavailable. > For Unavailable we loop thru branches now too. >[2] Calling template to list item data (including location or ccode). > Made the separate Location line obsolete. >[3] The tests around OPACItemLibrary are removed since we now look at > resultbranch from XSLT.pm. >[4] Removed code replication for various 'other' statuses like Checked out. >[5] Obsoleted three xslt key indexes, singleBranchMode. >[6] Apply the two prefs to control number of listed items. > >Test plan: >You may play with: OPACResultsLibrary (home/holding), OPACItemLocation >(library, callno, location, ccode), resultsMaxItems[Unavailable] (numbers), >Reference_NFL_Statuses (list of notforloan codes in reference part). > >[1] Create a biblio with various items on a few branches. Fill call number, > location and ccode too. Set home branch and holdingbranch differently. >[2] Toggle the preferences, and verify display within OAPC search results. > >Example with prefs (home, callnumber, 2, 2): >Availability: Items available for loan: Centerville (2)Call number: perl A 4, PERL D 1. Items available for reference: Fairfield: Not For Loan (1)Call number: PERL A 5. Not available: Centerville: Checked out (1)Call number: PERL A 3. Centerville: Ordered (1)Call number: PERL B 1. Centerville: Staff Collection (2)Call number: PERL A 2, PERL E 1. Centerville: Withdrawn (1)Call number: PERL B 2. Fairfield: Withdrawn (1)Call number: PERL C 1. > >Same data with prefs (holding, callnumber, 2, 2): >Availability: Items available for loan: Centerville (1)Call number: PERL D 1. Liberty (1)Call number: perl A 4. Items available for reference: Centerville: Not For Loan (1)Call number: PERL A 5. Not available: Centerville: Checked out (1)Call number: PERL A 3. Centerville: Staff Collection (1)Call number: PERL A 2. Centerville: Withdrawn (1)Call number: PERL B 2. Fairfield: Ordered (1)Call number: PERL B 1. Fairfield: Withdrawn (1)Call number: PERL C 1. Liberty: Staff Collection (1)Call number: PERL E 1. > >Same data with prefs (holding, library, n/a, n/a): >Availability: Items available for loan: Centerville (1). Liberty (1). Items available for reference: Centerville: Not For Loan (1). Not available: Centerville: Checked out (1). Centerville: Staff Collection (1). Centerville: Withdrawn (1). Fairfield: Ordered (1). Fairfield: Withdrawn (1). Liberty: Staff Collection (1). > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > .../en/xslt/MARC21slim2OPACResults.xsl | 383 +++++++----------- > 1 file changed, 144 insertions(+), 239 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index 92d1d2ff8f..d2867e54fe 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -5,14 +5,13 @@ > xmlns:marc="http://www.loc.gov/MARC21/slim" > xmlns:items="http://www.koha-community.org/items" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >+ xmlns:exsl="http://exslt.org/common" > xmlns:str="http://exslt.org/strings" >- exclude-result-prefixes="marc items str"> >+ exclude-result-prefixes="marc items str" extension-element-prefixes="exsl"> > <xsl:import href="MARC21slimUtils.xsl"/> > <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/> >+ > <xsl:key name="item-by-status" match="items:item" use="items:status"/> >- <xsl:key name="item-by-status-and-branch-home" match="items:item" use="concat(items:status, ' ', items:homebranch)"/> >- <xsl:key name="item-by-status-and-branch-holding" match="items:item" use="concat(items:status, ' ', items:holdingbranch)"/> >- <xsl:key name="item-by-substatus-and-branch" match="items:item" use="concat(items:substatus, ' ', items:homebranch)"/> > > <xsl:template match="/"> > <xsl:apply-templates/> >@@ -24,6 +23,8 @@ > <!-- Option: Display Alternate Graphic Representation (MARC 880) --> > <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/> > >+ <xsl:variable name="resultsMaxItems" select="number(marc:sysprefs/marc:syspref[@name='resultsMaxItems']+0)"/> >+ <xsl:variable name="resultsMaxItemsUnavailable" select="number(marc:sysprefs/marc:syspref[@name='resultsMaxItemsUnavailable']+0)"/> > <xsl:variable name="UseControlNumber" select="marc:sysprefs/marc:syspref[@name='UseControlNumber']"/> > <xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/> > <xsl:variable name="OPACResultsLibrary" select="marc:sysprefs/marc:syspref[@name='OPACResultsLibrary']"/> >@@ -36,7 +37,6 @@ > <xsl:variable name="AlternateHoldingsSubfields" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 4)"/> > <xsl:variable name="AlternateHoldingsSeparator" select="marc:sysprefs/marc:syspref[@name='AlternateHoldingsSeparator']"/> > <xsl:variable name="OPACItemLocation" select="marc:sysprefs/marc:syspref[@name='OPACItemLocation']"/> >- <xsl:variable name="singleBranchMode" select="marc:sysprefs/marc:syspref[@name='singleBranchMode']"/> > <xsl:variable name="OPACTrackClicks" select="marc:sysprefs/marc:syspref[@name='TrackClicks']"/> > <xsl:variable name="BiblioDefaultView" select="marc:sysprefs/marc:syspref[@name='BiblioDefaultView']"/> > <xsl:variable name="leader" select="marc:leader"/> >@@ -1250,258 +1250,123 @@ > <!-- Availability line --> > <span class="results_summary availability"> > <span class="label">Availability: </span> >- <xsl:variable name="sumAv" select="count(key('item-by-status', 'available'))"/> >- <xsl:variable name="sumRef" select="count(key('item-by-status', 'reference'))"/> > > <xsl:choose> >+ <!-- When there are no items, try alternate holdings --> > <xsl:when test="$itemcount=0"> >- <xsl:choose> >- <xsl:when test="string-length($AlternateHoldingsField)=3 and marc:datafield[@tag=$AlternateHoldingsField]"> >- <xsl:variable name="AlternateHoldingsCount" select="count(marc:datafield[@tag=$AlternateHoldingsField])"/> >- <xsl:for-each select="marc:datafield[@tag=$AlternateHoldingsField][1]"> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes"><xsl:value-of select="$AlternateHoldingsSubfields"/></xsl:with-param> >- <xsl:with-param name="delimeter"><xsl:value-of select="$AlternateHoldingsSeparator"/></xsl:with-param> >- </xsl:call-template> >- </xsl:for-each> >- (<xsl:value-of select="$AlternateHoldingsCount"/>) >- </xsl:when> >- <xsl:otherwise><span class="noitems">No items available.</span> </xsl:otherwise> >- </xsl:choose> >- </xsl:when> >- <xsl:when test="$sumAv>0"> >- <span class="available reallyavailable"> >- <span class="AvailabilityLabel"><strong><xsl:text>Items available for loan: </xsl:text></strong></span> >- <xsl:variable name="available_items" >- select="key('item-by-status', 'available')"/> >- <xsl:choose> >- <xsl:when test="$singleBranchMode=1"> >- <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]"> >- <span class="ItemSummary"> >- <xsl:value-of select="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))"/><xsl:text> </xsl:text> >- <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> >- <span class="CallNumberAndLabel"> >- <span class="LabelCallNumber">Call number: </span> >- <span class="CallNumber"><xsl:value-of select="items:itemcallnumber"/><xsl:if test="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))>1"><xsl:text>, ..</xsl:text></xsl:if></span> >- </span> >- </xsl:if> >- <xsl:choose> >- <xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when> >- <xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise> >- </xsl:choose> >- </span> >+ <xsl:choose> >+ <xsl:when test="string-length($AlternateHoldingsField)=3 and marc:datafield[@tag=$AlternateHoldingsField]"> >+ <xsl:variable name="AlternateHoldingsCount" select="count(marc:datafield[@tag=$AlternateHoldingsField])"/> >+ <xsl:for-each select="marc:datafield[@tag=$AlternateHoldingsField][1]"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes"><xsl:value-of select="$AlternateHoldingsSubfields"/></xsl:with-param> >+ <xsl:with-param name="delimeter"><xsl:value-of select="$AlternateHoldingsSeparator"/></xsl:with-param> >+ </xsl:call-template> > </xsl:for-each> >- </xsl:when> >- <xsl:otherwise> >- <xsl:choose> >- <xsl:when test="$OPACResultsLibrary='homebranch'"> >- <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]"> >- <span class="ItemSummary"> >- <span class="ItemBranch"><xsl:value-of select="items:homebranch"/> </span> >- <xsl:text> (</xsl:text> >- <xsl:value-of select="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))"/> >- <xsl:text>) </xsl:text> >- <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> >- <span class="CallNumberAndLabel"> >- <span class="LabelCallNumber">Call number: </span> >- <span class="CallNumber"><xsl:value-of select="items:itemcallnumber"/><xsl:if test="count(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch)))>1"><xsl:text>, ..</xsl:text></xsl:if></span> >- </span> >- </xsl:if> >- <xsl:choose> >- <xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when> >- <xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise> >- </xsl:choose> >- </span> >- </xsl:for-each> >- </xsl:when> >- <xsl:otherwise> >- <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch))[1])]"> >- <span class="ItemSummary"> >- <span class="ItemBranch"><xsl:value-of select="items:holdingbranch"/> </span> >- <xsl:text> (</xsl:text> >- <xsl:value-of select="count(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch)))"/> >- <xsl:text>) </xsl:text> >- <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> >- <span class="CallNumberAndLabel"> >- <span class="LabelCallNumber">Call number: </span> >- <span class="CallNumber"><xsl:value-of select="items:itemcallnumber"/><xsl:if test="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))>1"><xsl:text>, ..</xsl:text></xsl:if></span> >- </span> >- </xsl:if> >- <xsl:choose> >- <xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when> >- <xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise> >- </xsl:choose> >- </span> >- </xsl:for-each> >- </xsl:otherwise> >- </xsl:choose> >- </xsl:otherwise> >- </xsl:choose> >- </span> >+ (<xsl:value-of select="$AlternateHoldingsCount"/>) >+ </xsl:when> >+ <xsl:otherwise><span class="noitems">No items available.</span> </xsl:otherwise> >+ </xsl:choose> > </xsl:when> >- </xsl:choose> > >- <xsl:choose> >- <xsl:when test="$sumRef>0"> >- <span class="available reference"> >- <span class="AvailabilityLabel"><strong><xsl:text>Items available for reference: </xsl:text></strong></span> >- <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/> >- <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-substatus-and-branch', concat(items:substatus, ' ', items:homebranch))[1])]"> >- <span> >- <xsl:attribute name="class"> >- ItemSummary >- <xsl:value-of select="translate(items:substatus,' ','_')"/> >- </xsl:attribute> >- <xsl:if test="$singleBranchMode=0"> >- <span class="ItemBranch"><xsl:value-of select="items:homebranch"/><xsl:text> </xsl:text></span> >- </xsl:if> >- <span class='notforloandesc'><xsl:value-of select="items:substatus"/></span> >- <xsl:text> (</xsl:text> >- <xsl:value-of select="count(key('item-by-substatus-and-branch', concat(items:substatus, ' ', items:homebranch)))"/> >- <xsl:text>) </xsl:text> >- <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> >- <span class="CallNumberAndLabel"> >- <span class="LabelCallNumber">Call number: </span> >- <span class="CallNumber"><xsl:value-of select="items:itemcallnumber"/><xsl:if test="count(key('item-by-substatus-and-branch', concat(items:substatus, ' ', items:homebranch)))>1"><xsl:text>, ..</xsl:text></xsl:if></span> >- </span> >- </xsl:if> >- <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose> >+ <xsl:otherwise> >+ <xsl:variable name="sumAv" select="count(key('item-by-status', 'available'))"/> >+ <xsl:variable name="sumRef" select="count(key('item-by-status', 'reference'))"/> >+ >+ <!-- Availability part 1: ITEMS FOR LOAN --> >+ <xsl:if test="$sumAv>0"><span class="available reallyavailable"> >+ <span class="AvailabilityLabel"><strong><xsl:text>Items available for loan: </xsl:text></strong></span> >+ <xsl:variable name="available_items" select="key('item-by-status', 'available')"/> >+ <!-- group by branch, see also pref OPACResultsLibrary --> >+ <xsl:for-each select="$available_items[not(items:resultbranch=preceding-sibling::*[items:status='available']/items:resultbranch)]"> >+ <xsl:sort select="items:resultbranch"/> >+ <xsl:variable name="currentbranch" select="items:resultbranch"/> >+ <span class="ItemSummary"> >+ <xsl:call-template name="listCallNumbers"> >+ <xsl:with-param name="items" select="$available_items[items:resultbranch=$currentbranch]"/> >+ <xsl:with-param name="max" select="$resultsMaxItems"/> >+ <xsl:with-param name="status_text" select="$currentbranch"/> >+ <xsl:with-param name="class_status" select="ItemBranch"/> >+ <xsl:with-param name="OPACItemLocation" select="$OPACItemLocation"/> >+ </xsl:call-template> > </span> > </xsl:for-each> >- </span> >- </xsl:when> >- </xsl:choose> >+ </span></xsl:if> > >- <xsl:choose> >- <xsl:when test="number($sumAv+$sumRef) < number($itemcount)"> >- <span class="unavailable"> >- <span class="AvailabilityLabel"><strong><xsl:text>Not available: </xsl:text></strong></span> >+ <!-- Availability part 2: ITEMS FOR REFERENCE (see also pref Reference_NFL_Statuses) --> >+ <xsl:if test="$sumRef>0"><span class="available reference"> >+ <span class="AvailabilityLabel"><strong><xsl:text>Items available for reference: </xsl:text></strong></span> >+ <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/> >+ <!-- group by branch, then by substatus --> >+ <xsl:for-each select="$reference_items[not(items:resultbranch=preceding-sibling::*[items:status='reference']/items:resultbranch)]"> >+ <xsl:sort select="items:resultbranch"/> >+ <xsl:variable name="currentbranch" select="items:resultbranch"/> >+ <xsl:for-each select="$reference_items[not(items:substatus=preceding-sibling::*[items:status='reference']/items:substatus)]"> >+ <xsl:sort select="items:substatus"/> >+ <xsl:variable name="current_substatus" select="items:substatus"/> >+ <span class="ItemSummary"> >+ <xsl:call-template name="listCallNumbers"> >+ <xsl:with-param name="items" select="$reference_items[items:resultbranch=$currentbranch and items:substatus=$current_substatus]"/> >+ <xsl:with-param name="max" select="$resultsMaxItems"/> >+ <xsl:with-param name="status_text" select="concat($currentbranch,': ',$current_substatus)"/> >+ <xsl:with-param name="class_block" select="concat('notforloandesc_',$current_substatus)"/> >+ <xsl:with-param name="class_status" select="ItemBranch"/> >+ <xsl:with-param name="OPACItemLocation" select="$OPACItemLocation"/> >+ </xsl:call-template> >+ </span> >+ </xsl:for-each> >+ </xsl:for-each> >+ </span></xsl:if> > >- <!-- First the remaining not for loan categories --> >- <xsl:variable name="unavailable_items" select="key('item-by-status', 'reallynotforloan')"/> >- <xsl:for-each select="$unavailable_items[not(./items:substatus=preceding-sibling::*/items:substatus)]"> >+ <!-- Availability part 3: UNAVAILABLE ITEMS (see also pref Reference_NFL_Statuses); status reallynotforloan or status other --> >+ <xsl:if test="number($sumAv+$sumRef) < number($itemcount)"><span class="unavailable"> >+ <span class="AvailabilityLabel"><strong><xsl:text>Not available: </xsl:text></strong></span> >+ <xsl:variable name="other_status_list"> >+ <status english="Checked out">Checked out</status> >+ <status english="Withdrawn">Withdrawn</status> >+ <status english="Lost">Lost</status> >+ <status english="Damaged">Damaged</status> >+ <status english="Pending hold">Pending hold</status> >+ <status english="In transit">In transit</status> >+ <status english="Waiting">On hold</status> >+ </xsl:variable> >+ <xsl:variable name="unavailable_items" select="key('item-by-status', 'reallynotforloan')|key('item-by-status', 'other')"/> >+ <!-- First group by branch --> >+ <xsl:for-each select="items:items/items:item[not(items:resultbranch=preceding-sibling::*/items:resultbranch)]"> >+ <xsl:sort select="items:resultbranch"/> >+ <xsl:variable name="currentbranch" select="items:resultbranch"/> > <span class="ItemSummary unavailable"> >- <span class='notforloandesc'><xsl:value-of select="items:substatus"/></span> >- <xsl:text> (</xsl:text> >- <xsl:value-of select="count(parent::*/items:item/items:substatus[ text() = current()/items:substatus ])"/> >- <xsl:text>)</xsl:text> >- <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose> >+ <!-- Within same branch, group by substatus --> >+ <xsl:for-each select="$unavailable_items[not(items:substatus=preceding-sibling::*[items:status='reallynotforloan' or items:status='other']/items:substatus)]"> >+ <xsl:sort select="items:substatus"/> >+ <xsl:variable name="current_substatus" select="items:substatus"/> >+ <xsl:call-template name="listCallNumbers"> >+ <xsl:with-param name="items" select="$unavailable_items[items:resultbranch=$currentbranch and items:substatus=$current_substatus]"/> >+ <xsl:with-param name="max" select="$resultsMaxItemsUnavailable"/> >+ <xsl:with-param name="status_text"> >+ <xsl:value-of select="$currentbranch"/> >+ <xsl:text>: </xsl:text> >+ <xsl:if test="items:status='other'"> >+ <xsl:value-of select="exsl:node-set($other_status_list)/status[@english=$current_substatus]"/> >+ </xsl:if> >+ <xsl:if test="items:status='reallynotforloan'"> >+ <xsl:value-of select="$current_substatus"/> >+ </xsl:if> >+ </xsl:with-param> >+ <xsl:with-param name="class_block" select="concat('unavailable_',items:substatus)"/> >+ <xsl:with-param name="class_status" select="ItemBranch"/> >+ <xsl:with-param name="OPACItemLocation" select="$OPACItemLocation"/> >+ </xsl:call-template> >+ </xsl:for-each> > </span> > </xsl:for-each> >+ </span></xsl:if> > >- <!-- Followed by other statuses --> >- <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', 'Pending hold'))>0"> >- <span class="unavailable"> >- <xsl:text>Pending hold (</xsl:text> >- <xsl:value-of select="count(key('item-by-status', 'Pending hold'))"/> >- <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:if> >- </span> >- </xsl:when> >+ </xsl:otherwise> > </xsl:choose> > </span> > <!-- End of Availability line --> > >- <!-- Location line --> >- <xsl:choose> >- <xsl:when test="($OPACItemLocation='location' or $OPACItemLocation='ccode') and (count(key('item-by-status', 'available'))!=0 or count(key('item-by-status', 'reference'))!=0)"> >- <span class="results_summary location"> >- >- <xsl:choose> >- <xsl:when test="$OPACItemLocation='location'"> >- <span class="label">Location(s): </span> >- </xsl:when> >- <xsl:when test="$OPACItemLocation='ccode'"> >- <span class="label">Collection(s): </span> >- </xsl:when> >- </xsl:choose> >- >- <xsl:choose> >- <xsl:when test="count(key('item-by-status', 'available'))>0"> >- <span class="available"> >- <xsl:variable name="available_items" select="key('item-by-status', 'available')"/> >- <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]"> >- <xsl:choose> >- <xsl:when test="$OPACItemLocation='location'"><strong><xsl:value-of select="concat(items:location,' ')"/></strong></xsl:when> >- <xsl:when test="$OPACItemLocation='ccode'"><strong><xsl:value-of select="concat(items:ccode,' ')"/></strong></xsl:when> >- </xsl:choose> >- <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> >- <span class="CallNumberAndLabel"> >- <span class="LabelCallNumber">Call number: </span> >- <span class="CallNumber"><xsl:value-of select="items:itemcallnumber"/></span> >- </span> >- </xsl:if> >- <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:when> >- <xsl:when test="count(key('item-by-status', 'reference'))>0"> >- <span class="available"> >- <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/> >- <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]"> >- <xsl:choose> >- <xsl:when test="$OPACItemLocation='location'"><strong><xsl:value-of select="concat(items:location,' ')"/></strong></xsl:when> >- <xsl:when test="$OPACItemLocation='ccode'"><strong><xsl:value-of select="concat(items:ccode,' ')"/></strong></xsl:when> >- </xsl:choose> >- <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> >- <span class="CallNumberAndLabel"> >- <span class="LabelCallNumber">Call number: </span> >- <span class="CallNumber"><xsl:value-of select="items:itemcallnumber"/></span> >- </span> >- </xsl:if> >- <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:when> >- </xsl:choose> >- </span> >- </xsl:when> >- </xsl:choose> >- <!-- End of Location line --> >- > </xsl:template> > > <xsl:template name="nameABCQ"> >@@ -1598,4 +1463,44 @@ > </xsl:if> > </xsl:template> > >+ <xsl:template name="listCallNumbers"> >+ <xsl:param name="items"/> >+ <xsl:param name="max"/> >+ <xsl:param name="status_text"/> >+ <xsl:param name="class_block"/> >+ <xsl:param name="class_status"/> >+ <xsl:param name="OPACItemLocation"/> >+ <xsl:if test="count($items)>0"> >+ <span class="$class_block"> >+ <span class="$class_status"><xsl:value-of select="$status_text"/></span> >+ <xsl:text> (</xsl:text> >+ <xsl:value-of select="count($items)"/> >+ <xsl:text>)</xsl:text> >+ <xsl:if test="$max>0 and $OPACItemLocation!='library'"> >+ <span class="CallNumberAndLabel"> >+ <span class="LabelCallNumber"> >+ <xsl:if test="$OPACItemLocation='callnum'">Call number: </xsl:if> >+ <xsl:if test="$OPACItemLocation='ccode'">Collection code, call number: </xsl:if> >+ <xsl:if test="$OPACItemLocation='location'">Location, call number: </xsl:if> >+ </span> >+ <span class="CallNumber"> >+ <xsl:for-each select="$items[position() <= $max]"> >+ <xsl:if test="$OPACItemLocation='location'"> >+ <strong><xsl:value-of select="concat(items:location,' ')"/></strong> >+ </xsl:if> >+ <xsl:if test="$OPACItemLocation='ccode'"> >+ <strong><xsl:value-of select="concat(items:ccode,' ')"/></strong> >+ </xsl:if> >+ <xsl:value-of select="items:itemcallnumber"/><xsl:if test="position()!=last()"><xsl:text>, </xsl:text></xsl:if> >+ </xsl:for-each> >+ <xsl:if test="count($items)>$max"><xsl:text>, ..</xsl:text></xsl:if> >+ </span> >+ </span> >+ </xsl:if> >+ <xsl:text>. </xsl:text> >+ </span> >+ </xsl:if> >+ </xsl:template> >+ >+ > </xsl:stylesheet> >-- >2.20.1
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 26302
:
109184
|
119108
|
119109
|
119110
|
119111
|
122386
|
122387
|
122388
|
122389
|
122391
|
122462
|
122463
|
122464
|
122465
|
122466
|
122487
|
123499
|
123500
|
123501
|
123502
|
123526
|
123527
|
123528
|
123529
|
123531
|
123532
|
123533
|
123534
|
123640
|
123641
|
123643
|
123644
|
123645
|
123646
| 123647 |
123648
|
123649
|
124243
|
124244
|
124245