From d753993290a867752fcdd439fe65e94691a996fb Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Wed, 5 Jun 2019 16:26:34 +0200 Subject: [PATCH] Bug 23050: Plugin hook to add tabs in intranet biblio details page Test Plan: 1) Enable plugins 2) Download and install the latest version of this plugin https://git.biblibre.com/biblibre/koha-plugin-intranet-detail-hook 3) Browse to catalogue/detail.pl for a record 4) Note you see two new tabs with content Signed-off-by: Claire Gravely Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize --- catalogue/detail.pl | 17 ++++++++++++++++- .../prog/en/modules/catalogue/detail.tt | 9 +++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 303d709c7b..1103d2ee1c 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -69,8 +69,23 @@ if ( C4::Context->preference('UseKohaPlugins') && my @plugins = Koha::Plugins->new()->GetPlugins({ method => 'intranet_catalog_biblio_enhancements_toolbar_button' }); + + my @tab_plugins = Koha::Plugins->new()->GetPlugins({ + method => 'intranet_catalog_biblio_tab', + }); + my @tabs; + foreach my $tab_plugin (@tab_plugins) { + my @biblio_tabs = $tab_plugin->intranet_catalog_biblio_tab(); + foreach my $tab (@biblio_tabs) { + $tab->{id} = $tab->{title}; + $tab->{id} =~ s/[^\w]+/-/g; + push @tabs, $tab, + } + } + $template->param( - plugins => \@plugins + plugins => \@plugins, + tabs => \@tabs, ); } 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 f3bb3a1bf4..19b54a0eb5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -191,6 +191,9 @@ [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %] [% END %] +[% FOREACH tab IN tabs %] +
  • [% tab.title %]
  • +[% END %] [% items_table_block_iter = 0 %] @@ -722,6 +725,12 @@ [% END %] +[% FOREACH tab IN tabs %] +
    + [% tab.content | $raw %] +
    +[% END %] +
    -- 2.39.5