2008-12-15 15:53:33 +03:00
|
|
|
#!/usr/bin/perl -wT
|
2014-03-24 19:51:31 +04:00
|
|
|
# License: Dual-license GPL 3.0+ or MPL 1.1+
|
|
|
|
# Author: Vitaliy Filippov <vitalif@mail.ru> (the file is rewritten)
|
2008-12-15 15:53:33 +03:00
|
|
|
|
|
|
|
use strict;
|
|
|
|
use lib qw(. lib);
|
|
|
|
|
|
|
|
use Bugzilla;
|
|
|
|
use Bugzilla::Constants;
|
|
|
|
use Bugzilla::Util;
|
|
|
|
use Bugzilla::Error;
|
|
|
|
use Bugzilla::Product;
|
|
|
|
|
2014-03-24 19:51:31 +04:00
|
|
|
my $user = Bugzilla->login;
|
2008-12-15 15:53:33 +03:00
|
|
|
my $template = Bugzilla->template;
|
|
|
|
my $vars = {};
|
2014-08-28 15:55:58 +04:00
|
|
|
my $ARGS = Bugzilla->input_params;
|
2008-12-15 15:53:33 +03:00
|
|
|
|
2009-07-29 15:21:49 +04:00
|
|
|
Bugzilla->switch_to_shadow_db;
|
|
|
|
|
2014-08-28 15:36:37 +04:00
|
|
|
my $product = Bugzilla::Product->new({ name => trim($ARGS->{product} || '') });
|
2014-03-24 19:51:31 +04:00
|
|
|
unless ($product && $user->can_access_product($product->name))
|
|
|
|
{
|
2014-08-28 15:36:37 +04:00
|
|
|
$product = Bugzilla::Product->choose_product($user->get_accessible_products);
|
2008-12-15 15:53:33 +03:00
|
|
|
}
|
|
|
|
|
2014-03-24 19:51:31 +04:00
|
|
|
$vars->{product} = $product;
|
2008-12-15 15:53:33 +03:00
|
|
|
|
|
|
|
$template->process("reports/components.html.tmpl", $vars)
|
2014-03-24 19:51:31 +04:00
|
|
|
|| ThrowTemplateError($template->error());
|
|
|
|
exit;
|