[Bug 43230] New: Plugin hook for adding buttons to intranet authorities detail toolbar
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43230 Bug ID: 43230 Summary: Plugin hook for adding buttons to intranet authorities detail toolbar Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Plugin architecture Assignee: koha-bugs@lists.koha-community.org Reporter: matthias.meusburger@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: kyle@bywatersolutions.com, martin.renvoize@openfifth.co.uk, tomascohen@gmail.com Target Milestone: --- We should be able to add buttons to the authority detail toolbar, just like we can for biblios with the intranet_catalog_biblio_enhancements_toolbar_button hook (Bug 20968). -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43230 Matthias Meusburger <matthias.meusburger@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |matthias.meusburger@biblibr |ity.org |e.com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43230 --- Comment #1 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- Created attachment 203203 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203203&action=edit Bug 43230: Plugin hook for adding buttons to intranet authorities detail toolbar This patchs adds an intranet_authorities_detail_enhancements_toolbar_button hook, that allows adding one or several buttons to the intranet authorities detail toolbar. This is similar to the intranet_catalog_biblio_enhancements_toolbar_button hook (Bug 20968: Plugins: Add hooks to enable plugin integration into catalogue) but for authorities. Test plan: - With Bug 43230 applied to the koha kitchensink plugin (see https://github.com/bywatersolutions/dev-koha-plugin-kitchen-sink/pull/42), check that you have: - a "Plugin button on new authority" in the new authority toolbar (authorities/authorities.pl) - a "Plugin button on authority #<auth_id>" in the edit authority toolbar (authorities/detail.pl) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43230 Matthias Meusburger <matthias.meusburger@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff --- Comment #2 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- Added to https://wiki.koha-community.org/wiki/Koha_Plugin_Hooks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43230 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #3 from David Cook <dcook@prosentient.com.au> --- I've been thinking lately about how it would be good to have a hook or hooks that let us inject content into a variety of places rather than just one or two specific places (like the intranet authorities detail toolbar). Imagine a Template::Toolkit plugin like "Koha::Template::Plugin::ExtraContent::intranet('authorities_detail_toolbar',other_args)" Then within that Template::Toolkit plugin you'd have all the logic with Koha::Plugins->new()->GetPlugins(). I suppose we probably would need a database table registry for the keys like 'authorities_detail_toolbar' to make it performant. That is, the Koha plugin registers what "keys" it provides at install time, and then when Koha renders the templates it looks for any plugins that have those keys. I've just been thinking that way we only have to add 1 plugin hook and we can rapidly add Koha::Template::Plugin::ExtraContent::intranet() and Koha::Template::Plugin::ExtraContent::opac() into other templates. I've still got more thinking to do though... And my idea is very Template::Toolkit heavy and doesn't take into account the move to Vue.js for more of the front-end, although that could work similarly too. Extra reading: Bug 30289 - Use Template::Toolkit WRAPPER to reduce template boilerplate Bug 42534 - wrapper-staff-tool-plugin.inc interferes with js and includes in template files #For Bug 42534 I have a patch that allows plugins to push "js chunks" (but it could be anything) to the intranet-bottom.inc via the wrapper-staff-tool-plugin.inc -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43230 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- Comment on attachment 203203 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203203 Bug 43230: Plugin hook for adding buttons to intranet authorities detail toolbar Review of attachment 203203: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=43230&attachment=203203) ----------------------------------------------------------------- ::: authorities/authorities.pl @@ +677,5 @@
my $type = $authority_types->find($authtypecode); + +# Determine if we should be offering any enhancement plugin buttons +if ( C4::Context->config('enable_plugins') ) {
I think we're trying to move to Koha::Config for these checks. ::: koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt @@ +150,5 @@
<div class="alert alert-info">No plugins that can process online payments via the public catalog are installed</div> [% ELSIF method == 'intranet_catalog_biblio_enhancements' %] <div class="alert alert-info">No plugins that can enhance the bibliographic records in the staff interface are installed</div> + [% ELSIF method == 'intranet_catalog_authority_enhancements_toolbar_button' %] + <div class="dialog message">No plugins that can enhance the authorities detail in the staff interface are installed</div>
I think the classes might be wrong here as they're not consistent with the other plugins with similar messaging. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43230 --- Comment #5 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- Thank you for your feedback, David. Here is a follow-up to address these issues. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43230 --- Comment #6 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- Created attachment 203892 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203892&action=edit Bug 43230, Follow-up: Plugin hook for adding buttons to intranet authorities detail toolbar - Use Koha::Config instead of C4::Context to check if plugins are enabled - Use correct class when filtering by type of plugins hook -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org