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

(-)a/opac/opac-showmarc.pl (-17 / +25 lines)
Lines 41-67 my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ Link Here
41
    authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
41
    authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
42
    debug           => 1,
42
    debug           => 1,
43
});
43
});
44
my $biblionumber = $input->param('id');
45
$biblionumber   = int($biblionumber);
46
my $importid= $input->param('importid');
47
my $view= $input->param('viewas') || 'marc';
48
44
49
my $record_processor = Koha::RecordProcessor->new({ filters => 'ViewPolicy' });
45
my $biblionumber = $input->param('id');
50
46
51
my $record;
47
unless ( $biblionumber ) {
52
if ($importid) {
48
    print $input->redirect("/cgi-bin/koha/errors/400.pl");
53
    my ($marc) = GetImportRecordMarc($importid);
49
    exit;
54
    $record = MARC::Record->new_from_usmarc($marc);
55
}
50
}
56
else {
51
57
    $record = GetMarcBiblio({ biblionumber => $biblionumber });
52
my $biblio;
58
    my $framework = GetFrameworkCode($biblionumber);
53
$biblio = Koha::Biblios->find( $biblionumber, { prefetch => [ 'metadata' ] } );
59
    $record_processor->options({
54
60
        interface => 'opac',
55
unless ( $biblio ) {
61
        frameworkcode => $framework
56
    print $input->redirect('/cgi-bin/koha/errors/404.pl');
62
    });
57
    exit;
63
}
58
}
64
59
60
my $view= $input->param('viewas') || 'marc';
61
62
my $record_processor = Koha::RecordProcessor->new(
63
    {
64
        filters => 'ViewPolicy',
65
        options => {
66
            interface     => 'opac',
67
            frameworkcode => $biblio->frameworkcode
68
        }
69
    }
70
);
71
72
my $record = $biblio->metadata->record;
73
65
if(!ref $record) {
74
if(!ref $record) {
66
    print $input->redirect("/cgi-bin/koha/errors/404.pl");
75
    print $input->redirect("/cgi-bin/koha/errors/404.pl");
67
    exit;
76
    exit;
68
- 

Return to bug 25009