Bug 33758: Add a parameter to use the intranet_catalog_biblio_enhancements_toolbar_button Plugin hook
This patch adds a parameter to call the method intranet_catalog_biblio_enhancements_toolbar_button with a biblionumber in the page catalogue/detail.pl. Modification of cat-toolbar.inc to display new buttons correctly. To test : 1. Apply the patch 2. Take a plugin who implements the method intranet_catalog_biblio_enhancements_toolbar_button 3. Check if the parameter biblionumber is passed correctly at this method 4. Create the new button in HTML in the plugin method (button must be like the ones that are in the toolbar of the page detail.pl) 5. Go to the page in browser and check if the new button is displayed Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
1e0442b847
commit
6490728051
|
|
@ -317,7 +317,7 @@
|
|||
[% END %]
|
||||
|
||||
[% FOREACH p IN plugins %]
|
||||
[% p.intranet_catalog_biblio_enhancements_toolbar_button | $raw %]
|
||||
[% p.intranet_catalog_biblio_enhancements_toolbar_button({ biblionumber => biblionumber }) | $raw %]
|
||||
[% END %]
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -397,7 +397,8 @@ subtest 'Koha::Plugin::Test' => sub {
|
|||
|
||||
ok( can_load( modules => { "Koha::Plugin::Test" => undef } ), 'Test can_load' );
|
||||
|
||||
my $plugin = Koha::Plugin::Test->new( { enable_plugins => 1, cgi => CGI->new } );
|
||||
my $plugin = Koha::Plugin::Test->new( { enable_plugins => 1, cgi => CGI->new } );
|
||||
my $biblionumber = 1;
|
||||
|
||||
isa_ok( $plugin, "Koha::Plugin::Test", 'Test plugin class' );
|
||||
isa_ok( $plugin, "Koha::Plugins::Base", 'Test plugin parent class' );
|
||||
|
|
@ -406,9 +407,10 @@ subtest 'Koha::Plugin::Test' => sub {
|
|||
ok( $plugin->can('tool'), 'Test plugin can tool' );
|
||||
ok( $plugin->can('to_marc'), 'Test plugin can to_marc' );
|
||||
ok( $plugin->can('intranet_catalog_biblio_enhancements'), 'Test plugin can intranet_catalog_biblio_enhancements' );
|
||||
ok(
|
||||
$plugin->can('intranet_catalog_biblio_enhancements_toolbar_button'),
|
||||
'Test plugin can intranet_catalog_biblio_enhancements_toolbar_button'
|
||||
is(
|
||||
$plugin->intranet_catalog_biblio_enhancements_toolbar_button( { biblionumber => $biblionumber } ),
|
||||
$biblionumber,
|
||||
'Test plugin can intranet_catalog_biblio_enhancements_toolbar_button with biblionumber parameter'
|
||||
);
|
||||
ok( $plugin->can('opac_online_payment'), 'Test plugin can opac_online_payment' );
|
||||
ok( $plugin->can('after_hold_create'), 'Test plugin can after_hold_create' );
|
||||
|
|
|
|||
|
|
@ -55,8 +55,9 @@ sub to_marc {
|
|||
}
|
||||
|
||||
sub intranet_catalog_biblio_enhancements_toolbar_button {
|
||||
my ( $self, $args ) = @_;
|
||||
return "Koha::Plugin::Test::intranet_catalog_biblio_enhancements_toolbar_button";
|
||||
my ( $self, $params ) = @_;
|
||||
my $biblionumber = $params->{biblionumber};
|
||||
return $biblionumber;
|
||||
}
|
||||
|
||||
sub intranet_catalog_biblio_enhancements {
|
||||
|
|
|
|||
Loading…
Reference in New Issue