Lines 20-33
Link Here
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
use CGI; |
21 |
use CGI; |
22 |
use C4::Auth qw( get_template_and_user ); |
22 |
use C4::Auth qw( get_template_and_user ); |
23 |
use C4::Biblio qw( GetMarcBiblio ); |
23 |
use C4::Biblio qw( GetMarcBiblio ApplyMarcOverlayRules ); |
24 |
use C4::MarcModificationTemplates qw( ModifyRecordWithTemplate ); |
24 |
use C4::MarcModificationTemplates qw( ModifyRecordWithTemplate ); |
25 |
use C4::Output qw( output_html_with_http_headers ); |
25 |
use C4::Output qw( output_html_with_http_headers ); |
|
|
26 |
|
26 |
use Koha::MetadataRecord::Authority; |
27 |
use Koha::MetadataRecord::Authority; |
|
|
28 |
use Koha::Patrons; |
27 |
|
29 |
|
28 |
my $query = CGI->new(); |
30 |
my $query = CGI->new(); |
29 |
my $record_id = $query->param('record_id'); |
31 |
my $record_id = $query->param('record_id'); |
30 |
my $record_type = $query->param('record_type') || 'biblio'; |
32 |
my $record_type = $query->param('record_type') || 'biblio'; |
|
|
33 |
my $overlay_context = $query->param('overlay_context'); |
31 |
my $mmtid = $query->param('mmtid'); # Marc modification template id |
34 |
my $mmtid = $query->param('mmtid'); # Marc modification template id |
32 |
|
35 |
|
33 |
my $record; |
36 |
my $record; |
Lines 38-52
if ( $record_type eq 'biblio' ) {
Link Here
|
38 |
$record = $authority->record; |
41 |
$record = $authority->record; |
39 |
} |
42 |
} |
40 |
|
43 |
|
41 |
if ( $mmtid ) { |
|
|
42 |
ModifyRecordWithTemplate( $mmtid, $record ); |
43 |
} |
44 |
|
45 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ |
44 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ |
46 |
template_name => "catalogue/showmarc.tt", |
45 |
template_name => "catalogue/showmarc.tt", |
47 |
query => $query, |
46 |
query => $query, |
48 |
type => "intranet", |
47 |
type => "intranet", |
49 |
}); |
48 |
}); |
50 |
|
49 |
|
|
|
50 |
|
51 |
if ($mmtid) { |
52 |
ModifyRecordWithTemplate( $mmtid, $record ); |
53 |
|
54 |
if ( $record_type eq 'biblio' |
55 |
&& C4::Context->preference('MARCOverlayRules') |
56 |
&& $overlay_context ) |
57 |
{ |
58 |
my $logged_in_user = Koha::Patrons->find($loggedinuser); |
59 |
$record = ApplyMarcOverlayRules( |
60 |
{ |
61 |
biblionumber => $record_id, |
62 |
record => $record, |
63 |
overlay_context => { |
64 |
source => $overlay_context, |
65 |
categorycode => $logged_in_user->categorycode, |
66 |
userid => $logged_in_user->userid |
67 |
}, |
68 |
} |
69 |
); |
70 |
} |
71 |
} |
72 |
|
51 |
$template->param( MARC_FORMATTED => $record->as_formatted ); |
73 |
$template->param( MARC_FORMATTED => $record->as_formatted ); |
52 |
output_html_with_http_headers $query, $cookie, $template->output; |
74 |
output_html_with_http_headers $query, $cookie, $template->output; |
53 |
- |
|
|