|
Lines 20-25
use Modern::Perl;
Link Here
|
| 20 |
|
20 |
|
| 21 |
use CGI qw ( -utf8 ); |
21 |
use CGI qw ( -utf8 ); |
| 22 |
use HTML::Entities; |
22 |
use HTML::Entities; |
|
|
23 |
use Try::Tiny qw( catch try ); |
| 23 |
use C4::Auth qw( get_template_and_user ); |
24 |
use C4::Auth qw( get_template_and_user ); |
| 24 |
use C4::Context; |
25 |
use C4::Context; |
| 25 |
use C4::Koha qw( |
26 |
use C4::Koha qw( |
|
Lines 74-90
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
Link Here
|
| 74 |
} |
75 |
} |
| 75 |
); |
76 |
); |
| 76 |
|
77 |
|
| 77 |
# Determine if we should be offering any enhancement plugin buttons |
|
|
| 78 |
if ( C4::Context->config('enable_plugins') ) { |
| 79 |
# Only pass plugins that can offer a toolbar button |
| 80 |
my @plugins = Koha::Plugins->new()->GetPlugins({ |
| 81 |
method => 'intranet_catalog_biblio_enhancements_toolbar_button' |
| 82 |
}); |
| 83 |
$template->param( |
| 84 |
plugins => \@plugins, |
| 85 |
); |
| 86 |
} |
| 87 |
|
| 88 |
my $biblionumber = $query->param('biblionumber'); |
78 |
my $biblionumber = $query->param('biblionumber'); |
| 89 |
$biblionumber = HTML::Entities::encode($biblionumber); |
79 |
$biblionumber = HTML::Entities::encode($biblionumber); |
| 90 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
80 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
|
Lines 98-103
unless ( $biblio ) {
Link Here
|
| 98 |
exit; |
88 |
exit; |
| 99 |
} |
89 |
} |
| 100 |
|
90 |
|
|
|
91 |
# Determine if we should be offering any enhancement plugin buttons |
| 92 |
if ( C4::Context->config('enable_plugins') ) { |
| 93 |
# Only pass plugins that can offer a toolbar button |
| 94 |
my @plugins = Koha::Plugins->new()->GetPlugins({ |
| 95 |
method => 'intranet_catalog_biblio_enhancements_toolbar_button' |
| 96 |
}); |
| 97 |
my $buttons = ""; |
| 98 |
foreach my $plugin (@plugins) { |
| 99 |
try { |
| 100 |
$buttons .= $plugin->intranet_catalog_biblio_enhancements_toolbar_button( |
| 101 |
{ |
| 102 |
biblionumber => $biblionumber, |
| 103 |
} |
| 104 |
); |
| 105 |
} |
| 106 |
catch { |
| 107 |
warn "$_"; |
| 108 |
}; |
| 109 |
} |
| 110 |
|
| 111 |
$template->param( |
| 112 |
buttons => $buttons, |
| 113 |
); |
| 114 |
} |
| 115 |
|
| 101 |
my $marc_record = eval { $biblio->metadata->record }; |
116 |
my $marc_record = eval { $biblio->metadata->record }; |
| 102 |
my $invalid_marc_record = $@ || !$marc_record; |
117 |
my $invalid_marc_record = $@ || !$marc_record; |
| 103 |
if ($invalid_marc_record) { |
118 |
if ($invalid_marc_record) { |