From ab6e421152a763270e6d1e0083c433a38c86a277 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Tue, 1 Dec 2020 09:27:01 +0100 Subject: [PATCH] Bug 27120: Send biblio to Koha plugins hook 'intranet_catalog_biblio_tab' Koha plugins hook 'intranet_catalog_biblio_tab' should have the datas of the current biblio record. Koha::Biblio is aleady in template, send it with hooks call. This will be very usefull to be able to fetch external datas (wikipedia, youtube, ...) depending on current biblio record. Test plan : 1) Enable Koha plugins 2) Install plugin attached to this bug 3) Go to staff interface on a biblio record details page 4) Check you see tab 1 containing 'Tab for record {title}' 5) Check you see tab 2 containing 'Tab for record {isbn}' Signed-off-by: David Nind Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart (cherry picked from commit 3e4d37b03158aa24c5bd01a13a7acd53df8e2213) Signed-off-by: Fridolin Somers --- Koha/Template/Plugin/KohaPlugins.pm | 4 ++-- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Koha/Template/Plugin/KohaPlugins.pm b/Koha/Template/Plugin/KohaPlugins.pm index 5fe3a21b1e..b75d36c437 100644 --- a/Koha/Template/Plugin/KohaPlugins.pm +++ b/Koha/Template/Plugin/KohaPlugins.pm @@ -160,7 +160,7 @@ method to output to the list of extra cataloguing tabs on intranet pages. =cut sub get_plugins_intranet_catalog_biblio_tab { - + my ( $self, $params ) = @_; my $tabs = []; return $tabs unless C4::Context->config("enable_plugins"); @@ -176,7 +176,7 @@ sub get_plugins_intranet_catalog_biblio_tab { foreach my $plugin (@plugins) { try { - my @newtabs = $plugin->intranet_catalog_biblio_tab(); + my @newtabs = $plugin->intranet_catalog_biblio_tab($params); foreach my $newtab (@newtabs) { # Add a unique HTML id my $html_id = 'tab-'. $plugin->{class} . '-' . $newtab->title; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index ab99490483..06a53941ec 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -31,7 +31,7 @@ [% END %] [% END %] -[% SET plugins_intranet_catalog_biblio_tabs = KohaPlugins.get_plugins_intranet_catalog_biblio_tab %] +[% SET plugins_intranet_catalog_biblio_tabs = KohaPlugins.get_plugins_intranet_catalog_biblio_tab({ biblio => biblio }) %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] -- 2.39.5