Bug 6886 - OPAC XSLT respecting single branch mode
This is only for the MARC21 XSLT at this stage, follow up patch for UNIMARC will come Conflicts: C4/XSLT.pm koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
This commit is contained in:
parent
2341bd876a
commit
cf7f5ecbea
3 changed files with 26 additions and 10 deletions
|
@ -188,6 +188,7 @@ sub XSLTParse4Display {
|
|||
UseAuthoritiesForTracings TraceSubjectSubdivisions
|
||||
Display856uAsImage OPACDisplay856uAsImage
|
||||
UseControlNumber IntranetBiblioDefaultView BiblioDefaultView
|
||||
singleBranchMode
|
||||
AlternateHoldingsField AlternateHoldingsSeparator / )
|
||||
{
|
||||
my $sp = C4::Context->preference( $syspref );
|
||||
|
|
|
@ -359,7 +359,7 @@ OPAC:
|
|||
choices:
|
||||
yes: "Don't allow"
|
||||
no: Allow
|
||||
- patrons to select their library on the OPAC.
|
||||
- patrons to select their branch on the OPAC or show branch names with callnumbers.
|
||||
-
|
||||
- pref: SearchMyLibraryFirst
|
||||
choices:
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
<xsl:variable name="AlternateHoldingsField" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 1, 3)"/>
|
||||
<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="singleBranchMode" select="marc:sysprefs/marc:syspref[@name='singleBranchMode']"/>
|
||||
<xsl:variable name="leader" select="marc:leader"/>
|
||||
<xsl:variable name="leader6" select="substring($leader,7,1)"/>
|
||||
<xsl:variable name="leader7" select="substring($leader,8,1)"/>
|
||||
|
@ -1025,15 +1026,29 @@
|
|||
<b><xsl:text>Copies available for loan: </xsl:text></b>
|
||||
<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', concat(items:status, ' ', items:homebranch))[1])]">
|
||||
<xsl:value-of select="items:homebranch"/>
|
||||
<xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
|
||||
<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>
|
||||
</xsl:for-each>
|
||||
</span>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$singleBranchMode=1">
|
||||
<xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
|
||||
<xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
|
||||
<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>
|
||||
</xsl:for-each>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
|
||||
<xsl:value-of select="items:homebranch"/>
|
||||
<xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
|
||||
<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>
|
||||
</xsl:for-each>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</span>
|
||||
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
|
||||
|
|
Loading…
Reference in a new issue