Bugzilla – Attachment 178354 Details for
Bug 33758
Add a parameter to use the intranet_catalog_biblio_enhancements_toolbar_button Plugin hook
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33758: Add a parameter to use the intranet_catalog_biblio_enhancements_toolbar_button Plugin hook
Bug-33758-Add-a-parameter-to-use-the-intranetcatal.patch (text/plain), 3.47 KB, created by
Hammat wele
on 2025-02-19 15:11:32 UTC
(
hide
)
Description:
Bug 33758: Add a parameter to use the intranet_catalog_biblio_enhancements_toolbar_button Plugin hook
Filename:
MIME Type:
Creator:
Hammat wele
Created:
2025-02-19 15:11:32 UTC
Size:
3.47 KB
patch
obsolete
>From 36f7dcb02a9edb1252006d40bf35757af795c73e Mon Sep 17 00:00:00 2001 >From: Hammat Wele <hammat.wele@inlibro.com> >Date: Wed, 19 Feb 2025 15:09:50 +0000 >Subject: [PATCH] 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 >--- > koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc | 2 +- > t/db_dependent/Koha/Plugins/Plugins.t | 5 +---- > t/lib/plugins/Koha/Plugin/Test.pm | 5 +++-- > 3 files changed, 5 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >index 2b033e40f6..a4d37ab4b6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >@@ -307,7 +307,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> > >diff --git a/t/db_dependent/Koha/Plugins/Plugins.t b/t/db_dependent/Koha/Plugins/Plugins.t >index c8b8163b37..ad786eb52b 100755 >--- a/t/db_dependent/Koha/Plugins/Plugins.t >+++ b/t/db_dependent/Koha/Plugins/Plugins.t >@@ -266,10 +266,7 @@ 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' ); > ok( $plugin->can('before_send_messages'), 'Test plugin can before_send_messages' ); >diff --git a/t/lib/plugins/Koha/Plugin/Test.pm b/t/lib/plugins/Koha/Plugin/Test.pm >index 970c4ec7b6..f7ba3a65c9 100644 >--- a/t/lib/plugins/Koha/Plugin/Test.pm >+++ b/t/lib/plugins/Koha/Plugin/Test.pm >@@ -53,8 +53,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 { >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33758
:
151426
|
151434
|
151473
|
158160
|
163798
|
178342
| 178354 |
178355