View | Details | Raw Unified | Return to bug 21579
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/showdiffmarc.tt (-2 / +2 lines)
Lines 26-35 Link Here
26
            <h1>Original</h1>
26
            <h1>Original</h1>
27
            [% IF ( ERROR_FORMATTED1 ) %]
27
            [% IF ( ERROR_FORMATTED1 ) %]
28
                <div class="dialog alert">
28
                <div class="dialog alert">
29
                    <p>The biblionumber <em>[% BIBLIONUMBER | html %]</em> doesn't match any existing record.</p>
29
                    <p>The record id <em>[% RECORDID | html %]</em> doesn't match any existing record.</p>
30
                </div>
30
                </div>
31
            [% ELSE %]
31
            [% ELSE %]
32
                <h2>[% BIBLIOTITLE | html %]</h2>
32
                <h2>[% RECORDTITLE | html %]</h2>
33
                <pre>[% MARC_FORMATTED1 | html %]</pre>
33
                <pre>[% MARC_FORMATTED1 | html %]</pre>
34
            [% END %]
34
            [% END %]
35
        </div>
35
        </div>
(-)a/tools/batch_records_ajax.pl (-1 / +1 lines)
Lines 107-113 foreach my $record (@$records) { Link Here
107
          || q{},
107
          || q{},
108
        score => $#$match > -1 ? $match->[0]->{'score'} : 0,
108
        score => $#$match > -1 ? $match->[0]->{'score'} : 0,
109
        match_id => $match_id,
109
        match_id => $match_id,
110
        diff_url => $match_id ? "/cgi-bin/koha/tools/showdiffmarc.pl?batchid=$import_batch_id&importid=$record->{import_record_id}&id=$match_id" : undef
110
        diff_url => $match_id ? "/cgi-bin/koha/tools/showdiffmarc.pl?batchid=$import_batch_id&importid=$record->{import_record_id}&id=$match_id&type=$record->{record_type}" : undef
111
      };
111
      };
112
}
112
}
113
113
(-)a/tools/showdiffmarc.pl (-14 / +21 lines)
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
- 

Return to bug 21579