[Bug 24724] New: Add plugin hook for new SQL report export formats
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24724 Bug ID: 24724 Summary: Add plugin hook for new SQL report export formats Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Plugin architecture Assignee: koha-bugs@lists.koha-community.org Reporter: pasi.kallinen@koha-suomi.fi QA Contact: testopia@bugs.koha-community.org There should be a plugin hook for adding new SQL report export formats. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24724 paxed <pasi.kallinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |pasi.kallinen@koha-suomi.fi |ity.org | -- 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=24724 --- Comment #1 from paxed <pasi.kallinen@koha-suomi.fi> --- Created attachment 99574 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99574&action=edit Bug 24724: Add plugin hook for new SQL report export formats This adds plugin hooks for adding new export formats for SQL reports. The plugin should implement two new methods: - sql_report_get_export_formats Takes no parameters. Should return an array ref of hashes, with the following keys: shortname => 'dump', name => 'Name of this format', type => 'text/plain' - sql_report_process_data Takes 3 parameters: format, headers, and data. - format is string the shortname from one of the hashes in sql_report_get_export_formats. - headers is array ref of strings, column names of the data. - data is the data as returned by perl DBI fetchall_arrayref() Test plan: 1) Enable plugins, and install the example plugin for the bug 2) Create a new SQL report, eg. "SELECT * FROM BORROWERS LIMIT 30" 3) Run the report - you should see two new entries in the "Download" button: "Perl data dump (.dump)" and "HTML table (.htm)" 4) Download the new formats, and inspect the file contents that they look correct 5) Test the other entries in the download-button and that they work -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24724 --- Comment #2 from paxed <pasi.kallinen@koha-suomi.fi> --- Created attachment 99575 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99575&action=edit Plugin to test Bug 24724 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24724 paxed <pasi.kallinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24724 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #3 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- I propose you to depend on Bug 20415 that removes UseKohaPlugins system preference -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24724 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |In Discussion --- Comment #4 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Ah really nice hook. I think it could be useful for many other exports (checkouts table, ...). Use of those plugins will only be implemented only for sql reports, but can be implemented somewhere else in a second time. So I propose you some changes : 1) Only one format per plugin. 2 formats = create 2 plugins ;) Will make code more clear I bet. 2) Change methods : sub sql_report_get_export_format sub sql_report_process_data to : export_format process_export 3) Better add a method to Koha/Template/Plugin/KohaPlugins.pm to fetch the plugins you need. PS : you need to remove call to UseKohaPlugins system preference Let me know if you need help. Best regards, -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24724 --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Maybe we should keep sql in the hook name - I could imagine other spots it could be different data formats to export/convert? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24724 --- Comment #6 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- (In reply to Katrin Fischer from comment #5)
Maybe we should keep sql in the hook name - I could imagine other spots it could be different data formats to export/convert?
Ah yes I see, method should indicate where the plugin impacts. I suggest we keep "report" instead of "sql" : report_export_format report_process_export So a another place, ie checkouts, with exports will add hooks : checkouts_export_format checkouts_process_export Since a plugin can handle several hooks its fine :D -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org