From 884b136216762b77c44f532c008fb5f935f06518 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 1 Apr 2013 14:31:50 -0400 Subject: [PATCH] Bug 9965 - Improve integration of report plugins with existing reports Right now we have a link to in the Reports module to access all report plugins. It would probably be better for the report plugins were just listed on the reports page directly. Test Plan: 1) Install one or more report plugins 2) Apply patch 3) Browse to reports-home.pl 4) Observe the report plugins are listed under 'Other reports' [SIGNED-OFF] Signed off by Paola Rossi, It works Signed-off-by: Paola Rossi --- .../prog/en/modules/reports/reports-home.tt | 23 ++++++++---- reports/reports-home.pl | 37 ++++++++++++------- 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt index c7744fa..4f6ac73 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt @@ -12,7 +12,7 @@
-
+

Reports

Guided reports

    @@ -37,13 +37,6 @@
  • Holds
- [% IF UseKohaPlugins %] -

Report Plugins

- - [% END %] -

Top lists

@@ -67,6 +60,20 @@
  • Koha reports library
  • + + + [% IF UseKohaPlugins && CAN_user_plugins_report %] +
    +

    Other reports

    + + + +
    + [% END %]
    diff --git a/reports/reports-home.pl b/reports/reports-home.pl index d536b01..7e1aec7 100755 --- a/reports/reports-home.pl +++ b/reports/reports-home.pl @@ -17,26 +17,35 @@ # with Koha; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - use strict; + #use warnings; FIXME - Bug 2505 use CGI; use C4::Auth; use C4::Output; use C4::Context; - +use Koha::Plugins; my $query = new CGI; -my ($template, $loggedinuser, $cookie) -= get_template_and_user({template_name => "reports/reports-home.tmpl", - query => $query, - type => "intranet", - authnotrequired => 0, - flagsrequired => {reports => '*'}, - debug => 1, - }); -$template->param(intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), - intranetstylesheet => C4::Context->preference("intranetstylesheet"), - IntranetNav => C4::Context->preference("IntranetNav"), - ); +my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { template_name => "reports/reports-home.tmpl", + query => $query, + type => "intranet", + authnotrequired => 0, + flagsrequired => { reports => '*' }, + debug => 1, + } +); +$template->param( + intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), + intranetstylesheet => C4::Context->preference("intranetstylesheet"), + IntranetNav => C4::Context->preference("IntranetNav"), +); + +my $plugins_enabled = C4::Context->preference('UseKohaPlugins') && C4::Context->config("enable_plugins"); +if ($plugins_enabled) { + my @plugins = Koha::Plugins->new()->GetPlugins('report'); + $template->param( plugins => \@plugins, ); +} + output_html_with_http_headers $query, $cookie, $template->output; -- 1.7.2.5