long_list.cgi 4.19 KB
Newer Older
1 2
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
terry%netscape.com's avatar
terry%netscape.com committed
3
#
4 5 6 7 8 9 10 11 12 13
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (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.
#
terry%netscape.com's avatar
terry%netscape.com committed
14
# The Original Code is the Bugzilla Bug Tracking System.
15
#
terry%netscape.com's avatar
terry%netscape.com committed
16
# The Initial Developer of the Original Code is Netscape Communications
17 18 19 20
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
terry%netscape.com's avatar
terry%netscape.com committed
21 22 23
# Contributor(s): Terry Weissman <terry@mozilla.org>


24 25
use diagnostics;
use strict;
terry%netscape.com's avatar
terry%netscape.com committed
26

27 28
require "CGI.pl";

29 30 31 32 33
# Shut up misguided -w warnings about "used only once".  "use vars" just
# doesn't work for me.

sub sillyness {
    my $zz;
34
    $zz = $::legal_keywords;
35 36 37
    $zz = $::usergroupset;
    $zz = %::FORM;
}
38

39
print "Content-type: text/html\n";
40 41 42
#Changing attachment to inline to resolve 46897
#zach@zachlipton.com
print "Content-disposition: inline; filename=bugzilla_bug_list.html\n\n";
43
PutHeader ("Full Text Bug Listing");
44

45 46 47
ConnectToDatabase();
quietly_check_login();

48 49
GetVersionTable();

50
my $generic_query  = "
terry%netscape.com's avatar
terry%netscape.com committed
51 52 53 54 55 56 57 58 59 60 61 62 63 64
select
  bugs.bug_id,
  bugs.product,
  bugs.version,
  bugs.rep_platform,
  bugs.op_sys,
  bugs.bug_status,
  bugs.bug_severity,
  bugs.priority,
  bugs.resolution,
  assign.login_name,
  report.login_name,
  bugs.component,
  bugs.bug_file_loc,
65 66 67
  bugs.short_desc,
  bugs.target_milestone,
  bugs.qa_contact,
68 69
  bugs.status_whiteboard,
  bugs.keywords
terry%netscape.com's avatar
terry%netscape.com committed
70 71
from bugs,profiles assign,profiles report
where assign.userid = bugs.assigned_to and report.userid = bugs.reporter and
72
bugs.groupset & $::usergroupset = bugs.groupset and";
terry%netscape.com's avatar
terry%netscape.com committed
73

terry%mozilla.org's avatar
terry%mozilla.org committed
74
$::FORM{'buglist'} = "" unless exists $::FORM{'buglist'};
75 76
foreach my $bug (split(/:/, $::FORM{'buglist'})) {
    SendSQL("$generic_query bugs.bug_id = $bug");
terry%netscape.com's avatar
terry%netscape.com committed
77

78 79 80 81
    my @row;
    if (@row = FetchSQLData()) {
        my ($id, $product, $version, $platform, $opsys, $status, $severity,
            $priority, $resolution, $assigned, $reporter, $component, $url,
82
            $shortdesc, $target_milestone, $qa_contact,
83
            $status_whiteboard, $keywords) = (@row);
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
        print "<IMG SRC=\"1x1.gif\" WIDTH=1 HEIGHT=80 ALIGN=LEFT>\n";
        print "<TABLE WIDTH=100%>\n";
        print "<TD COLSPAN=4><TR><DIV ALIGN=CENTER><B><FONT =\"+3\">" .
            html_quote($shortdesc) .
                "</B></FONT></DIV>\n";
        print "<TR><TD><B>Bug#:</B> <A HREF=\"show_bug.cgi?id=$id\">$id</A>\n";
        print "<TD><B>Product:</B> $product\n";
        print "<TD><B>Version:</B> $version\n";
        print "<TD><B>Platform:</B> $platform\n";
        print "<TR><TD><B>OS/Version:</B> $opsys\n";
        print "<TD><B>Status:</B> $status\n";
        print "<TD><B>Severity:</B> $severity\n";
        print "<TD><B>Priority:</B> $priority\n";
        print "<TR><TD><B>Resolution:</B> $resolution</TD>\n";
        print "<TD><B>Assigned To:</B> $assigned\n";
        print "<TD><B>Reported By:</B> $reporter\n";
100 101 102 103 104 105 106
        if (Param("useqacontact")) {
            my $name = "";
            if ($qa_contact > 0) {
                $name = DBID_to_name($qa_contact);
            }
            print "<TD><B>QA Contact:</B> $name\n";
        }
107
        print "<TR><TD><B>Component:</B> $component\n";
108 109 110
        if (Param("usetargetmilestone")) {
            print "<TD><B>Target milestone:</B>$target_milestone\n";
        }
111 112
        print "<TR><TD COLSPAN=6><B>URL:</B>&nbsp;";
	print "<A HREF=\"" . $url . "\">" .  html_quote($url) . "</A>\n"; 
113
        print "<TR><TD COLSPAN=6><B>Summary:</B> " . html_quote($shortdesc) . "\n";
114 115 116
        if (@::legal_keywords) {
            print "<TR><TD><B>Keywords: </B>$keywords</TD></TR>\n";
        }
117 118 119 120 121
        if (Param("usestatuswhiteboard")) {
            print "<TR><TD COLSPAN=6><B>Status Whiteboard:" .
                html_quote($status_whiteboard) . "\n";
        }
        print "<TR><TD><B>Description:</B>\n</TABLE>\n";
122
        print GetLongDescriptionAsHTML($bug);
123 124
        print "<HR>\n";
    }
terry%netscape.com's avatar
terry%netscape.com committed
125
}