From: harrison%netscape.com <> Date: Mon, 19 Oct 1998 05:18:25 +0000 (+0000) Subject: created reports.cgi which provide an overview of active bugs X-Git-Tag: bugzilla-2.2~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b7812657fe6e4569586b189bf274b65071e5d90;p=thirdparty%2Fbugzilla.git created reports.cgi which provide an overview of active bugs sorted by owner. updated README to reflect my experiences installing mysql, bugzilla. put links into index.html, query.cgi to point into reports.cgi. harrison 10/18/98 --- diff --git a/CHANGES b/CHANGES index fe704836ae..7fbba808b6 100644 --- a/CHANGES +++ b/CHANGES @@ -9,8 +9,7 @@ query the CVS tree. For example, will tell you what has been changed in the last week. - - +10/17/98 modified README installation instructions slightly. 10/7/98 Added a new table called "products". Right now, this is used only to have a description for each product, and that description is diff --git a/README b/README index dab08e205d..5af19d61ec 100644 --- a/README +++ b/README @@ -53,17 +53,20 @@ You have a freedom of choice here - Apache, Netscape or any other server on UNIX would do. The only thing - to make configuration easier you'd better run HTTP daemon on the same machine that you run MySQL server on. Make sure that you can access 'bugs' database with user -id you're running the daemon with. +id you're running the daemon with. +globals.pl: $::db = Mysql->Connect("localhost", "bugs", "nobody", "") + +In globals.pl, the database connect call uses a mysql account +name "bugs" (third argument to Mysql->Connect) to access the +bugs database. You may have to hack the code to use "nobody" +or whatever your HTTP server is running as. -2. TWEAKING THE TOOLS - Now you should have all necessary tools to be able to run Bugzilla -and see why the wouldn't work for you right now. +2. TWEAKING THE TOOLS - First of all you have to change "#!/usr/bonsaitools" to wherever -you've installed your binaries in all executable scripts in Bugzilla -directories. + All scripts look in /usr/bonsaitools/bin for perl. Make +the appropriate links or modify the paths in each script. Make sure the directory containing the binaries is writable by the web server. Bugzilla keeps some temporary files here. diff --git a/index.html b/index.html index d1537012a7..a8e36662f4 100644 --- a/index.html +++ b/index.html @@ -68,7 +68,8 @@ bugzilla. But it all boils down to a choice of:
Go to the query page to start.
-Enter a new bug +Enter a new bug
+Bug reports
bug #
diff --git a/query.cgi b/query.cgi index 10d33143e7..32ac5717d6 100755 --- a/query.cgi +++ b/query.cgi @@ -264,6 +264,7 @@ if (defined $::COOKIE{"Bugzilla_login"}) { } print "Change your password.
\n"; print "Create a new bug.
\n"; +print "Bug reports
\n"; diff --git a/reports.cgi b/reports.cgi new file mode 100755 index 0000000000..2d9171dd77 --- /dev/null +++ b/reports.cgi @@ -0,0 +1,325 @@ +#!/usr/bonsaitools/bin/perl -w +# -*- Mode: perl; indent-tabs-mode: nil -*- +# +# The contents of this file are subject to the Mozilla Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations +# under the License. +# +# The Original Code is the Bugzilla Bug Tracking System. +# +# The Initial Developer of the Original Code is Netscape Communications +# Corporation. Portions created by Netscape are Copyright (C) 1998 +# Netscape Communications Corporation. All Rights Reserved. +# +# Contributor(s): Harrison Page , +# Terry Weissman + +use diagnostics; +use strict; + +require "CGI.pl"; +require "globals.pl"; + +use vars @::legal_product; + +my $week = 60 * 60 * 24 * 7; +my @status = qw (NEW ASSIGNED REOPENED); + +ConnectToDatabase(); + +print < + +Bugzilla Reports + + +FIN + +&header unless (defined $::FORM{'nobanner'}); + +if (! defined $::FORM{'product'}) + { + &choose_product; + } +else + { + &most_doomed; + } + +print < + + +FIN + +################################## +# user came in with no form data # +################################## + +sub choose_product + { + GetVersionTable(); + + my $product_popup = make_options (\@::legal_product); + + print < +

Welcome to the Bugzilla Query Kitchen

+
+ + + + + + + + + + + + +
Product: + +
Switches: + Links to Bugs
+ No Banner
+
+ +
+
+

+FIN + } + +########################## +# they sent us a project # +########################## + +sub most_doomed + { + my $when = localtime (time); + + print < +

+Bug Report for $::FORM{'product'} +

+$when

+FIN + + my $query = <$query

\n" + unless (! exists $::FORM{'showsql'}); + + SendSQL ($query); + + my $c = 0; + + my $bugs_count = 0; + my $bugs_new_this_week = 0; + my $bugs_reopened = 0; + my %bugs_owners; + my %bugs_summary; + my %bugs_status; + my %bugs_totals; + my %bugs_lookup; + + ############################# + # suck contents of database # + ############################# + + while (my ($bid, $a, $sev, $st, $prod, $who, $rep, $ts) = FetchSQLData()) + { + next if (exists $bugs_lookup{$bid}); + + $bugs_lookup{$bid} ++; + $bugs_owners{$who} ++; + $bugs_new_this_week ++ if (time - $ts <= $week); + $bugs_status{$st} ++; + $bugs_count ++; + + push @{$bugs_summary{$who}{$st}}, $bid; + + $bugs_totals{$who}{$st} ++; + } + + ######################### + # start painting report # + ######################### + + print <Summary + + + + + + + + + + + + + + + + + + + + + + + + + + +
New Bugs This Week$bugs_new_this_week
Bugs Marked New$bugs_status{'NEW'}
Bugs Marked Assigned$bugs_status{'ASSIGNED'}
Bugs Marked Reopened$bugs_status{'REOPENED'}
Total Bugs$bugs_count
+

+FIN + + if ($bugs_count == 0) + { + print "No bugs found!\n"; + exit; + } + + print <Bug Count by Engineer + + + + + + + + +FIN + + foreach my $who (sort keys %bugs_summary) + { + my $bugz = 0; + print < + +FIN + + foreach my $st (@status) + { + $bugs_totals{$who}{$st} += 0; + print <$bugs_totals{$who}{$st} +FIN + $bugz += $#{$bugs_summary{$who}{$st}} + 1; + } + + print <$bugz + +FIN + } + + print < +

+FIN + + ############################### + # individual bugs by engineer # + ############################### + + print <Individual Bugs by Engineer +

OwnerNewAssignedReopenedTotal
$who
+ + + + + + +FIN + + foreach my $who (sort keys %bugs_summary) + { + print < + +FIN + + foreach my $st (@status) + { + my @l; + + foreach (sort { $a <=> $b } @{$bugs_summary{$who}{$st}}) + { + if ($::FORM{'links'}) + { + push @l, "$_\n"; + } + else + { + push @l, $_; + } + } + + my $bugz = join ' ', @l; + $bugz = " " unless ($bugz); + + print <$bugz +FIN + } + + print < +FIN + } + + print < +

+FIN + } + +sub header + { + print < +

OwnerNewAssignedReopened
$who
+FIN + }