3 # Koha library project www.koha-community.org
5 # Copyright 2011 Libéo
7 # This file is part of Koha.
9 # Koha is free software; you can redistribute it and/or modify it under the
10 # terms of the GNU General Public License as published by the Free Software
11 # Foundation; either version 3 of the License, or (at your option) any later
14 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License along
19 # with Koha; if not, write to the Free Software Foundation, Inc.,
20 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 # standard or CPAN modules used
25 use CGI
qw(:standard);
40 my $biblionumber = $input->param('id');
41 my $importid = $input->param('importid');
42 my $batchid = $input->param('batchid');
45 if ( not $biblionumber or not $importid ) {
46 print $input->redirect("/cgi-bin/koha/errors/404.pl");
51 my ($recordBiblionumber, $recordImportid, $biblioTitle, $importTitle, $formatted1, $formatted2,
52 $errorFormatted1, $errorFormatted2);
56 my ( $template, $loggedinuser, $cookie ) = get_template_and_user
(
58 template_name
=> "tools/showdiffmarc.tt",
62 flagsrequired
=> { tools
=> 'manage_staged_marc' },
68 $recordBiblionumber =GetMarcBiblio
($biblionumber);
69 if( $recordBiblionumber ) {
70 $formatted1 = $recordBiblionumber->as_formatted;
71 my $data = GetBiblioData
($biblionumber);
72 $biblioTitle = $data->{title
};
77 my ($marc,$encoding) = GetImportRecordMarc
($importid);
79 $recordImportid = MARC
::Record
->new_from_usmarc($marc) ;
80 $formatted2 = $recordImportid->as_formatted;
81 my $biblio = GetImportBiblios
($importid);
82 $importTitle = $biblio->[0]->{'title'};
89 SCRIPT_NAME
=> $ENV{'SCRIPT_NAME'},
90 BIBLIONUMBER
=> $biblionumber,
91 IMPORTID
=> $importid,
92 BIBLIOTITLE
=> $biblioTitle,
93 IMPORTTITLE
=> $importTitle,
94 MARC_FORMATTED1
=> $formatted1,
95 MARC_FORMATTED2
=> $formatted2,
96 ERROR_FORMATTED1
=> $errorFormatted1,
97 ERROR_FORMATTED2
=> $errorFormatted2,
101 output_html_with_http_headers
$input, $cookie, $template->output;