3 # Koha library project www.koha-community.org
5 # Licensed under the GPL
7 # Copyright 2007 Liblime
8 # Parts copyright 2010 BibLibre
10 # This file is part of Koha.
12 # Koha is free software; you can redistribute it and/or modify it under the
13 # terms of the GNU General Public License as published by the Free Software
14 # Foundation; either version 2 of the License, or (at your option) any later
17 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
18 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
19 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License along
22 # with Koha; if not, write to the Free Software Foundation, Inc.,
23 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #use warnings; FIXME - Bug 2505
28 # standard or CPAN modules used
29 use CGI
qw(:standard);
42 my $biblionumber = $input->param('id');
43 my $importid = $input->param('importid');
44 my $view = $input->param('viewas');
46 my ( $template, $loggedinuser, $cookie ) = get_template_and_user
(
48 template_name
=> "catalogue/showmarc.tmpl",
52 flagsrequired
=> { catalogue
=> 1 },
57 $template->param( SCRIPT_NAME
=> $ENV{'SCRIPT_NAME'}, );
58 my ($record, $xmlrecord);
60 my ($marc,$encoding) = GetImportRecordMarc
($importid);
61 $record = MARC
::Record
->new_from_usmarc($marc) ;
63 $xmlrecord = $record->as_xml();
68 $xmlrecord = GetXmlBiblio
($biblionumber) unless $xmlrecord;
70 my $xslfile = C4
::Context
->config('intrahtdocs')."/prog/en/xslt/compact.xsl";
71 my $parser = XML
::LibXML
->new();
72 my $xslt = XML
::LibXSLT
->new();
73 my $source = $parser->parse_string($xmlrecord);
74 my $style_doc = $parser->parse_file($xslfile);
75 my $stylesheet = $xslt->parse_stylesheet($style_doc);
76 my $results = $stylesheet->transform($source);
77 my $newxmlrecord = $stylesheet->output_string($results);
79 print "Content-type: text/html\n\n";
80 utf8
::encode
($newxmlrecord);
85 $record =GetMarcBiblio
($biblionumber) unless $record;
87 my $formatted = $record->as_formatted;
88 $template->param( MARC_FORMATTED
=> $formatted );
90 output_html_with_http_headers
$input, $cookie, $template->output;