|
Lines 29-51
use C4::Context;
Link Here
|
| 29 |
use C4::Output; |
29 |
use C4::Output; |
| 30 |
use C4::Auth; |
30 |
use C4::Auth; |
| 31 |
use C4::Biblio; |
31 |
use C4::Biblio; |
|
|
32 |
use C4::AuthoritiesMarc; |
| 32 |
use C4::ImportBatch; |
33 |
use C4::ImportBatch; |
| 33 |
|
34 |
|
| 34 |
use Koha::Biblios; |
35 |
use Koha::Biblios; |
| 35 |
|
36 |
|
| 36 |
# Input params |
37 |
# Input params |
| 37 |
my $input = new CGI; |
38 |
my $input = new CGI; |
| 38 |
my $biblionumber = $input->param('id'); |
39 |
my $recordid = $input->param('id'); |
| 39 |
my $importid = $input->param('importid'); |
40 |
my $importid = $input->param('importid'); |
| 40 |
my $batchid = $input->param('batchid'); |
41 |
my $batchid = $input->param('batchid'); |
|
|
42 |
my $type = $input->param('type'); |
| 41 |
|
43 |
|
| 42 |
if ( not $biblionumber or not $importid ) { |
44 |
if ( not $recordid or not $importid ) { |
| 43 |
print $input->redirect("/cgi-bin/koha/errors/404.pl"); |
45 |
print $input->redirect("/cgi-bin/koha/errors/404.pl"); |
| 44 |
exit; |
46 |
exit; |
| 45 |
} |
47 |
} |
| 46 |
|
48 |
|
| 47 |
# Init vars |
49 |
# Init vars |
| 48 |
my ($recordBiblionumber, $recordImportid, $biblioTitle, $importTitle, $formatted1, $formatted2, $errorFormatted1, $errorFormatted2); |
50 |
my ($record, $recordImportid, $recordTitle, $importTitle, $formatted1, $formatted2, $errorFormatted1, $errorFormatted2); |
| 49 |
|
51 |
|
| 50 |
# Prepare template |
52 |
# Prepare template |
| 51 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
53 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
|
Lines 59-72
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
| 59 |
} |
61 |
} |
| 60 |
); |
62 |
); |
| 61 |
|
63 |
|
| 62 |
$recordBiblionumber = GetMarcBiblio({ |
64 |
if ( $type eq 'biblio' ) { |
| 63 |
biblionumber => $biblionumber, |
65 |
$record = GetMarcBiblio({ |
| 64 |
embed_items => 1, |
66 |
biblionumber => $recordid, |
| 65 |
}); |
67 |
embed_items => 1, |
| 66 |
if( $recordBiblionumber ) { |
68 |
}); |
| 67 |
$formatted1 = $recordBiblionumber->as_formatted; |
69 |
my $biblio = Koha::Biblios->find( $recordid ); |
| 68 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
70 |
$recordTitle = $biblio->title; |
| 69 |
$biblioTitle = $biblio->title; |
71 |
} |
|
|
72 |
elsif ( $type eq 'auth' ) { |
| 73 |
$record = GetAuthority( $recordid ); |
| 74 |
$recordTitle = "Authority number " . $recordid; #FIXME we should get the main heading |
| 75 |
} |
| 76 |
if( $record ) { |
| 77 |
$formatted1 = $record->as_formatted; |
| 70 |
} else { |
78 |
} else { |
| 71 |
$errorFormatted1 = 1; |
79 |
$errorFormatted1 = 1; |
| 72 |
} |
80 |
} |
|
Lines 82-90
if( $importid ) {
Link Here
|
| 82 |
|
90 |
|
| 83 |
$template->param( |
91 |
$template->param( |
| 84 |
SCRIPT_NAME => '/cgi-bin/koha/tools/showdiffmarc.pl', |
92 |
SCRIPT_NAME => '/cgi-bin/koha/tools/showdiffmarc.pl', |
| 85 |
BIBLIONUMBER => $biblionumber, |
93 |
RECORDID => $recordid, |
| 86 |
IMPORTID => $importid, |
94 |
IMPORTID => $importid, |
| 87 |
BIBLIOTITLE => $biblioTitle, |
95 |
RECORDTITLE => $recordTitle, |
| 88 |
IMPORTTITLE => $importTitle, |
96 |
IMPORTTITLE => $importTitle, |
| 89 |
MARC_FORMATTED1 => $formatted1, |
97 |
MARC_FORMATTED1 => $formatted1, |
| 90 |
MARC_FORMATTED2 => $formatted2, |
98 |
MARC_FORMATTED2 => $formatted2, |
| 91 |
- |
|
|