Bugzilla – Attachment 185287 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.52 KB, created by
Roman Dolny
on 2025-08-08 17:26:36 UTC
(
hide
)
Description:
Bug 33758: Add a parameter to use the intranet_catalog_biblio_enhancements_toolbar_button Plugin hook
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2025-08-08 17:26:36 UTC
Size:
3.52 KB
patch
obsolete
>From 922ebdd8de6ca9b9433b08d830db8268ebfcb377 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 > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > 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 f760ebc811..37b132bece 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 22c950b795..cba1c42f5e 100755 >--- a/t/db_dependent/Koha/Plugins/Plugins.t >+++ b/t/db_dependent/Koha/Plugins/Plugins.t >@@ -267,10 +267,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 46f0732dc6..dcc663e7de 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.39.5
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
|
185236
| 185287 |
185288