3 # Koha library project www.koha-community.org
5 # Copyright 2007 Liblime
6 # Parts copyright 2010 BibLibre
8 # This file is part of Koha.
10 # Koha is free software; you can redistribute it and/or modify it under the
11 # terms of the GNU General Public License as published by the Free Software
12 # Foundation; either version 2 of the License, or (at your option) any later
15 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
16 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
17 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License along
20 # with Koha; if not, write to the Free Software Foundation, Inc.,
21 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 # standard or CPAN modules used
27 use CGI
qw(:standard);
41 my $biblionumber= $input->param('id');
42 my $importid= $input->param('importid');
43 my $view= $input->param('viewas')||'';
47 my ($marc) = GetImportRecordMarc
($importid);
48 $record = MARC
::Record
->new_from_usmarc($marc);
51 $record =GetMarcBiblio
($biblionumber);
55 my $themelang = '/' . C4
::Context
->preference("opacthemes") . '/' . C4
::Templates
::_current_language
();
56 my $xmlrecord= $importid?
$record->as_xml(): GetXmlBiblio
($biblionumber);
58 C4
::Context
->config('intrahtdocs') . $themelang . "/xslt/compact.xsl";
59 my $parser = XML
::LibXML
->new();
60 my $xslt = XML
::LibXSLT
->new();
61 my $source = $parser->parse_string($xmlrecord);
62 my $style_doc = $parser->parse_file($xslfile);
63 my $stylesheet = $xslt->parse_stylesheet($style_doc);
64 my $results = $stylesheet->transform($source);
65 my $newxmlrecord = $stylesheet->output_string($results);
66 print $input->header(-charset
=> 'UTF-8'), Encode
::encode_utf8
($newxmlrecord);
69 my ( $template, $loggedinuser, $cookie ) = get_template_and_user
(
71 template_name
=> "catalogue/showmarc.tmpl",
75 flagsrequired
=> { catalogue
=> 1 },
79 $template->param( MARC_FORMATTED
=> $record->as_formatted );
80 output_html_with_http_headers
$input, $cookie, $template->output;