Bug 25167: (QA follow-up) Don't add a new variable
[koha-ffzg.git] / tools / tools-home.pl
index 86cfb03..69fc092 100755 (executable)
@@ -23,19 +23,18 @@ use C4::Output;
 use C4::Tags qw/get_count_by_tag_status/;
 use Koha::Reviews;
 
-my $query = new CGI;
+my $query = CGI->new;
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
         template_name   => "tools/tools-home.tt",
         query           => $query,
         type            => "intranet",
-        authnotrequired => 0,
         flagsrequired   => { tools => '*' },
         debug           => 1,
     }
 );
 
-my $pendingcomments = Koha::Reviews->search({ approved => 0 })->count;
+my $pendingcomments = Koha::Reviews->search_limited({ approved => 0 })->count;
 my $pendingtags = get_count_by_tag_status(0);
 
 $template->param(
@@ -43,4 +42,11 @@ $template->param(
     pendingtags     => $pendingtags
 );
 
+if ( C4::Context->config('enable_plugins') ) {
+    my @tool_plugins = Koha::Plugins->new()->GetPlugins({
+        method => 'tool',
+    });
+    $template->param( tool_plugins => \@tool_plugins );
+}
+
 output_html_with_http_headers $query, $cookie, $template->output;