diff options
Diffstat (limited to 'index.cgi')
-rwxr-xr-x | index.cgi | 27 |
1 files changed, 16 insertions, 11 deletions
@@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -6,14 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -############################################################################### -# Script Initialization -############################################################################### - -# Make it harder for us to do dangerous things in Perl. +use 5.10.1; use strict; +use warnings; -# Include the Bugzilla CGI and general utility library. use lib qw(. lib); use Bugzilla; @@ -37,10 +33,6 @@ if ($cgi->param('logout')) { $cgi->delete('logout'); } -############################################################################### -# Main Body Execution -############################################################################### - # Return the appropriate HTTP response headers. print $cgi->header(); @@ -55,6 +47,19 @@ if ($user->in_group('admin')) { $vars->{'release'} = Bugzilla::Update::get_notifications(); } +if ($user->id) { + my $dbh = Bugzilla->dbh; + $vars->{assignee_count} = + $dbh->selectrow_array("SELECT COUNT(*) FROM bugs WHERE assigned_to = ? + AND resolution = ''", undef, $user->id); + $vars->{reporter_count} = + $dbh->selectrow_array("SELECT COUNT(*) FROM bugs WHERE reporter = ? + AND resolution = ''", undef, $user->id); + $vars->{requestee_count} = + $dbh->selectrow_array('SELECT COUNT(DISTINCT bug_id) FROM flags + WHERE requestee_id = ?', undef, $user->id); +} + # Generate and return the UI (HTML page) from the appropriate template. $template->process("index.html.tmpl", $vars) || ThrowTemplateError($template->error()); |