3 # parts copyright 2010 BibLibre
4 # This file is part of Koha
6 # Koha is free software; you can redistribute it and/or modify it under the
7 # terms of the GNU General Public License as published by the Free Software
8 # Foundation; either version 2 of the License, or (at your option) any later
11 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
12 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License along
16 # with Koha; if not, write to the Free Software Foundation, Inc.,
17 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #use warnings; FIXME - Bug 2505
27 use C4
::Languages
qw(getTranslatedLanguages);
30 my ($template, $borrowernumber, $cookie)
31 = get_template_and_user
({template_name
=> "opac-detail.tmpl",
35 flagsrequired
=> {borrow
=> 1},
39 my @languages_options = getTranslatedLanguages
($query);
40 my $languages_count = @languages_options;
41 if($languages_count > 1){
42 $template->param(languages
=> \
@languages_options);
44 my $biblionumber=$query->param('biblionumber');
45 $template->param(biblionumber
=> $biblionumber);
47 # grab the XML, run it through our stylesheet, push it out to the browser
48 my $xmlrecord = GetXmlBiblio
($biblionumber);
49 #my $xslfile = "/home/kohacat/etc/xslt/MARC21slim2HTML.xsl";
50 #my $xslfile = "/home/kohacat/etc/xslt/MARC21slim2English.xsl";
51 my $xslfile = C4
::Context
->config('intranetdir')."/koha-tmpl/intranet-tmpl/prog/en/xslt/compact.xsl";
52 my $parser = XML
::LibXML
->new();
53 my $xslt = XML
::LibXSLT
->new();
54 my $source = $parser->parse_string($xmlrecord);
55 my $style_doc = $parser->parse_file($xslfile);
56 my $stylesheet = $xslt->parse_stylesheet($style_doc);
57 my $results = $stylesheet->transform($source);
58 my $newxmlrecord = $stylesheet->output_string($results);
59 print "Content-type: text/html\n\n";