canreservefromotherbranches => C4::Context->preference('canreservefromotherbranches'),
intranetreadinghistory => C4::Context->preference("intranetreadinghistory"),
noItemTypeImages => C4::Context->preference("noItemTypeImages"),
+ singleBranchMode => C4::Context->preference("singleBranchMode"),
);
}
else {
'item-level_itypes' => C4::Context->preference('item-level_itypes'),
'Version' => C4::Context->preference('Version'),
yuipath => C4::Context->preference("yuipath"),
+ singleBranchMode => C4::Context->preference("singleBranchMode"),
+ XSLTResultsDisplay => C4::Context->preference("XSLTResultsDisplay"),
+ XSLTDetailsDisplay => C4::Context->preference("XSLTDetailsDisplay"),
);
}
$template->param(listloop=>[{shelfname=>"Freelist", shelfnumber=>110}]);
use C4::Search::PazPar2;
use XML::Simple;
use C4::Dates qw(format_date);
+use C4::XSLT;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $DEBUG);
push @available_items_loop, $available_items->{$key}
}
-# last check for norequest : if itemtype is notforloan, it can't be reserved either, whatever the items
+ # XSLT processing of some stuff
+ if (C4::Context->preference("XSLTResultsDisplay") ) {
+ my $newxmlrecord = XSLTParse4Display($oldbiblio->{biblionumber},'Results');
+ $oldbiblio->{XSLTResultsRecord} = $newxmlrecord;
+ }
+
+ # last check for norequest : if itemtype is notforloan, it can't be reserved either, whatever the items
$can_place_holds = 0
if $itemtypes{ $oldbiblio->{itemtype} }->{notforloan};
$oldbiblio->{norequests} = 1 unless $can_place_holds;
--- /dev/null
+package C4::XSLT;
+# Copyright (C) 2006 LibLime
+# <jmf at liblime dot com>
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA 02111-1307 USA
+
+use C4::Context;
+use C4::Branch;
+use C4::Items;
+use C4::Koha;
+use C4::Biblio;
+use XML::LibXML;
+use XML::LibXSLT;
+
+use strict;
+
+use vars qw($VERSION @ISA @EXPORT);
+
+BEGIN {
+ require Exporter;
+ $VERSION = 0.03;
+ @ISA = qw(Exporter);
+ @EXPORT = qw(
+ &XSLTParse4Display
+ );
+}
+
+=head1 NAME
+
+C4::XSLT - Functions for displaying XSLT-generated content
+
+=head1 FUNCTIONS
+
+=head1 transformMARCXML4XSLT
+
+=head2 replaces codes with authorized values in a MARCXML record
+
+=cut
+
+sub transformMARCXML4XSLT {
+ my ($biblionumber) = @_;
+ my $record = GetMarcBiblio($biblionumber);
+ my $biblio = GetBiblioData($biblionumber);
+ my $frameworkcode = GetFrameworkCode($biblionumber);
+ my $tagslib = &GetMarcStructure(1,$frameworkcode);
+ my @fields = $record->fields();
+ my $list_of_authvalues = getAuthorisedValues4MARCSubfields($frameworkcode);
+ for my $authvalue (@$list_of_authvalues) {
+ for my $field ( $record->field($authvalue->{tagfield}) ) {
+ my @newSubfields = ();
+ for my $subfield ( $field->subfields() ) {
+ my ($code,$data) = @$subfield;
+ unless ($code eq $authvalue->{tagsubfield}) {
+ push ( @newSubfields, $code, $data );
+ } else {
+ my $newvalue = GetAuthorisedValueDesc( $authvalue->{tagfield}, $code, $data, '', $tagslib );
+ push ( @newSubfields, $code, $newvalue );
+ }
+ }
+ my $newField = MARC::Field->new(
+ $authvalue->{tagfield},
+ $field->indicator(1),
+ $field->indicator(2),
+ $authvalue->{tagsubfield} => @newSubfields
+ );
+ $field->replace_with($newField);
+ }
+ }
+ return $record;
+}
+
+=head1 getAuthorisedValues4MARCSubfields
+
+=head2 returns an array of hash refs for authorised value tag/subfield combos for a given framework
+
+=cut
+
+sub getAuthorisedValues4MARCSubfields {
+ my ($frameworkcode) = @_;
+ my @results;
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("SELECT DISTINCT tagfield,tagsubfield FROM marc_subfield_structure WHERE authorised_value IS NOT NULL AND authorised_value!='' AND frameworkcode=?");
+ $sth->execute($frameworkcode);
+ while (my $result = $sth->fetchrow_hashref()) {
+ push @results, $result;
+ }
+ return \@results;
+}
+
+sub XSLTParse4Display {
+ my ($biblionumber,$type) = @_;
+ # grab the XML, run it through our stylesheet, push it out to the browser
+ my $record = transformMARCXML4XSLT($biblionumber);
+ my $itemsxml = buildKohaItemsNamespace($biblionumber);
+ my $xmlrecord = $record->as_xml();
+ $xmlrecord =~ s/\<\/record\>/$itemsxml\<\/record\>/;
+ my $xslfile = C4::Context->config('intranetdir')."/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPAC$type.xsl";
+ my $parser = XML::LibXML->new();
+ # don't die when you find &, >, etc
+ $parser->recover_silently(1);
+ my $xslt = XML::LibXSLT->new();
+ my $source = $parser->parse_string($xmlrecord);
+ my $style_doc = $parser->parse_file($xslfile);
+ my $stylesheet = $xslt->parse_stylesheet($style_doc);
+ my $results = $stylesheet->transform($source);
+ my $newxmlrecord = $stylesheet->output_string($results);
+ return $newxmlrecord;
+}
+
+sub buildKohaItemsNamespace {
+ my ($biblionumber) = @_;
+ my @items = C4::Items::GetItemsInfo($biblionumber);
+ my $branches = GetBranches();
+ my $itemtypes = GetItemTypes();
+ my $xml;
+ for my $item (@items) {
+ my $status;
+ if ($item->{onloan}) {
+ $status = "On loan";
+ } else {
+ $status = "available";
+ }
+ $xml.="<item><homebranch>".$branches->{$item->{homebranch}}->{'branchname'}."</homebranch>"."<status>$status</status></item>";
+ }
+ return "<items xmlns='http://www.koha.org/items'>".$xml."</items>";
+}
+
+
+
+1;
+__END__
+
+=head1 NOTES
+
+=head1 AUTHOR
+
+Joshua Ferraro <jmf@liblime.com>
+
+=cut
</table>
</div>
<div id="team">
- <h2>Special thanks to the following libraries</h2>
+ <h2>Special thanks to the following organizations</h2>
<ul>
<li><strong><a href="http://library.org.nz">Horowhenua Library Trust</a></strong>, New Zealand, and Rosalie Blake, Head of Libraries, (Koha 1.0)</li>
<li>The <strong><a href="http://myacpl.org">Nelsonville Public Library System</a></strong>, Ohio, USA (MARC sponsorship, documentation, template maintenance)</li>
<li>The <strong><a href="http://ccfls.org">Crawford County Federated Library System</a></strong>, PA, USA (Koha 3.0 Zebra Integration sponsorship)</li>
<li>The <strong><a href="http://library.neu.edu.tr">Near East University</a></strong>, Cyprus</li>
<li><strong>OPUS International Consultants</strong>, Wellington, New Zealand (Corporate Serials sponsorship)</li>
+ <li><strong><a href="http://www.famfamfam.com/">famfamfam.com</a></strong> Birmingham (UK) based developer Mark James for the famfamfam Silk iconset.</li>
</ul>
<h2>Development team</h2>
}
td.resultscontrol {
- background-color : #EFF1DC;
+ background-color : #EEE;
vertical-align : middle;
padding : 3px 3px 5px 5px;
}
}
th {
- background-color:#EFF1DC;
+ background-color:#EEE;
font-weight : bold;
padding : 2px 23px;
text-align : center;
}
#search-facets h4 {
- background-color : #EFF1DC;
+ background-color : #EEE;
border-bottom : 1px solid #e8e8e8;
font-size : 90%;
margin : 0;
}
a:link.nav {
- background-color: #EFF1DC;
+ background-color: #EEE;
border: 1px solid #CCCC99;
color: #3366CC;
font-weight: bold;
}
a:visited.nav {
- background-color: #EFF1DC;
+ background-color: #EEE;
border: 1px solid #CCCC99;
color: #3366CC;
font-weight: bold;
#shelfbrowser dl img {vertical-align:bottom;padding:2px;background:#fff;margin-top:0;}
#shelfbrowser em {display:block;font-weight:bold;margin-bottom:5px;font-style:normal;}
#shelfbrowser dl div {float:left;}
-#shelfbrowser img {margin-top:3.5em;}
\ No newline at end of file
+#shelfbrowser img {margin-top:3.5em;}
<img border="0" src="http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif" alt="Cover Image" />
<!-- /TMPL_IF --></div>
<!-- /TMPL_IF -->
- <div id="views"> <h1><!-- TMPL_VAR NAME="title" --> <!-- TMPL_IF NAME="subtitle" --> <span class="subtitle"><!-- TMPL_VAR NAME="subtitle" --></span><!-- /TMPL_IF --></h1> <span class="views"><span id="Normalview">Normal View</span> <a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->">MARC View</a> <!-- TMPL_IF NAME="ISBD" --><a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->">ISBD View</a><!-- /TMPL_IF --></span></div>
+<!-- TMPL_IF NAME="XSLTDetailsDisplay" -->
+<!-- TMPL_VAR NAME="XSLTBloc" -->
+<!-- TMPL_ELSE -->
+ <div id="views">
+ <h1><!-- TMPL_VAR NAME="title" --> <!-- TMPL_IF NAME="subtitle" --> <span class="subtitle"><!-- TMPL_VAR NAME="subtitle" --></span><!-- /TMPL_IF --></h1> <span class="views"><span id="Normalview">Normal View</span> <a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->">MARC View</a> <!-- TMPL_IF NAME="ISBD" --><a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->">ISBD View</a><!-- /TMPL_IF --></span>
+ </div>
+
<!-- TMPL_IF NAME="author" --><h2 class="author">By <a href="/cgi-bin/koha/opac-search.pl?q=au:<!-- TMPL_VAR NAME="author" -->"><!-- TMPL_VAR NAME="author" ESCAPE="HTML" --></a></h2><!-- /TMPL_IF -->
<p><!-- TMPL_UNLESS NAME="item-level_itypes" -->
[
<!-- /TMPL_LOOP -->
</p>
<!-- /TMPL_IF -->
-
<!-- TMPL_IF name="editionstatement" -->
<p><span class="label">Edition statement:</span><!-- TMPL_VAR name="editionstatement" --><!-- TMPL_IF name="editionresponsibility" -->/<!-- TMPL_VAR name="editionresponsibility" --><!-- /TMPL_IF--></p>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="notes" --><ul><!-- TMPL_LOOP NAME="notes" --><li><!-- TMPL_VAR NAME="note" --></li><!-- /TMPL_LOOP --></ul><!-- /TMPL_IF --></li>
<!-- /TMPL_LOOP --></ul>
<!-- /TMPL_IF -->
+<!-- /TMPL_IF -->
</div>
<div id="bibliodescriptions" class="toptabs">
<!-- TMPL_IF NAME="item-level_itypes" --><td><!-- TMPL_IF NAME="imageurl" --><img src="<!-- TMPL_VAR NAME="imageurl" -->" title="<!-- TMPL_VAR name="description" -->" alt="<!-- TMPL_VAR NAME="description" -->" /><!-- /TMPL_IF --> <!-- TMPL_VAR name="description" -->
</td><!-- /TMPL_IF -->
- <td><!-- TMPL_IF NAME="singleBranchMode" --><!-- TMPL_VAR NAME="location_description" --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="branchname" --> <!-- /TMPL_IF --><!-- TMPL_VAR name="location_description" --> <!-- TMPL_IF NAME="itemcallnumber" --> <!-- TMPL_VAR NAME="itemcallnumber" --><!-- /TMPL_IF --> <!-- TMPL_IF NAME="OPACShelfBrowser" -->(<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&shelfbrowse_itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->#shelfbrowser">Browse Shelf</a>)<!-- /TMPL_IF --></td>
+ <td><!-- TMPL_UNLESS NAME="singleBranchMode" --><!-- TMPL_VAR NAME="branchname" --><!-- /TMPL_UNLESS --> <!-- TMPL_VAR name="location_description" --> <!-- TMPL_IF NAME="itemcallnumber" --> <!-- TMPL_VAR NAME="itemcallnumber" --><!-- /TMPL_IF --> <!-- TMPL_IF NAME="OPACShelfBrowser" -->(<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&shelfbrowse_itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->#shelfbrowser">Browse Shelf</a>)<!-- /TMPL_IF --></td>
<td><!-- TMPL_IF name="bi_notforloan" -->
Not for loan
<!-- TMPL_ELSE -->
<!-- TMPL_ELSE -->
<tr>
<!-- /TMPL_IF -->
+ <!-- TMPL_IF NAME="XSLTResultsDisplay" -->
+ <!-- TMPL_VAR NAME="XSLTResultsRecord" -->
+ <!-- TMPL_ELSE -->
<td><!-- TMPL_IF NAME="AmazonContent" -->
<a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><!-- TMPL_IF NAME="isbn" --><img src="http://images.amazon.com/images/P/<!-- TMPL_VAR name="isbn" -->.01.TZZZZZZZ.jpg" alt="" class="thumbnail" /><!-- TMPL_ELSE --><img src="http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif" alt="" class="thumbnail" /><!-- /TMPL_IF -->
</a>
<!-- TMPL_IF name="size" -->, <!-- TMPL_VAR name="size" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="timestamp" --> <i>(modified on <!-- TMPL_VAR name="timestamp" -->)</i><!-- /TMPL_IF -->
</p>
+ <!-- TMPL_VAR NAME="copyrightdate" -->
<!--TMPL_IF Name="searchhighlightblob"--><p class="searchhighlightblob"><!-- TMPL_VAR NAME="searchhighlightblob" --></p><!--/TMPL_IF-->
<p class="availability">
<!-- TMPL_IF NAME="available_items_loop" -->
- <span class="available"><strong>Copies available at:</strong>
+ <span class="available"><strong>Copies available:</strong>
<!-- TMPL_LOOP NAME="available_items_loop" -->
- <!-- TMPL_IF NAME="branchname" --><!-- TMPL_VAR NAME="branchname" --><!-- /TMPL_IF -->
+
+ <!-- TMPL_IF NAME="singleBranchMode" -->
+ <!-- TMPL_VAR NAME="location" -->
+ <!-- TMPL_ELSE -->
+ <!-- TMPL_VAR NAME="branchname" -->
+ <!-- /TMPL_IF -->
+
<!-- TMPL_IF name="OPACItemsResultsDisplay" -->
<!-- TMPL_IF NAME="location" --><!-- TMPL_VAR NAME="location" --><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="itemcallnumber" -->[<a href="/cgi-bin/koha/opac-search.pl?q=callnum:<!-- TMPL_VAR NAME="itemcallnumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="itemcallnumber" --></a>]<!-- /TMPL_IF -->
<a href="/cgi-bin/koha/opac-search.pl?q=callnum:<!-- TMPL_VAR NAME="itemcallnumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="itemcallnumber" --></a>
<!-- /TMPL_IF --></p>
</td>
+ <!-- /TMPL_IF -->
</tr>
<!-- /TMPL_LOOP -->
</table>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
+<xsl:stylesheet version="1.0"
+ xmlns:marc="http://www.loc.gov/MARC21/slim"
+ xmlns:items="http://www.koha.org/items"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ exclude-result-prefixes="marc items">
+ <xsl:import href="MARC21slimUtils.xsl"/>
+ <xsl:output method="html" indent="yes"/>
+
+ <xsl:template match="/">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="marc:record">
+ <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)"/>
+ <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
+ <xsl:variable name="materialTypeCode">
+ <xsl:choose>
+ <xsl:when test="$leader6='a'">
+ <xsl:choose>
+ <xsl:when test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
+ <xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'">SE</xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$leader6='t'">BK</xsl:when>
+ <xsl:when test="$leader6='p'">MM</xsl:when>
+ <xsl:when test="$leader6='m'">CF</xsl:when>
+ <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
+ <xsl:when test="$leader6='g' or $leader6='k' or $leader6='o' or $leader6='r'">VM</xsl:when>
+ <xsl:when test="$leader6='c' or $leader6='d' or $leader6='i' or $leader6='j'">MU</xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="materialTypeLabel">
+ <xsl:choose>
+ <xsl:when test="$leader6='a'">
+ <xsl:choose>
+ <xsl:when test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'">Book</xsl:when>
+ <xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'">Serial</xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$leader6='t'">Book</xsl:when>
+ <xsl:when test="$leader6='p'">Mixed Materials</xsl:when>
+ <xsl:when test="$leader6='m'">Computer File</xsl:when>
+ <xsl:when test="$leader6='e' or $leader6='f'">Map</xsl:when>
+ <xsl:when test="$leader6='g' or $leader6='k' or $leader6='o' or $leader6='r'">Visual Material</xsl:when>
+ <xsl:when test="$leader6='c' or $leader6='d' or $leader6='i' or $leader6='j'">Music</xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- Title Statement -->
+<style type="text/css">
+ .label {
+ font-size: 80%;
+ color: grey;
+ }
+</style>
+ <div id="views">
+ <xsl:if test="marc:datafield[@tag=245]">
+ <h1>
+ <xsl:for-each select="marc:datafield[@tag=245]">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">abfghk</xsl:with-param>
+ </xsl:call-template>
+ </xsl:for-each>
+ </h1>
+ </xsl:if>
+
+ <span class="views"><span id="Normalview">Normal View</span> <a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber={marc:datafield[@tag=999]/marc:subfield[@code='c']}">MARC View</a> <a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber={marc:datafield[@tag=999]/marc:subfield[@code='c']}">Card View (ISBD)</a></span>
+ </div>
+
+ <xsl:choose>
+ <xsl:when test="marc:datafield[@tag=100] or marc:datafield[@tag=110] or marc:datafield[@tag=111] or marc:datafield[@tag=700] or marc:datafield[@tag=710] or marc:datafield[@tag=711]">
+
+ <h5 class="author">by
+ <xsl:for-each select="marc:datafield[@tag=100 or @tag=700]">
+ <a>
+ <xsl:choose>
+ <xsl:when test="marc:subfield[@code=9]">
+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="nameABCDQ"/></a>
+ <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:for-each select="marc:datafield[@tag=110 or @tag=710]">
+ <a>
+ <xsl:choose>
+ <xsl:when test="marc:subfield[@code=9]">
+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="nameABCDN"/></a>
+ <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:for-each select="marc:datafield[@tag=111 or @tag=711]">
+ <a>
+ <xsl:choose>
+ <xsl:when test="marc:subfield[@code=9]">
+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="nameACDEQ"/></a>
+ <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>
+ </h5>
+ </xsl:when>
+ </xsl:choose>
+
+ <div class="summary">
+
+ <xsl:if test="$materialTypeCode">
+ <p><span class="label">Type: </span>
+ <img src="/opac-tmpl/prog/famfamfam/{$materialTypeCode}.png"/><xsl:value-of select="$materialTypeLabel"/>
+ </p>
+ </xsl:if>
+ <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
+ <p><span class="label">Series: </span>
+ <xsl:for-each select="marc:datafield[@tag=440]">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">av</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="part"/>
+ <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:for-each select="marc:datafield[@tag=490][@ind1=0]">
+ <a href="/cgi-bin/koha/opac-search.pl?se:{marc:subfield[@code='a']}">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">av</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </a>
+ <xsl:call-template name="part"/>
+ <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>
+ </p>
+ </xsl:if>
+ <xsl:if test="marc:datafield[@tag=260]">
+ <p><span class="label">Publisher: </span>
+ <xsl:for-each select="marc:datafield[@tag=260]">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">bcg</xsl:with-param>
+ </xsl:call-template>
+ </xsl:for-each>
+ </p>
+ </xsl:if>
+ <xsl:if test="marc:datafield[@tag=020]">
+ <p><span class="label">ISBN: </span>
+ <xsl:for-each select="marc:datafield[@tag=020]">
+ <xsl:value-of select="marc:subfield[@code='a']"/>
+ </xsl:for-each>
+ </p>
+ </xsl:if>
+
+ <xsl:if test="marc:datafield[@tag=022]">
+ <p><span class="label">ISSN: </span>
+ <xsl:for-each select="marc:datafield[@tag=022]">
+ <xsl:value-of select="marc:subfield[@code='a']"/>
+ </xsl:for-each>
+ </p>
+ </xsl:if>
+
+ <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
+ <p><span class="label">Uniform titles: </span>
+ <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
+ <xsl:variable name="str">
+ <xsl:for-each select="marc:subfield">
+ <xsl:if test="(contains('adfklmor',@code) and (not(../marc:subfield[@code='n' or @code='p']) or (following-sibling::marc:subfield[@code='n' or @code='p'])))">
+ <xsl:value-of select="text()"/>
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:for-each>
+ </p>
+ </xsl:if>
+
+ <xsl:if test="marc:datafield[@tag=650]">
+ <p><span class="label">Related Subjects: </span>
+ <xsl:for-each select="marc:datafield[@tag=650]">
+ <a>
+ <xsl:choose>
+ <xsl:when test="marc:subfield[@code=9]">
+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=su:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">abcdvxyz</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </a>
+ <xsl:choose>
+ <xsl:when test="position()=last()"></xsl:when>
+ <xsl:otherwise> | </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:for-each>
+ </p>
+ </xsl:if>
+
+ <xsl:if test="marc:datafield[@tag=856]">
+ <p><span class="label">Online Resources: </span>
+ <xsl:for-each select="marc:datafield[@tag=856]">
+ <a><xsl:attribute name="href"> <xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
+ <xsl:if test="marc:subfield[@code='y' or @code='3' or @code='z']">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">y3z</xsl:with-param>
+ </xsl:call-template>
+ </xsl:if></a>
+ <xsl:choose>
+ <xsl:when test="position()=last()"></xsl:when>
+ <xsl:otherwise> | </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:for-each>
+ </p>
+ </xsl:if>
+
+ <!-- 780 -->
+ <xsl:if test="marc:datafield[@tag=780]/marc:subfield[@code='a']">
+ <xsl:for-each select="marc:datafield[@tag=780]">
+ <p><span class="label">
+ <xsl:choose>
+ <xsl:when test="@ind2=0">
+ Continues:
+ </xsl:when>
+ <xsl:when test="@ind2=1">
+ Continues in part:
+ </xsl:when>
+ <xsl:when test="@ind2=2">
+ Supersedes:
+ </xsl:when>
+ <xsl:when test="@ind2=3">
+ Supersedes in part:
+ </xsl:when>
+ <xsl:when test="@ind2=4">
+ Formed by the union: ... and: ...
+ </xsl:when>
+ <xsl:when test="@ind2=5">
+ Absorbed:
+ </xsl:when>
+ <xsl:when test="@ind2=6">
+ Absorbed in part:
+ </xsl:when>
+ <xsl:when test="@ind2=7">
+ Separated from:
+ </xsl:when>
+ </xsl:choose>
+ </span>
+ <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of select="marc:subfield[@code='t']"/></xsl:attribute>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">atxwg</xsl:with-param>
+ </xsl:call-template>
+ </a>
+ </p>
+ <xsl:choose>
+ <xsl:when test="@ind1=0">
+ <p><xsl:value-of select="marc:subfield[@code='n']"/></p>
+ </xsl:when>
+ </xsl:choose>
+
+ </xsl:for-each>
+ </xsl:if>
+
+ </div>
+
+ </xsl:template>
+
+ <xsl:template name="nameABCDQ">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">aq</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="punctuation">
+ <xsl:text>:,;/ </xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="termsOfAddress"/>
+ </xsl:template>
+
+ <xsl:template name="nameABCDN">
+ <xsl:for-each select="marc:subfield[@code='a']">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="."/>
+ </xsl:call-template>
+ </xsl:for-each>
+ <xsl:for-each select="marc:subfield[@code='b']">
+ <xsl:value-of select="."/>
+ </xsl:for-each>
+ <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">cdn</xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="nameACDEQ">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">acdeq</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+ <xsl:template name="termsOfAddress">
+ <xsl:if test="marc:subfield[@code='b' or @code='c']">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">bc</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="part">
+ <xsl:variable name="partNumber">
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="axis">n</xsl:with-param>
+ <xsl:with-param name="anyCodes">n</xsl:with-param>
+ <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="partName">
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="axis">p</xsl:with-param>
+ <xsl:with-param name="anyCodes">p</xsl:with-param>
+ <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="string-length(normalize-space($partNumber))">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="$partNumber"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="string-length(normalize-space($partName))">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="$partName"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="specialSubfieldSelect">
+ <xsl:param name="anyCodes"/>
+ <xsl:param name="axis"/>
+ <xsl:param name="beforeCodes"/>
+ <xsl:param name="afterCodes"/>
+ <xsl:variable name="str">
+ <xsl:for-each select="marc:subfield">
+ <xsl:if test="contains($anyCodes, @code) or (contains($beforeCodes,@code) and following-sibling::marc:subfield[@code=$axis]) or (contains($afterCodes,@code) and preceding-sibling::marc:subfield[@code=$axis])">
+ <xsl:value-of select="text()"/>
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+ </xsl:template>
+</xsl:stylesheet>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
+<xsl:stylesheet version="1.0"
+ xmlns:marc="http://www.loc.gov/MARC21/slim"
+ xmlns:items="http://www.koha.org/items"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ exclude-result-prefixes="marc items">
+ <xsl:import href="MARC21slimUtils.xsl"/>
+ <xsl:output method="html" indent="yes"/>
+ <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:template match="/">
+ <xsl:apply-templates/>
+ </xsl:template>
+ <xsl:template match="marc:record">
+ <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)"/>
+ <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
+ <xsl:variable name="materialTypeCode">
+ <xsl:choose>
+ <xsl:when test="$leader6='a'">
+ <xsl:choose>
+ <xsl:when test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
+ <xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'">SE</xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$leader6='t'">BK</xsl:when>
+ <xsl:when test="$leader6='p'">MM</xsl:when>
+ <xsl:when test="$leader6='m'">CF</xsl:when>
+ <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
+ <xsl:when test="$leader6='g' or $leader6='k' or $leader6='o' or $leader6='r'">VM</xsl:when>
+ <xsl:when test="$leader6='c' or $leader6='d' or $leader6='i' or $leader6='j'">MU</xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="materialTypeLabel">
+ <xsl:choose>
+ <xsl:when test="$leader6='a'">
+ <xsl:choose>
+ <xsl:when test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'">Book</xsl:when>
+ <xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'">Serial</xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$leader6='t'">Book</xsl:when>
+ <xsl:when test="$leader6='p'">Mixed Materials</xsl:when>
+ <xsl:when test="$leader6='m'">Computer File</xsl:when>
+ <xsl:when test="$leader6='e' or $leader6='f'">Map</xsl:when>
+ <xsl:when test="$leader6='g' or $leader6='k' or $leader6='o' or $leader6='r'">Visual Material</xsl:when>
+ <xsl:when test="$leader6='c' or $leader6='d' or $leader6='i' or $leader6='j'">Music</xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+
+<style type="text/css">
+ .results_summary {
+ font-size: 80%;
+ color: grey;
+ }
+ .select {
+ border-bottom: 1px solid #ddd; padding: 6px 5px; vertical-align: top;
+ }
+ .holdings_summary {
+ font-size: 90%;
+ }
+</style>
+
+ <td class="select">
+<input type="checkbox" id="bib{marc:datafield[@tag=999]/marc:subfield[@code='c']}" name="biblionumber" value="{marc:datafield[@tag=999]/marc:subfield[@code='c']}" title="Click to add to cart" /> <label for="bib{marc:datafield[@tag=999]/marc:subfield[@code='c']}"></label>
+ </td>
+ <td>
+ <a><xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/></xsl:attribute>
+
+ <xsl:if test="marc:datafield[@tag=245]">
+ <xsl:for-each select="marc:datafield[@tag=245]">
+ <xsl:variable name="title">
+ <xsl:choose>
+ <xsl:when test="marc:subfield[@code='b']">
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="axis">b</xsl:with-param>
+ <xsl:with-param name="beforeCodes">afghk</xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">abfgk</xsl:with-param>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="titleChop">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="$title"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="$titleChop"/>
+ <xsl:if test="marc:subfield[@code='b']">
+ <xsl:text> : </xsl:text>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="axis">b</xsl:with-param>
+ <xsl:with-param name="anyCodes">b</xsl:with-param>
+ <xsl:with-param name="afterCodes">afghk</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:call-template name="part"/>
+ </xsl:for-each>.
+ </xsl:if>
+ </a>
+ <p>
+
+ <xsl:choose>
+ <xsl:when test="marc:datafield[@tag=100] or marc:datafield[@tag=110] or marc:datafield[@tag=111] or marc:datafield[@tag=700] or marc:datafield[@tag=710] or marc:datafield[@tag=711]">
+
+ by
+ <xsl:for-each select="marc:datafield[@tag=100 or @tag=700]">
+ <xsl:choose>
+ <xsl:when test="position()=last()">
+ <xsl:call-template name="nameABCDQ"/>.
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="nameABCDQ"/>;
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=110 or @tag=710]">
+ <xsl:choose>
+ <xsl:when test="position()=last()">
+ <xsl:call-template name="nameABCDN"/>.
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="nameABCDN"/>;
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+
+ <xsl:for-each select="marc:datafield[@tag=111 or @tag=711]">
+ <xsl:choose>
+ <xsl:when test="position()=last()">
+ <xsl:call-template name="nameACDEQ"/>.
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="nameACDEQ"/>;
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+
+ </xsl:when>
+ </xsl:choose>
+ </p>
+ <span class="results_summary">
+ <xsl:if test="$materialTypeCode">
+ <span class="label">Type: </span>
+ <img src="/opac-tmpl/prog/famfamfam/{$materialTypeCode}.png"/><xsl:value-of select="$materialTypeLabel"/><br/>
+ </xsl:if>
+ <xsl:if test="marc:datafield[@tag=260]">
+ <span class="label">Publisher: </span>
+ <xsl:for-each select="marc:datafield[@tag=260]">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">bcg</xsl:with-param>
+ </xsl:call-template>
+ </xsl:for-each>
+
+ </xsl:if>
+ </span>
+ <div class="holdings_summary">
+ <xsl:if test="count(key('item-by-status', 'available'))>0">
+ <span class="available">
+ <xsl:text>Copies available at: </xsl:text>
+ <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:text> (</xsl:text>
+ <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
+ <xsl:text>) </xsl:text>
+ </xsl:for-each>
+ </span>
+ </xsl:if>
+ <xsl:if test="count(key('item-by-status', 'On loan'))>0">
+ <span class="unavailable">
+ <xsl:text>On loan (</xsl:text>
+ <xsl:value-of select="count(key('item-by-status', 'On loan'))"/>
+ <xsl:text>)</xsl:text>
+ </span>
+ </xsl:if>
+ </div>
+ </td>
+ </xsl:template>
+ <xsl:template name="nameABCDQ">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">aq</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="punctuation">
+ <xsl:text>:,;/ </xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:call-template name="termsOfAddress"/>
+ </xsl:template>
+
+ <xsl:template name="nameABCDN">
+ <xsl:for-each select="marc:subfield[@code='a']">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="."/>
+ </xsl:call-template>
+ </xsl:for-each>
+ <xsl:for-each select="marc:subfield[@code='b']">
+ <xsl:value-of select="."/>
+ </xsl:for-each>
+ <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">cdn</xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="nameACDEQ">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">acdeq</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template name="termsOfAddress">
+ <xsl:if test="marc:subfield[@code='b' or @code='c']">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">bc</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="nameDate">
+ <xsl:for-each select="marc:subfield[@code='d']">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="."/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="role">
+ <xsl:for-each select="marc:subfield[@code='e']">
+ <xsl:value-of select="."/>
+ </xsl:for-each>
+ <xsl:for-each select="marc:subfield[@code='4']">
+ <xsl:value-of select="."/>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="specialSubfieldSelect">
+ <xsl:param name="anyCodes"/>
+ <xsl:param name="axis"/>
+ <xsl:param name="beforeCodes"/>
+ <xsl:param name="afterCodes"/>
+ <xsl:variable name="str">
+ <xsl:for-each select="marc:subfield">
+ <xsl:if test="contains($anyCodes, @code) or (contains($beforeCodes,@code) and following-sibling::marc:subfield[@code=$axis]) or (contains($afterCodes,@code) and preceding-sibling::marc:subfield[@code=$axis])">
+ <xsl:value-of select="text()"/>
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+ </xsl:template>
+
+ <xsl:template name="subtitle">
+ <xsl:if test="marc:subfield[@code='b']">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="marc:subfield[@code='b']"/>
+
+ <!--<xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">b</xsl:with-param>
+ </xsl:call-template>-->
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="part">
+ <xsl:variable name="partNumber">
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="axis">n</xsl:with-param>
+ <xsl:with-param name="anyCodes">n</xsl:with-param>
+ <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="partName">
+ <xsl:call-template name="specialSubfieldSelect">
+ <xsl:with-param name="axis">p</xsl:with-param>
+ <xsl:with-param name="anyCodes">p</xsl:with-param>
+ <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="string-length(normalize-space($partNumber))">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="$partNumber"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="string-length(normalize-space($partName))">
+ <xsl:if test="string-length(normalize-space($partName))">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString" select="$partName"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+</xsl:stylesheet>
--- /dev/null
+<?xml version='1.0'?>\r
+<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\r
+ <xsl:template name="datafield">\r
+ <xsl:param name="tag"/>\r
+ <xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param>\r
+ <xsl:param name="ind2"><xsl:text> </xsl:text></xsl:param>\r
+ <xsl:param name="subfields"/>\r
+ <xsl:element name="datafield">\r
+ <xsl:attribute name="tag">\r
+ <xsl:value-of select="$tag"/>\r
+ </xsl:attribute>\r
+ <xsl:attribute name="ind1">\r
+ <xsl:value-of select="$ind1"/>\r
+ </xsl:attribute>\r
+ <xsl:attribute name="ind2">\r
+ <xsl:value-of select="$ind2"/>\r
+ </xsl:attribute>\r
+ <xsl:copy-of select="$subfields"/>\r
+ </xsl:element>\r
+ </xsl:template>\r
+\r
+ <xsl:template name="subfieldSelect">\r
+ <xsl:param name="codes"/>\r
+ <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>\r
+ <xsl:variable name="str">\r
+ <xsl:for-each select="marc:subfield">\r
+ <xsl:if test="contains($codes, @code)">\r
+ <xsl:value-of select="text()"/><xsl:value-of select="$delimeter"/>\r
+ </xsl:if>\r
+ </xsl:for-each>\r
+ </xsl:variable>\r
+ <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>\r
+ </xsl:template>\r
+\r
+ <xsl:template name="buildSpaces">\r
+ <xsl:param name="spaces"/>\r
+ <xsl:param name="char"><xsl:text> </xsl:text></xsl:param>\r
+ <xsl:if test="$spaces>0">\r
+ <xsl:value-of select="$char"/>\r
+ <xsl:call-template name="buildSpaces">\r
+ <xsl:with-param name="spaces" select="$spaces - 1"/>\r
+ <xsl:with-param name="char" select="$char"/>\r
+ </xsl:call-template>\r
+ </xsl:if>\r
+ </xsl:template>\r
+\r
+ <xsl:template name="chopPunctuation">\r
+ <xsl:param name="chopString"/>\r
+ <xsl:variable name="length" select="string-length($chopString)"/>\r
+ <xsl:choose>\r
+ <xsl:when test="$length=0"/>\r
+ <xsl:when test="contains('.:,;/ ', substring($chopString,$length,1))">\r
+ <xsl:call-template name="chopPunctuation">\r
+ <xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>\r
+ </xsl:call-template>\r
+ </xsl:when>\r
+ <xsl:when test="not($chopString)"/>\r
+ <xsl:otherwise><xsl:value-of select="$chopString"/></xsl:otherwise>\r
+ </xsl:choose>\r
+ </xsl:template>\r
+</xsl:stylesheet><!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.\r
+<metaInformation>\r
+<scenarios/><MapperInfo srcSchemaPath="" srcSchemaRoot="" srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>\r
+</metaInformation>\r
+-->
\ No newline at end of file
use C4::Review;
use C4::Serials;
use C4::Members;
+use C4::XSLT;
my $query = new CGI;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
my $biblionumber = $query->param('biblionumber') || $query->param('bib');
$template->param( biblionumber => $biblionumber );
+# XSLT processing of some stuff
+if (C4::Context->preference("XSLTResultsDisplay") ) {
+ my $newxmlrecord = XSLTParse4Display($biblionumber,'Detail');
+ $template->param('XSLTBloc' => $newxmlrecord);
+}
# change back when ive fixed request.pl
my @all_items = &GetItemsInfo( $biblionumber, 'opac' );