UseControlNumber IntranetBiblioDefaultView BiblioDefaultView
OPACItemLocation DisplayIconsXSLT
AlternateHoldingsField AlternateHoldingsSeparator
- TrackClicks opacthemes IdRef OpacSuppression / )
+ TrackClicks opacthemes IdRef OpacSuppression
+ OPACResultsLibrary / )
{
my $sp = C4::Context->preference( $syspref );
next unless defined($sp);
$location = $item->{location}? xml_escape($shelflocations->{$item->{location}}||$item->{location}):'';
$ccode = $item->{ccode}? xml_escape($ccodes->{$item->{ccode}}||$item->{ccode}):'';
my $itemcallnumber = xml_escape($item->{itemcallnumber});
- $xml.= "<item><homebranch>$homebranch</homebranch>".
- "<holdingbranch>$holdingbranch</holdingbranch>".
- "<location>$location</location>".
- "<ccode>$ccode</ccode>".
- "<status>$status</status>".
- "<itemcallnumber>".$itemcallnumber."</itemcallnumber>".
- "</item>";
+ $xml .=
+ "<item>"
+ . "<homebranch>$homebranch</homebranch>"
+ . "<holdingbranch>$holdingbranch</holdingbranch>"
+ . "<location>$location</location>"
+ . "<ccode>$ccode</ccode>"
+ . "<status>$status</status>"
+ . "<itemcallnumber>$itemcallnumber</itemcallnumber>"
+ . "</item>";
}
$xml = "<items xmlns=\"http://www.koha-community.org/items\">".$xml."</items>";
return $xml;
('OpacRenewalAllowed','0',NULL,'If ON, users can renew their issues directly from their OPAC account','YesNo'),
('OpacRenewalBranch','checkoutbranch','itemhomebranch|patronhomebranch|checkoutbranch|null','Choose how the branch for an OPAC renewal is recorded in statistics','Choice'),
('OpacResetPassword','0','','Shows the ''Forgot your password?'' link in the OPAC','YesNo'),
+('OPACResultsLibrary', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results when using XSLT', 'Choice'),
('OPACResultsSidebar','','70|10','Define HTML to be included on the search results page, underneath the facets sidebar','Textarea'),
('OPACSearchForTitleIn','<li><a href=\"http://worldcat.org/search?q={TITLE}\" target=\"_blank\">Other Libraries (WorldCat)</a></li>\n<li><a href=\"http://www.scholar.google.com/scholar?q={TITLE}\" target=\"_blank\">Other Databases (Google Scholar)</a></li>\n<li><a href=\"http://www.bookfinder.com/search/?author={AUTHOR}&title={TITLE}&st=xl&ac=qr\" target=\"_blank\">Online Stores (Bookfinder.com)</a></li>\n<li><a href=\"http://openlibrary.org/search/?author=({AUTHOR})&title=({TITLE})\" target=\"_blank\">Open Library (openlibrary.org)</a></li>','70|10','Enter the HTML that will appear in the \'Search for this title in\' box on the detail page in the OPAC. Enter {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the URL. Leave blank to disable \'More Searches\' menu.','Textarea'),
('OpacSeparateHoldings','0',NULL,'Separate current branch holdings from other holdings (OPAC)','YesNo'),
<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" match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
+ <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:template match="/">
<xsl:apply-templates/>
<!-- Option: Display Alternate Graphic Representation (MARC 880) -->
<xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
+ <xsl:variable name="OPACResultsLibrary" select="marc:sysprefs/marc:syspref[@name='OPACResultsLibrary']"/>
<xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
<xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
<xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
<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', concat(items:status, ' ', items:homebranch))[1])]">
- <span class="ItemSummary">
- <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<span class="LabelCallNumber">Call number: </span><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>
- </span>
- </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])]">
- <span class="ItemSummary">
- <xsl:value-of select="items:homebranch"/>
- <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> [<span class="LabelCallNumber">Call number: </span><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>
- </span>
- </xsl:for-each>
- </xsl:otherwise>
+ <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:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<span class="LabelCallNumber">Call number: </span><xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
+ <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: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: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">
+ <xsl:value-of select="items:homebranch"/>
+ <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> [<span class="LabelCallNumber">Call number: </span><xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
+ <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: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">
+ <xsl:value-of select="items:holdingbranch"/>
+ <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> [<span class="LabelCallNumber">Call number: </span><xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
+ <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: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>
<span class="available">
<b><xsl:text>Items available for reference: </xsl:text></b>
<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', concat(items:status, ' ', items:homebranch))[1])]">
+ <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
<span class="ItemSummary">
<xsl:if test="$singleBranchMode=0">
<xsl:value-of select="items:homebranch"/>
</xsl:if>
<xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<span class="LabelCallNumber">Call number: </span><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:value-of select="count(key('item-by-status-and-branch-home', 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>
</span>
<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', concat(items:status, ' ', items:homebranch))[1])]">
+ <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'"><b><xsl:value-of select="concat(items:location,' ')"/></b></xsl:when>
<xsl:when test="$OPACItemLocation='ccode'"><b><xsl:value-of select="concat(items:ccode,' ')"/></b></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', concat(items:status, ' ', items:homebranch))[1])]">
+ <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'"><b><xsl:value-of select="concat(items:location,' ')"/></b></xsl:when>
<xsl:when test="$OPACItemLocation='ccode'"><b><xsl:value-of select="concat(items:ccode,' ')"/></b></xsl:when>