Compare commits
1 Commits
tags/BUGZI
...
src
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
258dc9fead |
|
Before Width: | Height: | Size: 82 B |
@@ -1,97 +0,0 @@
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Terry Weissman <terry@mozilla.org>
|
||||
# Myk Melez <myk@mozilla.org>
|
||||
|
||||
############################################################################
|
||||
# Module Initialization
|
||||
############################################################################
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
package Attachment;
|
||||
|
||||
# This module requires that its caller have said "require CGI.pl" to import
|
||||
# relevant functions from that script and its companion globals.pl.
|
||||
|
||||
############################################################################
|
||||
# Functions
|
||||
############################################################################
|
||||
|
||||
sub query
|
||||
{
|
||||
# Retrieves and returns an array of attachment records for a given bug.
|
||||
# This data should be given to attachment/list.atml in an
|
||||
# "attachments" variable.
|
||||
my ($bugid) = @_;
|
||||
|
||||
my $in_editbugs = &::UserInGroup("editbugs");
|
||||
|
||||
# Retrieve a list of attachments for this bug and write them into an array
|
||||
# of hashes in which each hash represents a single attachment.
|
||||
&::SendSQL("
|
||||
SELECT attach_id, creation_ts, mimetype, description, ispatch,
|
||||
isobsolete, submitter_id
|
||||
FROM attachments WHERE bug_id = $bugid ORDER BY attach_id
|
||||
");
|
||||
my @attachments = ();
|
||||
while (&::MoreSQLData()) {
|
||||
my %a;
|
||||
my $submitter_id;
|
||||
($a{'attachid'}, $a{'date'}, $a{'contenttype'}, $a{'description'},
|
||||
$a{'ispatch'}, $a{'isobsolete'}, $submitter_id) = &::FetchSQLData();
|
||||
|
||||
# Format the attachment's creation/modification date into a standard
|
||||
# format (YYYY-MM-DD HH:MM)
|
||||
if ($a{'date'} =~ /^(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/) {
|
||||
$a{'date'} = "$1-$2-$3 $4:$5";
|
||||
}
|
||||
|
||||
# Retrieve a list of status flags that have been set on the attachment.
|
||||
&::PushGlobalSQLState();
|
||||
&::SendSQL("
|
||||
SELECT name
|
||||
FROM attachstatuses, attachstatusdefs
|
||||
WHERE attach_id = $a{'attachid'}
|
||||
AND attachstatuses.statusid = attachstatusdefs.id
|
||||
ORDER BY sortkey
|
||||
");
|
||||
my @statuses = ();
|
||||
while (&::MoreSQLData()) {
|
||||
my ($status) = &::FetchSQLData();
|
||||
push @statuses , $status;
|
||||
}
|
||||
$a{'statuses'} = \@statuses;
|
||||
&::PopGlobalSQLState();
|
||||
|
||||
# We will display the edit link if the user can edit the attachment;
|
||||
# ie the are the submitter, or they have canedit.
|
||||
# Also show the link if the user is not logged in - in that cae,
|
||||
# They'll be prompted later
|
||||
$a{'canedit'} = ($::userid == 0 || $submitter_id == $::userid ||
|
||||
$in_editbugs);
|
||||
push @attachments, \%a;
|
||||
}
|
||||
|
||||
return \@attachments;
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,517 +0,0 @@
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Dawn Endico <endico@mozilla.org>
|
||||
# Terry Weissman <terry@mozilla.org>
|
||||
# Chris Yeh <cyeh@bluemartini.com>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
use DBI;
|
||||
use RelationSet;
|
||||
use vars qw($unconfirmedstate $legal_keywords);
|
||||
require "globals.pl";
|
||||
require "CGI.pl";
|
||||
package Bug;
|
||||
use CGI::Carp qw(fatalsToBrowser);
|
||||
my %ok_field;
|
||||
|
||||
for my $key (qw (bug_id product version rep_platform op_sys bug_status
|
||||
resolution priority bug_severity component assigned_to
|
||||
reporter bug_file_loc short_desc target_milestone
|
||||
qa_contact status_whiteboard creation_ts groupset
|
||||
delta_ts votes whoid usergroupset comment query error) ){
|
||||
$ok_field{$key}++;
|
||||
}
|
||||
|
||||
# create a new empty bug
|
||||
#
|
||||
sub new {
|
||||
my $type = shift();
|
||||
my %bug;
|
||||
|
||||
# create a ref to an empty hash and bless it
|
||||
#
|
||||
my $self = {%bug};
|
||||
bless $self, $type;
|
||||
|
||||
# construct from a hash containing a bug's info
|
||||
#
|
||||
if ($#_ == 1) {
|
||||
$self->initBug(@_);
|
||||
} else {
|
||||
confess("invalid number of arguments \($#_\)($_)");
|
||||
}
|
||||
|
||||
# bless as a Bug
|
||||
#
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
||||
|
||||
# dump info about bug into hash unless user doesn't have permission
|
||||
# user_id 0 is used when person is not logged in.
|
||||
#
|
||||
sub initBug {
|
||||
my $self = shift();
|
||||
my ($bug_id, $user_id) = (@_);
|
||||
|
||||
my $old_bug_id = $bug_id;
|
||||
if ((! defined $bug_id) || (!$bug_id) || (!&::detaint_natural($bug_id))) {
|
||||
# no bug number given
|
||||
$self->{'bug_id'} = $old_bug_id;
|
||||
$self->{'error'} = "InvalidBugId";
|
||||
return $self;
|
||||
}
|
||||
|
||||
# default userid 0, or get DBID if you used an email address
|
||||
unless (defined $user_id) {
|
||||
$user_id = 0;
|
||||
}
|
||||
else {
|
||||
if ($user_id =~ /^\@/) {
|
||||
$user_id = &::DBname_to_id($user_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
&::ConnectToDatabase();
|
||||
&::GetVersionTable();
|
||||
|
||||
# this verification should already have been done by caller
|
||||
# my $loginok = quietly_check_login();
|
||||
|
||||
|
||||
$self->{'whoid'} = $user_id;
|
||||
&::SendSQL("SELECT groupset FROM profiles WHERE userid=$self->{'whoid'}");
|
||||
my $usergroupset = &::FetchOneColumn();
|
||||
if (!$usergroupset) { $usergroupset = '0' }
|
||||
$self->{'usergroupset'} = $usergroupset;
|
||||
|
||||
my $query = "
|
||||
select
|
||||
bugs.bug_id, product, version, rep_platform, op_sys, bug_status,
|
||||
resolution, priority, bug_severity, component, assigned_to, reporter,
|
||||
bug_file_loc, short_desc, target_milestone, qa_contact,
|
||||
status_whiteboard, date_format(creation_ts,'%Y-%m-%d %H:%i'),
|
||||
groupset, delta_ts, ifnull(sum(votes.count),0)
|
||||
from bugs left join votes using(bug_id)
|
||||
where bugs.bug_id = $bug_id
|
||||
group by bugs.bug_id";
|
||||
|
||||
&::SendSQL(&::SelectVisible($query, $user_id, $usergroupset));
|
||||
my @row;
|
||||
|
||||
if (@row = &::FetchSQLData()) {
|
||||
my $count = 0;
|
||||
my %fields;
|
||||
foreach my $field ("bug_id", "product", "version", "rep_platform",
|
||||
"op_sys", "bug_status", "resolution", "priority",
|
||||
"bug_severity", "component", "assigned_to", "reporter",
|
||||
"bug_file_loc", "short_desc", "target_milestone",
|
||||
"qa_contact", "status_whiteboard", "creation_ts",
|
||||
"groupset", "delta_ts", "votes") {
|
||||
$fields{$field} = shift @row;
|
||||
if ($fields{$field}) {
|
||||
$self->{$field} = $fields{$field};
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
} else {
|
||||
&::SendSQL("select groupset from bugs where bug_id = $bug_id");
|
||||
if (@row = &::FetchSQLData()) {
|
||||
$self->{'bug_id'} = $bug_id;
|
||||
$self->{'error'} = "NotPermitted";
|
||||
return $self;
|
||||
} else {
|
||||
$self->{'bug_id'} = $bug_id;
|
||||
$self->{'error'} = "NotFound";
|
||||
return $self;
|
||||
}
|
||||
}
|
||||
|
||||
$self->{'assigned_to'} = &::DBID_to_name($self->{'assigned_to'});
|
||||
$self->{'reporter'} = &::DBID_to_name($self->{'reporter'});
|
||||
|
||||
my $ccSet = new RelationSet;
|
||||
$ccSet->mergeFromDB("select who from cc where bug_id=$bug_id");
|
||||
my @cc = $ccSet->toArrayOfStrings();
|
||||
if (@cc) {
|
||||
$self->{'cc'} = \@cc;
|
||||
}
|
||||
|
||||
if (&::Param("useqacontact") && (defined $self->{'qa_contact'}) ) {
|
||||
my $name = $self->{'qa_contact'} > 0 ? &::DBID_to_name($self->{'qa_contact'}) :"";
|
||||
if ($name) {
|
||||
$self->{'qa_contact'} = $name;
|
||||
}
|
||||
}
|
||||
|
||||
if (@::legal_keywords) {
|
||||
&::SendSQL("SELECT keyworddefs.name
|
||||
FROM keyworddefs, keywords
|
||||
WHERE keywords.bug_id = $bug_id
|
||||
AND keyworddefs.id = keywords.keywordid
|
||||
ORDER BY keyworddefs.name");
|
||||
my @list;
|
||||
while (&::MoreSQLData()) {
|
||||
push(@list, &::FetchOneColumn());
|
||||
}
|
||||
if (@list) {
|
||||
$self->{'keywords'} = join(', ', @list);
|
||||
}
|
||||
}
|
||||
|
||||
&::SendSQL("select attach_id, creation_ts, description
|
||||
from attachments
|
||||
where bug_id = $bug_id");
|
||||
my @attachments;
|
||||
while (&::MoreSQLData()) {
|
||||
my ($attachid, $date, $desc) = (&::FetchSQLData());
|
||||
if ($date =~ /^(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/) {
|
||||
$date = "$3/$4/$2 $5:$6";
|
||||
my %attach;
|
||||
$attach{'attachid'} = $attachid;
|
||||
$attach{'date'} = $date;
|
||||
$attach{'desc'} = $desc;
|
||||
push @attachments, \%attach;
|
||||
}
|
||||
}
|
||||
if (@attachments) {
|
||||
$self->{'attachments'} = \@attachments;
|
||||
}
|
||||
|
||||
&::SendSQL("select bug_id, who, bug_when, thetext
|
||||
from longdescs
|
||||
where bug_id = $bug_id");
|
||||
my @longdescs;
|
||||
while (&::MoreSQLData()) {
|
||||
my ($bug_id, $who, $bug_when, $thetext) = (&::FetchSQLData());
|
||||
my %longdesc;
|
||||
$longdesc{'who'} = $who;
|
||||
$longdesc{'bug_when'} = $bug_when;
|
||||
$longdesc{'thetext'} = $thetext;
|
||||
push @longdescs, \%longdesc;
|
||||
}
|
||||
if (@longdescs) {
|
||||
$self->{'longdescs'} = \@longdescs;
|
||||
}
|
||||
|
||||
if (&::Param("usedependencies")) {
|
||||
my @depends = EmitDependList("blocked", "dependson", $bug_id);
|
||||
if ( @depends ) {
|
||||
$self->{'dependson'} = \@depends;
|
||||
}
|
||||
my @blocks = EmitDependList("dependson", "blocked", $bug_id);
|
||||
if ( @blocks ) {
|
||||
$self->{'blocks'} = \@blocks;
|
||||
}
|
||||
}
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
||||
|
||||
# given a bug hash, emit xml for it. with file header provided by caller
|
||||
#
|
||||
sub emitXML {
|
||||
( $#_ == 0 ) || confess("invalid number of arguments");
|
||||
my $self = shift();
|
||||
my $xml;
|
||||
|
||||
|
||||
if (exists $self->{'error'}) {
|
||||
$xml .= "<bug error=\"$self->{'error'}\">\n";
|
||||
$xml .= " <bug_id>$self->{'bug_id'}</bug_id>\n";
|
||||
$xml .= "</bug>\n";
|
||||
return $xml;
|
||||
}
|
||||
|
||||
$xml .= "<bug>\n";
|
||||
|
||||
foreach my $field ("bug_id", "bug_status", "product",
|
||||
"priority", "version", "rep_platform", "assigned_to", "delta_ts",
|
||||
"component", "reporter", "target_milestone", "bug_severity",
|
||||
"creation_ts", "qa_contact", "op_sys", "resolution", "bug_file_loc",
|
||||
"short_desc", "keywords", "status_whiteboard") {
|
||||
if ($self->{$field}) {
|
||||
$xml .= " <$field>" . QuoteXMLChars($self->{$field}) . "</$field>\n";
|
||||
}
|
||||
}
|
||||
|
||||
foreach my $field ("dependson", "blocks", "cc") {
|
||||
if (defined $self->{$field}) {
|
||||
for (my $i=0 ; $i < @{$self->{$field}} ; $i++) {
|
||||
$xml .= " <$field>" . $self->{$field}[$i] . "</$field>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (defined $self->{'longdescs'}) {
|
||||
for (my $i=0 ; $i < @{$self->{'longdescs'}} ; $i++) {
|
||||
$xml .= " <long_desc>\n";
|
||||
$xml .= " <who>" . &::DBID_to_name($self->{'longdescs'}[$i]->{'who'})
|
||||
. "</who>\n";
|
||||
$xml .= " <bug_when>" . $self->{'longdescs'}[$i]->{'bug_when'}
|
||||
. "</bug_when>\n";
|
||||
$xml .= " <thetext>" . QuoteXMLChars($self->{'longdescs'}[$i]->{'thetext'})
|
||||
. "</thetext>\n";
|
||||
$xml .= " </long_desc>\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (defined $self->{'attachments'}) {
|
||||
for (my $i=0 ; $i < @{$self->{'attachments'}} ; $i++) {
|
||||
$xml .= " <attachment>\n";
|
||||
$xml .= " <attachid>" . $self->{'attachments'}[$i]->{'attachid'}
|
||||
. "</attachid>\n";
|
||||
$xml .= " <date>" . $self->{'attachments'}[$i]->{'date'} . "</date>\n";
|
||||
$xml .= " <desc>" . QuoteXMLChars($self->{'attachments'}[$i]->{'desc'}) . "</desc>\n";
|
||||
# $xml .= " <type>" . $self->{'attachments'}[$i]->{'type'} . "</type>\n";
|
||||
# $xml .= " <data>" . $self->{'attachments'}[$i]->{'data'} . "</data>\n";
|
||||
$xml .= " </attachment>\n";
|
||||
}
|
||||
}
|
||||
|
||||
$xml .= "</bug>\n";
|
||||
return $xml;
|
||||
}
|
||||
|
||||
sub EmitDependList {
|
||||
my ($myfield, $targetfield, $bug_id) = (@_);
|
||||
my @list;
|
||||
&::SendSQL("select dependencies.$targetfield, bugs.bug_status
|
||||
from dependencies, bugs
|
||||
where dependencies.$myfield = $bug_id
|
||||
and bugs.bug_id = dependencies.$targetfield
|
||||
order by dependencies.$targetfield");
|
||||
while (&::MoreSQLData()) {
|
||||
my ($i, $stat) = (&::FetchSQLData());
|
||||
push @list, $i;
|
||||
}
|
||||
return @list;
|
||||
}
|
||||
|
||||
sub QuoteXMLChars {
|
||||
$_[0] =~ s/&/&/g;
|
||||
$_[0] =~ s/</</g;
|
||||
$_[0] =~ s/>/>/g;
|
||||
$_[0] =~ s/'/'/g;
|
||||
$_[0] =~ s/"/"/g;
|
||||
# $_[0] =~ s/([\x80-\xFF])/&XmlUtf8Encode(ord($1))/ge;
|
||||
return($_[0]);
|
||||
}
|
||||
|
||||
sub XML_Header {
|
||||
my ($urlbase, $version, $maintainer, $exporter) = (@_);
|
||||
|
||||
my $xml;
|
||||
$xml = "<?xml version=\"1.0\" standalone=\"yes\"?>\n";
|
||||
$xml .= "<!DOCTYPE bugzilla SYSTEM \"$urlbase";
|
||||
if (! ($urlbase =~ /.+\/$/)) {
|
||||
$xml .= "/";
|
||||
}
|
||||
$xml .= "bugzilla.dtd\">\n";
|
||||
$xml .= "<bugzilla";
|
||||
if (defined $exporter) {
|
||||
$xml .= " exporter=\"$exporter\"";
|
||||
}
|
||||
$xml .= " version=\"$version\"";
|
||||
$xml .= " urlbase=\"$urlbase\"";
|
||||
$xml .= " maintainer=\"$maintainer\">\n";
|
||||
return ($xml);
|
||||
}
|
||||
|
||||
|
||||
sub XML_Footer {
|
||||
return ("</bugzilla>\n");
|
||||
}
|
||||
|
||||
sub UserInGroup {
|
||||
my $self = shift();
|
||||
my ($groupname) = (@_);
|
||||
if ($self->{'usergroupset'} eq "0") {
|
||||
return 0;
|
||||
}
|
||||
&::ConnectToDatabase();
|
||||
&::SendSQL("select (bit & $self->{'usergroupset'}) != 0 from groups where name = "
|
||||
. &::SqlQuote($groupname));
|
||||
my $bit = &::FetchOneColumn();
|
||||
if ($bit) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub CanChangeField {
|
||||
my $self = shift();
|
||||
my ($f, $oldvalue, $newvalue) = (@_);
|
||||
my $UserInEditGroupSet = -1;
|
||||
my $UserInCanConfirmGroupSet = -1;
|
||||
my $ownerid;
|
||||
my $reporterid;
|
||||
my $qacontactid;
|
||||
|
||||
if ($f eq "assigned_to" || $f eq "reporter" || $f eq "qa_contact") {
|
||||
if ($oldvalue =~ /^\d+$/) {
|
||||
if ($oldvalue == 0) {
|
||||
$oldvalue = "";
|
||||
} else {
|
||||
$oldvalue = &::DBID_to_name($oldvalue);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($oldvalue eq $newvalue) {
|
||||
return 1;
|
||||
}
|
||||
if (&::trim($oldvalue) eq &::trim($newvalue)) {
|
||||
return 1;
|
||||
}
|
||||
if ($f =~ /^longdesc/) {
|
||||
return 1;
|
||||
}
|
||||
if ($UserInEditGroupSet < 0) {
|
||||
$UserInEditGroupSet = UserInGroup($self, "editbugs");
|
||||
}
|
||||
if ($UserInEditGroupSet) {
|
||||
return 1;
|
||||
}
|
||||
&::SendSQL("SELECT reporter, assigned_to, qa_contact FROM bugs " .
|
||||
"WHERE bug_id = $self->{'bug_id'}");
|
||||
($reporterid, $ownerid, $qacontactid) = (&::FetchSQLData());
|
||||
|
||||
# Let reporter change bug status, even if they can't edit bugs.
|
||||
# If reporter can't re-open their bug they will just file a duplicate.
|
||||
# While we're at it, let them close their own bugs as well.
|
||||
if ( ($f eq "bug_status") && ($self->{'whoid'} eq $reporterid) ) {
|
||||
return 1;
|
||||
}
|
||||
if ($f eq "bug_status" && $newvalue ne $::unconfirmedstate &&
|
||||
&::IsOpenedState($newvalue)) {
|
||||
|
||||
# Hmm. They are trying to set this bug to some opened state
|
||||
# that isn't the UNCONFIRMED state. Are they in the right
|
||||
# group? Or, has it ever been confirmed? If not, then this
|
||||
# isn't legal.
|
||||
|
||||
if ($UserInCanConfirmGroupSet < 0) {
|
||||
$UserInCanConfirmGroupSet = &::UserInGroup("canconfirm");
|
||||
}
|
||||
if ($UserInCanConfirmGroupSet) {
|
||||
return 1;
|
||||
}
|
||||
&::SendSQL("SELECT everconfirmed FROM bugs WHERE bug_id = $self->{'bug_id'}");
|
||||
my $everconfirmed = FetchOneColumn();
|
||||
if ($everconfirmed) {
|
||||
return 1;
|
||||
}
|
||||
} elsif ($reporterid eq $self->{'whoid'} || $ownerid eq $self->{'whoid'} ||
|
||||
$qacontactid eq $self->{'whoid'}) {
|
||||
return 1;
|
||||
}
|
||||
$self->{'error'} = "
|
||||
Only the owner or submitter of the bug, or a sufficiently
|
||||
empowered user, may make that change to the $f field."
|
||||
}
|
||||
|
||||
sub Collision {
|
||||
my $self = shift();
|
||||
my $write = "WRITE"; # Might want to make a param to control
|
||||
# whether we do LOW_PRIORITY ...
|
||||
&::SendSQL("LOCK TABLES bugs $write, bugs_activity $write, cc $write, " .
|
||||
"cc AS selectVisible_cc $write, " .
|
||||
"profiles $write, dependencies $write, votes $write, " .
|
||||
"keywords $write, longdescs $write, fielddefs $write, " .
|
||||
"keyworddefs READ, groups READ, attachments READ, products READ");
|
||||
&::SendSQL("SELECT delta_ts FROM bugs where bug_id=$self->{'bug_id'}");
|
||||
my $delta_ts = &::FetchOneColumn();
|
||||
&::SendSQL("unlock tables");
|
||||
if ($self->{'delta_ts'} ne $delta_ts) {
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
sub AppendComment {
|
||||
my $self = shift();
|
||||
my ($comment) = (@_);
|
||||
$comment =~ s/\r\n/\n/g; # Get rid of windows-style line endings.
|
||||
$comment =~ s/\r/\n/g; # Get rid of mac-style line endings.
|
||||
if ($comment =~ /^\s*$/) { # Nothin' but whitespace.
|
||||
return;
|
||||
}
|
||||
|
||||
&::SendSQL("INSERT INTO longdescs (bug_id, who, bug_when, thetext) " .
|
||||
"VALUES($self->{'bug_id'}, $self->{'whoid'}, now(), " . &::SqlQuote($comment) . ")");
|
||||
|
||||
&::SendSQL("UPDATE bugs SET delta_ts = now() WHERE bug_id = $self->{'bug_id'}");
|
||||
}
|
||||
|
||||
|
||||
#from o'reilley's Programming Perl
|
||||
sub display {
|
||||
my $self = shift;
|
||||
my @keys;
|
||||
if (@_ == 0) { # no further arguments
|
||||
@keys = sort keys(%$self);
|
||||
} else {
|
||||
@keys = @_; # use the ones given
|
||||
}
|
||||
foreach my $key (@keys) {
|
||||
print "\t$key => $self->{$key}\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub CommitChanges {
|
||||
|
||||
#snapshot bug
|
||||
#snapshot dependencies
|
||||
#check can change fields
|
||||
#check collision
|
||||
#lock and change fields
|
||||
#notify through mail
|
||||
|
||||
}
|
||||
|
||||
sub AUTOLOAD {
|
||||
use vars qw($AUTOLOAD);
|
||||
my $self = shift;
|
||||
my $type = ref($self) || $self;
|
||||
my $attr = $AUTOLOAD;
|
||||
|
||||
$attr =~ s/.*:://;
|
||||
return unless $attr=~ /[^A-Z]/;
|
||||
if (@_) {
|
||||
$self->{$attr} = shift;
|
||||
return;
|
||||
}
|
||||
confess ("invalid bug attribute $attr") unless $ok_field{$attr};
|
||||
if (defined $self->{$attr}) {
|
||||
return $self->{$attr};
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,16 +0,0 @@
|
||||
* This README is no longer used to house installation instructions. Instead,
|
||||
it contains pointers to where you may find the information you need.
|
||||
|
||||
* Installation instructions are now found in docs/, with a variety of document
|
||||
types available. Please refer to these documents when installing, configuring,
|
||||
and maintaining your Bugzilla installation. A helpful starting point is
|
||||
docs/txt/Bugzilla-Guide.txt, or with a web browser at docs/html/index.html.
|
||||
|
||||
* Release notes for people upgrading to a new version of Bugzilla are
|
||||
available at docs/rel_notes.txt.
|
||||
|
||||
* If you wish to contribute to the documentation, please read docs/README.docs.
|
||||
|
||||
* The Bugzilla web site is at "http://www.mozilla.org/projects/bugzilla/".
|
||||
This site will contain the latest Bugzilla information, including how to
|
||||
report bugs and how to get help with Bugzilla.
|
||||
@@ -1,268 +0,0 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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) 2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s): Dan Mosedale <dmose@mozilla.org>
|
||||
# Terry Weissman <terry@mozilla.org>
|
||||
# Dave Miller <justdave@syndicomm.com>
|
||||
|
||||
# This object models a set of relations between one item and a group
|
||||
# of other items. An example is the set of relations between one bug
|
||||
# and the users CCed on that bug. Currently, the relation objects are
|
||||
# expected to be bugzilla userids. However, this could and perhaps
|
||||
# should be generalized to work with non userid objects, such as
|
||||
# keywords associated with a bug. That shouldn't be hard to do; it
|
||||
# might involve turning this into a virtual base class, and having
|
||||
# UserSet and KeywordSet types that inherit from it.
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
# Everything that uses RelationSet should already have globals.pl loaded
|
||||
# so we don't want to load it here. Doing so causes a loop in Perl because
|
||||
# globals.pl turns around and does a 'use RelationSet'
|
||||
# See http://bugzilla.mozilla.org/show_bug.cgi?id=72862
|
||||
#require "globals.pl";
|
||||
|
||||
package RelationSet;
|
||||
use CGI::Carp qw(fatalsToBrowser);
|
||||
|
||||
# create a new empty RelationSet
|
||||
#
|
||||
sub new {
|
||||
my $type = shift();
|
||||
|
||||
# create a ref to an empty hash and bless it
|
||||
#
|
||||
my $self = {};
|
||||
bless $self, $type;
|
||||
|
||||
# construct from a comma-delimited string
|
||||
#
|
||||
if ($#_ == 0) {
|
||||
$self->mergeFromString($_[0]);
|
||||
}
|
||||
# unless this was a constructor for an empty list, somebody screwed up.
|
||||
#
|
||||
elsif ( $#_ != -1 ) {
|
||||
confess("invalid number of arguments");
|
||||
}
|
||||
|
||||
# bless as a RelationSet
|
||||
#
|
||||
return $self;
|
||||
}
|
||||
|
||||
# Assumes that the set of relations "FROM $table WHERE $constantSql and
|
||||
# $column = $value" is currently represented by $self, and this set should
|
||||
# be updated to look like $other.
|
||||
#
|
||||
# Returns an array of two strings, one INSERT and one DELETE, which will
|
||||
# make this change. Either or both strings may be the empty string,
|
||||
# meaning that no INSERT or DELETE or both (respectively) need to be done.
|
||||
#
|
||||
# THE CALLER IS RESPONSIBLE FOR ANY DESIRED LOCKING AND/OR CONSISTENCY
|
||||
# CHECKS (not to mention doing the SendSQL() calls).
|
||||
#
|
||||
sub generateSqlDeltas {
|
||||
($#_ == 5) || confess("invalid number of arguments");
|
||||
my ( $self, # instance ptr to set representing the existing state
|
||||
$endState, # instance ptr to set representing the desired state
|
||||
$table, # table where these relations are kept
|
||||
$invariantName, # column held const for a RelationSet (often "bug_id")
|
||||
$invariantValue, # what to hold the above column constant at
|
||||
$columnName # the column which varies (often a userid)
|
||||
) = @_;
|
||||
|
||||
# construct the insert list by finding relations which exist in the
|
||||
# end state but not the current state.
|
||||
#
|
||||
my @endStateRelations = keys(%$endState);
|
||||
my @insertList = ();
|
||||
foreach ( @endStateRelations ) {
|
||||
push ( @insertList, $_ ) if ( ! exists $$self{"$_"} );
|
||||
}
|
||||
|
||||
# we've built the list. If it's non-null, add required sql chrome.
|
||||
#
|
||||
my $sqlInsert="";
|
||||
if ( $#insertList > -1 ) {
|
||||
$sqlInsert = "INSERT INTO $table ($invariantName, $columnName) VALUES " .
|
||||
join (",",
|
||||
map ( "($invariantValue, $_)" , @insertList )
|
||||
);
|
||||
}
|
||||
|
||||
# construct the delete list by seeing which relations exist in the
|
||||
# current state but not the end state
|
||||
#
|
||||
my @selfRelations = keys(%$self);
|
||||
my @deleteList = ();
|
||||
foreach ( @selfRelations ) {
|
||||
push (@deleteList, $_) if ( ! exists $$endState{"$_"} );
|
||||
}
|
||||
|
||||
# we've built the list. if it's non-empty, add required sql chrome.
|
||||
#
|
||||
my $sqlDelete = "";
|
||||
if ( $#deleteList > -1 ) {
|
||||
$sqlDelete = "DELETE FROM $table WHERE $invariantName = $invariantValue " .
|
||||
"AND $columnName IN ( " . join (",", @deleteList) . " )";
|
||||
}
|
||||
|
||||
return ($sqlInsert, $sqlDelete);
|
||||
}
|
||||
|
||||
# compare the current object with another.
|
||||
#
|
||||
sub isEqual {
|
||||
($#_ == 1) || confess("invalid number of arguments");
|
||||
my $self = shift();
|
||||
my $other = shift();
|
||||
|
||||
# get arrays of the keys for faster processing
|
||||
#
|
||||
my @selfRelations = keys(%$self);
|
||||
my @otherRelations = keys(%$other);
|
||||
|
||||
# make sure the arrays are the same size
|
||||
#
|
||||
return 0 if ( $#selfRelations != $#otherRelations );
|
||||
|
||||
# bail out if any of the elements are different
|
||||
#
|
||||
foreach my $relation ( @selfRelations ) {
|
||||
return 0 if ( !exists $$other{$relation})
|
||||
}
|
||||
|
||||
# we made it!
|
||||
#
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
# merge the results of a SQL command into this set
|
||||
#
|
||||
sub mergeFromDB {
|
||||
( $#_ == 1 ) || confess("invalid number of arguments");
|
||||
my $self = shift();
|
||||
|
||||
&::SendSQL(shift());
|
||||
while (my @row = &::FetchSQLData()) {
|
||||
$$self{$row[0]} = 1;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
# merge a set in string form into this set
|
||||
#
|
||||
sub mergeFromString {
|
||||
($#_ == 1) || confess("invalid number of arguments");
|
||||
my $self = shift();
|
||||
|
||||
# do the merge
|
||||
#
|
||||
foreach my $person (split(/[ ,]/, shift())) {
|
||||
if ($person ne "") {
|
||||
$$self{&::DBNameToIdAndCheck($person)} = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# remove a set in string form from this set
|
||||
#
|
||||
sub removeItemsInString {
|
||||
($#_ == 1) || confess("invalid number of arguments");
|
||||
my $self = shift();
|
||||
|
||||
# do the merge
|
||||
#
|
||||
foreach my $person (split(/[ ,]/, shift())) {
|
||||
if ($person ne "") {
|
||||
my $dbid = &::DBNameToIdAndCheck($person);
|
||||
if (exists $$self{$dbid}) {
|
||||
delete $$self{$dbid};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# remove a set in array form from this set
|
||||
#
|
||||
sub removeItemsInArray {
|
||||
($#_ > 0) || confess("invalid number of arguments");
|
||||
my $self = shift();
|
||||
|
||||
# do the merge
|
||||
#
|
||||
while (my $person = shift()) {
|
||||
if ($person ne "") {
|
||||
my $dbid = &::DBNameToIdAndCheck($person);
|
||||
if (exists $$self{$dbid}) {
|
||||
delete $$self{$dbid};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# return the number of elements in this set
|
||||
#
|
||||
sub size {
|
||||
my $self = shift();
|
||||
|
||||
my @k = keys(%$self);
|
||||
return $#k++;
|
||||
}
|
||||
|
||||
# return this set in array form
|
||||
#
|
||||
sub toArray {
|
||||
my $self= shift();
|
||||
|
||||
return keys(%$self);
|
||||
}
|
||||
|
||||
# return this set as an array of strings
|
||||
#
|
||||
sub toArrayOfStrings {
|
||||
($#_ == 0) || confess("invalid number of arguments");
|
||||
my $self = shift();
|
||||
|
||||
my @result = ();
|
||||
foreach my $i ( keys %$self ) {
|
||||
push @result, &::DBID_to_name($i);
|
||||
}
|
||||
|
||||
return sort { lc($a) cmp lc($b) } @result;
|
||||
}
|
||||
|
||||
# return this set in string form (comma-separated and sorted)
|
||||
#
|
||||
sub toString {
|
||||
($#_ == 0) || confess("invalid number of arguments");
|
||||
my $self = shift();
|
||||
|
||||
my @result = ();
|
||||
foreach my $i ( keys %$self ) {
|
||||
push @result, &::DBID_to_name($i);
|
||||
}
|
||||
|
||||
return join(',', sort(@result));
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,277 +0,0 @@
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Myk Melez <myk@mozilla.org>
|
||||
|
||||
################################################################################
|
||||
# Module Initialization
|
||||
################################################################################
|
||||
|
||||
# Make it harder for us to do dangerous things in Perl.
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
# Bundle the functions in this file together into the "Token" package.
|
||||
package Token;
|
||||
|
||||
use Date::Format;
|
||||
|
||||
# This module requires that its caller have said "require CGI.pl" to import
|
||||
# relevant functions from that script and its companion globals.pl.
|
||||
|
||||
################################################################################
|
||||
# Constants
|
||||
################################################################################
|
||||
|
||||
# The maximum number of days a token will remain valid.
|
||||
my $maxtokenage = 3;
|
||||
|
||||
################################################################################
|
||||
# Functions
|
||||
################################################################################
|
||||
|
||||
sub IssueEmailChangeToken {
|
||||
my ($userid, $old_email, $new_email) = @_;
|
||||
|
||||
my $token_ts = time();
|
||||
my $issuedate = time2str("%Y-%m-%d %H:%M", $token_ts);
|
||||
|
||||
# Generate a unique token and insert it into the tokens table.
|
||||
# We have to lock the tokens table before generating the token,
|
||||
# since the database must be queried for token uniqueness.
|
||||
&::SendSQL("LOCK TABLES tokens WRITE");
|
||||
my $token = GenerateUniqueToken();
|
||||
my $quotedtoken = &::SqlQuote($token);
|
||||
my $quoted_emails = &::SqlQuote($old_email . ":" . $new_email);
|
||||
&::SendSQL("INSERT INTO tokens ( userid , issuedate , token ,
|
||||
tokentype , eventdata )
|
||||
VALUES ( $userid , '$issuedate' , $quotedtoken ,
|
||||
'emailold' , $quoted_emails )");
|
||||
my $newtoken = GenerateUniqueToken();
|
||||
$quotedtoken = &::SqlQuote($newtoken);
|
||||
&::SendSQL("INSERT INTO tokens ( userid , issuedate , token ,
|
||||
tokentype , eventdata )
|
||||
VALUES ( $userid , '$issuedate' , $quotedtoken ,
|
||||
'emailnew' , $quoted_emails )");
|
||||
&::SendSQL("UNLOCK TABLES");
|
||||
|
||||
# Mail the user the token along with instructions for using it.
|
||||
|
||||
my $template = $::template;
|
||||
my $vars = $::vars;
|
||||
|
||||
$vars->{'oldemailaddress'} = $old_email . &::Param('emailsuffix');
|
||||
$vars->{'newemailaddress'} = $new_email . &::Param('emailsuffix');
|
||||
|
||||
$vars->{'max_token_age'} = $maxtokenage;
|
||||
$vars->{'token_ts'} = $token_ts;
|
||||
|
||||
$vars->{'token'} = $token;
|
||||
$vars->{'emailaddress'} = $old_email . &::Param('emailsuffix');
|
||||
|
||||
my $message;
|
||||
$template->process("account/email/change-old.txt.tmpl", $vars, \$message)
|
||||
|| &::ThrowTemplateError($template->error());
|
||||
|
||||
open SENDMAIL, "|/usr/lib/sendmail -t -i";
|
||||
print SENDMAIL $message;
|
||||
close SENDMAIL;
|
||||
|
||||
$vars->{'token'} = $newtoken;
|
||||
$vars->{'emailaddress'} = $new_email . &::Param('emailsuffix');
|
||||
|
||||
$message = "";
|
||||
$template->process("account/email/change-new.txt.tmpl", $vars, \$message)
|
||||
|| &::ThrowTemplateError($template->error());
|
||||
|
||||
open SENDMAIL, "|/usr/lib/sendmail -t -i";
|
||||
print SENDMAIL $message;
|
||||
close SENDMAIL;
|
||||
|
||||
}
|
||||
|
||||
sub IssuePasswordToken {
|
||||
# Generates a random token, adds it to the tokens table, and sends it
|
||||
# to the user with instructions for using it to change their password.
|
||||
|
||||
my ($loginname) = @_;
|
||||
|
||||
# Retrieve the user's ID from the database.
|
||||
my $quotedloginname = &::SqlQuote($loginname);
|
||||
&::SendSQL("SELECT profiles.userid, tokens.issuedate FROM profiles
|
||||
LEFT JOIN tokens
|
||||
ON tokens.userid = profiles.userid
|
||||
AND tokens.tokentype = 'password'
|
||||
AND tokens.issuedate > DATE_SUB(NOW(), INTERVAL 10 MINUTE)
|
||||
WHERE login_name = $quotedloginname");
|
||||
my ($userid, $toosoon) = &::FetchSQLData();
|
||||
|
||||
if ($toosoon) {
|
||||
&::DisplayError('Too Soon For Another Password Token') && exit;
|
||||
};
|
||||
|
||||
my $token_ts = time();
|
||||
|
||||
# Generate a unique token and insert it into the tokens table.
|
||||
# We have to lock the tokens table before generating the token,
|
||||
# since the database must be queried for token uniqueness.
|
||||
&::SendSQL("LOCK TABLES tokens WRITE");
|
||||
my $token = GenerateUniqueToken();
|
||||
my $quotedtoken = &::SqlQuote($token);
|
||||
my $quotedipaddr = &::SqlQuote($::ENV{'REMOTE_ADDR'});
|
||||
&::SendSQL("INSERT INTO tokens ( userid , issuedate , token , tokentype , eventdata )
|
||||
VALUES ( $userid , NOW() , $quotedtoken , 'password' , $quotedipaddr )");
|
||||
&::SendSQL("UNLOCK TABLES");
|
||||
|
||||
# Mail the user the token along with instructions for using it.
|
||||
|
||||
my $template = $::template;
|
||||
my $vars = $::vars;
|
||||
|
||||
$vars->{'token'} = $token;
|
||||
$vars->{'emailaddress'} = $loginname . &::Param('emailsuffix');
|
||||
|
||||
$vars->{'max_token_age'} = $maxtokenage;
|
||||
$vars->{'token_ts'} = $token_ts;
|
||||
|
||||
my $message = "";
|
||||
$template->process("account/password/forgotten-password.txt.tmpl",
|
||||
$vars, \$message)
|
||||
|| &::ThrowTemplateError($template->error());
|
||||
|
||||
open SENDMAIL, "|/usr/lib/sendmail -t -i";
|
||||
print SENDMAIL $message;
|
||||
close SENDMAIL;
|
||||
|
||||
}
|
||||
|
||||
|
||||
sub CleanTokenTable {
|
||||
&::SendSQL("LOCK TABLES tokens WRITE");
|
||||
&::SendSQL("DELETE FROM tokens
|
||||
WHERE TO_DAYS(NOW()) - TO_DAYS(issuedate) >= " . $maxtokenage);
|
||||
&::SendSQL("UNLOCK TABLES");
|
||||
}
|
||||
|
||||
|
||||
sub GenerateUniqueToken {
|
||||
# Generates a unique random token. Uses &GenerateRandomPassword
|
||||
# for the tokens themselves and checks uniqueness by searching for
|
||||
# the token in the "tokens" table. Gives up if it can't come up
|
||||
# with a token after about one hundred tries.
|
||||
|
||||
my $token;
|
||||
my $duplicate = 1;
|
||||
my $tries = 0;
|
||||
while ($duplicate) {
|
||||
|
||||
++$tries;
|
||||
if ($tries > 100) {
|
||||
&::DisplayError("Something is seriously wrong with the token generation system.");
|
||||
exit;
|
||||
}
|
||||
|
||||
$token = &::GenerateRandomPassword();
|
||||
&::SendSQL("SELECT userid FROM tokens WHERE token = " . &::SqlQuote($token));
|
||||
$duplicate = &::FetchSQLData();
|
||||
}
|
||||
|
||||
return $token;
|
||||
|
||||
}
|
||||
|
||||
|
||||
sub Cancel {
|
||||
# Cancels a previously issued token and notifies the system administrator.
|
||||
# This should only happen when the user accidentally makes a token request
|
||||
# or when a malicious hacker makes a token request on behalf of a user.
|
||||
|
||||
my ($token, $cancelaction) = @_;
|
||||
|
||||
# Quote the token for inclusion in SQL statements.
|
||||
my $quotedtoken = &::SqlQuote($token);
|
||||
|
||||
# Get information about the token being cancelled.
|
||||
&::SendSQL("SELECT issuedate , tokentype , eventdata , login_name , realname
|
||||
FROM tokens, profiles
|
||||
WHERE tokens.userid = profiles.userid
|
||||
AND token = $quotedtoken");
|
||||
my ($issuedate, $tokentype, $eventdata, $loginname, $realname) = &::FetchSQLData();
|
||||
|
||||
# Get the email address of the Bugzilla maintainer.
|
||||
my $maintainer = &::Param('maintainer');
|
||||
|
||||
# Format the user's real name and email address into a single string.
|
||||
my $username = $realname ? $realname . " <" . $loginname . ">" : $loginname;
|
||||
|
||||
my $template = $::template;
|
||||
my $vars = $::vars;
|
||||
|
||||
$vars->{'emailaddress'} = $username;
|
||||
$vars->{'maintainer'} = $maintainer;
|
||||
$vars->{'remoteaddress'} = $::ENV{'REMOTE_ADDR'};
|
||||
$vars->{'token'} = $token;
|
||||
$vars->{'tokentype'} = $tokentype;
|
||||
$vars->{'issuedate'} = $issuedate;
|
||||
$vars->{'eventdata'} = $eventdata;
|
||||
$vars->{'cancelaction'} = $cancelaction;
|
||||
|
||||
# Notify the user via email about the cancellation.
|
||||
|
||||
my $message;
|
||||
$template->process("account/cancel-token.txt.tmpl", $vars, \$message)
|
||||
|| &::ThrowTemplateError($template->error());
|
||||
|
||||
open SENDMAIL, "|/usr/lib/sendmail -t -i";
|
||||
print SENDMAIL $message;
|
||||
close SENDMAIL;
|
||||
|
||||
# Delete the token from the database.
|
||||
&::SendSQL("LOCK TABLES tokens WRITE");
|
||||
&::SendSQL("DELETE FROM tokens WHERE token = $quotedtoken");
|
||||
&::SendSQL("UNLOCK TABLES");
|
||||
}
|
||||
|
||||
sub HasPasswordToken {
|
||||
# Returns a password token if the user has one.
|
||||
|
||||
my ($userid) = @_;
|
||||
|
||||
&::SendSQL("SELECT token FROM tokens
|
||||
WHERE userid = $userid AND tokentype = 'password' LIMIT 1");
|
||||
my ($token) = &::FetchSQLData();
|
||||
|
||||
return $token;
|
||||
}
|
||||
|
||||
sub HasEmailChangeToken {
|
||||
# Returns an email change token if the user has one.
|
||||
|
||||
my ($userid) = @_;
|
||||
|
||||
&::SendSQL("SELECT token FROM tokens WHERE userid = $userid " .
|
||||
"AND (tokentype = 'emailnew' OR tokentype = 'emailold') " .
|
||||
"LIMIT 1");
|
||||
my ($token) = &::FetchSQLData();
|
||||
|
||||
return $token;
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
@@ -1,3 +0,0 @@
|
||||
Please consult The Bugzilla Guide for instructions on how to upgrade
|
||||
Bugzilla from an older version. The Guide can be found with this
|
||||
distribution, in docs/html, docs/txt, and docs/sgml.
|
||||
@@ -1,407 +0,0 @@
|
||||
This file contains only important changes made to Bugzilla before release
|
||||
2.8. If you are upgrading from version older than 2.8, please read this file.
|
||||
If you are upgrading from 2.8 or newer, please read the Installation and
|
||||
Upgrade instructions in The Bugzilla Guide, found with this distribution in
|
||||
docs/html, docs/txt, and docs/sgml.
|
||||
|
||||
For a complete list of what changes, use Bonsai
|
||||
(http://cvs-mirror.mozilla.org/webtools/bonsai/cvsqueryform.cgi) to
|
||||
query the CVS tree. For example,
|
||||
|
||||
http://cvs-mirror.mozilla.org/webtools/bonsai/cvsquery.cgi?module=all&branch=HEAD&branchtype=match&dir=mozilla%2Fwebtools%2Fbugzilla&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot
|
||||
|
||||
will tell you what has been changed in the last week.
|
||||
|
||||
|
||||
10/12/99 The CHANGES file is now obsolete! There is a new file called
|
||||
checksetup.pl. You should get in the habit of running that file every time
|
||||
you update your installation of Bugzilla. That file will be constantly
|
||||
updated to automatically update your installation to match any code changes.
|
||||
If you're curious as to what is going on, changes are commented in that file,
|
||||
at the end.
|
||||
|
||||
Many thanks to Holger Schurig <holgerschurig@nikocity.de> for writing this
|
||||
script!
|
||||
|
||||
|
||||
|
||||
10/11/99 Restructured voting database to add a cached value in each
|
||||
bug recording how many total votes that bug has. While I'm at it, I
|
||||
removed the unused "area" field from the bugs database. It is
|
||||
distressing to realize that the bugs table has reached the maximum
|
||||
number of indices allowed by MySQL (16), which may make future
|
||||
enhancements awkward.
|
||||
|
||||
You must feed the following to MySQL:
|
||||
|
||||
alter table bugs drop column area;
|
||||
alter table bugs add column votes mediumint not null, add index (votes);
|
||||
|
||||
You then *must* delete the data/versioncache file when you make this
|
||||
change, as it contains references to the "area" field. Deleting it is safe,
|
||||
bugzilla will correctly regenerate it.
|
||||
|
||||
If you have been using the voting feature at all, then you will then
|
||||
need to update the voting cache. You can do this by visiting the
|
||||
sanitycheck.cgi page, and taking it up on its offer to rebuild the
|
||||
votes stuff.
|
||||
|
||||
|
||||
10/7/99 Added voting ability. You must run the new script
|
||||
"makevotestable.sh". You must also feed the following to mysql:
|
||||
|
||||
alter table products add column votesperuser smallint not null;
|
||||
|
||||
|
||||
|
||||
9/15/99 Apparently, newer alphas of MySQL won't allow you to have
|
||||
"when" as a column name. So, I have had to rename a column in the
|
||||
bugs_activity table. You must feed the below to mysql or you won't
|
||||
work at all.
|
||||
|
||||
alter table bugs_activity change column when bug_when datetime not null;
|
||||
|
||||
|
||||
8/16/99 Added "OpenVMS" to the list of OS's. Feed this to mysql:
|
||||
|
||||
alter table bugs change column op_sys op_sys enum("All", "Windows 3.1", "Windows 95", "Windows 98", "Windows NT", "Mac System 7", "Mac System 7.5", "Mac System 7.6.1", "Mac System 8.0", "Mac System 8.5", "Mac System 8.6", "AIX", "BSDI", "HP-UX", "IRIX", "Linux", "FreeBSD", "OSF/1", "Solaris", "SunOS", "Neutrino", "OS/2", "BeOS", "OpenVMS", "other") not null;
|
||||
|
||||
6/22/99 Added an entry to the attachments table to record who the submitter
|
||||
was. Nothing uses this yet, but it still should be recorded.
|
||||
|
||||
alter table attachments add column submitter_id mediumint not null;
|
||||
|
||||
You should also run this script to populate the new field:
|
||||
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
use diagnostics;
|
||||
use strict;
|
||||
require "globals.pl";
|
||||
$|=1;
|
||||
ConnectToDatabase();
|
||||
SendSQL("select bug_id, attach_id from attachments order by bug_id");
|
||||
my @list;
|
||||
while (MoreSQLData()) {
|
||||
my @row = FetchSQLData();
|
||||
push(@list, \@row);
|
||||
}
|
||||
foreach my $ref (@list) {
|
||||
my ($bug, $attach) = (@$ref);
|
||||
SendSQL("select long_desc from bugs where bug_id = $bug");
|
||||
my $comment = FetchOneColumn() . "Created an attachment (id=$attach)";
|
||||
|
||||
if ($comment =~ m@-* Additional Comments From ([^ ]*)[- 0-9/:]*\nCreated an attachment \(id=$attach\)@) {
|
||||
print "Found $1\n";
|
||||
SendSQL("select userid from profiles where login_name=" .
|
||||
SqlQuote($1));
|
||||
my $userid = FetchOneColumn();
|
||||
if (defined $userid && $userid > 0) {
|
||||
SendSQL("update attachments set submitter_id=$userid where attach_id = $attach");
|
||||
}
|
||||
} else {
|
||||
print "Bug $bug can't find comment for attachment $attach\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
6/14/99 Added "BeOS" to the list of OS's. Feed this to mysql:
|
||||
|
||||
alter table bugs change column op_sys op_sys enum("All", "Windows 3.1", "Windows 95", "Windows 98", "Windows NT", "Mac System 7", "Mac System 7.5", "Mac System 7.6.1", "Mac System 8.0", "Mac System 8.5", "Mac System 8.6", "AIX", "BSDI", "HP-UX", "IRIX", "Linux", "FreeBSD", "OSF/1", "Solaris", "SunOS", "Neutrino", "OS/2", "BeOS", "other") not null;
|
||||
|
||||
|
||||
5/27/99 Added support for dependency information. You must run the new
|
||||
"makedependenciestable.sh" script. You can turn off dependencies with the new
|
||||
"usedependencies" param, but it defaults to being on. Also, read very
|
||||
carefully the description for the new "webdotbase" param; you will almost
|
||||
certainly need to tweak it.
|
||||
|
||||
|
||||
5/24/99 Added "Mac System 8.6" and "Neutrino" to the list of OS's.
|
||||
Feed this to mysql:
|
||||
|
||||
alter table bugs change column op_sys op_sys enum("All", "Windows 3.1", "Windows 95", "Windows 98", "Windows NT", "Mac System 7", "Mac System 7.5", "Mac System 7.6.1", "Mac System 8.0", "Mac System 8.5", "Mac System 8.6", "AIX", "BSDI", "HP-UX", "IRIX", "Linux", "FreeBSD", "OSF/1", "Solaris", "SunOS", "Neutrino", "OS/2", "other") not null;
|
||||
|
||||
|
||||
5/12/99 Added a pref to control how much email you get. This needs a new
|
||||
column in the profiles table, so feed the following to mysql:
|
||||
|
||||
alter table profiles add column emailnotification enum("ExcludeSelfChanges", "CConly", "All") not null default "ExcludeSelfChanges";
|
||||
|
||||
5/5/99 Added the ability to search by creation date. To make this perform
|
||||
well, you ought to do the following:
|
||||
|
||||
alter table bugs change column creation_ts creation_ts datetime not null, add index (creation_ts);
|
||||
|
||||
|
||||
4/30/99 Added a new severity, "blocker". To get this into your running
|
||||
Bugzilla, do the following:
|
||||
|
||||
alter table bugs change column bug_severity bug_severity enum("blocker", "critical", "major", "normal", "minor", "trivial", "enhancement") not null;
|
||||
|
||||
|
||||
4/22/99 There was a bug where the long descriptions of bugs had a variety of
|
||||
newline characters at the end, depending on the operating system of the browser
|
||||
that submitted the text. This bug has been fixed, so that no further changes
|
||||
like that will happen. But to fix problems that have already crept into your
|
||||
database, you can run the following perl script (which is slow and ugly, but
|
||||
does work:)
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
use diagnostics;
|
||||
use strict;
|
||||
require "globals.pl";
|
||||
$|=1;
|
||||
ConnectToDatabase();
|
||||
SendSQL("select bug_id from bugs order by bug_id");
|
||||
my @list;
|
||||
while (MoreSQLData()) {
|
||||
push(@list, FetchOneColumn());
|
||||
}
|
||||
foreach my $id (@list) {
|
||||
if ($id % 50 == 0) {
|
||||
print "\n$id ";
|
||||
}
|
||||
SendSQL("select long_desc from bugs where bug_id = $id");
|
||||
my $comment = FetchOneColumn();
|
||||
my $orig = $comment;
|
||||
$comment =~ s/\r\n/\n/g; # Get rid of windows-style line endings.
|
||||
$comment =~ s/\r/\n/g; # Get rid of mac-style line endings.
|
||||
if ($comment ne $orig) {
|
||||
SendSQL("update bugs set long_desc = " . SqlQuote($comment) .
|
||||
" where bug_id = $id");
|
||||
print ".";
|
||||
} else {
|
||||
print "-";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
4/8/99 Added ability to store patches with bugs. This requires a new table
|
||||
to store the data, so you will need to run the "makeattachmenttable.sh" script.
|
||||
|
||||
3/25/99 Unfortunately, the HTML::FromText CPAN module had too many bugs, and
|
||||
so I had to roll my own. We no longer use the HTML::FromText CPAN module.
|
||||
|
||||
3/24/99 (This entry has been removed. It used to say that we required the
|
||||
HTML::FromText CPAN module, but that's no longer true.)
|
||||
|
||||
3/22/99 Added the ability to query by fields which have changed within a date
|
||||
range. To make this perform a bit better, we need a new index:
|
||||
|
||||
alter table bugs_activity add index (field);
|
||||
|
||||
3/10/99 Added 'groups' stuff, where we have different group bits that we can
|
||||
put on a person or on a bug. Some of the group bits control access to bugzilla
|
||||
features. And a person can't access a bug unless he has every group bit set
|
||||
that is also set on the bug. See the comments in makegroupstable.sh for a bit
|
||||
more info.
|
||||
|
||||
The 'maintainer' param is now used only as an email address for people to send
|
||||
complaints to. The groups table is what is now used to determine permissions.
|
||||
|
||||
You will need to run the new script "makegroupstable.sh". And then you need to
|
||||
feed the following lines to MySQL (replace XXX with the login name of the
|
||||
maintainer, the person you wish to be all-powerful).
|
||||
|
||||
alter table bugs add column groupset bigint not null;
|
||||
alter table profiles add column groupset bigint not null;
|
||||
update profiles set groupset=0x7fffffffffffffff where login_name = XXX;
|
||||
|
||||
|
||||
|
||||
3/8/99 Added params to control how priorities are set in a new bug. You can
|
||||
now choose whether to let submitters of new bugs choose a priority, or whether
|
||||
they should just accept the default priority (which is now no longer hardcoded
|
||||
to "P2", but is instead a param.) The default value of the params will cause
|
||||
the same behavior as before.
|
||||
|
||||
3/3/99 Added a "disallownew" field to the products table. If non-zero, then
|
||||
don't let people file new bugs against this product. (This is for when a
|
||||
product is retired, but you want to keep the bug reports around for posterity.)
|
||||
Feed this to MySQL:
|
||||
|
||||
alter table products add column disallownew tinyint not null;
|
||||
|
||||
|
||||
2/8/99 Added FreeBSD to the list of OS's. Feed this to MySQL:
|
||||
|
||||
alter table bugs change column op_sys op_sys enum("All", "Windows 3.1", "Windows 95", "Windows 98", "Windows NT", "Mac System 7", "Mac System 7.5", "Mac System 7.6.1", "Mac System 8.0", "Mac System 8.5", "AIX", "BSDI", "HP-UX", "IRIX", "Linux", "FreeBSD", "OSF/1", "Solaris", "SunOS", "OS/2", "other") not null;
|
||||
|
||||
|
||||
2/4/99 Added a new column "description" to the components table, and added
|
||||
links to a new page which will use this to describe the components of a
|
||||
given product. Feed this to MySQL:
|
||||
|
||||
alter table components add column description mediumtext not null;
|
||||
|
||||
|
||||
2/3/99 Added a new column "initialqacontact" to the components table that gives
|
||||
an initial QA contact field. It may be empty if you wish the initial qa
|
||||
contact to be empty. If you're not using the QA contact field, you don't need
|
||||
to add this column, but you might as well be safe and add it anyway:
|
||||
|
||||
alter table components add column initialqacontact tinytext not null;
|
||||
|
||||
|
||||
2/2/99 Added a new column "milestoneurl" to the products table that gives a URL
|
||||
which is to describe the currently defined milestones for a product. If you
|
||||
don't use target milestone, you might be able to get away without adding this
|
||||
column, but you might as well be safe and add it anyway:
|
||||
|
||||
alter table products add column milestoneurl tinytext not null;
|
||||
|
||||
|
||||
1/29/99 Whoops; had a misspelled op_sys. It was "Mac System 7.1.6"; it should
|
||||
be "Mac System 7.6.1". It turns out I had no bugs with this value set, so I
|
||||
could just do the below simple command. If you have bugs with this value, you
|
||||
may need to do something more complicated.
|
||||
|
||||
alter table bugs change column op_sys op_sys enum("All", "Windows 3.1", "Windows 95", "Windows 98", "Windows NT", "Mac System 7", "Mac System 7.5", "Mac System 7.6.1", "Mac System 8.0", "Mac System 8.5", "AIX", "BSDI", "HP-UX", "IRIX", "Linux", "OSF/1", "Solaris", "SunOS", "OS/2", "other") not null;
|
||||
|
||||
|
||||
|
||||
1/20/99 Added new fields: Target Milestone, QA Contact, and Status Whiteboard.
|
||||
These fields are all optional in the UI; there are parameters to turn them on.
|
||||
However, whether or not you use them, the fields need to be in the DB. There
|
||||
is some code that needs them, even if you don't.
|
||||
|
||||
To update your DB to have these fields, send the following to MySQL:
|
||||
|
||||
alter table bugs add column target_milestone varchar(20) not null,
|
||||
add column qa_contact mediumint not null,
|
||||
add column status_whiteboard mediumtext not null,
|
||||
add index (target_milestone), add index (qa_contact);
|
||||
|
||||
|
||||
|
||||
1/18/99 You can now query by CC. To make this perform reasonably, the CC table
|
||||
needs some indices. The following MySQL does the necessary stuff:
|
||||
|
||||
alter table cc add index (bug_id), add index (who);
|
||||
|
||||
|
||||
1/15/99 The op_sys field can now be queried by (and more easily tweaked).
|
||||
To make this perform reasonably, it needs an index. The following MySQL
|
||||
command will create the necessary index:
|
||||
|
||||
alter table bugs add index (op_sys);
|
||||
|
||||
|
||||
12/2/98 The op_sys and rep_platform fields have been tweaked. op_sys
|
||||
is now an enum, rather than having the legal values all hard-coded in
|
||||
perl. rep_platform now no longer allows a value of "X-Windows".
|
||||
|
||||
Here's how I ported to the new world. This ought to work for you too.
|
||||
Actually, it's probably overkill. I had a lot of illegal values for op_sys
|
||||
in my tables, from importing bugs from strange places. If you haven't done
|
||||
anything funky, then much of the below will be a no-op.
|
||||
|
||||
First, send the following commands to MySQL to make sure all your values for
|
||||
rep_platform and op_sys are legal in the new world..
|
||||
|
||||
update bugs set rep_platform="Sun" where rep_platform="X-Windows" and op_sys like "Solaris%";
|
||||
update bugs set rep_platform="SGI" where rep_platform="X-Windows" and op_sys = "IRIX";
|
||||
update bugs set rep_platform="SGI" where rep_platform="X-Windows" and op_sys = "HP-UX";
|
||||
update bugs set rep_platform="DEC" where rep_platform="X-Windows" and op_sys = "OSF/1";
|
||||
update bugs set rep_platform="PC" where rep_platform="X-Windows" and op_sys = "Linux";
|
||||
update bugs set rep_platform="other" where rep_platform="X-Windows";
|
||||
update bugs set rep_platform="other" where rep_platform="";
|
||||
update bugs set op_sys="Mac System 7" where op_sys="System 7";
|
||||
update bugs set op_sys="Mac System 7.5" where op_sys="System 7.5";
|
||||
update bugs set op_sys="Mac System 8.0" where op_sys="8.0";
|
||||
update bugs set op_sys="OSF/1" where op_sys="Digital Unix 4.0";
|
||||
update bugs set op_sys="IRIX" where op_sys like "IRIX %";
|
||||
update bugs set op_sys="HP-UX" where op_sys like "HP-UX %";
|
||||
update bugs set op_sys="Windows NT" where op_sys like "NT %";
|
||||
update bugs set op_sys="OSF/1" where op_sys like "OSF/1 %";
|
||||
update bugs set op_sys="Solaris" where op_sys like "Solaris %";
|
||||
update bugs set op_sys="SunOS" where op_sys like "SunOS%";
|
||||
update bugs set op_sys="other" where op_sys = "Motif";
|
||||
update bugs set op_sys="other" where op_sys = "Other";
|
||||
|
||||
Next, send the following commands to make sure you now have only legal
|
||||
entries in your table. If either of the queries do not come up empty, then
|
||||
you have to do more stuff like the above.
|
||||
|
||||
select bug_id,op_sys,rep_platform from bugs where rep_platform not regexp "^(All|DEC|HP|Macintosh|PC|SGI|Sun|X-Windows|Other)$";
|
||||
select bug_id,op_sys,rep_platform from bugs where op_sys not regexp "^(All|Windows 3.1|Windows 95|Windows 98|Windows NT|Mac System 7|Mac System 7.5|Mac System 7.1.6|Mac System 8.0|AIX|BSDI|HP-UX|IRIX|Linux|OSF/1|Solaris|SunOS|other)$";
|
||||
|
||||
Finally, once that's all clear, alter the table to make enforce the new legal
|
||||
entries:
|
||||
|
||||
alter table bugs change column op_sys op_sys enum("All", "Windows 3.1", "Windows 95", "Windows 98", "Windows NT", "Mac System 7", "Mac System 7.5", "Mac System 7.1.6", "Mac System 8.0", "AIX", "BSDI", "HP-UX", "IRIX", "Linux", "OSF/1", "Solaris", "SunOS", "other") not null, change column rep_platform rep_platform enum("All", "DEC", "HP", "Macintosh", "PC", "SGI", "Sun", "Other");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
11/20/98 Added searching of CC field. To better support this, added
|
||||
some indexes to the CC table. You probably want to execute the following
|
||||
mysql commands:
|
||||
|
||||
alter table cc add index (bug_id);
|
||||
alter table cc add index (who);
|
||||
|
||||
|
||||
10/27/98 security check for legal products in place. bug charts are not
|
||||
available as an option if collectstats.pl has never been run. all products
|
||||
get daily stats collected now. README updated: Chart::Base is listed as
|
||||
a requirement, instructions for using collectstats.pl included as
|
||||
an optional step. also got silly and added optional quips to bug
|
||||
reports.
|
||||
|
||||
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
|
||||
only used when initially adding a new bug. Anyway, you *must* create
|
||||
the new table (which you can do by running the new makeproducttable.sh
|
||||
script). If you just leave it empty, things will work much as they
|
||||
did before, or you can add descriptions for some or all of your
|
||||
products.
|
||||
|
||||
|
||||
9/15/98 Everything has been ported to Perl. NO MORE TCL. This
|
||||
transition should be relatively painless, except for the "params"
|
||||
file. This is the file that contains parameters you've set up on the
|
||||
editparams.cgi page. Before changing to Perl, this was a tcl-syntax
|
||||
file, stored in the same directory as the code; after the change to
|
||||
Perl, it becomes a perl-syntax file, stored in a subdirectory named
|
||||
"data". See the README file for more details on what version of Perl
|
||||
you need.
|
||||
|
||||
So, if updating from an older version of Bugzilla, you will need to
|
||||
edit data/param, change the email address listed for
|
||||
$::param{'maintainer'}, and then go revisit the editparams.cgi page
|
||||
and reset all the parameters to your taste. Fortunately, your old
|
||||
params file will still be around, and so you ought to be able to
|
||||
cut&paste important bits from there.
|
||||
|
||||
Also, note that the "whineatnews" script has changed name (it now has
|
||||
an extension of .pl instead of .tcl), so you'll need to change your
|
||||
cron job.
|
||||
|
||||
And the "comments" file has been moved to the data directory. Just do
|
||||
"cat comments >> data/comments" to restore any old comments that may
|
||||
have been lost.
|
||||
|
||||
|
||||
|
||||
9/2/98 Changed the way password validation works. We now keep a
|
||||
crypt'd version of the password in the database, and check against
|
||||
that. (This is silly, because we're also keeping the plaintext
|
||||
version there, but I have plans...) Stop passing the plaintext
|
||||
password around as a cookie; instead, we have a cookie that references
|
||||
a record in a new database table, logincookies.
|
||||
|
||||
IMPORTANT: if updating from an older version of Bugzilla, you must run
|
||||
the following commands to keep things working:
|
||||
|
||||
./makelogincookiestable.sh
|
||||
echo "alter table profiles add column cryptpassword varchar(64);" | mysql bugs
|
||||
echo "update profiles set cryptpassword = encrypt(password,substring(rand(),3, 4));" | mysql bugs
|
||||
|
||||
|
Before Width: | Height: | Size: 8.3 KiB |
@@ -1,788 +0,0 @@
|
||||
#!/usr/bonsaitools/bin/perl -wT
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Terry Weissman <terry@mozilla.org>
|
||||
# Myk Melez <myk@mozilla.org>
|
||||
|
||||
################################################################################
|
||||
# Script Initialization
|
||||
################################################################################
|
||||
|
||||
# Make it harder for us to do dangerous things in Perl.
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
use lib qw(.);
|
||||
|
||||
use vars qw(
|
||||
$template
|
||||
$vars
|
||||
);
|
||||
|
||||
# Include the Bugzilla CGI and general utility library.
|
||||
require "CGI.pl";
|
||||
|
||||
# Establish a connection to the database backend.
|
||||
ConnectToDatabase();
|
||||
|
||||
# Check whether or not the user is logged in and, if so, set the $::userid
|
||||
# and $::usergroupset variables.
|
||||
quietly_check_login();
|
||||
|
||||
################################################################################
|
||||
# Main Body Execution
|
||||
################################################################################
|
||||
|
||||
# All calls to this script should contain an "action" variable whose value
|
||||
# determines what the user wants to do. The code below checks the value of
|
||||
# that variable and runs the appropriate code.
|
||||
|
||||
# Determine whether to use the action specified by the user or the default.
|
||||
my $action = $::FORM{'action'} || 'view';
|
||||
|
||||
if ($action eq "view")
|
||||
{
|
||||
validateID();
|
||||
view();
|
||||
}
|
||||
elsif ($action eq "viewall")
|
||||
{
|
||||
ValidateBugID($::FORM{'bugid'});
|
||||
viewall();
|
||||
}
|
||||
elsif ($action eq "enter")
|
||||
{
|
||||
confirm_login();
|
||||
ValidateBugID($::FORM{'bugid'});
|
||||
enter();
|
||||
}
|
||||
elsif ($action eq "insert")
|
||||
{
|
||||
confirm_login();
|
||||
ValidateBugID($::FORM{'bugid'});
|
||||
ValidateComment($::FORM{'comment'});
|
||||
validateFilename();
|
||||
validateData();
|
||||
validateDescription();
|
||||
validateIsPatch();
|
||||
validateContentType() unless $::FORM{'ispatch'};
|
||||
validateObsolete() if $::FORM{'obsolete'};
|
||||
insert();
|
||||
}
|
||||
elsif ($action eq "edit")
|
||||
{
|
||||
quietly_check_login();
|
||||
validateID();
|
||||
validateCanEdit($::FORM{'id'});
|
||||
edit();
|
||||
}
|
||||
elsif ($action eq "update")
|
||||
{
|
||||
confirm_login();
|
||||
ValidateComment($::FORM{'comment'});
|
||||
validateID();
|
||||
validateCanEdit($::FORM{'id'});
|
||||
validateDescription();
|
||||
validateIsPatch();
|
||||
validateContentType() unless $::FORM{'ispatch'};
|
||||
validateIsObsolete();
|
||||
validateStatuses();
|
||||
update();
|
||||
}
|
||||
else
|
||||
{
|
||||
DisplayError("I could not figure out what you wanted to do.")
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
################################################################################
|
||||
# Data Validation / Security Authorization
|
||||
################################################################################
|
||||
|
||||
sub validateID
|
||||
{
|
||||
# Validate the value of the "id" form field, which must contain an
|
||||
# integer that is the ID of an existing attachment.
|
||||
|
||||
detaint_natural($::FORM{'id'})
|
||||
|| DisplayError("You did not enter a valid attachment number.")
|
||||
&& exit;
|
||||
|
||||
# Make sure the attachment exists in the database.
|
||||
SendSQL("SELECT bug_id FROM attachments WHERE attach_id = $::FORM{'id'}");
|
||||
MoreSQLData()
|
||||
|| DisplayError("Attachment #$::FORM{'id'} does not exist.")
|
||||
&& exit;
|
||||
|
||||
# Make sure the user is authorized to access this attachment's bug.
|
||||
my ($bugid) = FetchSQLData();
|
||||
ValidateBugID($bugid);
|
||||
}
|
||||
|
||||
sub validateCanEdit
|
||||
{
|
||||
my ($attach_id) = (@_);
|
||||
|
||||
# If the user is not logged in, claim that they can edit. This allows
|
||||
# the edit scrren to be displayed to people who aren't logged in.
|
||||
# People not logged in can't actually commit changes, because that code
|
||||
# calls confirm_login, not quietly_check_login, before calling this sub
|
||||
return if $::userid == 0;
|
||||
|
||||
# People in editbugs can edit all attachments
|
||||
return if UserInGroup("editbugs");
|
||||
|
||||
# Bug 97729 - the submitter can edit their attachments
|
||||
SendSQL("SELECT attach_id FROM attachments WHERE " .
|
||||
"attach_id = $attach_id AND submitter_id = $::userid");
|
||||
|
||||
FetchSQLData()
|
||||
|| DisplayError("You are not authorised to edit attachment #$attach_id")
|
||||
&& exit;
|
||||
}
|
||||
|
||||
sub validateDescription
|
||||
{
|
||||
$::FORM{'description'}
|
||||
|| DisplayError("You must enter a description for the attachment.")
|
||||
&& exit;
|
||||
}
|
||||
|
||||
sub validateIsPatch
|
||||
{
|
||||
# Set the ispatch flag to zero if it is undefined, since the UI uses
|
||||
# an HTML checkbox to represent this flag, and unchecked HTML checkboxes
|
||||
# do not get sent in HTML requests.
|
||||
$::FORM{'ispatch'} = $::FORM{'ispatch'} ? 1 : 0;
|
||||
|
||||
# Set the content type to text/plain if the attachment is a patch.
|
||||
$::FORM{'contenttype'} = "text/plain" if $::FORM{'ispatch'};
|
||||
}
|
||||
|
||||
sub validateContentType
|
||||
{
|
||||
if (!$::FORM{'contenttypemethod'})
|
||||
{
|
||||
DisplayError("You must choose a method for determining the content type,
|
||||
either <em>auto-detect</em>, <em>select from list</em>, or <em>enter
|
||||
manually</em>.");
|
||||
exit;
|
||||
}
|
||||
elsif ($::FORM{'contenttypemethod'} eq 'autodetect')
|
||||
{
|
||||
# The user asked us to auto-detect the content type, so use the type
|
||||
# specified in the HTTP request headers.
|
||||
if ( !$::FILE{'data'}->{'contenttype'} )
|
||||
{
|
||||
DisplayError("You asked Bugzilla to auto-detect the content type, but
|
||||
your browser did not specify a content type when uploading the file,
|
||||
so you must enter a content type manually.");
|
||||
exit;
|
||||
}
|
||||
$::FORM{'contenttype'} = $::FILE{'data'}->{'contenttype'};
|
||||
}
|
||||
elsif ($::FORM{'contenttypemethod'} eq 'list')
|
||||
{
|
||||
# The user selected a content type from the list, so use their selection.
|
||||
$::FORM{'contenttype'} = $::FORM{'contenttypeselection'};
|
||||
}
|
||||
elsif ($::FORM{'contenttypemethod'} eq 'manual')
|
||||
{
|
||||
# The user entered a content type manually, so use their entry.
|
||||
$::FORM{'contenttype'} = $::FORM{'contenttypeentry'};
|
||||
}
|
||||
else
|
||||
{
|
||||
my $htmlcontenttypemethod = html_quote($::FORM{'contenttypemethod'});
|
||||
DisplayError("Your form submission got corrupted somehow. The <em>content
|
||||
method</em> field, which specifies how the content type gets determined,
|
||||
should have been either <em>autodetect</em>, <em>list</em>,
|
||||
or <em>manual</em>, but was instead <em>$htmlcontenttypemethod</em>.");
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( $::FORM{'contenttype'} !~ /^(application|audio|image|message|model|multipart|text|video)\/.+$/ )
|
||||
{
|
||||
my $htmlcontenttype = html_quote($::FORM{'contenttype'});
|
||||
DisplayError("The content type <em>$htmlcontenttype</em> is invalid.
|
||||
Valid types must be of the form <em>foo/bar</em> where <em>foo</em>
|
||||
is either <em>application, audio, image, message, model, multipart,
|
||||
text,</em> or <em>video</em>.");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
sub validateIsObsolete
|
||||
{
|
||||
# Set the isobsolete flag to zero if it is undefined, since the UI uses
|
||||
# an HTML checkbox to represent this flag, and unchecked HTML checkboxes
|
||||
# do not get sent in HTML requests.
|
||||
$::FORM{'isobsolete'} = $::FORM{'isobsolete'} ? 1 : 0;
|
||||
}
|
||||
|
||||
sub validateStatuses
|
||||
{
|
||||
# Get a list of attachment statuses that are valid for this attachment.
|
||||
PushGlobalSQLState();
|
||||
SendSQL("SELECT attachstatusdefs.id
|
||||
FROM attachments, bugs, attachstatusdefs
|
||||
WHERE attachments.attach_id = $::FORM{'id'}
|
||||
AND attachments.bug_id = bugs.bug_id
|
||||
AND attachstatusdefs.product = bugs.product");
|
||||
my @statusdefs;
|
||||
push(@statusdefs, FetchSQLData()) while MoreSQLData();
|
||||
PopGlobalSQLState();
|
||||
|
||||
foreach my $status (@{$::MFORM{'status'}})
|
||||
{
|
||||
grep($_ == $status, @statusdefs)
|
||||
|| DisplayError("One of the statuses you entered is not a valid status
|
||||
for this attachment.")
|
||||
&& exit;
|
||||
# We have tested that the status is valid, so it can be detainted
|
||||
detaint_natural($status);
|
||||
}
|
||||
}
|
||||
|
||||
sub validateData
|
||||
{
|
||||
$::FORM{'data'}
|
||||
|| DisplayError("The file you are trying to attach is empty!")
|
||||
&& exit;
|
||||
|
||||
my $len = length($::FORM{'data'});
|
||||
|
||||
my $maxpatchsize = Param('maxpatchsize');
|
||||
my $maxattachmentsize = Param('maxattachmentsize');
|
||||
|
||||
# Makes sure the attachment does not exceed either the "maxpatchsize" or
|
||||
# the "maxattachmentsize" parameter.
|
||||
if ( $::FORM{'ispatch'} && $maxpatchsize && $len > $maxpatchsize*1024 )
|
||||
{
|
||||
my $lenkb = sprintf("%.0f", $len/1024);
|
||||
DisplayError("The file you are trying to attach is ${lenkb} kilobytes (KB) in size.
|
||||
Patches cannot be more than ${maxpatchsize}KB in size.
|
||||
Try breaking your patch into several pieces.");
|
||||
exit;
|
||||
} elsif ( !$::FORM{'ispatch'} && $maxattachmentsize && $len > $maxattachmentsize*1024 ) {
|
||||
my $lenkb = sprintf("%.0f", $len/1024);
|
||||
DisplayError("The file you are trying to attach is ${lenkb} kilobytes (KB) in size.
|
||||
Non-patch attachments cannot be more than ${maxattachmentsize}KB.
|
||||
If your attachment is an image, try converting it to a compressable
|
||||
format like JPG or PNG, or put it elsewhere on the web and
|
||||
link to it from the bug's URL field or in a comment on the bug.");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
sub validateFilename
|
||||
{
|
||||
defined $::FILE{'data'}
|
||||
|| DisplayError("You did not specify a file to attach.")
|
||||
&& exit;
|
||||
}
|
||||
|
||||
sub validateObsolete
|
||||
{
|
||||
# Make sure the attachment id is valid and the user has permissions to view
|
||||
# the bug to which it is attached.
|
||||
foreach my $attachid (@{$::MFORM{'obsolete'}}) {
|
||||
detaint_natural($attachid)
|
||||
|| DisplayError("The attachment number of one of the attachments
|
||||
you wanted to obsolete is invalid.")
|
||||
&& exit;
|
||||
|
||||
SendSQL("SELECT bug_id, isobsolete, description
|
||||
FROM attachments WHERE attach_id = $attachid");
|
||||
|
||||
# Make sure the attachment exists in the database.
|
||||
MoreSQLData()
|
||||
|| DisplayError("Attachment #$attachid does not exist.")
|
||||
&& exit;
|
||||
|
||||
my ($bugid, $isobsolete, $description) = FetchSQLData();
|
||||
|
||||
if ($bugid != $::FORM{'bugid'})
|
||||
{
|
||||
$description = html_quote($description);
|
||||
DisplayError("Attachment #$attachid ($description) is attached
|
||||
to bug #$bugid, but you tried to flag it as obsolete while
|
||||
creating a new attachment to bug #$::FORM{'bugid'}.");
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( $isobsolete )
|
||||
{
|
||||
$description = html_quote($description);
|
||||
DisplayError("Attachment #$attachid ($description) is already obsolete.");
|
||||
exit;
|
||||
}
|
||||
|
||||
# Check that the user can modify this attachment
|
||||
validateCanEdit($attachid);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Functions
|
||||
################################################################################
|
||||
|
||||
sub view
|
||||
{
|
||||
# Display an attachment.
|
||||
|
||||
# Retrieve the attachment content and its content type from the database.
|
||||
SendSQL("SELECT mimetype, thedata FROM attachments WHERE attach_id = $::FORM{'id'}");
|
||||
my ($contenttype, $thedata) = FetchSQLData();
|
||||
|
||||
# Return the appropriate HTTP response headers.
|
||||
print "Content-Type: $contenttype\n\n";
|
||||
|
||||
print $thedata;
|
||||
}
|
||||
|
||||
|
||||
sub viewall
|
||||
{
|
||||
# Display all attachments for a given bug in a series of IFRAMEs within one HTML page.
|
||||
|
||||
# Retrieve the attachments from the database and write them into an array
|
||||
# of hashes where each hash represents one attachment.
|
||||
SendSQL("SELECT attach_id, creation_ts, mimetype, description, ispatch, isobsolete
|
||||
FROM attachments WHERE bug_id = $::FORM{'bugid'} ORDER BY attach_id");
|
||||
my @attachments; # the attachments array
|
||||
while (MoreSQLData())
|
||||
{
|
||||
my %a; # the attachment hash
|
||||
($a{'attachid'}, $a{'date'}, $a{'contenttype'},
|
||||
$a{'description'}, $a{'ispatch'}, $a{'isobsolete'}) = FetchSQLData();
|
||||
|
||||
# Format the attachment's creation/modification date into something readable.
|
||||
if ($a{'date'} =~ /^(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/) {
|
||||
$a{'date'} = "$3/$4/$2 $5:$6";
|
||||
}
|
||||
|
||||
# Flag attachments as to whether or not they can be viewed (as opposed to
|
||||
# being downloaded). Currently I decide they are viewable if their MIME type
|
||||
# is either text/*, image/*, or application/vnd.mozilla.*.
|
||||
# !!! Yuck, what an ugly hack. Fix it!
|
||||
$a{'isviewable'} = ( $a{'contenttype'} =~ /^(text|image|application\/vnd\.mozilla\.)/ );
|
||||
|
||||
# Retrieve a list of status flags that have been set on the attachment.
|
||||
PushGlobalSQLState();
|
||||
SendSQL("SELECT name
|
||||
FROM attachstatuses, attachstatusdefs
|
||||
WHERE attach_id = $a{'attachid'}
|
||||
AND attachstatuses.statusid = attachstatusdefs.id
|
||||
ORDER BY sortkey");
|
||||
my @statuses;
|
||||
push(@statuses, FetchSQLData()) while MoreSQLData();
|
||||
$a{'statuses'} = \@statuses;
|
||||
PopGlobalSQLState();
|
||||
|
||||
# Add the hash representing the attachment to the array of attachments.
|
||||
push @attachments, \%a;
|
||||
}
|
||||
|
||||
# Retrieve the bug summary for displaying on screen.
|
||||
SendSQL("SELECT short_desc FROM bugs WHERE bug_id = $::FORM{'bugid'}");
|
||||
my ($bugsummary) = FetchSQLData();
|
||||
|
||||
# Define the variables and functions that will be passed to the UI template.
|
||||
$vars->{'bugid'} = $::FORM{'bugid'};
|
||||
$vars->{'bugsummary'} = $bugsummary;
|
||||
$vars->{'attachments'} = \@attachments;
|
||||
|
||||
# Return the appropriate HTTP response headers.
|
||||
print "Content-Type: text/html\n\n";
|
||||
|
||||
# Generate and return the UI (HTML page) from the appropriate template.
|
||||
$template->process("attachment/show-multiple.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
}
|
||||
|
||||
|
||||
sub enter
|
||||
{
|
||||
# Display a form for entering a new attachment.
|
||||
|
||||
# Retrieve the attachments the user can edit from the database and write
|
||||
# them into an array of hashes where each hash represents one attachment.
|
||||
my $canEdit = "";
|
||||
if (!UserInGroup("editbugs")) {
|
||||
$canEdit = "AND submitter_id = $::userid";
|
||||
}
|
||||
SendSQL("SELECT attach_id, description
|
||||
FROM attachments
|
||||
WHERE bug_id = $::FORM{'bugid'}
|
||||
AND isobsolete = 0 $canEdit
|
||||
ORDER BY attach_id");
|
||||
my @attachments; # the attachments array
|
||||
while ( MoreSQLData() ) {
|
||||
my %a; # the attachment hash
|
||||
($a{'id'}, $a{'description'}) = FetchSQLData();
|
||||
|
||||
# Add the hash representing the attachment to the array of attachments.
|
||||
push @attachments, \%a;
|
||||
}
|
||||
|
||||
# Retrieve the bug summary for displaying on screen.
|
||||
SendSQL("SELECT short_desc FROM bugs WHERE bug_id = $::FORM{'bugid'}");
|
||||
my ($bugsummary) = FetchSQLData();
|
||||
|
||||
# Define the variables and functions that will be passed to the UI template.
|
||||
$vars->{'bugid'} = $::FORM{'bugid'};
|
||||
$vars->{'bugsummary'} = $bugsummary;
|
||||
$vars->{'attachments'} = \@attachments;
|
||||
|
||||
# Return the appropriate HTTP response headers.
|
||||
print "Content-Type: text/html\n\n";
|
||||
|
||||
# Generate and return the UI (HTML page) from the appropriate template.
|
||||
$template->process("attachment/create.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
}
|
||||
|
||||
|
||||
sub insert
|
||||
{
|
||||
# Insert a new attachment into the database.
|
||||
|
||||
# Escape characters in strings that will be used in SQL statements.
|
||||
my $filename = SqlQuote($::FILE{'data'}->{'filename'});
|
||||
my $description = SqlQuote($::FORM{'description'});
|
||||
my $contenttype = SqlQuote($::FORM{'contenttype'});
|
||||
my $thedata = SqlQuote($::FORM{'data'});
|
||||
|
||||
# Insert the attachment into the database.
|
||||
SendSQL("INSERT INTO attachments (bug_id, filename, description, mimetype, ispatch, submitter_id, thedata)
|
||||
VALUES ($::FORM{'bugid'}, $filename, $description, $contenttype, $::FORM{'ispatch'}, $::userid, $thedata)");
|
||||
|
||||
# Retrieve the ID of the newly created attachment record.
|
||||
SendSQL("SELECT LAST_INSERT_ID()");
|
||||
my $attachid = FetchOneColumn();
|
||||
|
||||
# Insert a comment about the new attachment into the database.
|
||||
my $comment = "Created an attachment (id=$attachid)\n$::FORM{'description'}\n";
|
||||
$comment .= ("\n" . $::FORM{'comment'}) if $::FORM{'comment'};
|
||||
|
||||
use Text::Wrap;
|
||||
$Text::Wrap::columns = 80;
|
||||
$Text::Wrap::huge = 'overflow';
|
||||
$comment = Text::Wrap::wrap('', '', $comment);
|
||||
|
||||
AppendComment($::FORM{'bugid'},
|
||||
$::COOKIE{"Bugzilla_login"},
|
||||
$comment);
|
||||
|
||||
# Make existing attachments obsolete.
|
||||
my $fieldid = GetFieldID('attachments.isobsolete');
|
||||
foreach my $attachid (@{$::MFORM{'obsolete'}}) {
|
||||
SendSQL("UPDATE attachments SET isobsolete = 1 WHERE attach_id = $attachid");
|
||||
SendSQL("INSERT INTO bugs_activity (bug_id, attach_id, who, bug_when, fieldid, removed, added)
|
||||
VALUES ($::FORM{'bugid'}, $attachid, $::userid, NOW(), $fieldid, '0', '1')");
|
||||
}
|
||||
|
||||
# Send mail to let people know the attachment has been created. Uses a
|
||||
# special syntax of the "open" and "exec" commands to capture the output of
|
||||
# "processmail", which "system" doesn't allow, without running the command
|
||||
# through a shell, which backticks (``) do.
|
||||
#system ("./processmail", $bugid , $::userid);
|
||||
#my $mailresults = `./processmail $bugid $::userid`;
|
||||
my $mailresults = '';
|
||||
open(PMAIL, "-|") or exec('./processmail', $::FORM{'bugid'}, $::COOKIE{'Bugzilla_login'});
|
||||
$mailresults .= $_ while <PMAIL>;
|
||||
close(PMAIL);
|
||||
|
||||
# Define the variables and functions that will be passed to the UI template.
|
||||
$vars->{'bugid'} = $::FORM{'bugid'};
|
||||
$vars->{'attachid'} = $attachid;
|
||||
$vars->{'description'} = $description;
|
||||
$vars->{'mailresults'} = $mailresults;
|
||||
$vars->{'contenttypemethod'} = $::FORM{'contenttypemethod'};
|
||||
$vars->{'contenttype'} = $::FORM{'contenttype'};
|
||||
|
||||
# Return the appropriate HTTP response headers.
|
||||
print "Content-Type: text/html\n\n";
|
||||
|
||||
# Generate and return the UI (HTML page) from the appropriate template.
|
||||
$template->process("attachment/created.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
}
|
||||
|
||||
|
||||
sub edit
|
||||
{
|
||||
# Edit an attachment record. Users with "editbugs" privileges, (or the
|
||||
# original attachment's submitter) can edit the attachment's description,
|
||||
# content type, ispatch and isobsolete flags, and statuses, and they can
|
||||
# also submit a comment that appears in the bug.
|
||||
# Users cannot edit the content of the attachment itself.
|
||||
|
||||
# Retrieve the attachment from the database.
|
||||
SendSQL("SELECT description, mimetype, bug_id, ispatch, isobsolete
|
||||
FROM attachments WHERE attach_id = $::FORM{'id'}");
|
||||
my ($description, $contenttype, $bugid, $ispatch, $isobsolete) = FetchSQLData();
|
||||
|
||||
# Flag attachment as to whether or not it can be viewed (as opposed to
|
||||
# being downloaded). Currently I decide it is viewable if its content
|
||||
# type is either text/.* or application/vnd.mozilla.*.
|
||||
# !!! Yuck, what an ugly hack. Fix it!
|
||||
my $isviewable = ( $contenttype =~ /^(text|image|application\/vnd\.mozilla\.)/ );
|
||||
|
||||
# Retrieve a list of status flags that have been set on the attachment.
|
||||
my %statuses;
|
||||
SendSQL("SELECT id, name
|
||||
FROM attachstatuses JOIN attachstatusdefs
|
||||
WHERE attachstatuses.statusid = attachstatusdefs.id
|
||||
AND attach_id = $::FORM{'id'}");
|
||||
while ( my ($id, $name) = FetchSQLData() )
|
||||
{
|
||||
$statuses{$id} = $name;
|
||||
}
|
||||
|
||||
# Retrieve a list of statuses for this bug's product, and build an array
|
||||
# of hashes in which each hash is a status flag record.
|
||||
# ???: Move this into versioncache or its own routine?
|
||||
my @statusdefs;
|
||||
SendSQL("SELECT id, name
|
||||
FROM attachstatusdefs, bugs
|
||||
WHERE bug_id = $bugid
|
||||
AND attachstatusdefs.product = bugs.product
|
||||
ORDER BY sortkey");
|
||||
while ( MoreSQLData() )
|
||||
{
|
||||
my ($id, $name) = FetchSQLData();
|
||||
push @statusdefs, { 'id' => $id , 'name' => $name };
|
||||
}
|
||||
|
||||
# Retrieve a list of attachments for this bug as well as a summary of the bug
|
||||
# to use in a navigation bar across the top of the screen.
|
||||
SendSQL("SELECT attach_id FROM attachments WHERE bug_id = $bugid ORDER BY attach_id");
|
||||
my @bugattachments;
|
||||
push(@bugattachments, FetchSQLData()) while (MoreSQLData());
|
||||
SendSQL("SELECT short_desc FROM bugs WHERE bug_id = $bugid");
|
||||
my ($bugsummary) = FetchSQLData();
|
||||
|
||||
# Define the variables and functions that will be passed to the UI template.
|
||||
$vars->{'attachid'} = $::FORM{'id'};
|
||||
$vars->{'description'} = $description;
|
||||
$vars->{'contenttype'} = $contenttype;
|
||||
$vars->{'bugid'} = $bugid;
|
||||
$vars->{'bugsummary'} = $bugsummary;
|
||||
$vars->{'ispatch'} = $ispatch;
|
||||
$vars->{'isobsolete'} = $isobsolete;
|
||||
$vars->{'isviewable'} = $isviewable;
|
||||
$vars->{'statuses'} = \%statuses;
|
||||
$vars->{'statusdefs'} = \@statusdefs;
|
||||
$vars->{'attachments'} = \@bugattachments;
|
||||
|
||||
# Return the appropriate HTTP response headers.
|
||||
print "Content-Type: text/html\n\n";
|
||||
|
||||
# Generate and return the UI (HTML page) from the appropriate template.
|
||||
$template->process("attachment/edit.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
}
|
||||
|
||||
|
||||
sub update
|
||||
{
|
||||
# Update an attachment record.
|
||||
|
||||
# Get the bug ID for the bug to which this attachment is attached.
|
||||
SendSQL("SELECT bug_id FROM attachments WHERE attach_id = $::FORM{'id'}");
|
||||
my $bugid = FetchSQLData()
|
||||
|| DisplayError("Cannot figure out bug number.")
|
||||
&& exit;
|
||||
|
||||
# Lock database tables in preparation for updating the attachment.
|
||||
SendSQL("LOCK TABLES attachments WRITE , attachstatuses WRITE ,
|
||||
attachstatusdefs READ , fielddefs READ , bugs_activity WRITE");
|
||||
|
||||
# Get a copy of the attachment record before we make changes
|
||||
# so we can record those changes in the activity table.
|
||||
SendSQL("SELECT description, mimetype, ispatch, isobsolete
|
||||
FROM attachments WHERE attach_id = $::FORM{'id'}");
|
||||
my ($olddescription, $oldcontenttype, $oldispatch, $oldisobsolete) = FetchSQLData();
|
||||
|
||||
# Get the list of old status flags.
|
||||
SendSQL("SELECT attachstatusdefs.name
|
||||
FROM attachments, attachstatuses, attachstatusdefs
|
||||
WHERE attachments.attach_id = $::FORM{'id'}
|
||||
AND attachments.attach_id = attachstatuses.attach_id
|
||||
AND attachstatuses.statusid = attachstatusdefs.id
|
||||
ORDER BY attachstatusdefs.sortkey
|
||||
");
|
||||
my @oldstatuses;
|
||||
while (MoreSQLData()) {
|
||||
push(@oldstatuses, FetchSQLData());
|
||||
}
|
||||
my $oldstatuslist = join(', ', @oldstatuses);
|
||||
|
||||
# Update the database with the new status flags.
|
||||
SendSQL("DELETE FROM attachstatuses WHERE attach_id = $::FORM{'id'}");
|
||||
foreach my $statusid (@{$::MFORM{'status'}})
|
||||
{
|
||||
SendSQL("INSERT INTO attachstatuses (attach_id, statusid) VALUES ($::FORM{'id'}, $statusid)");
|
||||
}
|
||||
|
||||
# Get the list of new status flags.
|
||||
SendSQL("SELECT attachstatusdefs.name
|
||||
FROM attachments, attachstatuses, attachstatusdefs
|
||||
WHERE attachments.attach_id = $::FORM{'id'}
|
||||
AND attachments.attach_id = attachstatuses.attach_id
|
||||
AND attachstatuses.statusid = attachstatusdefs.id
|
||||
ORDER BY attachstatusdefs.sortkey
|
||||
");
|
||||
my @newstatuses;
|
||||
while (MoreSQLData()) {
|
||||
push(@newstatuses, FetchSQLData());
|
||||
}
|
||||
my $newstatuslist = join(', ', @newstatuses);
|
||||
|
||||
# Quote the description and content type for use in the SQL UPDATE statement.
|
||||
my $quoteddescription = SqlQuote($::FORM{'description'});
|
||||
my $quotedcontenttype = SqlQuote($::FORM{'contenttype'});
|
||||
|
||||
# Update the attachment record in the database.
|
||||
# Sets the creation timestamp to itself to avoid it being updated automatically.
|
||||
SendSQL("UPDATE attachments
|
||||
SET description = $quoteddescription ,
|
||||
mimetype = $quotedcontenttype ,
|
||||
ispatch = $::FORM{'ispatch'} ,
|
||||
isobsolete = $::FORM{'isobsolete'} ,
|
||||
creation_ts = creation_ts
|
||||
WHERE attach_id = $::FORM{'id'}
|
||||
");
|
||||
|
||||
# Record changes in the activity table.
|
||||
if ($olddescription ne $::FORM{'description'}) {
|
||||
my $quotedolddescription = SqlQuote($olddescription);
|
||||
my $fieldid = GetFieldID('attachments.description');
|
||||
SendSQL("INSERT INTO bugs_activity (bug_id, attach_id, who, bug_when, fieldid, removed, added)
|
||||
VALUES ($bugid, $::FORM{'id'}, $::userid, NOW(), $fieldid, $quotedolddescription, $quoteddescription)");
|
||||
}
|
||||
if ($oldcontenttype ne $::FORM{'contenttype'}) {
|
||||
my $quotedoldcontenttype = SqlQuote($oldcontenttype);
|
||||
my $fieldid = GetFieldID('attachments.mimetype');
|
||||
SendSQL("INSERT INTO bugs_activity (bug_id, attach_id, who, bug_when, fieldid, removed, added)
|
||||
VALUES ($bugid, $::FORM{'id'}, $::userid, NOW(), $fieldid, $quotedoldcontenttype, $quotedcontenttype)");
|
||||
}
|
||||
if ($oldispatch ne $::FORM{'ispatch'}) {
|
||||
my $fieldid = GetFieldID('attachments.ispatch');
|
||||
SendSQL("INSERT INTO bugs_activity (bug_id, attach_id, who, bug_when, fieldid, removed, added)
|
||||
VALUES ($bugid, $::FORM{'id'}, $::userid, NOW(), $fieldid, $oldispatch, $::FORM{'ispatch'})");
|
||||
}
|
||||
if ($oldisobsolete ne $::FORM{'isobsolete'}) {
|
||||
my $fieldid = GetFieldID('attachments.isobsolete');
|
||||
SendSQL("INSERT INTO bugs_activity (bug_id, attach_id, who, bug_when, fieldid, removed, added)
|
||||
VALUES ($bugid, $::FORM{'id'}, $::userid, NOW(), $fieldid, $oldisobsolete, $::FORM{'isobsolete'})");
|
||||
}
|
||||
if ($oldstatuslist ne $newstatuslist) {
|
||||
my ($removed, $added) = DiffStrings($oldstatuslist, $newstatuslist);
|
||||
my $quotedremoved = SqlQuote($removed);
|
||||
my $quotedadded = SqlQuote($added);
|
||||
my $fieldid = GetFieldID('attachstatusdefs.name');
|
||||
SendSQL("INSERT INTO bugs_activity (bug_id, attach_id, who, bug_when, fieldid, removed, added)
|
||||
VALUES ($bugid, $::FORM{'id'}, $::userid, NOW(), $fieldid, $quotedremoved, $quotedadded)");
|
||||
}
|
||||
|
||||
# Unlock all database tables now that we are finished updating the database.
|
||||
SendSQL("UNLOCK TABLES");
|
||||
|
||||
# If this installation has enabled the request manager, let the manager know
|
||||
# an attachment was updated so it can check for requests on that attachment
|
||||
# and fulfill them. The request manager allows users to request database
|
||||
# changes of other users and tracks the fulfillment of those requests. When
|
||||
# an attachment record is updated and the request manager is called, it will
|
||||
# fulfill those requests that were requested of the user performing the update
|
||||
# which are requests for the attachment being updated.
|
||||
#my $requests;
|
||||
#if (Param('userequestmanager'))
|
||||
#{
|
||||
# use Request;
|
||||
# # Specify the fieldnames that have been updated.
|
||||
# my @fieldnames = ('description', 'mimetype', 'status', 'ispatch', 'isobsolete');
|
||||
# # Fulfill pending requests.
|
||||
# $requests = Request::fulfillRequest('attachment', $::FORM{'id'}, @fieldnames);
|
||||
# $vars->{'requests'} = $requests;
|
||||
#}
|
||||
|
||||
# If the user submitted a comment while editing the attachment,
|
||||
# add the comment to the bug.
|
||||
if ( $::FORM{'comment'} )
|
||||
{
|
||||
use Text::Wrap;
|
||||
$Text::Wrap::columns = 80;
|
||||
$Text::Wrap::huge = 'wrap';
|
||||
|
||||
# Append a string to the comment to let users know that the comment came from
|
||||
# the "edit attachment" screen.
|
||||
my $comment = qq|(From update of attachment $::FORM{'id'})\n| . $::FORM{'comment'};
|
||||
|
||||
my $wrappedcomment = "";
|
||||
foreach my $line (split(/\r\n|\r|\n/, $comment))
|
||||
{
|
||||
if ( $line =~ /^>/ )
|
||||
{
|
||||
$wrappedcomment .= $line . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$wrappedcomment .= wrap('', '', $line) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
# Get the user's login name since the AppendComment function needs it.
|
||||
my $who = DBID_to_name($::userid);
|
||||
# Mention $::userid again so Perl doesn't give me a warning about it.
|
||||
my $neverused = $::userid;
|
||||
|
||||
# Append the comment to the list of comments in the database.
|
||||
AppendComment($bugid, $who, $wrappedcomment);
|
||||
|
||||
}
|
||||
|
||||
# Send mail to let people know the bug has changed. Uses a special syntax
|
||||
# of the "open" and "exec" commands to capture the output of "processmail",
|
||||
# which "system" doesn't allow, without running the command through a shell,
|
||||
# which backticks (``) do.
|
||||
#system ("./processmail", $bugid , $::userid);
|
||||
#my $mailresults = `./processmail $bugid $::userid`;
|
||||
my $mailresults = '';
|
||||
open(PMAIL, "-|") or exec('./processmail', $bugid, DBID_to_name($::userid));
|
||||
$mailresults .= $_ while <PMAIL>;
|
||||
close(PMAIL);
|
||||
|
||||
# Define the variables and functions that will be passed to the UI template.
|
||||
$vars->{'attachid'} = $::FORM{'id'};
|
||||
$vars->{'bugid'} = $bugid;
|
||||
$vars->{'mailresults'} = $mailresults;
|
||||
|
||||
# Return the appropriate HTTP response headers.
|
||||
print "Content-Type: text/html\n\n";
|
||||
|
||||
# Generate and return the UI (HTML page) from the appropriate template.
|
||||
$template->process("attachment/updated.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
}
|
||||
@@ -1,326 +0,0 @@
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Terry Weissman <terry@mozilla.org>
|
||||
# Dave Miller <justdave@syndicomm.com>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
use RelationSet;
|
||||
|
||||
# Use the Attachment module to display attachments for the bug.
|
||||
use Attachment;
|
||||
|
||||
sub show_bug {
|
||||
# Shut up misguided -w warnings about "used only once". For some reason,
|
||||
# "use vars" chokes on me when I try it here.
|
||||
sub bug_form_pl_sillyness {
|
||||
my $zz;
|
||||
$zz = %::FORM;
|
||||
$zz = %::proddesc;
|
||||
$zz = %::prodmaxvotes;
|
||||
$zz = @::enterable_products;
|
||||
$zz = @::settable_resolution;
|
||||
$zz = $::unconfirmedstate;
|
||||
$zz = $::milestoneurl;
|
||||
$zz = $::template;
|
||||
$zz = $::vars;
|
||||
$zz = @::legal_priority;
|
||||
$zz = @::legal_platform;
|
||||
$zz = @::legal_severity;
|
||||
$zz = @::legal_bug_status;
|
||||
$zz = @::target_milestone;
|
||||
$zz = @::components;
|
||||
$zz = @::legal_keywords;
|
||||
$zz = @::versions;
|
||||
$zz = @::legal_opsys;
|
||||
}
|
||||
|
||||
# Use templates
|
||||
my $template = $::template;
|
||||
my $vars = $::vars;
|
||||
|
||||
$vars->{'GetBugLink'} = \&GetBugLink;
|
||||
$vars->{'quoteUrls'} = \"eUrls,
|
||||
$vars->{'lsearch'} = \&lsearch,
|
||||
$vars->{'header_done'} = (@_),
|
||||
|
||||
quietly_check_login();
|
||||
|
||||
my $id = $::FORM{'id'};
|
||||
|
||||
if (!defined($id)) {
|
||||
$template->process("bug/choose.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
exit;
|
||||
}
|
||||
|
||||
my %user = %{$vars->{'user'}};
|
||||
my %bug;
|
||||
|
||||
# Populate the bug hash with the info we get directly from the DB.
|
||||
my $query = "
|
||||
SELECT bugs.bug_id, product, version, rep_platform,
|
||||
op_sys, bug_status, resolution, priority,
|
||||
bug_severity, component, assigned_to, reporter,
|
||||
bug_file_loc, short_desc, target_milestone,
|
||||
qa_contact, status_whiteboard,
|
||||
date_format(creation_ts,'%Y-%m-%d %H:%i'),
|
||||
groupset, delta_ts, ifnull(sum(votes.count),0)
|
||||
FROM bugs LEFT JOIN votes USING(bug_id)
|
||||
WHERE bugs.bug_id = $id
|
||||
GROUP BY bugs.bug_id";
|
||||
|
||||
SendSQL($query);
|
||||
|
||||
my $value;
|
||||
my @row = FetchSQLData();
|
||||
foreach my $field ("bug_id", "product", "version", "rep_platform",
|
||||
"op_sys", "bug_status", "resolution", "priority",
|
||||
"bug_severity", "component", "assigned_to", "reporter",
|
||||
"bug_file_loc", "short_desc", "target_milestone",
|
||||
"qa_contact", "status_whiteboard", "creation_ts",
|
||||
"groupset", "delta_ts", "votes")
|
||||
{
|
||||
$value = shift(@row);
|
||||
$bug{$field} = defined($value) ? $value : "";
|
||||
}
|
||||
|
||||
# General arrays of info about the database state
|
||||
GetVersionTable();
|
||||
|
||||
# Fiddle the product list.
|
||||
my $seen_curr_prod;
|
||||
my @prodlist;
|
||||
|
||||
foreach my $product (@::enterable_products) {
|
||||
if ($product eq $bug{'product'}) {
|
||||
# if it's the product the bug is already in, it's ALWAYS in
|
||||
# the popup, period, whether the user can see it or not, and
|
||||
# regardless of the disallownew setting.
|
||||
$seen_curr_prod = 1;
|
||||
push(@prodlist, $product);
|
||||
next;
|
||||
}
|
||||
|
||||
if (Param("usebuggroupsentry")
|
||||
&& GroupExists($product)
|
||||
&& !UserInGroup($product))
|
||||
{
|
||||
# If we're using bug groups to restrict entry on products, and
|
||||
# this product has a bug group, and the user is not in that
|
||||
# group, we don't want to include that product in this list.
|
||||
next;
|
||||
}
|
||||
|
||||
push(@prodlist, $product);
|
||||
}
|
||||
|
||||
# The current product is part of the popup, even if new bugs are no longer
|
||||
# allowed for that product
|
||||
if (!$seen_curr_prod) {
|
||||
push (@prodlist, $bug{'product'});
|
||||
@prodlist = sort @prodlist;
|
||||
}
|
||||
|
||||
$vars->{'product'} = \@prodlist;
|
||||
$vars->{'rep_platform'} = \@::legal_platform;
|
||||
$vars->{'priority'} = \@::legal_priority;
|
||||
$vars->{'bug_severity'} = \@::legal_severity;
|
||||
$vars->{'op_sys'} = \@::legal_opsys;
|
||||
$vars->{'bug_status'} = \@::legal_bug_status;
|
||||
|
||||
# Hack - this array contains "" for some reason. See bug 106589.
|
||||
shift @::settable_resolution;
|
||||
$vars->{'resolution'} = \@::settable_resolution;
|
||||
|
||||
$vars->{'component_'} = $::components{$bug{'product'}};
|
||||
$vars->{'version'} = $::versions{$bug{'product'}};
|
||||
$vars->{'target_milestone'} = $::target_milestone{$bug{'product'}};
|
||||
$bug{'milestoneurl'} = $::milestoneurl{$bug{'product'}} ||
|
||||
"notargetmilestone.html";
|
||||
|
||||
$vars->{'use_votes'} = Param('usevotes')
|
||||
&& $::prodmaxvotes{$bug{'product'}} > 0;
|
||||
|
||||
# Add additional, calculated fields to the bug hash
|
||||
if (@::legal_keywords) {
|
||||
$vars->{'use_keywords'} = 1;
|
||||
|
||||
SendSQL("SELECT keyworddefs.name
|
||||
FROM keyworddefs, keywords
|
||||
WHERE keywords.bug_id = $id
|
||||
AND keyworddefs.id = keywords.keywordid
|
||||
ORDER BY keyworddefs.name");
|
||||
my @keywords;
|
||||
while (MoreSQLData()) {
|
||||
push(@keywords, FetchOneColumn());
|
||||
}
|
||||
|
||||
$bug{'keywords'} = \@keywords;
|
||||
}
|
||||
|
||||
# Attachments
|
||||
$bug{'attachments'} = Attachment::query($id);
|
||||
|
||||
# Dependencies
|
||||
my @list;
|
||||
SendSQL("SELECT dependson FROM dependencies WHERE
|
||||
blocked = $id ORDER BY dependson");
|
||||
while (MoreSQLData()) {
|
||||
my ($i) = FetchSQLData();
|
||||
push(@list, $i);
|
||||
}
|
||||
|
||||
$bug{'dependson'} = \@list;
|
||||
|
||||
my @list2;
|
||||
SendSQL("SELECT blocked FROM dependencies WHERE
|
||||
dependson = $id ORDER BY blocked");
|
||||
while (MoreSQLData()) {
|
||||
my ($i) = FetchSQLData();
|
||||
push(@list2, $i);
|
||||
}
|
||||
|
||||
$bug{'blocked'} = \@list2;
|
||||
|
||||
# Groups
|
||||
my @groups;
|
||||
if ($::usergroupset ne '0' || $bug{'groupset'} ne '0') {
|
||||
my $bug_groupset = $bug{'groupset'};
|
||||
|
||||
SendSQL("SELECT bit, name, description, (bit & $bug_groupset != 0),
|
||||
(bit & $::usergroupset != 0) FROM groups
|
||||
WHERE isbuggroup != 0 " .
|
||||
# Include active groups as well as inactive groups to which
|
||||
# the bug already belongs. This way the bug can be removed
|
||||
# from an inactive group but can only be added to active ones.
|
||||
"AND ((isactive = 1 AND (bit & $::usergroupset != 0)) OR
|
||||
(bit & $bug_groupset != 0))");
|
||||
|
||||
$user{'inallgroups'} = 1;
|
||||
|
||||
while (MoreSQLData()) {
|
||||
my ($bit, $name, $description, $ison, $ingroup) = FetchSQLData();
|
||||
# For product groups, we only want to display the checkbox if either
|
||||
# (1) The bit is already set, or
|
||||
# (2) The user is in the group, but either:
|
||||
# (a) The group is a product group for the current product, or
|
||||
# (b) The group name isn't a product name
|
||||
# This means that all product groups will be skipped, but
|
||||
# non-product bug groups will still be displayed.
|
||||
if($ison ||
|
||||
($ingroup && (($name eq $bug{'product'}) ||
|
||||
(!defined $::proddesc{$name}))))
|
||||
{
|
||||
$user{'inallgroups'} &= $ingroup;
|
||||
|
||||
push (@groups, { "bit" => $bit,
|
||||
"ison" => $ison,
|
||||
"ingroup" => $ingroup,
|
||||
"description" => $description });
|
||||
}
|
||||
}
|
||||
|
||||
# If the bug is restricted to a group, display checkboxes that allow
|
||||
# the user to set whether or not the reporter
|
||||
# and cc list can see the bug even if they are not members of all
|
||||
# groups to which the bug is restricted.
|
||||
if ($bug{'groupset'} != 0) {
|
||||
$bug{'inagroup'} = 1;
|
||||
|
||||
# Determine whether or not the bug is always accessible by the
|
||||
# reporter, QA contact, and/or users on the cc: list.
|
||||
SendSQL("SELECT reporter_accessible, cclist_accessible
|
||||
FROM bugs
|
||||
WHERE bug_id = $id
|
||||
");
|
||||
($bug{'reporter_accessible'},
|
||||
$bug{'cclist_accessible'}) = FetchSQLData();
|
||||
}
|
||||
}
|
||||
$vars->{'groups'} = \@groups;
|
||||
|
||||
my $movers = Param("movers");
|
||||
$user{'canmove'} = Param("move-enabled")
|
||||
&& (defined $::COOKIE{"Bugzilla_login"})
|
||||
&& ($::COOKIE{"Bugzilla_login"} =~ /\Q$movers\E/);
|
||||
|
||||
# User permissions
|
||||
|
||||
# In the below, if the person hasn't logged in ($::userid == 0), then
|
||||
# we treat them as if they can do anything. That's because we don't
|
||||
# know why they haven't logged in; it may just be because they don't
|
||||
# use cookies. Display everything as if they have all the permissions
|
||||
# in the world; their permissions will get checked when they log in
|
||||
# and actually try to make the change.
|
||||
$user{'canedit'} = $::userid == 0
|
||||
|| $::userid == $bug{'reporter'}
|
||||
|| $::userid == $bug{'qa_contact'}
|
||||
|| $::userid == $bug{'assigned_to'}
|
||||
|| UserInGroup("editbugs");
|
||||
$user{'canconfirm'} = ($::userid == 0)
|
||||
|| UserInGroup("canconfirm")
|
||||
|| UserInGroup("editbugs");
|
||||
|
||||
# Bug states
|
||||
$bug{'isunconfirmed'} = ($bug{'bug_status'} eq $::unconfirmedstate);
|
||||
$bug{'isopened'} = IsOpenedState($bug{'bug_status'});
|
||||
|
||||
# People involved with the bug
|
||||
$bug{'assigned_to_email'} = DBID_to_name($bug{'assigned_to'});
|
||||
$bug{'assigned_to'} = DBID_to_real_or_loginname($bug{'assigned_to'});
|
||||
$bug{'reporter'} = DBID_to_real_or_loginname($bug{'reporter'});
|
||||
$bug{'qa_contact'} = $bug{'qa_contact'} > 0 ?
|
||||
DBID_to_name($bug{'qa_contact'}) : "";
|
||||
|
||||
my $ccset = new RelationSet;
|
||||
$ccset->mergeFromDB("SELECT who FROM cc WHERE bug_id=$id");
|
||||
|
||||
my @cc = $ccset->toArrayOfStrings();
|
||||
$bug{'cc'} = \@cc if $cc[0];
|
||||
|
||||
# Next bug in list (if there is one)
|
||||
my @bug_list;
|
||||
if ($::COOKIE{"BUGLIST"} && $id)
|
||||
{
|
||||
@bug_list = split(/:/, $::COOKIE{"BUGLIST"});
|
||||
}
|
||||
$vars->{'bug_list'} = \@bug_list;
|
||||
|
||||
$bug{'comments'} = GetComments($bug{'bug_id'});
|
||||
|
||||
# This is length in number of comments
|
||||
$bug{'longdesclength'} = scalar(@{$bug{'comments'}});
|
||||
|
||||
# Add the bug and user hashes to the variables
|
||||
$vars->{'bug'} = \%bug;
|
||||
$vars->{'user'} = \%user;
|
||||
|
||||
# Create the <link> elements for browsing bug lists
|
||||
$vars->{'navigation_links'} = navigation_links(join(':',@bug_list));
|
||||
|
||||
# Generate and return the UI (HTML page) from the appropriate template.
|
||||
$template->process("bug/edit.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
@@ -1,206 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<HTML>
|
||||
|
||||
<!--
|
||||
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.
|
||||
|
||||
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):
|
||||
|
||||
Contributor(s): Terry Weissman <terry@mozilla.org>
|
||||
-->
|
||||
|
||||
<head>
|
||||
<TITLE>A Bug's Life Cycle</TITLE>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1 ALIGN=CENTER>A Bug's Life Cycle</h1>
|
||||
|
||||
The <B>status</B> and <B>resolution</B> field define and track the
|
||||
life cycle of a bug.
|
||||
|
||||
<a name="status"></a>
|
||||
<p>
|
||||
<TABLE BORDER=1 CELLPADDING=4>
|
||||
|
||||
<TR ALIGN=CENTER VALIGN=TOP>
|
||||
<TD WIDTH="50%"><H1>STATUS</H1> <TD><H1>RESOLUTION</H1>
|
||||
|
||||
<TR VALIGN=TOP>
|
||||
<TD>The <B>status</B> field indicates the general health of a bug. Only
|
||||
certain status transitions are allowed.
|
||||
<TD>The <b>resolution</b> field indicates what happened to this bug.
|
||||
|
||||
<TR VALIGN=TOP><TD>
|
||||
<DL><DT><B>
|
||||
<A HREF="confirmhelp.html">UNCONFIRMED</A></B>
|
||||
<DD> This bug has recently been added to the database. Nobody has
|
||||
validated that this bug is true. Users who have the "canconfirm"
|
||||
permission set may confirm this bug, changing its state to NEW.
|
||||
Or, it may be directly resolved and marked RESOLVED.
|
||||
<DT><B>NEW</B>
|
||||
<DD> This bug has recently been added to the assignee's list of bugs
|
||||
and must be processed. Bugs in this state may be accepted, and
|
||||
become <B>ASSIGNED</B>, passed on to someone else, and remain
|
||||
<B>NEW</B>, or resolved and marked <B>RESOLVED</B>.
|
||||
<DT><B>ASSIGNED</B>
|
||||
<DD> This bug is not yet resolved, but is assigned to the proper
|
||||
person. From here bugs can be given to another person and become
|
||||
<B>NEW</B>, or resolved and become <B>RESOLVED</B>.
|
||||
<DT><B>REOPENED</B>
|
||||
<DD>This bug was once resolved, but the resolution was deemed
|
||||
incorrect. For example, a <B>WORKSFORME</B> bug is
|
||||
<B>REOPENED</B> when more information shows up and the bug is now
|
||||
reproducible. From here bugs are either marked <B>ASSIGNED</B>
|
||||
or <B>RESOLVED</B>.
|
||||
</DL>
|
||||
<TD>
|
||||
<DL>
|
||||
<DD> No resolution yet. All bugs which are in one of these "open" states
|
||||
have the resolution set to blank. All other bugs
|
||||
will be marked with one of the following resolutions.
|
||||
</DL>
|
||||
|
||||
<TR VALIGN=TOP><TD>
|
||||
<DL>
|
||||
<DT><B>RESOLVED</B>
|
||||
<DD> A resolution has been taken, and it is awaiting verification by
|
||||
QA. From here bugs are either re-opened and become
|
||||
<B>REOPENED</B>, are marked <B>VERIFIED</B>, or are closed for good
|
||||
and marked <B>CLOSED</B>.
|
||||
<DT><B>VERIFIED</B>
|
||||
<DD> QA has looked at the bug and the resolution and agrees that the
|
||||
appropriate resolution has been taken. Bugs remain in this state
|
||||
until the product they were reported against actually ships, at
|
||||
which point they become <B>CLOSED</B>.
|
||||
<DT><B>CLOSED</B>
|
||||
<DD> The bug is considered dead, the resolution is correct. Any zombie
|
||||
bugs who choose to walk the earth again must do so by becoming
|
||||
<B>REOPENED</B>.
|
||||
</DL>
|
||||
|
||||
<TD>
|
||||
<DL>
|
||||
<DT><B>FIXED</B>
|
||||
<DD> A fix for this bug is checked into the tree and tested.
|
||||
<DT><B>INVALID</B>
|
||||
<DD> The problem described is not a bug
|
||||
<DT><B>WONTFIX</B>
|
||||
<DD> The problem described is a bug which will never be fixed.
|
||||
<DT><B>LATER</B>
|
||||
<DD> The problem described is a bug which will not be fixed in this
|
||||
version of the product.
|
||||
<DT><B>REMIND</B>
|
||||
<DD> The problem described is a bug which will probably not be fixed in this
|
||||
version of the product, but might still be.
|
||||
<DT><B>DUPLICATE</B>
|
||||
<DD> The problem is a duplicate of an existing bug. Marking a bug
|
||||
duplicate requires the bug# of the duplicating bug and will at
|
||||
least put that bug number in the description field.
|
||||
<DT><B>WORKSFORME</B>
|
||||
<DD> All attempts at reproducing this bug were futile,
|
||||
and reading the code produces no clues as to why the described
|
||||
behavior would occur. If more information appears later, the
|
||||
bug can be reopened.
|
||||
</DL>
|
||||
</TABLE>
|
||||
|
||||
<H1>Other Fields</H1>
|
||||
|
||||
<table border=1 cellpadding=4><tr><td>
|
||||
<h2><a name="severity">Severity</a></h2>
|
||||
|
||||
This field describes the impact of a bug.
|
||||
|
||||
<p>
|
||||
<p>
|
||||
|
||||
<table>
|
||||
<tr><th>Blocker</th><td>Blocks development and/or testing work
|
||||
<tr><th>Critical</th><td>crashes, loss of data, severe memory leak
|
||||
<tr><th>Major</th><td>major loss of function
|
||||
<tr><th>Minor</th><td>minor loss of function, or other problem where easy workaround is present
|
||||
<tr><th>Trivial</th><td>cosmetic problem like misspelled words or misaligned text
|
||||
<tr><th>Enhancement</th><td>Request for enhancement
|
||||
</table>
|
||||
|
||||
</td><td>
|
||||
|
||||
<h2><a name="priority">Priority</a></h2>
|
||||
|
||||
This field describes the importance and order in which a bug should be
|
||||
fixed. This field is utilized by the programmers/engineers to
|
||||
prioritize their work to be done. The available priorities are:
|
||||
|
||||
<p>
|
||||
<p>
|
||||
|
||||
<table>
|
||||
<tr><th>P1</th><td>Most important
|
||||
<tr><th>P2</th><td>
|
||||
<tr><th>P3</th><td>
|
||||
<tr><th>P4</th><td>
|
||||
<tr><th>P5</th><td>Least important
|
||||
</table>
|
||||
</tr></table>
|
||||
|
||||
<h2><a name="rep_platform">Platform</a></h2>
|
||||
This is the hardware platform against which the bug was reported. Legal
|
||||
platforms include:
|
||||
|
||||
<UL>
|
||||
<LI> All (happens on all platform; cross-platform bug)
|
||||
<LI> Macintosh
|
||||
<LI> PC
|
||||
<LI> Sun
|
||||
<LI> HP
|
||||
</UL>
|
||||
|
||||
<b>Note:</b> Selecting the option "All" does not select bugs assigned against all platforms. It
|
||||
merely selects bugs that <b>occur</b> on all platforms.
|
||||
|
||||
<h2><a name="op_sys">Operating System</a></h2>
|
||||
This is the operating system against which the bug was reported. Legal
|
||||
operating systems include:
|
||||
|
||||
<UL>
|
||||
<LI> All (happens on all operating systems; cross-platform bug)
|
||||
<LI> Windows 95
|
||||
<LI> Mac System 8.0
|
||||
<LI> Linux
|
||||
</UL>
|
||||
|
||||
Note that the operating system implies the platform, but not always.
|
||||
For example, Linux can run on PC and Macintosh and others.
|
||||
|
||||
<h2><a name="assigned_to">Assigned To</a></h2>
|
||||
|
||||
This is the person in charge of resolving the bug. Every time this
|
||||
field changes, the status changes to <B>NEW</B> to make it easy to see
|
||||
which new bugs have appeared on a person's list.
|
||||
|
||||
The default status for queries is set to NEW, ASSIGNED and REOPENED. When
|
||||
searching for bugs that have been resolved or verified, remember to set the
|
||||
status field appropriately.
|
||||
|
||||
<hr>
|
||||
<!-- hhmts start -->
|
||||
Last modified: Sun Apr 14 12:51:23 EST 2002
|
||||
<!-- hhmts end -->
|
||||
</body> </html>
|
||||
@@ -1,392 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
|
||||
<title>Bug Writing Guidelines</title>
|
||||
</head>
|
||||
<body>
|
||||
<center>
|
||||
<h1>Bug Writing Guidelines</h1>
|
||||
</center>
|
||||
|
||||
<h3>Why You Should Read This</h3>
|
||||
|
||||
<blockquote>
|
||||
<p>Simply put, the more effectively you report a bug, the more
|
||||
likely an engineer will actually fix it.</p>
|
||||
|
||||
<p>These guidelines are a general
|
||||
tutorial to teach novice and intermediate bug reporters how to compose effective bug reports. Not every sentence may precisely apply to
|
||||
your software project.</p>
|
||||
</blockquote>
|
||||
|
||||
<h3>How to Write a Useful Bug Report</h3>
|
||||
|
||||
<blockquote>
|
||||
<p>Useful bug reports are ones that get bugs fixed. A useful bug
|
||||
report normally has two qualities:</p>
|
||||
|
||||
<ol>
|
||||
<li><b>Reproducible.</b> If an engineer can't see the bug herself to prove that it exists, she'll probably stamp your bug report "WORKSFORME" or "INVALID" and move on to the next bug. Every detail you can provide helps.<br>
|
||||
<br>
|
||||
</li>
|
||||
|
||||
<li><b>Specific.</b> The quicker the engineer can isolate the bug
|
||||
to a specific area, the more likely she'll expediently fix it.
|
||||
(If a programmer or tester has to decypher a bug, they may spend
|
||||
more time cursing the submitter than solving the problem.)
|
||||
<br>
|
||||
<br>
|
||||
[ <a href="#tips" name="Anchor">Tell Me More</a> ]
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<p>Let's say the application you're testing is a web browser. You
|
||||
crash at foo.com, and want to write up a bug report:</p>
|
||||
|
||||
<blockquote>
|
||||
<p><b>BAD:</b> "My browser crashed. I think I was on www.foo.com. I play golf with Bill Gates, so you better fix this problem, or I'll report you to him. By the way, your Back icon looks like a squashed rodent. UGGGLY. And my grandmother's home page is all messed up in your browser. Thx 4 UR help."
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>GOOD:</b> "I crashed each time I went to www.foo.com, using
|
||||
the 2002-02-25 build on a Windows 2000 system. I also
|
||||
rebooted into Linux, and reproduced this problem using the 2002-02-24
|
||||
Linux build.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
It again crashed each time upon drawing the Foo banner at the top
|
||||
of the page. I broke apart the page, and discovered that the
|
||||
following image link will crash the application reproducibly,
|
||||
unless you remove the "border=0" attribute:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<tt><IMG SRC="http://www.foo.com/images/topics/topicfoos.gif"
|
||||
width="34" height="44" border="0" alt="News"></tt>
|
||||
</p>
|
||||
</blockquote>
|
||||
</blockquote>
|
||||
|
||||
<h3>How to Enter your Useful Bug Report into Bugzilla:</h3>
|
||||
|
||||
<blockquote>
|
||||
<p>Before you enter your bug, use Bugzilla's
|
||||
<a href="query.cgi">search page</a> to determine whether the defect you've discovered is a known, already-reported bug. If your bug is the 37th duplicate of a known issue, you're more likely to annoy the engineer. (Annoyed
|
||||
engineers fix fewer bugs.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Next, be sure to reproduce your bug using a recent
|
||||
build. Engineers tend to be most interested in problems affecting
|
||||
the code base that they're actively working on. After all, the bug you're reporting
|
||||
may already be fixed.
|
||||
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you've discovered a new bug using a current build, report it in
|
||||
Bugzilla:
|
||||
</p>
|
||||
|
||||
<ol>
|
||||
<li>From your Bugzilla main page, choose
|
||||
"<a href="enter_bug.cgi">Enter a new bug</a>".</li>
|
||||
|
||||
<li>Select the product that you've found a bug in.</li>
|
||||
|
||||
<li>Enter your e-mail address, password, and press the "Login"
|
||||
button. (If you don't yet have a password, leave the password field empty,
|
||||
and press the "E-mail me a password" button instead.
|
||||
You'll quickly receive an e-mail message with your password.)</li>
|
||||
</ol>
|
||||
|
||||
<p>Now, fill out the form. Here's what it all means:</p>
|
||||
|
||||
<p><b>Where did you find the bug?</b></p>
|
||||
|
||||
<blockquote>
|
||||
<p><b>Product: In which product did you find the bug?</b><br>
|
||||
You just specified this on the last page, so you can't edit it here.</p>
|
||||
|
||||
<p><b>Version: In which product version did you find the
|
||||
bug?</b><br>
|
||||
(If applicable)</p>
|
||||
|
||||
<p><b>Component: In which component does the bug exist?</b><br>
|
||||
Bugzilla requires that you select a component to enter a bug. (Not sure which to choose?
|
||||
Click on the Component link. You'll see a description of each component, to help you make the best choice.)</p>
|
||||
|
||||
<p><b>OS: On which Operating System (OS) did you find this bug?</b>
|
||||
(e.g. Linux, Windows 2000, Mac OS 9.)<br>
|
||||
If you know the bug happens on all OSs, choose 'All'. Otherwise,
|
||||
select the OS that you found the bug on, or "Other" if your OS
|
||||
isn't listed.</p>
|
||||
</blockquote>
|
||||
|
||||
<p><b>How important is the bug?</b></p>
|
||||
|
||||
<blockquote>
|
||||
<p><b>Severity: How damaging is the bug?</b><br>
|
||||
This item defaults to 'normal'. If you're not sure what severity your bug deserves, click on the Severity link.
|
||||
You'll see a description of each severity rating. <br>
|
||||
</p>
|
||||
</blockquote>
|
||||
|
||||
<p><b>Who will be following up on the bug?</b></p>
|
||||
|
||||
<blockquote>
|
||||
<p><b>Assigned To: Which engineer should be responsible for fixing
|
||||
this bug?</b><br>
|
||||
Bugzilla will automatically assign the bug to a default engineer
|
||||
upon submitting a bug report. If you'd prefer to directly assign the bug to
|
||||
someone else, enter their e-mail address into this field. (To see the list of
|
||||
default engineers for each component, click on the Component
|
||||
link.)</p>
|
||||
|
||||
<p><b>Cc: Who else should receive e-mail updates on changes to this
|
||||
bug?</b><br>
|
||||
List the full e-mail addresses of other individuals who should
|
||||
receive an e-mail update upon every change to the bug report. You
|
||||
can enter as many e-mail addresses as you'd like, separated by spaces or commas, as long as those
|
||||
people have Bugzilla accounts.</p>
|
||||
</blockquote>
|
||||
|
||||
<p><b>What else can you tell the engineer about the bug?</b></p>
|
||||
|
||||
<blockquote>
|
||||
|
||||
<p><b>Summary:</b> <b>How would you describe the bug, in
|
||||
approximately 60 or fewer characters?</b><br>
|
||||
A good summary should <b>quickly and uniquely identify a bug
|
||||
report</b>. Otherwise, an engineer cannot meaningfully identify
|
||||
your bug by its summary, and will often fail to pay attention to
|
||||
your bug report when skimming through a 10 page bug list.<br>
|
||||
<br>
|
||||
A useful summary might be
|
||||
"<tt>PCMCIA install fails on Tosh Tecra 780DVD w/ 3c589C</tt>".
|
||||
"<tt>Software fails</tt>" or "<tt>install problem</tt>" would be
|
||||
examples of a bad summary.<br>
|
||||
<br>
|
||||
[ <a href="#summary">Tell Me More</a> ]<br>
|
||||
<br>
|
||||
<b>Description: </b><br>
|
||||
Please provide a detailed problem report in this field.
|
||||
Your bug's recipients will most likely expect the following information:</p>
|
||||
|
||||
<blockquote>
|
||||
<p><b>Overview Description:</b> More detailed expansion of
|
||||
summary.</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>
|
||||
Drag-selecting any page crashes Mac builds in NSGetFactory
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
<p><b>Steps to Reproduce:</b> Minimized, easy-to-follow steps that will
|
||||
trigger the bug. Include any special setup steps.</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>
|
||||
1) View any web page. (I used the default sample page,
|
||||
resource:/res/samples/test0.html)
|
||||
|
||||
2) Drag-select the page. (Specifically, while holding down
|
||||
the mouse button, drag the mouse pointer downwards from any
|
||||
point in the browser's content region to the bottom of the
|
||||
browser's content region.)
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>
|
||||
<b>Actual Results:</b> What the application did after performing
|
||||
the above steps.
|
||||
</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>
|
||||
The application crashed. Stack crawl appended below from MacsBug.
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
<p><b>Expected Results:</b> What the application should have done,
|
||||
were the bug not present.</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>
|
||||
The window should scroll downwards. Scrolled content should be selected.
|
||||
(Or, at least, the application should not crash.)
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
<p><b>Build Date & Platform:</b> Date and platform of the build
|
||||
that you first encountered the bug in.</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>
|
||||
Build 2002-03-15 on Mac OS 9.0
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
<p><b>Additional Builds and Platforms:</b> Whether or not the bug
|
||||
takes place on other platforms (or browsers, if applicable).</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>
|
||||
- Also Occurs On
|
||||
Mozilla (2002-03-15 build on Windows NT 4.0)
|
||||
|
||||
- Doesn't Occur On
|
||||
Mozilla (2002-03-15 build on Red Hat Linux; feature not supported)
|
||||
Internet Explorer 5.0 (shipping build on Windows NT 4.0)
|
||||
Netscape Communicator 4.5 (shipping build on Mac OS 9.0)
|
||||
</pre>
|
||||
</blockquote>
|
||||
|
||||
<p><b>Additional Information:</b> Any other debugging information.
|
||||
For crashing bugs:</p>
|
||||
|
||||
<ul>
|
||||
<li><b>Win32:</b> if you receive a Dr. Watson error, please note
|
||||
the type of the crash, and the module that the application crashed
|
||||
in. (e.g. access violation in apprunner.exe)</li>
|
||||
|
||||
<li><b>Mac OS:</b> if you're running MacsBug, please provide the
|
||||
results of a <b>how</b> and an <b>sc</b>:</li>
|
||||
</ul>
|
||||
|
||||
<blockquote>
|
||||
<pre>
|
||||
*** MACSBUG STACK CRAWL OF CRASH (Mac OS)
|
||||
Calling chain using A6/R1 links
|
||||
Back chain ISA Caller
|
||||
00000000 PPC 0BA85E74
|
||||
03AEFD80 PPC 0B742248
|
||||
03AEFD30 PPC 0B50FDDC NSGetFactory+027FC
|
||||
PowerPC unmapped memory exception at 0B512BD0 NSGetFactory+055F0
|
||||
</pre>
|
||||
</blockquote>
|
||||
</blockquote>
|
||||
</blockquote>
|
||||
|
||||
<p>You're done!<br>
|
||||
<br>
|
||||
After double-checking your entries for any possible errors, press
|
||||
the "Commit" button, and your bug report will now be in the
|
||||
Bugzilla database.<br>
|
||||
</p>
|
||||
</blockquote>
|
||||
|
||||
<hr>
|
||||
<h3>More Information on Writing Good Bug Reports</h3>
|
||||
|
||||
<blockquote>
|
||||
<p><b><a name="tips"></a> 1. General Tips for a Useful Bug
|
||||
Report</b>
|
||||
</p>
|
||||
|
||||
<blockquote>
|
||||
<p>
|
||||
<b>Use an explicit structure, so your bug reports are easy to
|
||||
skim.</b> Bug report users often need immediate access to specific
|
||||
sections of your bug. If your Bugzilla installation supports the
|
||||
Bugzilla Helper, use it.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Avoid cuteness if it costs clarity.</b> Nobody will be laughing
|
||||
at your funny bug title at 3:00 AM when they can't remember how to
|
||||
find your bug.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>One bug per report.</b> Completely different people typically
|
||||
fix, verify, and prioritize different bugs. If you mix a handful of
|
||||
bugs into a single report, the right people probably won't discover
|
||||
your bugs in a timely fashion, or at all. Certain bugs are also
|
||||
more important than others. It's impossible to prioritize a bug
|
||||
report when it contains four different issues, all of differing
|
||||
importance.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>No bug is too trivial to report.</b> Unless you're reading the
|
||||
source code, you can't see actual software bugs, like a dangling
|
||||
pointer -- you'll see their visible manifestations, such as the
|
||||
segfault when the application finally crashes. Severe software
|
||||
problems can manifest themselves in superficially trivial ways.
|
||||
File them anyway.<br>
|
||||
</p>
|
||||
</blockquote>
|
||||
|
||||
<p><b><a name="summary"></a>2. How and Why to Write Good Bug Summaries</b>
|
||||
</p>
|
||||
|
||||
<blockquote>
|
||||
<p><b>You want to make a good first impression on the bug
|
||||
recipient.</b> Just like a New York Times headline guides readers
|
||||
towards a relevant article from dozens of choices, will your bug summary
|
||||
suggest that your bug report is worth reading from dozens or hundreds of
|
||||
choices?
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Conversely, a vague bug summary like <tt>install problem</tt> forces anyone
|
||||
reviewing installation bugs to waste time opening up your bug to
|
||||
determine whether it matters.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Your bug will often be searched by its summary.</b> Just as
|
||||
you'd find web pages with Google by searching by keywords through
|
||||
intuition, so will other people locate your bugs. Descriptive bug
|
||||
summaries are naturally keyword-rich, and easier to find.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For example, you'll find a bug titled "<tt>Dragging icons from List View to
|
||||
gnome-terminal doesn't paste path</tt>" if you search on "List",
|
||||
"terminal", or "path". Those search keywords wouldn't have found a
|
||||
bug titled "<tt>Dragging icons
|
||||
doesn't paste</tt>".
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Ask yourself, "Would someone understand my bug from just this
|
||||
summary?" If so, you've written a fine summary.
|
||||
</p>
|
||||
|
||||
<p><b>Don't write titles like these:</b></p>
|
||||
|
||||
<ol>
|
||||
<li>"Can't install" - Why can't you install? What happens when you
|
||||
try to install?</li>
|
||||
<li>"Severe Performance Problems" - ...and they occur when you do
|
||||
what?</li>
|
||||
<li>"back button does not work" - Ever? At all?</li>
|
||||
</ol>
|
||||
|
||||
<p><b>Good bug titles:</b></p>
|
||||
<ol>
|
||||
<li>"1.0 upgrade installation fails if Mozilla M18 package present"
|
||||
- Explains problem and the context.</li>
|
||||
<li>"RPM 4 installer crashes if launched on Red Hat 6.2 (RPM 3)
|
||||
system" - Explains what happens, and the context.</li>
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
</blockquote>
|
||||
</blockquote>
|
||||
|
||||
<p>(Written and maintained by
|
||||
<a href="http://www.prometheus-music.com/eli">Eli Goldberg</a>. Claudius
|
||||
Gayle, Gervase Markham, Peter Mock, Chris Pratt, Tom Schutter and Chris Yeh also
|
||||
contributed significant changes. Constructive
|
||||
<a href="mailto:eli@prometheus-music.com">suggestions</a> welcome.)</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
<!ELEMENT bugzilla (bug+)>
|
||||
<!ATTLIST bugzilla
|
||||
version CDATA #REQUIRED
|
||||
urlbase CDATA #REQUIRED
|
||||
maintainer CDATA #REQUIRED
|
||||
exporter CDATA #IMPLIED
|
||||
>
|
||||
<!ELEMENT bug (bug_id, (bug_status, product, priority, version, rep_platform, assigned_to, delta_ts, component, reporter, target_milestone?, bug_severity, creation_ts, qa_contact?, op_sys, resolution?, bug_file_loc?, short_desc?, keywords*, status_whiteboard?, dependson*, blocks*, cc*, long_desc*, attachment*)?)>
|
||||
<!ATTLIST bug
|
||||
error (NotFound | NotPermitted | InvalidBugId) #IMPLIED
|
||||
>
|
||||
<!ELEMENT bug_id (#PCDATA)>
|
||||
<!ELEMENT exporter (#PCDATA)>
|
||||
<!ELEMENT urlbase (#PCDATA)>
|
||||
<!ELEMENT bug_status (#PCDATA)>
|
||||
<!ELEMENT product (#PCDATA)>
|
||||
<!ELEMENT priority (#PCDATA)>
|
||||
<!ELEMENT version (#PCDATA)>
|
||||
<!ELEMENT rep_platform (#PCDATA)>
|
||||
<!ELEMENT assigned_to (#PCDATA)>
|
||||
<!ELEMENT delta_ts (#PCDATA)>
|
||||
<!ELEMENT component (#PCDATA)>
|
||||
<!ELEMENT reporter (#PCDATA)>
|
||||
<!ELEMENT target_milestone (#PCDATA)>
|
||||
<!ELEMENT bug_severity (#PCDATA)>
|
||||
<!ELEMENT creation_ts (#PCDATA)>
|
||||
<!ELEMENT qa_contact (#PCDATA)>
|
||||
<!ELEMENT status_whiteboard (#PCDATA)>
|
||||
<!ELEMENT op_sys (#PCDATA)>
|
||||
<!ELEMENT resolution (#PCDATA)>
|
||||
<!ELEMENT bug_file_loc (#PCDATA)>
|
||||
<!ELEMENT short_desc (#PCDATA)>
|
||||
<!ELEMENT keywords (#PCDATA)>
|
||||
<!ELEMENT dependson (#PCDATA)>
|
||||
<!ELEMENT blocks (#PCDATA)>
|
||||
<!ELEMENT cc (#PCDATA)>
|
||||
<!ELEMENT long_desc (who, bug_when, thetext)>
|
||||
<!ELEMENT who (#PCDATA)>
|
||||
<!ELEMENT bug_when (#PCDATA)>
|
||||
<!ELEMENT thetext (#PCDATA)>
|
||||
<!ELEMENT attachment (attachid, date, desc, type?, data?)>
|
||||
<!ELEMENT attachid (#PCDATA)>
|
||||
<!ELEMENT date (#PCDATA)>
|
||||
<!ELEMENT desc (#PCDATA)>
|
||||
<!ELEMENT type (#PCDATA)>
|
||||
<!ELEMENT data (#PCDATA)>
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/usr/bonsaitools/bin/perl -wT
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Terry Weissman <terry@mozilla.org>
|
||||
|
||||
use strict;
|
||||
|
||||
print q{Content-type: text/html
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Refresh"
|
||||
CONTENT="0; URL=userprefs.cgi">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
This URL is obsolete. Forwarding you to the correct one.
|
||||
<P>
|
||||
Going to <A HREF="userprefs.cgi">userprefs.cgi</A>
|
||||
<BR>
|
||||
</BODY>
|
||||
</HTML>
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
#!/usr/bonsaitools/bin/perl -wT
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Terry Weissman <terry@mozilla.org>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
use lib qw(.);
|
||||
|
||||
use vars qw(
|
||||
@legal_keywords
|
||||
$buffer
|
||||
$template
|
||||
$vars
|
||||
);
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
ConnectToDatabase();
|
||||
quietly_check_login();
|
||||
|
||||
print "Content-type: text/html\n";
|
||||
|
||||
# The master list not only says what fields are possible, but what order
|
||||
# they get displayed in.
|
||||
|
||||
GetVersionTable();
|
||||
|
||||
my @masterlist = ("opendate", "changeddate", "severity", "priority",
|
||||
"platform", "owner", "reporter", "status", "resolution",
|
||||
"product", "component", "version", "os");
|
||||
|
||||
if (Param("usevotes")) {
|
||||
push(@masterlist, "votes");
|
||||
}
|
||||
if (Param("usetargetmilestone")) {
|
||||
push(@masterlist, "target_milestone");
|
||||
}
|
||||
if (Param("useqacontact")) {
|
||||
push(@masterlist, "qa_contact");
|
||||
}
|
||||
if (Param("usestatuswhiteboard")) {
|
||||
push(@masterlist, "status_whiteboard");
|
||||
}
|
||||
if (@::legal_keywords) {
|
||||
push(@masterlist, "keywords");
|
||||
}
|
||||
|
||||
|
||||
push(@masterlist, ("summary", "summaryfull"));
|
||||
|
||||
$vars->{masterlist} = \@masterlist;
|
||||
|
||||
my @collist;
|
||||
if (defined $::FORM{'rememberedquery'}) {
|
||||
my $splitheader = 0;
|
||||
if (defined $::FORM{'resetit'}) {
|
||||
@collist = @::default_column_list;
|
||||
} else {
|
||||
foreach my $i (@masterlist) {
|
||||
if (defined $::FORM{"column_$i"}) {
|
||||
push @collist, $i;
|
||||
}
|
||||
}
|
||||
if (exists $::FORM{'splitheader'}) {
|
||||
$splitheader = $::FORM{'splitheader'};
|
||||
}
|
||||
}
|
||||
my $list = join(" ", @collist);
|
||||
my $urlbase = Param("urlbase");
|
||||
my $cookiepath = Param("cookiepath");
|
||||
print "Set-Cookie: COLUMNLIST=$list ; path=$cookiepath ; expires=Sat, 30-Jun-2029 00:00:00 GMT\n";
|
||||
print "Set-Cookie: SPLITHEADER=$::FORM{'splitheader'} ; path=$cookiepath ; expires=Sat, 30-Jun-2029 00:00:00 GMT\n";
|
||||
print "Refresh: 0; URL=buglist.cgi?$::FORM{'rememberedquery'}\n";
|
||||
print "\n";
|
||||
print "<META HTTP-EQUIV=Refresh CONTENT=\"1; URL=$urlbase"."buglist.cgi?$::FORM{'rememberedquery'}\">\n";
|
||||
print "<TITLE>What a hack.</TITLE>\n";
|
||||
PutHeader ("Change columns");
|
||||
print "Resubmitting your query with new columns...\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
if (defined $::COOKIE{'COLUMNLIST'}) {
|
||||
@collist = split(/ /, $::COOKIE{'COLUMNLIST'});
|
||||
} else {
|
||||
@collist = @::default_column_list;
|
||||
}
|
||||
|
||||
$vars->{collist} = \@collist;
|
||||
|
||||
$vars->{splitheader} = 0;
|
||||
if ($::COOKIE{'SPLITHEADER'}) {
|
||||
$vars->{splitheader} = 1;
|
||||
}
|
||||
|
||||
my %desc = ();
|
||||
foreach my $i (@masterlist) {
|
||||
$desc{$i} = $i;
|
||||
}
|
||||
|
||||
$desc{'summary'} = "Summary (first 60 characters)";
|
||||
$desc{'summaryfull'} = "Full Summary";
|
||||
|
||||
$vars->{desc} = \%desc;
|
||||
$vars->{buffer} = $::buffer;
|
||||
|
||||
# Generate and return the UI (HTML page) from the appropriate template.
|
||||
print "Content-type: text/html\n\n";
|
||||
$template->process("list/change-columns.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
|
||||
@@ -1,202 +0,0 @@
|
||||
#!/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.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.
|
||||
#
|
||||
# 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): Terry Weissman <terry@mozilla.org>,
|
||||
# Harrison Page <harrison@netscape.com>
|
||||
# Gervase Markham <gerv@gerv.net>
|
||||
|
||||
# Run me out of cron at midnight to collect Bugzilla statistics.
|
||||
|
||||
|
||||
use AnyDBM_File;
|
||||
use diagnostics;
|
||||
use strict;
|
||||
use vars @::legal_product;
|
||||
|
||||
require "globals.pl";
|
||||
|
||||
# tidy up after graphing module
|
||||
if (chdir("graphs")) {
|
||||
unlink <./*.gif>;
|
||||
unlink <./*.png>;
|
||||
chdir("..");
|
||||
}
|
||||
|
||||
ConnectToDatabase(1);
|
||||
GetVersionTable();
|
||||
|
||||
my @myproducts;
|
||||
push( @myproducts, "-All-", @::legal_product );
|
||||
|
||||
foreach (@myproducts) {
|
||||
my $dir = "data/mining";
|
||||
|
||||
&check_data_dir ($dir);
|
||||
&collect_stats ($dir, $_);
|
||||
}
|
||||
|
||||
&calculate_dupes();
|
||||
|
||||
sub check_data_dir {
|
||||
my $dir = shift;
|
||||
|
||||
if (! -d $dir) {
|
||||
mkdir $dir, 0777;
|
||||
chmod 0777, $dir;
|
||||
}
|
||||
}
|
||||
|
||||
sub collect_stats {
|
||||
my $dir = shift;
|
||||
my $product = shift;
|
||||
my $when = localtime (time);
|
||||
|
||||
# NB: Need to mangle the product for the filename, but use the real
|
||||
# product name in the query
|
||||
my $file_product = $product;
|
||||
$file_product =~ s/\//-/gs;
|
||||
my $file = join '/', $dir, $file_product;
|
||||
my $exists = -f $file;
|
||||
|
||||
if (open DATA, ">>$file") {
|
||||
push my @row, &today;
|
||||
|
||||
foreach my $status ('NEW', 'ASSIGNED', 'REOPENED', 'UNCONFIRMED', 'RESOLVED', 'VERIFIED', 'CLOSED') {
|
||||
if( $product eq "-All-" ) {
|
||||
SendSQL("select count(bug_status) from bugs where bug_status='$status'");
|
||||
} else {
|
||||
SendSQL("select count(bug_status) from bugs where bug_status='$status' and product=" . SqlQuote($product));
|
||||
}
|
||||
|
||||
push @row, FetchOneColumn();
|
||||
}
|
||||
|
||||
foreach my $resolution ('FIXED', 'INVALID', 'WONTFIX', 'LATER', 'REMIND', 'DUPLICATE', 'WORKSFORME', 'MOVED') {
|
||||
if( $product eq "-All-" ) {
|
||||
SendSQL("select count(resolution) from bugs where resolution='$resolution'");
|
||||
} else {
|
||||
SendSQL("select count(resolution) from bugs where resolution='$resolution' and product=" . SqlQuote($product));
|
||||
}
|
||||
|
||||
push @row, FetchOneColumn();
|
||||
}
|
||||
|
||||
if (! $exists) {
|
||||
print DATA <<FIN;
|
||||
# Bugzilla Daily Bug Stats
|
||||
#
|
||||
# Do not edit me! This file is generated.
|
||||
#
|
||||
# fields: DATE|NEW|ASSIGNED|REOPENED|UNCONFIRMED|RESOLVED|VERIFIED|CLOSED|FIXED|INVALID|WONTFIX|LATER|REMIND|DUPLICATE|WORKSFORME|MOVED
|
||||
# Product: $product
|
||||
# Created: $when
|
||||
FIN
|
||||
}
|
||||
|
||||
print DATA (join '|', @row) . "\n";
|
||||
close DATA;
|
||||
} else {
|
||||
print "$0: $file, $!";
|
||||
}
|
||||
}
|
||||
|
||||
sub calculate_dupes {
|
||||
SendSQL("SELECT dupe_of, dupe FROM duplicates");
|
||||
|
||||
my %dupes;
|
||||
my %count;
|
||||
my @row;
|
||||
my $key;
|
||||
my $changed = 1;
|
||||
|
||||
my $today = &today_dash;
|
||||
|
||||
# Save % count here in a date-named file
|
||||
# so we can read it back in to do changed counters
|
||||
# First, delete it if it exists, so we don't add to the contents of an old file
|
||||
if (my @files = <data/duplicates/dupes$today*>) {
|
||||
unlink @files;
|
||||
}
|
||||
|
||||
dbmopen(%count, "data/duplicates/dupes$today", 0644) || die "Can't open DBM dupes file: $!";
|
||||
|
||||
# Create a hash with key "a bug number", value "bug which that bug is a
|
||||
# direct dupe of" - straight from the duplicates table.
|
||||
while (@row = FetchSQLData()) {
|
||||
my $dupe_of = shift @row;
|
||||
my $dupe = shift @row;
|
||||
$dupes{$dupe} = $dupe_of;
|
||||
}
|
||||
|
||||
# Total up the number of bugs which are dupes of a given bug
|
||||
# count will then have key = "bug number",
|
||||
# value = "number of immediate dupes of that bug".
|
||||
foreach $key (keys(%dupes))
|
||||
{
|
||||
my $dupe_of = $dupes{$key};
|
||||
|
||||
if (!defined($count{$dupe_of})) {
|
||||
$count{$dupe_of} = 0;
|
||||
}
|
||||
|
||||
$count{$dupe_of}++;
|
||||
}
|
||||
|
||||
# Now we collapse the dupe tree by iterating over %count until
|
||||
# there is no further change.
|
||||
while ($changed == 1)
|
||||
{
|
||||
$changed = 0;
|
||||
foreach $key (keys(%count)) {
|
||||
# if this bug is actually itself a dupe, and has a count...
|
||||
if (defined($dupes{$key}) && $count{$key} > 0) {
|
||||
# add that count onto the bug it is a dupe of,
|
||||
# and zero the count; the check is to avoid
|
||||
# loops
|
||||
if ($count{$dupes{$key}} != 0) {
|
||||
$count{$dupes{$key}} += $count{$key};
|
||||
$count{$key} = 0;
|
||||
$changed = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Remove the values for which the count is zero
|
||||
foreach $key (keys(%count))
|
||||
{
|
||||
if ($count{$key} == 0) {
|
||||
delete $count{$key};
|
||||
}
|
||||
}
|
||||
|
||||
dbmclose(%count);
|
||||
}
|
||||
|
||||
sub today {
|
||||
my ($dom, $mon, $year) = (localtime(time))[3, 4, 5];
|
||||
return sprintf "%04d%02d%02d", 1900 + $year, ++$mon, $dom;
|
||||
}
|
||||
|
||||
sub today_dash {
|
||||
my ($dom, $mon, $year) = (localtime(time))[3, 4, 5];
|
||||
return sprintf "%04d-%02d-%02d", 1900 + $year, ++$mon, $dom;
|
||||
}
|
||||
|
||||
@@ -1,168 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html><head>
|
||||
|
||||
<!--
|
||||
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.
|
||||
|
||||
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) 2000 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
|
||||
Contributor(s): Terry Weissman <terry@mozilla.org>
|
||||
-->
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<title>Understanding the UNCONFIRMED state, and other recent changes</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Understanding the UNCONFIRMED state, and other recent changes</h1>
|
||||
|
||||
<p>
|
||||
[This document is aimed primarily at people who have used Bugzilla
|
||||
before the UNCONFIRMED state was implemented. It might be helpful for
|
||||
newer users as well.]
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
New bugs in some products will now show up in a new state,
|
||||
UNCONFIRMED. This means that we have nobody has confirmed that the
|
||||
bug is real. Very busy engineers will probably generally ignore
|
||||
UNCONFIRMED that have been assigned to them, until they have been
|
||||
confirmed in one way or another. (Engineers with more time will
|
||||
hopefully glance over their UNCONFIRMED bugs regularly.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <a href="bug_status.html">page describing bug fields</a> has been
|
||||
updated to include UNCONFIRMED.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
There are two basic ways that a bug can become confirmed (and enter
|
||||
the NEW) state.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li> A user with the appropriate permissions (see below for more on
|
||||
permissions) decides that the bug is a valid one, and confirms
|
||||
it. We hope to gather a small army of responsible volunteers
|
||||
to regularly go through bugs for us.</li>
|
||||
<li> The bug gathers a certain number of votes. <b>Any</b> valid Bugzilla user may vote for
|
||||
bugs (each user gets a certain number of bugs); any UNCONFIRMED bug which
|
||||
gets enough votes becomes automatically confirmed, and enters the NEW state.</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
One implication of this is that it is worth your time to search the
|
||||
bug system for duplicates of your bug to vote on them, before
|
||||
submitting your own bug. If we can spread around knowledge of this
|
||||
fact, it ought to help cut down the number of duplicate bugs in the
|
||||
system.
|
||||
</p>
|
||||
|
||||
<h2>Permissions.</h2>
|
||||
|
||||
<p>
|
||||
Users now have a certain set of permissions. To see your permissions,
|
||||
check out the
|
||||
<a href="userprefs.cgi?bank=permissions">user preferences</a> page.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you have the "Can confirm a bug" permission, then you will be able
|
||||
to move UNCONFIRMED bugs into the NEW state.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you have the "Can edit all aspects of any bug" permission, then you
|
||||
can tweak anything about any bug. If not, you may only edit those
|
||||
bugs that you have submitted, or that you have assigned to you (or
|
||||
qa-assigned to you). However, anyone may add a comment to any bug.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Some people (initially, the initial owners and initial qa-contacts for
|
||||
components in the system) have the ability to give the above two
|
||||
permissions to other people. So, if you really feel that you ought to
|
||||
have one of these permissions, a good person to ask (via private
|
||||
email, please!) is the person who is assigned a relevant bug.
|
||||
</p>
|
||||
|
||||
<h2>Other details.</h2>
|
||||
|
||||
<p>
|
||||
An initial stab was taken to decide who would be given which of the
|
||||
above permissions. This was determined by some simple heurstics of
|
||||
who was assigned bugs, and who the default owners of bugs were, and a
|
||||
look at people who seem to have submitted several bugs that appear to
|
||||
have been interesting and valid. Inevitably, we have failed to give
|
||||
someone the permissions they deserve. Please don't take it
|
||||
personally; just bear with us as we shake out the new system.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
People with one of the two bits above can easily confirm their own
|
||||
bugs, so bugs they submit will actually start out in the NEW state.
|
||||
They can override this when submitting a bug.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
People can ACCEPT or RESOLVE a bug assigned to them, even if they
|
||||
aren't allowed to confirm it. However, the system remembers, and if
|
||||
the bug gets REOPENED or reassigned to someone else, it will revert
|
||||
back to the UNCONFIRMED state. If the bug has ever been confirmed,
|
||||
then REOPENing or reassigning will cause it to go to the NEW or
|
||||
REOPENED state.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Note that only some products support the UNCONFIRMED state. In other
|
||||
products, all new bugs will automatically start in the NEW state.
|
||||
</p>
|
||||
|
||||
<h2>Things still to be done.</h2>
|
||||
|
||||
<p>
|
||||
There probably ought to be a way to get a bug back into the
|
||||
UNCONFIRMED state, but there isn't yet.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If a person has submitted several bugs that get confirmed, then this
|
||||
is probably a person who understands the system well, and deserves the
|
||||
"Can confirm a bug" permission. This kind of person should be
|
||||
detected and promoted automatically.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
There should also be a way to automatically promote people to get the
|
||||
"Can edit all aspects of any bug" permission.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The "enter a new bug" page needs to be revamped with easy ways for new
|
||||
people to educate themselves on the benefit of searching for a bug
|
||||
like the one they're about to submit and voting on it, rather than
|
||||
adding a new useless duplicate.
|
||||
</p>
|
||||
|
||||
<hr>
|
||||
<p>
|
||||
<!-- hhmts start -->
|
||||
Last modified: Sun Apr 14 12:55:14 EST 2002
|
||||
<!-- hhmts end -->
|
||||
</p>
|
||||
</body> </html>
|
||||
@@ -1,79 +0,0 @@
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
|
||||
# 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.
|
||||
#
|
||||
# This code is based on code found in bug_email.pl from the bugzilla
|
||||
# email tracker. Initial contributors are ::
|
||||
# Terry Weissman <terry@mozilla.org>
|
||||
# Gregor Fischer <fischer@suse.de>
|
||||
# Klaas Freitag <freitag@suse.de>
|
||||
# Seth Landsman <seth@dworkin.net>
|
||||
|
||||
# The purpose of this module is to abstract out a bunch of the code
|
||||
# that is central to email interfaces to bugzilla and its database
|
||||
|
||||
# Contributor : Seth Landsman <seth@dworkin.net>
|
||||
|
||||
# Initial checkin : 03/15/00 (SML)
|
||||
# findUser() function moved from bug_email.pl to here
|
||||
|
||||
push @INC, "../."; # this script now lives in contrib
|
||||
|
||||
require "globals.pl";
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
my $EMAIL_TRANSFORM_NONE = "email_transform_none";
|
||||
my $EMAIL_TRANSFORM_BASE_DOMAIN = "email_transform_base_domain";
|
||||
my $EMAIL_TRANSFORM_NAME_ONLY = "email_transform_name_only";
|
||||
|
||||
# change to do incoming email address fuzzy matching
|
||||
my $email_transform = $EMAIL_TRANSFORM_NAME_ONLY;
|
||||
|
||||
# findUser()
|
||||
# This function takes an email address and returns the user email.
|
||||
# matching is sloppy based on the $email_transform parameter
|
||||
sub findUser($) {
|
||||
my ($address) = @_;
|
||||
# if $email_transform is $EMAIL_TRANSFORM_NONE, return the address, otherwise, return undef
|
||||
if ($email_transform eq $EMAIL_TRANSFORM_NONE) {
|
||||
my $stmt = "SELECT login_name FROM profiles WHERE profiles.login_name = \'$address\';";
|
||||
SendSQL($stmt);
|
||||
my $found_address = FetchOneColumn();
|
||||
return $found_address;
|
||||
} elsif ($email_transform eq $EMAIL_TRANSFORM_BASE_DOMAIN) {
|
||||
my ($username) = ($address =~ /(.+)@/);
|
||||
my $stmt = "SELECT login_name FROM profiles WHERE profiles.login_name RLIKE \'$username\';";
|
||||
SendSQL($stmt);
|
||||
|
||||
my $domain;
|
||||
my $found = undef;
|
||||
my $found_address;
|
||||
my $new_address = undef;
|
||||
while ((!$found) && ($found_address = FetchOneColumn())) {
|
||||
($domain) = ($found_address =~ /.+@(.+)/);
|
||||
if ($address =~ /$domain/) {
|
||||
$found = 1;
|
||||
$new_address = $found_address;
|
||||
}
|
||||
}
|
||||
return $new_address;
|
||||
} elsif ($email_transform eq $EMAIL_TRANSFORM_NAME_ONLY) {
|
||||
my ($username) = ($address =~ /(.+)@/);
|
||||
my $stmt = "SELECT login_name FROM profiles WHERE profiles.login_name RLIKE \'$username\';";
|
||||
SendSQL($stmt);
|
||||
my $found_address = FetchOneColumn();
|
||||
return $found_address;
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,22 +0,0 @@
|
||||
This directory contains contributed software related to Bugzilla.
|
||||
Things in here have not necessarily been tested or tried by anyone
|
||||
except the original contributor, so tred carefully. But it may still
|
||||
be useful to you.
|
||||
|
||||
This directory includes:
|
||||
|
||||
mysqld-watcher.pl -- This script can be installed as a frequent cron
|
||||
job to clean up stalled/dead queries.
|
||||
gnats2bz.pl -- A perl script to help import bugs from a GNATS
|
||||
database into a Bugzilla database. Contributed by
|
||||
Tom Schutter <tom@platte.com>
|
||||
|
||||
bug_email.pl -- A perl script that can receive email containing
|
||||
bug reports (email-interface). Contributed by
|
||||
Klaas Freitag <freitag@SuSE.de>
|
||||
|
||||
README.Mailif -- Readme describing the mail interface.
|
||||
bugmail_help.html -- User help page for the mail interface.
|
||||
|
||||
yp_nomail.sh -- Script you can run via cron that regularly updates
|
||||
the nomail file for terminated employees
|
||||
@@ -1,80 +0,0 @@
|
||||
|
||||
The Bugzilla Mail interface
|
||||
===========================
|
||||
|
||||
(UPDATE 03/14/00 to better reflect reality by SML)
|
||||
|
||||
The Bugzilla Mail interface allows to submit bugs to Bugzilla by email.
|
||||
|
||||
The Mail Interface Contribution consists of three files:
|
||||
README.Mailif - this readme.
|
||||
bug_email.pl - the script
|
||||
bugmail_help.html - a user help html site
|
||||
|
||||
Installation:
|
||||
|
||||
Next is to add a user who receives the bugmails, e. g. bugmail. Create a
|
||||
mail account and a home directory for the user.
|
||||
|
||||
The mailinterface script bug_email.pl needs to get the mail through stdin.
|
||||
I use procmail for that, with the following line in the .procmailrc:
|
||||
|
||||
BUGZILLA_HOME=/usr/local/httpd/htdocs/bugzilla
|
||||
:0 c
|
||||
|(cd $BUGZILLA_HOME/contrib; ./bug_email.pl)
|
||||
|
||||
This defines the Bugzilla directory as the variable BUGZILLA_HOME and passes
|
||||
all incoming mail to the script after cd'ing into the bugzilla home.
|
||||
|
||||
In some cases, it is necessary to alter the headers of incoming email. The
|
||||
additional line to procmail :
|
||||
|
||||
:0 fhw
|
||||
| formail -I "From " -a "From "
|
||||
|
||||
fixes many problems.
|
||||
|
||||
See bugzilla.procmailrc for a sample procmailrc that works for me (SML) and
|
||||
also deals with bugzilla_email_append.pl
|
||||
|
||||
Customation:
|
||||
|
||||
There are some values inside the script which need to be customized for your
|
||||
needs:
|
||||
|
||||
1. In sub-routine Reply (search 'sub Reply':
|
||||
there is the line
|
||||
print MAIL "From: Bugzilla Mailinterface<yourmail\@here.com>\n";
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
Fill in your correct mail here. That will make it easy for people to reply
|
||||
to the mail.
|
||||
|
||||
2. check, if your sendmail resides in /usr/sbin/sendmail, change the path if neccessary.
|
||||
Search the script after 'default' - you find some default-Settings for bug
|
||||
reports, which are used, if the sender did not send a field for it. The defaults
|
||||
should be checked and changed.
|
||||
|
||||
Thats hopefully all, we will come up with any configuration file or something.
|
||||
|
||||
|
||||
If your mail works, your script will insert mails from now on.
|
||||
|
||||
The mailinterface supports two commandline switches:
|
||||
|
||||
There are two command line switches :
|
||||
|
||||
-t: Testmode
|
||||
The mailinterface does not really insert the bug into the database, but
|
||||
writes some debug output to stdout and writes the mail into the file
|
||||
bug_email_test.log in the data-dir.
|
||||
|
||||
-r: restricted mode
|
||||
All lines before the first line with a keyword character are skipped.
|
||||
In not restricted, default mode, these lines are added to the long
|
||||
description of the bug.
|
||||
|
||||
|
||||
02/2000 - Klaas Freitag, SuSE GmbH <freitag@suse.de>
|
||||
03/2000 - Seth M. Landsman <seth@cs.brandeis.edu>
|
||||
bug_email.pl now lives out of bugzilla/contrib
|
||||
added line about formail
|
||||
@@ -1,223 +0,0 @@
|
||||
<HTML>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
||||
<!--
|
||||
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.
|
||||
|
||||
The Original Code is the Bugzilla Bug Tracking System.
|
||||
|
||||
Contributor(s): Klaas Freitag <Freitag@SuSE.de>
|
||||
-->
|
||||
|
||||
<HEAD> <TITLE>Bugzilla Mail Interface</TITLE> </HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF">
|
||||
<CENTER><H1>The Bugzilla Mail Interface</H1>
|
||||
Contributor: <A HREF="mailto:freitag@suse.de">Klaas Freitag</A>, SuSE GmbH
|
||||
</CENTER>
|
||||
<P>
|
||||
The bugzilla Mail interface allows the registered bugzilla users to submit bugs by
|
||||
sending email with a bug description. This is usefull for people, who do not work
|
||||
inhouse and want to submitt bugs to the bugzilla system.
|
||||
<p>
|
||||
|
||||
|
||||
I know, show me the <A HREF="#examplemail">example-mail !</A>
|
||||
|
||||
|
||||
<H2>What do you need to do to submitt a bug by mail ?</H2>
|
||||
You need to send a email in the described format to the bugmail-user of the
|
||||
bugzilla-system. This is <A HREF="mailto:our_bugzilla@xyz.com">yourbugzilla@here.com</A>
|
||||
|
||||
You receive a reply mail with the new bug-ID if your request was ok.
|
||||
If not, you get a mail with
|
||||
some help on the bugmail system and a specific analysis of your request.
|
||||
<P>
|
||||
Please dont refuse to send one or two wrong mails, you will get all the information
|
||||
you need in the replies, and <I>only</I> in the mail replies. The information on this
|
||||
page, concerning available products, versions and so on, is not dynamicly generated and
|
||||
may be old therefore.
|
||||
|
||||
<H1>The Mail Format</H1>
|
||||
The bugmail needs a special format , which consists of some keywords and suitable
|
||||
values for them and a description text. Note that the keyword block needs to be
|
||||
above of the description text.
|
||||
|
||||
<H2>Keywords</H2>
|
||||
You need to tell bugzilla some properties of the bugs. This is done by keywords, which
|
||||
start on a new line with a @, followed by the keyword and and equal-sign, followed by a
|
||||
hopefully valid value.
|
||||
|
||||
|
||||
<TABLE BORDER=4 FRAME=box CELLSPACING="5" width=95%> <COLGROUP> <col width="2*">
|
||||
<col width="5*"> <col width="1*"> </COLGROUP>
|
||||
<TR>
|
||||
<TH>Keyword</TH>
|
||||
<TH>Value description</TH>
|
||||
<TH>required and default value</TH>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>@product</TD>
|
||||
<TD>The product which has a bug</TD>
|
||||
<TD>yes. <br> This is the most important information. Many other
|
||||
fields depend on the product.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>@component</TD>
|
||||
<TD>the desired component which is affected by the bug</TD>
|
||||
<TD>yes. <br> As the @product, this is a very important
|
||||
field.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>@version</TD>
|
||||
<TD>The version of the product</TD>
|
||||
<TD>yes. <br>See @product and @component</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>@short_desc</TD>
|
||||
<TD>A summary of your bug report</TD>
|
||||
<TD>yes. <br>This summary of the error you want to report
|
||||
describes what happen. You may skip the long description,
|
||||
but not this summary.<br>
|
||||
<b>Note:</b>The short description may be given in the mail subject
|
||||
instead of using the keyword !</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>@rep_platform</TD>
|
||||
<TD>The desired platform</TD>
|
||||
<TD>no.<br>If you dont give a value, this field is set to <I>All</I>.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>@bug_severity</TD>
|
||||
<TD>The severity of the bug</TD>
|
||||
<TD>no. <br> If you dont give a value, this field is set to
|
||||
<I>normal</I></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>@priority</TD>
|
||||
<TD>The priority of the bug</TD>
|
||||
<TD>no.<br>If you dont give a value, this field is set to <I>P3</I></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>@op_sys</TD>
|
||||
<TD>The operating system</TD>
|
||||
<TD>no.<br>If you dont give a value, this field is set to <I>Linux</I>.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>@assigned_to</TD>
|
||||
<TD>The one to whom the bug is assigned to</TD>
|
||||
<TD>no. <br>There is an initial owner for every product/version/component.
|
||||
He owns the bug by default. The initial owner can only be found if
|
||||
product, version and component are valid.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>@bug_file_loc</TD>
|
||||
<TD>?</TD>
|
||||
<TD>no.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>@status_whiteboard</TD>
|
||||
<TD>?</TD>
|
||||
<TD>no.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>@target_milestone</TD>
|
||||
<TD>?</TD>
|
||||
<TD>no.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>@groupset</TD>
|
||||
<TD>rules the visibility of the bug.</TD>
|
||||
<TD>no.<br>This value defaults to the smallest of the available groups,
|
||||
which is <I>readInternal</I>.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>@qa_contact</TD>
|
||||
<TD>the quality manager for the product</TD>
|
||||
<TD>no.<br>This value can be retrieved from product, component and
|
||||
version</TD>
|
||||
</TR>
|
||||
|
||||
</TABLE>
|
||||
<H2>Valid values</H2>
|
||||
Give string values for the most keys above. Some keywords require special values:<br>
|
||||
<ol>
|
||||
<li>E-Mail adresses: If you want to set the qa-contact, specify a email-adress for @qa_contact. The email must be known by bugzilla of course.</li>
|
||||
<li>Listvalues: Most of the values have to be one of a list of valid values. Try by sending
|
||||
a mail and read the reply. Skip fields if you dont get help for them unless you dont know
|
||||
which values you may choose.</li>
|
||||
<li>free Text: The descriptions may be free text. </li>
|
||||
<li>Special: The field groupset may be specified in different in three different kinds:
|
||||
<ol>
|
||||
<li> A plain numeric way, which is one usually huge number, e. g. <I>65536</I></li>
|
||||
<li> a string with added numbers e.g. <I>65536+131072</I></li>
|
||||
<li> a string list, e.g. <I>ReadInternal, ReadBeta </I></li>
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<p>
|
||||
|
||||
But most of them need <b>valid</b> values.
|
||||
<p>
|
||||
Sorry, you will not find lists of valid products, components and the other stuff
|
||||
here. Send a mail to with any text, and you will get a list of valid keywords in the reply.
|
||||
|
||||
<p>
|
||||
Some of the values must be choosen from a list:<br>
|
||||
<ol>
|
||||
<li>bug_severity: blocker, critical, major, normal, minor, trivial, enhancement</li>
|
||||
<li>op_sys: Linux </li>
|
||||
<li>priority: P1, P2, P3, P4, P5</li>
|
||||
<li>rep_platform: All, i386, AXP, i686, Other</li></ol>
|
||||
|
||||
|
||||
<p>
|
||||
|
||||
After you have specified the required keywords and maybe some other value, you may
|
||||
describe your bug. You dont need a keyword for starting your bug description. All
|
||||
text which follows the keyword block is handled as long description of the bug.
|
||||
<p>
|
||||
|
||||
The bugmail interface is able to find required information by itself. E.g. if you specify
|
||||
a product which has exactly one component, this component will be found by the interface
|
||||
automatically.
|
||||
|
||||
<H1>Attachments</H1>
|
||||
|
||||
The mail interface is able to cope with MIME-attachments.
|
||||
People could for example add a logfile as a mail attachment, and it will appear in
|
||||
bugzilla as attachment. A comment for the attachment should be added, it will describe
|
||||
the attachment in bugzilla.
|
||||
|
||||
<H1><A NAME="examplemail">Example Mail</A></H1>
|
||||
|
||||
See the example of the mail <b>body</b> (Dont forget to specify the short description
|
||||
in the mail subject):<hr><pre>
|
||||
|
||||
@product = Bugzilla
|
||||
@component = general
|
||||
@version = All
|
||||
@groupset = ReadWorld ReadPartners
|
||||
@op_sys = Linux
|
||||
@priority = P3
|
||||
@rep_platform = i386
|
||||
|
||||
|
||||
This is the description of the bug I found. It is not neccessary to start
|
||||
it with a keyword.
|
||||
|
||||
Note: The short_description is neccessary and may be given with the keyword
|
||||
@short_description or will be retrieved from the mail subject.
|
||||
|
||||
|
||||
</pre><hr>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,30 +0,0 @@
|
||||
:0 fhw
|
||||
| formail -I "From " -a "From "
|
||||
|
||||
BUGZILLA_HOME=/home/bugzilla/WEB/bugzilla/contrib
|
||||
|
||||
:0
|
||||
* ^Subject: .*\[Bug .*\]
|
||||
RESULT=|(cd $BUGZILLA_HOME && ./bugzilla_email_append.pl)
|
||||
|
||||
|
||||
# Feed mail to stdin of bug_email.pl
|
||||
:0 Ec
|
||||
#* !^Subject: .*[Bug .*]
|
||||
RESULT=|(cd $BUGZILLA_HOME && ./bug_email.pl )
|
||||
|
||||
# write result to a logfile
|
||||
:0 c
|
||||
|echo `date '+%d.%m.%y %H:%M: '` $RESULT >> $HOME/bug_email.log
|
||||
|
||||
|
||||
:0 c
|
||||
|echo "----------------------------------" >> $HOME/bug_email.log
|
||||
|
||||
:0 c
|
||||
$HOME/bug_email.log
|
||||
|
||||
# Move mail to the inbox
|
||||
:0
|
||||
$HOME/Mail/INBOX
|
||||
|
||||
@@ -1,192 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
|
||||
# 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.
|
||||
|
||||
# The purpose of this script is to take an email message, which
|
||||
# specifies a bugid and append it to the bug as part of the longdesc
|
||||
# table
|
||||
|
||||
# Contributor : Seth M. Landsman <seth@dworkin.net>
|
||||
|
||||
# 03/15/00 : Initial version by SML
|
||||
# 03/15/00 : processmail gets called
|
||||
|
||||
# Email subject must be of format :
|
||||
# .* Bug ### .*
|
||||
# replying to a typical bugzilla email should be valid
|
||||
|
||||
# TODO :
|
||||
# 1. better way to get the body text (I don't know what dump_entity() is
|
||||
# actually doing
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
use MIME::Parser;
|
||||
|
||||
chdir ".."; # this script lives in contrib, change to main
|
||||
push @INC, "contrib";
|
||||
push @INC, "."; # this script lives in contrib
|
||||
require "globals.pl";
|
||||
require "BugzillaEmail.pm";
|
||||
|
||||
# Create a new MIME parser:
|
||||
my $parser = new MIME::Parser;
|
||||
|
||||
my $Comment = "";
|
||||
|
||||
# Create and set the output directory:
|
||||
# FIXME: There should be a $BUGZILLA_HOME variable (SML)
|
||||
(-d "data/mimedump-tmp") or mkdir "data/mimedump-tmp",0755 or die "mkdir: $!";
|
||||
(-w "data/mimedump-tmp") or die "can't write to directory";
|
||||
|
||||
$parser->output_dir("data/mimedump-tmp");
|
||||
|
||||
# Read the MIME message:
|
||||
my $entity = $parser->read(\*STDIN) or die "couldn't parse MIME stream";
|
||||
$entity->remove_sig(10); # Removes the signature in the last 10 lines
|
||||
|
||||
# Getting values from parsed mail
|
||||
my $Sender = $entity->get( 'From' );
|
||||
$Sender ||= $entity->get( 'Reply-To' );
|
||||
my $Message_ID = $entity->get( 'Message-Id' );
|
||||
|
||||
die (" *** Cant find Sender-adress in sent mail ! ***\n" ) unless defined( $Sender );
|
||||
chomp( $Sender );
|
||||
chomp( $Message_ID );
|
||||
|
||||
print "Dealing with the sender $Sender\n";
|
||||
|
||||
ConnectToDatabase();
|
||||
|
||||
my $SenderShort = $Sender;
|
||||
$SenderShort =~ s/^.*?([a-zA-Z0-9_.-]+?\@[a-zA-Z0-9_.-]+\.[a-zA-Z0-9_.-]+).*$/$1/;
|
||||
|
||||
$SenderShort = findUser($SenderShort);
|
||||
|
||||
print "SenderShort is $SenderShort\n";
|
||||
if (!defined($SenderShort)) {
|
||||
$SenderShort = $Sender;
|
||||
$SenderShort =~ s/^.*?([a-zA-Z0-9_.-]+?\@[a-zA-Z0-9_.-]+\.[a-zA-Z0-9_.-]+).*$/$1/;
|
||||
}
|
||||
print "The sendershort is now $SenderShort\n";
|
||||
|
||||
if (!defined($SenderShort)) {
|
||||
DealWithError("No such user $SenderShort exists.");
|
||||
}
|
||||
|
||||
my $Subject = $entity->get('Subject');
|
||||
print "The subject is $Subject\n";
|
||||
|
||||
my ($bugid) = ($Subject =~ /\[Bug ([\d]+)\]/);
|
||||
print "The bugid is $bugid\n";
|
||||
|
||||
# make sure the bug exists
|
||||
|
||||
SendSQL("SELECT bug_id FROM bugs WHERE bug_id = $bugid;");
|
||||
my $found_id = FetchOneColumn();
|
||||
print "Did we find the bug? $found_id-\n";
|
||||
if (!defined($found_id)) {
|
||||
DealWithError("Bug $bugid does not exist");
|
||||
}
|
||||
|
||||
# get the user id
|
||||
SendSQL("SELECT userid FROM profiles WHERE login_name = \'$SenderShort\';");
|
||||
my $userid = FetchOneColumn();
|
||||
if (!defined($userid)) {
|
||||
DealWithError("Userid not found for $SenderShort");
|
||||
}
|
||||
|
||||
# parse out the text of the message
|
||||
dump_entity($entity);
|
||||
|
||||
# Get rid of the bug id
|
||||
$Subject =~ s/\[Bug [\d]+\]//;
|
||||
#my $Comment = "This is only a test ...";
|
||||
my $Body = "Subject: " . $Subject . "\n" . $Comment;
|
||||
|
||||
# shove it in the table
|
||||
my $long_desc_query = "INSERT INTO longdescs SET bug_id=$found_id, who=$userid, bug_when=NOW(), thetext=" . SqlQuote($Body) . ";";
|
||||
SendSQL($long_desc_query);
|
||||
|
||||
system("./processmail", $found_id, $SenderShort);
|
||||
|
||||
sub DealWithError {
|
||||
my ($reason) = @_;
|
||||
print $reason . "\n";
|
||||
exit 100;
|
||||
}
|
||||
|
||||
# Yanking this wholesale from bug_email, 'cause I know this works. I'll
|
||||
# figure out what it really does later
|
||||
#------------------------------
|
||||
#
|
||||
# dump_entity ENTITY, NAME
|
||||
#
|
||||
# Recursive routine for parsing a mime coded mail.
|
||||
# One mail may contain more than one mime blocks, which need to be
|
||||
# handled. Therefore, this function is called recursively.
|
||||
#
|
||||
# It gets the for bugzilla important information from the mailbody and
|
||||
# stores them into the global attachment-list @attachments. The attachment-list
|
||||
# is needed in storeAttachments.
|
||||
#
|
||||
sub dump_entity {
|
||||
my ($entity, $name) = @_;
|
||||
defined($name) or $name = "'anonymous'";
|
||||
my $IO;
|
||||
|
||||
|
||||
# Output the body:
|
||||
my @parts = $entity->parts;
|
||||
if (@parts) { # multipart...
|
||||
my $i;
|
||||
foreach $i (0 .. $#parts) { # dump each part...
|
||||
dump_entity($parts[$i], ("$name, part ".(1+$i)));
|
||||
}
|
||||
} else { # single part...
|
||||
|
||||
# Get MIME type, and display accordingly...
|
||||
my $msg_part = $entity->head->get( 'Content-Disposition' );
|
||||
|
||||
$msg_part ||= "";
|
||||
|
||||
my ($type, $subtype) = split('/', $entity->head->mime_type);
|
||||
my $body = $entity->bodyhandle;
|
||||
my ($data, $on_disk );
|
||||
|
||||
if( $msg_part =~ /^attachment/ ) {
|
||||
# Attached File
|
||||
my $des = $entity->head->get('Content-Description');
|
||||
$des ||= "";
|
||||
|
||||
if( defined( $body->path )) { # Data is on disk
|
||||
$on_disk = 1;
|
||||
$data = $body->path;
|
||||
|
||||
} else { # Data is in core
|
||||
$on_disk = 0;
|
||||
$data = $body->as_string;
|
||||
}
|
||||
# push ( @attachments, [ $data, $entity->head->mime_type, $on_disk, $des ] );
|
||||
} else {
|
||||
# Real Message
|
||||
if ($type =~ /^(text|message)$/) { # text: display it...
|
||||
if ($IO = $body->open("r")) {
|
||||
$Comment .= $_ while (defined($_ = $IO->getline));
|
||||
$IO->close;
|
||||
} else { # d'oh!
|
||||
print "$0: couldn't find/open '$name': $!";
|
||||
}
|
||||
} else { print "Oooops - no Body !\n"; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
#!/bin/sh
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Bugzilla Bug Tracking System.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Andreas Franke <afranke@ags.uni-sb.de>.
|
||||
# Corporation. Portions created by Andreas Franke are
|
||||
# Copyright (C) 2001 Andreas Franke. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
conf="`dirname $0`/query.conf"
|
||||
|
||||
query="http://bugzilla.mozilla.org/buglist.cgi?cmd=doit"
|
||||
defaultcolumnlist="severity priority platform status resolution target_milestone status_whiteboard keywords summaryfull"
|
||||
|
||||
chart=0
|
||||
and=0
|
||||
while test "$1" != ""; do
|
||||
arg=$1
|
||||
arg_len=`expr length ${arg}`
|
||||
if test `expr substr "${arg}" 1 2` == "--"; then
|
||||
eq_pos=`expr match ${arg} '--.*='`
|
||||
if test "${eq_pos}" == "0"; then
|
||||
echo 'Missing value for long option '"${arg}"' ("=" not found)' 1>&2
|
||||
exit 1;
|
||||
fi
|
||||
# extract option name
|
||||
let name_len=${eq_pos}-3
|
||||
name=`expr substr ${arg} 3 ${name_len}`
|
||||
# extract option value
|
||||
let val_start=${eq_pos}+1
|
||||
let val_len=${arg_len}-${eq_pos}
|
||||
val=`expr substr ${arg} ${val_start} ${val_len}`
|
||||
elif test `expr substr ${arg} 1 1` == "-" &&
|
||||
test "`expr substr ${arg} 2 1`" != ""; then
|
||||
# extract
|
||||
name=`expr substr ${arg} 2 1`
|
||||
let val_len=${arg_len}-2
|
||||
val=`expr substr ${arg} 3 ${val_len}`
|
||||
else
|
||||
name="default"
|
||||
val="${arg}"
|
||||
#echo "Unrecognized option ${arg}" 1>&2
|
||||
#exit 1
|
||||
fi
|
||||
|
||||
# find field and comparison type for option ${name}
|
||||
field=`grep '"'${name}'"' ${conf} | awk '{printf $1}'`
|
||||
type=`grep '"'${name}'"' ${conf} | awk '{printf $2}'`
|
||||
if test "${field}" == "" || test "${type}" == ""; then
|
||||
echo "Field name & comparison type not found for option ${name}." 1>&2
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
or=0
|
||||
while test "${val}" != ""; do
|
||||
comma_idx=`expr index ${val} ,`
|
||||
if test ${comma_idx} == "0"; then
|
||||
val1="${val}"
|
||||
val=""
|
||||
else
|
||||
let val1_len=${comma_idx}-1
|
||||
val1=`expr substr ${val} 1 ${val1_len}`
|
||||
val_len=`expr length ${val}`
|
||||
let rest_start=${comma_idx}+1
|
||||
let rest_len=${val_len}-${comma_idx}
|
||||
val=`expr substr ${val} ${rest_start} ${rest_len}`
|
||||
fi
|
||||
query="${query}&field${chart}-${and}-${or}=${field}"
|
||||
query="${query}&type${chart}-${and}-${or}=${type}"
|
||||
query="${query}&value${chart}-${and}-${or}=${val1}"
|
||||
#echo "----- ${name} : ${field} : ${type} : ${val1} -----" 1>&2
|
||||
let or=${or}+1
|
||||
done
|
||||
let chart=${chart}+1
|
||||
shift
|
||||
done
|
||||
|
||||
outputfile="/dev/stdout"
|
||||
#outputfile="buglist.html"
|
||||
#\rm -f ${outputfile}
|
||||
wget -q -O ${outputfile} --header="Cookie: COLUMNLIST=${COLUMNLIST-${defaultcolumnlist}}" "${query}"
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
#!/bin/sh
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Bugzilla Bug Tracking System.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Andreas Franke <afranke@ags.uni-sb.de>.
|
||||
# Corporation. Portions created by Andreas Franke are
|
||||
# Copyright (C) 2001 Andreas Franke. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
buglist="`dirname $0`/buglist"
|
||||
htmlfile="`dirname $0`/buglist.html"
|
||||
|
||||
${buglist} "$@" 2>&1 1>${htmlfile}
|
||||
if test ${?} == "0"; then
|
||||
echo `grep 'TR VALIGN=TOP ALIGN=LEFT CLASS=' ${htmlfile} | sed -e 's/<TR.*id=//' | sed -e 's/".*//'` | sed -e 's/ /\,/g'
|
||||
else
|
||||
cat ${htmlfile} 1>&2
|
||||
exit 1
|
||||
fi
|
||||
@@ -1,49 +0,0 @@
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Bugzilla Bug Tracking System.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Andreas Franke <afranke@ags.uni-sb.de>.
|
||||
# Corporation. Portions created by Andreas Franke are
|
||||
# Copyright (C) 2001 Andreas Franke. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
#
|
||||
# This is `query.conf', the config file for `buglist'.
|
||||
#
|
||||
# Columns: 1: field_name, 2: comparison_type, 3: cmd-line options
|
||||
#
|
||||
bug_status substring "s","status"
|
||||
resolution substring "r","resolution"
|
||||
rep_platform substring "p","platform"
|
||||
op_sys substring "o","os","opsys"
|
||||
priority substring "p","priority"
|
||||
bug_severity substring "S","severity"
|
||||
assigned_to substring "A","O","owner","assignedto"
|
||||
reporter substring "R","reporter"
|
||||
qa_contact substring "Q","qa","qacontact"
|
||||
cc substring "C","cc"
|
||||
product substring "product"
|
||||
version substring "V","version"
|
||||
component substring "c","component"
|
||||
target_milestone substring "M","milestone"
|
||||
short_desc substring "default","summary"
|
||||
longdesc substring "d","description","longdesc"
|
||||
bug_file_loc substring "u","url"
|
||||
status_whiteboard substring "w","whiteboard"
|
||||
keywords substring "k","K","keywords"
|
||||
attachments.description substring "attachdesc"
|
||||
attachments.thedata substring "attachdata"
|
||||
attachments.mimetype substring "attachmime"
|
||||
dependson substring # bug 30823
|
||||
blocked substring # bug 30823
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Dawn Endico <endico@mozilla.org>
|
||||
|
||||
|
||||
# Keep a record of all cvs updates made from a given directory.
|
||||
#
|
||||
# Later, if changes need to be backed out, look at the log file
|
||||
# and run the cvs command with the date that you want to back
|
||||
# out to. (Probably the second to last entry).
|
||||
|
||||
#DATE=`date +%e/%m/%Y\ %k:%M:%S\ %Z`
|
||||
DATE=`date`
|
||||
COMMAND="cvs update -d -P -D"
|
||||
echo $COMMAND \"$DATE\" >> cvs-update.log
|
||||
$COMMAND "$DATE"
|
||||
|
||||
|
||||
# sample log file
|
||||
#cvs update -P -D "11/04/2000 20:22:08 PDT"
|
||||
#cvs update -P -D "11/05/2000 20:22:22 PDT"
|
||||
#cvs update -P -D "11/07/2000 20:26:29 PDT"
|
||||
#cvs update -P -D "11/08/2000 20:27:10 PDT"
|
||||
@@ -1,303 +0,0 @@
|
||||
#!/usr/local/bin/python
|
||||
# -*- mode: python -*-
|
||||
|
||||
"""
|
||||
jb2bz.py - a nonce script to import bugs from JitterBug to Bugzilla
|
||||
Written by Tom Emerson, tree@basistech.com
|
||||
|
||||
This script is provided in the hopes that it will be useful. No
|
||||
rights reserved. No guarantees expressed or implied. Use at your own
|
||||
risk. May be dangerous if swallowed. If it doesn't work for you, don't
|
||||
blame me. It did what I needed it to do.
|
||||
|
||||
This code requires a recent version of Andy Dustman's MySQLdb interface,
|
||||
|
||||
http://sourceforge.net/projects/mysql-python
|
||||
|
||||
Share and enjoy.
|
||||
"""
|
||||
|
||||
import rfc822, mimetools, multifile, mimetypes
|
||||
import sys, re, glob, StringIO, os, stat, time
|
||||
import MySQLdb, getopt
|
||||
|
||||
# mimetypes doesn't include everything we might encounter, yet.
|
||||
if not mimetypes.types_map.has_key('.doc'):
|
||||
mimetypes.types_map['.doc'] = 'application/msword'
|
||||
|
||||
if not mimetypes.encodings_map.has_key('.bz2'):
|
||||
mimetypes.encodings_map['.bz2'] = "bzip2"
|
||||
|
||||
bug_status='NEW'
|
||||
component="default"
|
||||
version=""
|
||||
product="" # this is required, the rest of these are defaulted as above
|
||||
|
||||
"""
|
||||
Each bug in JitterBug is stored as a text file named by the bug number.
|
||||
Additions to the bug are indicated by suffixes to this:
|
||||
|
||||
<bug>
|
||||
<bug>.followup.*
|
||||
<bug>.reply.*
|
||||
<bug>.notes
|
||||
|
||||
The dates on the files represent the respective dates they were created/added.
|
||||
|
||||
All <bug>s and <bug>.reply.*s include RFC 822 mail headers. These could include
|
||||
MIME file attachments as well that would need to be extracted.
|
||||
|
||||
There are other additions to the file names, such as
|
||||
|
||||
<bug>.notify
|
||||
|
||||
which are ignored.
|
||||
|
||||
Bugs in JitterBug are organized into directories. At Basis we used the following
|
||||
naming conventions:
|
||||
|
||||
<product>-bugs Open bugs
|
||||
<product>-requests Open Feature Requests
|
||||
<product>-resolved Bugs/Features marked fixed by engineering, but not verified
|
||||
<product>-verified Resolved defects that have been verified by QA
|
||||
|
||||
where <product> is either:
|
||||
|
||||
<product-name>
|
||||
|
||||
or
|
||||
|
||||
<product-name>-<version>
|
||||
"""
|
||||
|
||||
def process_notes_file(current, fname):
|
||||
try:
|
||||
new_note = {}
|
||||
notes = open(fname, "r")
|
||||
s = os.fstat(notes.fileno())
|
||||
|
||||
new_note['text'] = notes.read()
|
||||
new_note['timestamp'] = time.gmtime(s[stat.ST_MTIME])
|
||||
|
||||
notes.close()
|
||||
|
||||
current['notes'].append(new_note)
|
||||
|
||||
except IOError:
|
||||
pass
|
||||
|
||||
def process_reply_file(current, fname):
|
||||
new_note = {}
|
||||
reply = open(fname, "r")
|
||||
msg = rfc822.Message(reply)
|
||||
new_note['text'] = "%s\n%s" % (msg['From'], msg.fp.read())
|
||||
new_note['timestamp'] = rfc822.parsedate_tz(msg['Date'])
|
||||
current["notes"].append(new_note)
|
||||
|
||||
def add_notes(current):
|
||||
"""Add any notes that have been recorded for the current bug."""
|
||||
process_notes_file(current, "%d.notes" % current['number'])
|
||||
|
||||
for f in glob.glob("%d.reply.*" % current['number']):
|
||||
process_reply_file(current, f)
|
||||
|
||||
for f in glob.glob("%d.followup.*" % current['number']):
|
||||
process_reply_file(current, f)
|
||||
|
||||
def maybe_add_attachment(current, file, submsg):
|
||||
"""Adds the attachment to the current record"""
|
||||
cd = submsg["Content-Disposition"]
|
||||
m = re.search(r'filename="([^"]+)"', cd)
|
||||
if m == None:
|
||||
return
|
||||
attachment_filename = m.group(1)
|
||||
if (submsg.gettype() == 'application/octet-stream'):
|
||||
# try get a more specific content-type for this attachment
|
||||
type, encoding = mimetypes.guess_type(m.group(1))
|
||||
if type == None:
|
||||
type = submsg.gettype()
|
||||
else:
|
||||
type = submsg.gettype()
|
||||
|
||||
try:
|
||||
data = StringIO.StringIO()
|
||||
mimetools.decode(file, data, submsg.getencoding())
|
||||
except:
|
||||
return
|
||||
|
||||
current['attachments'].append( ( attachment_filename, type, data.getvalue() ) )
|
||||
|
||||
def process_mime_body(current, file, submsg):
|
||||
data = StringIO.StringIO()
|
||||
mimetools.decode(file, data, submsg.getencoding())
|
||||
current['description'] = data.getvalue()
|
||||
|
||||
|
||||
|
||||
def process_text_plain(msg, current):
|
||||
print "Processing: %d" % current['number']
|
||||
current['description'] = msg.fp.read()
|
||||
|
||||
def process_multi_part(file, msg, current):
|
||||
print "Processing: %d" % current['number']
|
||||
mf = multifile.MultiFile(file)
|
||||
mf.push(msg.getparam("boundary"))
|
||||
while mf.next():
|
||||
submsg = mimetools.Message(file)
|
||||
if submsg.has_key("Content-Disposition"):
|
||||
maybe_add_attachment(current, mf, submsg)
|
||||
else:
|
||||
# This is the message body itself (always?), so process
|
||||
# accordingly
|
||||
process_mime_body(current, mf, submsg)
|
||||
|
||||
def process_jitterbug(filename):
|
||||
current = {}
|
||||
current['number'] = int(filename)
|
||||
current['notes'] = []
|
||||
current['attachments'] = []
|
||||
current['description'] = ''
|
||||
current['date-reported'] = ()
|
||||
current['short-description'] = ''
|
||||
|
||||
file = open(filename, "r")
|
||||
msg = mimetools.Message(file)
|
||||
|
||||
msgtype = msg.gettype()
|
||||
|
||||
add_notes(current)
|
||||
current['date-reported'] = rfc822.parsedate_tz(msg['Date'])
|
||||
current['short-description'] = msg['Subject']
|
||||
|
||||
if msgtype[:5] == 'text/':
|
||||
process_text_plain(msg, current)
|
||||
elif msgtype[:10] == "multipart/":
|
||||
process_multi_part(file, msg, current)
|
||||
else:
|
||||
# Huh? This should never happen.
|
||||
print "Unknown content-type: %s" % msgtype
|
||||
sys.exit(1)
|
||||
|
||||
# At this point we have processed the message: we have all of the notes and
|
||||
# attachments stored, so it's time to add things to the database.
|
||||
# The schema for JitterBug 2.14 can be found at:
|
||||
#
|
||||
# http://www.trilobyte.net/barnsons/html/dbschema.html
|
||||
#
|
||||
# The following fields need to be provided by the user:
|
||||
#
|
||||
# bug_status
|
||||
# product
|
||||
# version
|
||||
# reporter
|
||||
# component
|
||||
# resolution
|
||||
|
||||
# change this to the user_id of the Bugzilla user who is blessed with the
|
||||
# imported defects
|
||||
reporter=6
|
||||
|
||||
# the resolution will need to be set manually
|
||||
resolution=""
|
||||
|
||||
db = MySQLdb.connect(db='bugs',user='root',host='localhost')
|
||||
cursor = db.cursor()
|
||||
|
||||
cursor.execute( "INSERT INTO bugs SET " \
|
||||
"bug_id=%s," \
|
||||
"bug_severity='normal'," \
|
||||
"bug_status=%s," \
|
||||
"creation_ts=%s," \
|
||||
"short_desc=%s," \
|
||||
"product=%s," \
|
||||
"rep_platform='All'," \
|
||||
"assigned_to=%s,"
|
||||
"reporter=%s," \
|
||||
"version=%s," \
|
||||
"component=%s," \
|
||||
"resolution=%s",
|
||||
[ current['number'],
|
||||
bug_status,
|
||||
time.strftime("%Y-%m-%d %H:%M:%S", current['date-reported'][:9]),
|
||||
current['short-description'],
|
||||
product,
|
||||
reporter,
|
||||
reporter,
|
||||
version,
|
||||
component,
|
||||
resolution] )
|
||||
|
||||
# This is the initial long description associated with the bug report
|
||||
cursor.execute( "INSERT INTO longdescs VALUES (%s,%s,%s,%s)",
|
||||
[ current['number'],
|
||||
reporter,
|
||||
time.strftime("%Y-%m-%d %H:%M:%S", current['date-reported'][:9]),
|
||||
current['description'] ] )
|
||||
|
||||
# Add whatever notes are associated with this defect
|
||||
for n in current['notes']:
|
||||
cursor.execute( "INSERT INTO longdescs VALUES (%s,%s,%s,%s)",
|
||||
[current['number'],
|
||||
reporter,
|
||||
time.strftime("%Y-%m-%d %H:%M:%S", n['timestamp'][:9]),
|
||||
n['text']])
|
||||
|
||||
# add attachments associated with this defect
|
||||
for a in current['attachments']:
|
||||
cursor.execute( "INSERT INTO attachments SET " \
|
||||
"bug_id=%s, creation_ts=%s, description='', mimetype=%s," \
|
||||
"filename=%s, thedata=%s, submitter_id=%s",
|
||||
[ current['number'],
|
||||
time.strftime("%Y-%m-%d %H:%M:%S", current['date-reported'][:9]),
|
||||
a[1], a[0], a[2], reporter ])
|
||||
|
||||
cursor.close()
|
||||
db.close()
|
||||
|
||||
def usage():
|
||||
print """Usage: jb2bz.py [OPTIONS] Product
|
||||
|
||||
Where OPTIONS are one or more of the following:
|
||||
|
||||
-h This help information.
|
||||
-s STATUS One of UNCONFIRMED, NEW, ASSIGNED, REOPENED, RESOLVED, VERIFIED, CLOSED
|
||||
(default is NEW)
|
||||
-c COMPONENT The component to attach to each bug as it is important. This should be
|
||||
valid component for the Product.
|
||||
-v VERSION Version to assign to these defects.
|
||||
|
||||
Product is the Product to assign these defects to.
|
||||
|
||||
All of the JitterBugs in the current directory are imported, including replies, notes,
|
||||
attachments, and similar noise.
|
||||
"""
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def main():
|
||||
global bug_status, component, version, product
|
||||
opts, args = getopt.getopt(sys.argv[1:], "hs:c:v:")
|
||||
|
||||
for o,a in opts:
|
||||
if o == "-s":
|
||||
if a in ('UNCONFIRMED','NEW','ASSIGNED','REOPENED','RESOLVED','VERIFIED','CLOSED'):
|
||||
bug_status = a
|
||||
elif o == '-c':
|
||||
component = a
|
||||
elif o == '-v':
|
||||
version = a
|
||||
elif o == '-h':
|
||||
usage()
|
||||
|
||||
if len(args) != 1:
|
||||
sys.stderr.write("Must specify the Product.\n")
|
||||
sys.exit(1)
|
||||
|
||||
product = args[0]
|
||||
|
||||
for bug in filter(lambda x: re.match(r"\d+$", x), glob.glob("*")):
|
||||
process_jitterbug(bug)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,102 +0,0 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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) 2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s): Dan Mosedale <dmose@mozilla.org>
|
||||
#
|
||||
|
||||
# mysqld-watcher.pl - a script that watches the running instance of
|
||||
# mysqld and kills off any long-running SELECTs against the shadow_db
|
||||
#
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "globals.pl";
|
||||
|
||||
# some configurables:
|
||||
|
||||
# length of time before a thread is eligible to be killed, in seconds
|
||||
#
|
||||
my $long_query_time = 600;
|
||||
#
|
||||
# the From header for any messages sent out
|
||||
#
|
||||
my $mail_from = "root\@lounge.mozilla.org";
|
||||
#
|
||||
# mail transfer agent. this should probably really be converted to a Param().
|
||||
#
|
||||
my $mta_program = "/usr/lib/sendmail -t -ODeliveryMode=deferred";
|
||||
|
||||
# and STDIN is where we get the info about running threads
|
||||
#
|
||||
close(STDIN);
|
||||
open(STDIN, "/usr/bonsaitools/bin/mysqladmin processlist |");
|
||||
|
||||
# iterate through the running threads
|
||||
#
|
||||
my @LONGEST = (0,0,0,0,0,0,0,0,0);
|
||||
while ( <STDIN> ) {
|
||||
my @F = split(/\|/);
|
||||
|
||||
# if this line is not the correct number of fields, or if the thread-id
|
||||
# field contains Id, skip this line. both these cases indicate that this
|
||||
# line contains pretty-printing gunk and not thread info.
|
||||
#
|
||||
next if ( $#F != 9 || $F[1] =~ /Id/);
|
||||
|
||||
if ( $F[4] =~ /shadow_bugs/ # shadowbugs database in use
|
||||
&& $F[5] =~ /Query/ # this is actually a query
|
||||
&& $F[6] > $long_query_time # this query has taken too long
|
||||
&& $F[8] =~ /(select|SELECT)/ # only kill a select
|
||||
&& $F[6] > $LONGEST[6] ) { # the longest running query seen
|
||||
@LONGEST = @F;
|
||||
}
|
||||
}
|
||||
|
||||
# send an email message
|
||||
#
|
||||
# should perhaps be moved to somewhere more global for use in bugzilla as a
|
||||
# whole; should also do more error-checking
|
||||
#
|
||||
sub sendEmail($$$$) {
|
||||
($#_ == 3) || die("sendEmail: invalid number of arguments");
|
||||
my ($from, $to, $subject, $body) = @_;
|
||||
|
||||
open(MTA, "|$mta_program");
|
||||
print MTA "From: $from\n";
|
||||
print MTA "To: $to\n";
|
||||
print MTA "Subject: $subject\n";
|
||||
print MTA "\n";
|
||||
print MTA $body;
|
||||
print MTA "\n";
|
||||
close(MTA);
|
||||
|
||||
}
|
||||
|
||||
# if we found anything, kill the database thread and send mail about it
|
||||
#
|
||||
if ($LONGEST[6] != 0) {
|
||||
|
||||
system ("/usr/bonsaitools/bin/mysqladmin", "kill", $LONGEST[1]);
|
||||
|
||||
# fire off an email telling the maintainer that we had to kill a thread
|
||||
#
|
||||
sendEmail($mail_from, Param("maintainer"),
|
||||
"long running MySQL thread killed",
|
||||
join(" ", @LONGEST) . "\n");
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
#!/bin/sh
|
||||
# -*- Mode: ksh -*-
|
||||
##############################################################################
|
||||
# $Id: yp_nomail.sh,v 1.1 2000-09-12 23:50:31 cyeh%bluemartini.com Exp $
|
||||
# yp_nomail
|
||||
#
|
||||
# Our mail admins got annoyed when bugzilla kept sending email
|
||||
# to people who'd had bugzilla entries and left the company. They
|
||||
# were no longer in the list of valid email users so it'd bounce.
|
||||
# Maintaining the 'data/nomail' file was a pain. Luckily, our UNIX
|
||||
# admins list all the users that ever were, but the people who've left
|
||||
# have a distinct marker in their password file. For example:
|
||||
#
|
||||
# fired:*LK*:2053:1010:You're Fired Dude:/home/loser:/bin/false
|
||||
#
|
||||
# This script takes advantage of the "*LK*" convention seen via
|
||||
# ypcat passwd and dumps those people into the nomail file. Any
|
||||
# manual additions are kept in a "nomail.(domainname)" file and
|
||||
# appended to the list of yp lockouts every night via Cron
|
||||
#
|
||||
# 58 23 * * * /export/bugzilla/contrib/yp_nomail.sh > /dev/null 2>&1
|
||||
#
|
||||
# Tak ( Mark Takacs ) 08/2000
|
||||
#
|
||||
# XXX: Maybe should crosscheck w/bugzilla users?
|
||||
##############################################################################
|
||||
|
||||
####
|
||||
# Configure this section to suite yer installation
|
||||
####
|
||||
|
||||
DOMAIN=`domainname`
|
||||
MOZILLA_HOME="/export/mozilla"
|
||||
BUGZILLA_HOME="${MOZILLA_HOME}/bugzilla"
|
||||
NOMAIL_DIR="${BUGZILLA_HOME}/data"
|
||||
NOMAIL="${NOMAIL_DIR}/nomail"
|
||||
NOMAIL_ETIME="${NOMAIL}.${DOMAIN}"
|
||||
NOMAIL_YP="${NOMAIL}.yp"
|
||||
FIRED_FLAG="\*LK\*"
|
||||
|
||||
YPCAT="/usr/bin/ypcat"
|
||||
GREP="/usr/bin/grep"
|
||||
SORT="/usr/bin/sort"
|
||||
|
||||
########################## no more config needed #################
|
||||
|
||||
# This dir comes w/Bugzilla. WAY too paranoid
|
||||
if [ ! -d ${NOMAIL_DIR} ] ; then
|
||||
echo "Creating $date_dir"
|
||||
mkdir -p ${NOMAIL_DIR}
|
||||
fi
|
||||
|
||||
#
|
||||
# Do some (more) paranoid checking
|
||||
#
|
||||
touch ${NOMAIL}
|
||||
if [ ! -w ${NOMAIL} ] ; then
|
||||
echo "Can't write nomail file: ${NOMAIL} -- exiting"
|
||||
exit
|
||||
fi
|
||||
if [ ! -r ${NOMAIL_ETIME} ] ; then
|
||||
echo "Can't access custom nomail file: ${NOMAIL_ETIME} -- skipping"
|
||||
NOMAIL_ETIME=""
|
||||
fi
|
||||
|
||||
#
|
||||
# add all the people with '*LK*' password to the nomail list
|
||||
# XXX: maybe I should customize the *LK* string. Doh.
|
||||
#
|
||||
|
||||
LOCKOUT=`$YPCAT passwd | $GREP "${FIRED_FLAG}" | cut -d: -f1 | sort > ${NOMAIL_YP}`
|
||||
`cat ${NOMAIL_YP} ${NOMAIL_ETIME} > ${NOMAIL}`
|
||||
|
||||
exit
|
||||
|
||||
|
||||
# end
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
#!/usr/bonsaitools/bin/perl -wT
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Terry Weissman <terry@mozilla.org>
|
||||
# David Gardiner <david.gardiner@unisa.edu.au>
|
||||
# Joe Robins <jmrobins@tgix.com>
|
||||
# Christopher Aillon <christopher@aillon.com>
|
||||
# Gervase Markham <gerv@gerv.net>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
use lib qw(.);
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
# Shut up misguided -w warnings about "used only once":
|
||||
use vars qw(
|
||||
%FORM
|
||||
$template
|
||||
$vars
|
||||
);
|
||||
|
||||
ConnectToDatabase();
|
||||
|
||||
# If we're using LDAP for login, then we can't create a new account here.
|
||||
if(Param('useLDAP')) {
|
||||
# Just in case someone already has an account, let them get the correct
|
||||
# footer on the error message
|
||||
quietly_check_login();
|
||||
DisplayError("This site is using LDAP for authentication. Please contact
|
||||
an LDAP administrator to get a new account created.",
|
||||
"Can't create LDAP accounts");
|
||||
PutFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
# Clear out the login cookies. Make people log in again if they create an
|
||||
# account; otherwise, they'll probably get confused.
|
||||
my $cookiepath = Param("cookiepath");
|
||||
print "Set-Cookie: Bugzilla_login= ; path=$cookiepath; expires=Tue, 15-Sep-1998 21:49:00 GMT
|
||||
Set-Cookie: Bugzilla_logincookie= ; path=$cookiepath; expires=Tue, 15-Sep-1998 21:49:00 GMT\n";
|
||||
|
||||
my $login = $::FORM{'login'};
|
||||
|
||||
if (defined($login)) {
|
||||
# We've been asked to create an account.
|
||||
my $realname = trim($::FORM{'realname'});
|
||||
CheckEmailSyntax($login);
|
||||
$vars->{'login'} = $login;
|
||||
|
||||
print "Content-Type: text/html\n\n";
|
||||
|
||||
if (!ValidateNewUser($login)) {
|
||||
# Account already exists
|
||||
$template->process("account/exists.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
exit;
|
||||
}
|
||||
|
||||
# Create account
|
||||
my $password = InsertNewUser($login, $realname);
|
||||
MailPassword($login, $password);
|
||||
|
||||
$template->process("account/created.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
exit;
|
||||
}
|
||||
|
||||
print "Content-Type: text/html\n\n";
|
||||
|
||||
# Show the standard "would you like to create an account?" form.
|
||||
$template->process("account/create.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
@@ -1,38 +0,0 @@
|
||||
/* 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.
|
||||
*
|
||||
* 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): Myk Melez <myk@mozilla.org>
|
||||
*/
|
||||
|
||||
/* Right align bug IDs. */
|
||||
.bz_id_column { text-align: right; }
|
||||
|
||||
/* Style bug rows according to severity. */
|
||||
.bz_blocker { color: red; font-weight: bold; }
|
||||
.bz_critical { color: red; }
|
||||
.bz_enhancement { font-style: italic; }
|
||||
|
||||
/* Style secure bugs if the installation is not using bug groups.
|
||||
* Installations that *are* using bug groups are likely to be using
|
||||
* them for almost all bugs, in which case special styling is not
|
||||
* informative and generally a nuisance.
|
||||
*/
|
||||
.bz_secure { color: black; background-color: lightgrey; }
|
||||
|
||||
/* Align columns in the "change multiple bugs" form to the right. */
|
||||
table#form tr th { text-align: right; }
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
body
|
||||
{
|
||||
font-family: sans-serif;
|
||||
font-size: 10pt;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
ul
|
||||
{
|
||||
padding-left: 12px;
|
||||
}
|
||||
|
||||
radio
|
||||
{
|
||||
-moz-user-select: ignore;
|
||||
}
|
||||
|
||||
.text-link
|
||||
{
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
.text-link:hover
|
||||
{
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.descriptive-content
|
||||
{
|
||||
color: #AAAAAA;
|
||||
}
|
||||
|
||||
.descriptive-content[focused=true]
|
||||
{
|
||||
color: black;
|
||||
}
|
||||
@@ -1,620 +0,0 @@
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Terry Weissman <terry@mozilla.org>
|
||||
# Dawn Endico <endico@mozilla.org>
|
||||
# Dan Mosedale <dmose@mozilla.org>
|
||||
# Joe Robins <jmrobins@tgix.com>
|
||||
# Jake <jake@acutex.net>
|
||||
#
|
||||
|
||||
# This file defines all the parameters that we have a GUI to edit within
|
||||
# Bugzilla.
|
||||
|
||||
# ATTENTION!!!! THIS FILE ONLY CONTAINS THE DEFAULTS.
|
||||
# You cannot change your live settings by editing this file.
|
||||
# Only adding new parameters is done here. Once the parameter exists, you
|
||||
# must use %baseurl%/editparams.cgi from the web to edit the settings.
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
# Shut up misguided -w warnings about "used only once". For some reason,
|
||||
# "use vars" chokes on me when I try it here.
|
||||
|
||||
sub defparams_pl_sillyness {
|
||||
my $zz;
|
||||
$zz = %::param_checker;
|
||||
$zz = %::param_desc;
|
||||
$zz = %::param_type;
|
||||
}
|
||||
|
||||
sub WriteParams {
|
||||
foreach my $i (@::param_list) {
|
||||
if (!defined $::param{$i}) {
|
||||
$::param{$i} = $::param_default{$i};
|
||||
if (!defined $::param{$i}) {
|
||||
die "No default parameter ever specified for $i";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
require File::Temp;
|
||||
my ($fh, $tmpname) = File::Temp::tempfile("params.XXXXX",
|
||||
DIR=>'data');
|
||||
my $v = $::param{'version'};
|
||||
delete $::param{'version'}; # Don't write the version number out to
|
||||
# the params file.
|
||||
print $fh (GenerateCode('%::param'));
|
||||
$::param{'version'} = $v;
|
||||
print $fh "1;\n";
|
||||
close $fh;
|
||||
rename $tmpname, "data/params" || die "Can't rename $tmpname to data/params";
|
||||
ChmodDataFile('data/params', 0666);
|
||||
}
|
||||
|
||||
|
||||
sub DefParam {
|
||||
my ($id, $desc, $type, $default, $checker) = (@_);
|
||||
push @::param_list, $id;
|
||||
$::param_desc{$id} = $desc;
|
||||
$::param_type{$id} = $type;
|
||||
$::param_default{$id} = $default;
|
||||
if (defined $checker) {
|
||||
$::param_checker{$id} = $checker;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub check_numeric {
|
||||
my ($value) = (@_);
|
||||
if ($value !~ /^[0-9]+$/) {
|
||||
return "must be a numeric value";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
sub check_shadowdb {
|
||||
my ($value) = (@_);
|
||||
$value = trim($value);
|
||||
if ($value =~ /^([A-Za-z0-9_]+)$/) {
|
||||
$value = $1;
|
||||
}
|
||||
else {
|
||||
return "Invalid database name. Database names must include only alphanumeric characters and underscores.";
|
||||
}
|
||||
if ($value eq "") {
|
||||
return "";
|
||||
}
|
||||
SendSQL("SHOW DATABASES");
|
||||
while (MoreSQLData()) {
|
||||
my $n = FetchOneColumn();
|
||||
if (lc($n) eq lc($value)) {
|
||||
return "The $n database already exists. If that's really the name you want to use for the backup, please CAREFULLY make the existing database go away somehow, and then try again.";
|
||||
}
|
||||
}
|
||||
SendSQL("CREATE DATABASE $value");
|
||||
SendSQL("INSERT INTO shadowlog (command) VALUES ('SYNCUP')", 1);
|
||||
return "";
|
||||
}
|
||||
|
||||
@::param_list = ();
|
||||
|
||||
|
||||
|
||||
# OK, here are the definitions themselves.
|
||||
#
|
||||
# The type of parameters (the third parameter to DefParam) can be one
|
||||
# of the following:
|
||||
#
|
||||
# t -- A short text entry field (suitable for a single line)
|
||||
# l -- A long text field (suitable for many lines)
|
||||
# b -- A boolean value (either 1 or 0)
|
||||
|
||||
DefParam("maintainer",
|
||||
"The email address of the person who maintains this installation of Bugzilla.",
|
||||
"t",
|
||||
'THE MAINTAINER HAS NOT YET BEEN SET');
|
||||
|
||||
DefParam("urlbase",
|
||||
"The URL that is the common initial leading part of all Bugzilla URLs.",
|
||||
"t",
|
||||
"http://cvs-mirror.mozilla.org/webtools/bugzilla/",
|
||||
\&check_urlbase);
|
||||
|
||||
sub check_urlbase {
|
||||
my ($url) = (@_);
|
||||
if ($url !~ m:^http.*/$:) {
|
||||
return "must be a legal URL, that starts with http and ends with a slash.";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
DefParam("cookiepath",
|
||||
"Directory path under your document root that holds your Bugzilla installation. Make sure to begin with a /.",
|
||||
"t",
|
||||
"/");
|
||||
|
||||
DefParam("usequip",
|
||||
"If this is on, Bugzilla displays a silly quip at the beginning of buglists, and lets users add to the list of quips.",
|
||||
"b",
|
||||
1);
|
||||
|
||||
# Added parameter - JMR, 2/16/00
|
||||
DefParam("usebuggroups",
|
||||
"If this is on, Bugzilla will associate a bug group with each product in the database, and use it for querying bugs.",
|
||||
"b",
|
||||
0);
|
||||
|
||||
# Added parameter - JMR, 2/16/00
|
||||
DefParam("usebuggroupsentry",
|
||||
"If this is on, Bugzilla will use product bug groups to restrict who can enter bugs. Requires usebuggroups to be on as well.",
|
||||
"b",
|
||||
0);
|
||||
|
||||
DefParam("shadowdb",
|
||||
"If non-empty, then this is the name of another database in which Bugzilla will keep a shadow read-only copy of everything. This is done so that long slow read-only operations can be used against this db, and not lock up things for everyone else. Turning on this parameter will create the given database; be careful not to use the name of an existing database with useful data in it! The db_user you defined in the localconfig file must already have permission to access and write to the new database name before entering the name here, or the database creation will fail. The same permissions should be granted as for the primary database used by Bugzilla.",
|
||||
"t",
|
||||
"",
|
||||
\&check_shadowdb);
|
||||
|
||||
DefParam("queryagainstshadowdb",
|
||||
"If this is on, and the shadowdb is set, then queries will happen against the shadow database.",
|
||||
"b",
|
||||
0);
|
||||
|
||||
|
||||
# Adding in four parameters for LDAP authentication. -JMR, 7/28/00
|
||||
DefParam("useLDAP",
|
||||
"Turn this on to use an LDAP directory for user authentication ".
|
||||
"instead of the Bugzilla database. (User profiles will still be ".
|
||||
"stored in the database, and will match against the LDAP user by ".
|
||||
"email address.)",
|
||||
"b",
|
||||
0);
|
||||
|
||||
|
||||
DefParam("LDAPserver",
|
||||
"The name (and optionally port) of your LDAP server. (e.g. ldap.company.com, or ldap.company.com:portnum)",
|
||||
"t",
|
||||
"");
|
||||
|
||||
|
||||
DefParam("LDAPBaseDN",
|
||||
"The BaseDN for authenticating users against. (e.g. \"ou=People,o=Company\")",
|
||||
"t",
|
||||
"");
|
||||
|
||||
|
||||
DefParam("LDAPmailattribute",
|
||||
"The name of the attribute of a user in your directory that ".
|
||||
"contains the email address.",
|
||||
"t",
|
||||
"mail");
|
||||
#End of LDAP parameters
|
||||
|
||||
|
||||
DefParam("mostfreqthreshold",
|
||||
"The minimum number of duplicates a bug needs to show up on the <A HREF=\"duplicates.cgi\">most frequently reported bugs page</a>. If you have a large database and this page takes a long time to load, try increasing this number.",
|
||||
"t",
|
||||
"2",
|
||||
\&check_numeric);
|
||||
|
||||
|
||||
DefParam("mybugstemplate",
|
||||
"This is the URL to use to bring up a simple 'all of my bugs' list for a user. %userid% will get replaced with the login name of a user.",
|
||||
"t",
|
||||
"buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=%userid%&emailtype1=exact&emailassigned_to1=1&emailreporter1=1");
|
||||
|
||||
|
||||
DefParam("shutdownhtml",
|
||||
"If this field is non-empty, then Bugzilla will be completely disabled and this text will be displayed instead of all the Bugzilla pages.",
|
||||
"l",
|
||||
"");
|
||||
|
||||
DefParam("sendmailnow",
|
||||
"Sites using anything older than version 8.12 of \'sendmail\' can achieve a significant performance increase in the UI -- at the cost of delaying the sending of mail -- by disabling this parameter. Sites using 'sendmail' 8.12 or higher should leave this on, as they will see no benefit from turning it off. Sites using an MTA other than 'sendmail' *must* leave it on, or no bug mail will be sent.",
|
||||
"b",
|
||||
1);
|
||||
|
||||
DefParam("passwordmail",
|
||||
q{The email that gets sent to people to tell them their password. Within
|
||||
this text, %mailaddress% gets replaced by the person's email address,
|
||||
%login% gets replaced by the person's login (usually the same thing), and
|
||||
%password% gets replaced by their password. %<i>anythingelse</i>% gets
|
||||
replaced by the definition of that parameter (as defined on this page).},
|
||||
"l",
|
||||
q{From: bugzilla-daemon
|
||||
To: %mailaddress%
|
||||
Subject: Your Bugzilla password.
|
||||
|
||||
To use the wonders of Bugzilla, you can use the following:
|
||||
|
||||
E-mail address: %login%
|
||||
Password: %password%
|
||||
|
||||
To change your password, go to:
|
||||
%urlbase%userprefs.cgi
|
||||
});
|
||||
|
||||
|
||||
DefParam("newchangedmail",
|
||||
q{The email that gets sent to people when a bug changes. Within this
|
||||
text, %to% gets replaced with the e-mail address of the person recieving
|
||||
the mail. %bugid% gets replaced by the bug number. %diffs% gets
|
||||
replaced with what's changed. %neworchanged% is "New:" if this mail is
|
||||
reporting a new bug or empty if changes were made to an existing one.
|
||||
%summary% gets replaced by the summary of this bug. %reasonsheader%
|
||||
is replaced by an abbreviated list of reasons why the user is getting the email,
|
||||
suitable for use in an email header (such as X-Bugzilla-Reason).
|
||||
%reasonsbody% is replaced by text that explains why the user is getting the email
|
||||
in more user friendly text than %reasonsheader%.
|
||||
%<i>anythingelse</i>% gets replaced by the definition of
|
||||
that parameter (as defined on this
|
||||
page).},
|
||||
"l",
|
||||
"From: bugzilla-daemon
|
||||
To: %to%
|
||||
Subject: [Bug %bugid%] %neworchanged%%summary%
|
||||
X-Bugzilla-Reason: %reasonsheader%
|
||||
|
||||
%urlbase%show_bug.cgi?id=%bugid%
|
||||
|
||||
%diffs%
|
||||
|
||||
|
||||
|
||||
%reasonsbody%");
|
||||
|
||||
|
||||
|
||||
DefParam("whinedays",
|
||||
"The number of days that we'll let a bug sit untouched in a NEW state before our cronjob will whine at the owner.",
|
||||
"t",
|
||||
7,
|
||||
\&check_numeric);
|
||||
|
||||
|
||||
DefParam("whinemail",
|
||||
"The email that gets sent to anyone who has a NEW bug that hasn't been touched for more than <b>whinedays</b>. Within this text, %email% gets replaced by the offender's email address. %userid% gets replaced by the offender's bugzilla login (which, in most installations, is the same as the email address.) %<i>anythingelse</i>% gets replaced by the definition of that parameter (as defined on this page).<p> It is a good idea to make sure this message has a valid From: address, so that if the mail bounces, a real person can know that there are bugs assigned to an invalid address.",
|
||||
"l",
|
||||
q{From: %maintainer%
|
||||
To: %email%
|
||||
Subject: Your Bugzilla buglist needs attention.
|
||||
|
||||
[This e-mail has been automatically generated.]
|
||||
|
||||
You have one or more bugs assigned to you in the Bugzilla
|
||||
bugsystem (%urlbase%) that require
|
||||
attention.
|
||||
|
||||
All of these bugs are in the NEW state, and have not been touched
|
||||
in %whinedays% days or more. You need to take a look at them, and
|
||||
decide on an initial action.
|
||||
|
||||
Generally, this means one of three things:
|
||||
|
||||
(1) You decide this bug is really quick to deal with (like, it's INVALID),
|
||||
and so you get rid of it immediately.
|
||||
(2) You decide the bug doesn't belong to you, and you reassign it to someone
|
||||
else. (Hint: if you don't know who to reassign it to, make sure that
|
||||
the Component field seems reasonable, and then use the "Reassign bug to
|
||||
owner of selected component" option.)
|
||||
(3) You decide the bug belongs to you, but you can't solve it this moment.
|
||||
Just use the "Accept bug" command.
|
||||
|
||||
To get a list of all NEW bugs, you can use this URL (bookmark it if you like!):
|
||||
|
||||
%urlbase%buglist.cgi?bug_status=NEW&assigned_to=%userid%
|
||||
|
||||
Or, you can use the general query page, at
|
||||
%urlbase%query.cgi.
|
||||
|
||||
Appended below are the individual URLs to get to all of your NEW bugs that
|
||||
haven't been touched for a week or more.
|
||||
|
||||
You will get this message once a day until you've dealt with these bugs!
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
DefParam("defaultquery",
|
||||
"This is the default query that initially comes up when you access the query page. It's in URL parameter format, which makes it hard to read. Sorry!",
|
||||
"t",
|
||||
"bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailqa_contact2=1&order=%22Importance%22");
|
||||
|
||||
|
||||
DefParam("letsubmitterchoosepriority",
|
||||
"If this is on, then people submitting bugs can choose an initial priority for that bug. If off, then all bugs initially have the default priority selected below.",
|
||||
"b",
|
||||
1);
|
||||
|
||||
|
||||
sub check_priority {
|
||||
my ($value) = (@_);
|
||||
GetVersionTable();
|
||||
if (lsearch(\@::legal_priority, $value) < 0) {
|
||||
return "Must be a legal priority value: one of " .
|
||||
join(", ", @::legal_priority);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
DefParam("defaultpriority",
|
||||
"This is the priority that newly entered bugs are set to.",
|
||||
"t",
|
||||
"P2",
|
||||
\&check_priority);
|
||||
|
||||
|
||||
DefParam("usetargetmilestone",
|
||||
"Do you wish to use the Target Milestone field?",
|
||||
"b",
|
||||
0);
|
||||
|
||||
DefParam("nummilestones",
|
||||
"If using Target Milestone, how many milestones do you wish to
|
||||
appear?",
|
||||
"t",
|
||||
10,
|
||||
\&check_numeric);
|
||||
|
||||
DefParam("curmilestone",
|
||||
"If using Target Milestone, Which milestone are we working toward right now?",
|
||||
"t",
|
||||
1,
|
||||
\&check_numeric);
|
||||
|
||||
DefParam("musthavemilestoneonaccept",
|
||||
"If you are using Target Milestone, do you want to require that the milestone be set in order for a user to ACCEPT a bug?",
|
||||
"b",
|
||||
0);
|
||||
|
||||
DefParam("useqacontact",
|
||||
"Do you wish to use the QA Contact field?",
|
||||
"b",
|
||||
0);
|
||||
|
||||
DefParam("usestatuswhiteboard",
|
||||
"Do you wish to use the Status Whiteboard field?",
|
||||
"b",
|
||||
0);
|
||||
|
||||
DefParam("usebrowserinfo",
|
||||
"Do you want bug reports to be assigned an OS & Platform based on the browser
|
||||
the user makes the report from?",
|
||||
"b",
|
||||
1);
|
||||
|
||||
DefParam("usedependencies",
|
||||
"Do you wish to use dependencies (allowing you to mark which bugs depend on which other ones)?",
|
||||
"b",
|
||||
1);
|
||||
|
||||
DefParam("usevotes",
|
||||
"Do you wish to allow users to vote for bugs? Note that in order for this to be effective, you will have to change the maximum votes allowed in a product to be non-zero in <a href=\"editproducts.cgi\">the product edit page</a>.",
|
||||
"b",
|
||||
1);
|
||||
|
||||
DefParam("webdotbase",
|
||||
"It is possible to show graphs of dependent bugs. You may set this parameter to
|
||||
any of the following:
|
||||
<ul>
|
||||
<li>A complete file path to \'dot\' (part of <a
|
||||
href=\"http://www.graphviz.org\">GraphViz</a>) will generate the graphs
|
||||
locally.</li>
|
||||
<li>A URL prefix pointing to an installation of the <a
|
||||
href=\"http://www.research.att.com/~north/cgi-bin/webdot.cgi\">webdot
|
||||
package</a> will generate the graphs remotely.</li>
|
||||
<li>A blank value will disable dependency graphing.</li>
|
||||
</ul>
|
||||
The default value is a publically-accessible webdot server. If you change
|
||||
this value, make certain that the webdot server can read files from your
|
||||
data/webdot directory. On Apache you do this by editing the .htaccess file,
|
||||
for other systems the needed measures may vary. You can run checksetup.pl
|
||||
to recreate the .htaccess file if it has been lost.",
|
||||
"t",
|
||||
"http://www.research.att.com/~north/cgi-bin/webdot.cgi/%urlbase%",
|
||||
\&check_webdotbase);
|
||||
|
||||
sub check_webdotbase {
|
||||
my ($value) = (@_);
|
||||
$value = trim($value);
|
||||
if ($value eq "") {
|
||||
return "";
|
||||
}
|
||||
if($value !~ /^https?:/) {
|
||||
if(! -x $value) {
|
||||
return "The file path \"$value\" is not a valid executable. Please specify the complete file path to 'dot' if you intend to generate graphs locally.";
|
||||
}
|
||||
# Check .htaccess allows access to generated images
|
||||
if(-e "data/webdot/.htaccess") {
|
||||
open HTACCESS, "data/webdot/.htaccess";
|
||||
if(! grep(/ \\\.png\$/,<HTACCESS>)) {
|
||||
print "Dependency graph images are not accessible.\nAssuming that you have not modified the file, delete data/webdot/.htaccess and re-run checksetup.pl to rectify.\n";
|
||||
}
|
||||
close HTACCESS;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
DefParam("expectbigqueries",
|
||||
"If this is on, then we will tell mysql to <tt>set option SQL_BIG_TABLES=1</tt> before doing queries on bugs. This will be a little slower, but one will not get the error <tt>The table ### is full</tt> for big queries that require a big temporary table.",
|
||||
"b",
|
||||
0);
|
||||
|
||||
DefParam("emailregexp",
|
||||
'This defines the regexp to use for legal email addresses. The default tries to match fully qualified email addresses. Another popular value to put here is <tt>^[^@]+$</tt>, which means "local usernames, no @ allowed."',
|
||||
"t",
|
||||
q:^[^@]+@[^@]+\\.[^@]+$:);
|
||||
|
||||
DefParam("emailregexpdesc",
|
||||
"This describes in english words what kinds of legal addresses are allowed by the <tt>emailregexp</tt> param.",
|
||||
"l",
|
||||
"A legal address must contain exactly one '\@', and at least one '.' after the \@.");
|
||||
|
||||
DefParam("emailsuffix",
|
||||
"This is a string to append to any email addresses when actually sending mail to that address. It is useful if you have changed the <tt>emailregexp</tt> param to only allow local usernames, but you want the mail to be delivered to username\@my.local.hostname.",
|
||||
"t",
|
||||
"");
|
||||
|
||||
|
||||
DefParam("voteremovedmail",
|
||||
q{This is a mail message to send to anyone who gets a vote removed from a bug for any reason. %to% gets replaced by the person who used to be voting for this bug. %bugid% gets replaced by the bug number. %reason% gets replaced by a short reason describing why the vote(s) were removed. %votesremoved%, %votesold% and %votesnew% is the number of votes removed, before and after respectively. %votesremovedtext%, %votesoldtext% and %votesnewtext% are these as sentences, eg "You had 2 votes on this bug." %count% is also supported for backwards compatibility. %<i>anythingelse</i>% gets replaced by the definition of that parameter (as defined on this page).},
|
||||
"l",
|
||||
"From: bugzilla-daemon
|
||||
To: %to%
|
||||
Subject: [Bug %bugid%] Some or all of your votes have been removed.
|
||||
|
||||
Some or all of your votes have been removed from bug %bugid%.
|
||||
|
||||
%votesoldtext%
|
||||
|
||||
%votesnewtext%
|
||||
|
||||
Reason: %reason%
|
||||
|
||||
%urlbase%show_bug.cgi?id=%bugid%
|
||||
");
|
||||
|
||||
DefParam("allowbugdeletion",
|
||||
q{The pages to edit products and components and versions can delete all associated bugs when you delete a product (or component or version). Since that is a pretty scary idea, you have to turn on this option before any such deletions will ever happen.},
|
||||
"b",
|
||||
0);
|
||||
|
||||
|
||||
DefParam("allowemailchange",
|
||||
q{Users can change their own email address through the preferences. Note that the change is validated by emailing both addresses, so switching this option on will not let users use an invalid address.},
|
||||
"b",
|
||||
0);
|
||||
|
||||
|
||||
DefParam("allowuserdeletion",
|
||||
q{The pages to edit users can also let you delete a user. But there is no code that goes and cleans up any references to that user in other tables, so such deletions are kinda scary. So, you have to turn on this option before any such deletions will ever happen.},
|
||||
"b",
|
||||
0);
|
||||
|
||||
DefParam("browserbugmessage",
|
||||
"If bugzilla gets unexpected data from the browser, in addition to displaying the cause of the problem, it will output this HTML as well.",
|
||||
"l",
|
||||
"this may indicate a bug in your browser.\n");
|
||||
|
||||
#
|
||||
# Parameters to force users to comment their changes for different actions.
|
||||
DefParam("commentonaccept",
|
||||
"If this option is on, the user needs to enter a short comment if he accepts the bug",
|
||||
"b", 0 );
|
||||
DefParam("commentonclearresolution",
|
||||
"If this option is on, the user needs to enter a short comment if the bugs resolution is cleared",
|
||||
"b", 0 );
|
||||
DefParam("commentonconfirm",
|
||||
"If this option is on, the user needs to enter a short comment when confirming a bug",
|
||||
"b", 0 );
|
||||
DefParam("commentonresolve",
|
||||
"If this option is on, the user needs to enter a short comment if the bug is resolved",
|
||||
"b", 0 );
|
||||
DefParam("commentonreassign",
|
||||
"If this option is on, the user needs to enter a short comment if the bug is reassigned",
|
||||
"b", 0 );
|
||||
DefParam("commentonreassignbycomponent",
|
||||
"If this option is on, the user needs to enter a short comment if the bug is reassigned by component",
|
||||
"b", 0 );
|
||||
DefParam("commentonreopen",
|
||||
"If this option is on, the user needs to enter a short comment if the bug is reopened",
|
||||
"b", 0 );
|
||||
DefParam("commentonverify",
|
||||
"If this option is on, the user needs to enter a short comment if the bug is verified",
|
||||
"b", 0 );
|
||||
DefParam("commentonclose",
|
||||
"If this option is on, the user needs to enter a short comment if the bug is closed",
|
||||
"b", 0 );
|
||||
DefParam("commentonduplicate",
|
||||
"If this option is on, the user needs to enter a short comment if the bug is marked as duplicate",
|
||||
"b", 0 );
|
||||
DefParam("supportwatchers",
|
||||
"Support one user watching (ie getting copies of all related email" .
|
||||
" about) another's bugs. Useful for people going on vacation, and" .
|
||||
" QA folks watching particular developers' bugs",
|
||||
"b", 0 );
|
||||
|
||||
|
||||
DefParam("move-enabled",
|
||||
"If this is on, Bugzilla will allow certain people to move bugs to the defined database.",
|
||||
"b",
|
||||
0);
|
||||
DefParam("move-button-text",
|
||||
"The text written on the Move button. Explain where the bug is being moved to.",
|
||||
"t",
|
||||
'Move To Bugscape');
|
||||
DefParam("move-to-url",
|
||||
"The URL of the database we allow some of our bugs to be moved to.",
|
||||
"t",
|
||||
'');
|
||||
DefParam("move-to-address",
|
||||
"To move bugs, an email is sent to the target database. This is the email address that database
|
||||
uses to listen for incoming bugs.",
|
||||
"t",
|
||||
'bugzilla-import');
|
||||
DefParam("moved-from-address",
|
||||
"To move bugs, an email is sent to the target database. This is the email address from which
|
||||
this mail, and error messages are sent.",
|
||||
"t",
|
||||
'bugzilla-admin');
|
||||
DefParam("movers",
|
||||
"A list of people with permission to move bugs and reopen moved bugs (in case the move operation fails).",
|
||||
"t",
|
||||
'');
|
||||
DefParam("moved-default-product",
|
||||
"Bugs moved from other databases to here are assigned to this product.",
|
||||
"t",
|
||||
'');
|
||||
DefParam("moved-default-component",
|
||||
"Bugs moved from other databases to here are assigned to this component.",
|
||||
"t",
|
||||
'');
|
||||
|
||||
# The maximum size (in bytes) for patches and non-patch attachments.
|
||||
# The default limit is 1000KB, which is 24KB less than mysql's default
|
||||
# maximum packet size (which determines how much data can be sent in a
|
||||
# single mysql packet and thus how much data can be inserted into the
|
||||
# database) to provide breathing space for the data in other fields of
|
||||
# the attachment record as well as any mysql packet overhead (I don't
|
||||
# know of any, but I suspect there may be some.)
|
||||
|
||||
DefParam("maxpatchsize",
|
||||
"The maximum size (in kilobytes) of patches. Bugzilla will not
|
||||
accept patches greater than this number of kilobytes in size.
|
||||
To accept patches of any size (subject to the limitations of
|
||||
your server software), set this value to zero." ,
|
||||
"t",
|
||||
'1000',
|
||||
\&check_numeric);
|
||||
|
||||
DefParam("maxattachmentsize" ,
|
||||
"The maximum size (in kilobytes) of non-patch attachments. Bugzilla
|
||||
will not accept attachments greater than this number of kilobytes
|
||||
in size. To accept attachments of any size (subject to the
|
||||
limitations of your server software), set this value to zero." ,
|
||||
"t" ,
|
||||
'1000',
|
||||
\&check_numeric);
|
||||
|
||||
1;
|
||||
@@ -1,130 +0,0 @@
|
||||
#!/usr/bonsaitools/bin/perl -wT
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Terry Weissman <terry@mozilla.org>
|
||||
# Bradley Baetz <bbaetz@student.usyd.edu.au>
|
||||
|
||||
use vars qw(
|
||||
%FORM
|
||||
$userid
|
||||
);
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
use lib qw(.);
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
ConnectToDatabase();
|
||||
quietly_check_login();
|
||||
|
||||
GetVersionTable();
|
||||
|
||||
if (!defined $::FORM{'product'}) {
|
||||
# Reference to a subset of %::proddesc, which the user is allowed to see
|
||||
my %products;
|
||||
|
||||
if (Param("usebuggroups")) {
|
||||
# OK, now only add products the user can see
|
||||
confirm_login() unless $::userid;
|
||||
foreach my $p (@::legal_product) {
|
||||
if (!GroupExists($p) || UserInGroup($p)) {
|
||||
$products{$p} = $::proddesc{$p};
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
%products = %::proddesc;
|
||||
}
|
||||
|
||||
my $prodsize = scalar(keys %products);
|
||||
if ($prodsize == 0) {
|
||||
DisplayError("Either no products have been defined ".
|
||||
"or you have not been given access to any.\n");
|
||||
exit;
|
||||
}
|
||||
elsif ($prodsize > 1) {
|
||||
$::vars->{'proddesc'} = \%products;
|
||||
$::vars->{'target'} = "describecomponents.cgi";
|
||||
$::vars->{'title'} = "Bugzilla component description";
|
||||
$::vars->{'h2'} =
|
||||
"Please specify the product whose components you want described.";
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
$::template->process("global/choose-product.html.tmpl", $::vars)
|
||||
|| ThrowTemplateError($::template->error());
|
||||
exit;
|
||||
}
|
||||
|
||||
$::FORM{'product'} = (keys %products)[0];
|
||||
}
|
||||
|
||||
my $product = $::FORM{'product'};
|
||||
|
||||
# Make sure the user specified a valid product name. Note that
|
||||
# if the user specifies a valid product name but is not authorized
|
||||
# to access that product, they will receive a different error message
|
||||
# which could enable people guessing product names to determine
|
||||
# whether or not certain products exist in Bugzilla, even if they
|
||||
# cannot get any other information about that product.
|
||||
grep($product eq $_ , @::legal_product)
|
||||
|| DisplayError("The product name is invalid.")
|
||||
&& exit;
|
||||
|
||||
# Make sure the user is authorized to access this product.
|
||||
if (Param("usebuggroups") && GroupExists($product)) {
|
||||
confirm_login() unless $::userid;
|
||||
UserInGroup($product)
|
||||
|| DisplayError("You are not authorized to access that product.")
|
||||
&& exit;
|
||||
}
|
||||
|
||||
######################################################################
|
||||
# End Data/Security Validation
|
||||
######################################################################
|
||||
|
||||
my @components;
|
||||
SendSQL("SELECT value, initialowner, initialqacontact, description FROM " .
|
||||
"components WHERE program = " . SqlQuote($product) . " ORDER BY " .
|
||||
"value");
|
||||
while (MoreSQLData()) {
|
||||
my ($name, $initialowner, $initialqacontact, $description) =
|
||||
FetchSQLData();
|
||||
|
||||
my %component;
|
||||
|
||||
$component{'name'} = $name;
|
||||
$component{'initialowner'} = $initialowner ?
|
||||
DBID_to_name($initialowner) : '';
|
||||
$component{'initialqacontact'} = $initialqacontact ?
|
||||
DBID_to_name($initialqacontact) : '';
|
||||
$component{'description'} = $description;
|
||||
|
||||
push @components, \%component;
|
||||
}
|
||||
|
||||
$::vars->{'product'} = $product;
|
||||
$::vars->{'components'} = \@components;
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
$::template->process("reports/components.html.tmpl", $::vars)
|
||||
|| ThrowTemplateError($::template->error());
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
#!/usr/bonsaitools/bin/perl -wT
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Bugzilla Bug Tracking System.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Terry Weissman.
|
||||
# Portions created by Terry Weissman are
|
||||
# Copyright (C) 2000 Terry Weissman. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s): Terry Weissman <terry@mozilla.org>
|
||||
# Contributor(s): Gervase Markham <gerv@gerv.net>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
use lib ".";
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
# Use the global template variables.
|
||||
use vars qw($vars $template);
|
||||
|
||||
ConnectToDatabase();
|
||||
|
||||
quietly_check_login();
|
||||
|
||||
SendSQL("SELECT keyworddefs.name, keyworddefs.description,
|
||||
COUNT(keywords.bug_id)
|
||||
FROM keyworddefs LEFT JOIN keywords ON keyworddefs.id=keywords.keywordid
|
||||
GROUP BY keyworddefs.id
|
||||
ORDER BY keyworddefs.name");
|
||||
|
||||
my @keywords;
|
||||
|
||||
while (MoreSQLData()) {
|
||||
my ($name, $description, $bugs) = FetchSQLData();
|
||||
|
||||
push (@keywords, { name => $name,
|
||||
description => $description,
|
||||
bugcount => $bugs });
|
||||
}
|
||||
|
||||
$vars->{'keywords'} = \@keywords;
|
||||
$vars->{'caneditkeywords'} = UserInGroup("editkeywords");
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
$template->process("reports/keywords.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
@@ -1,155 +0,0 @@
|
||||
Welcome to the Bugzilla documentation project!
|
||||
You'll find these directories and files here:
|
||||
|
||||
README.docs # This README file
|
||||
html/ # The compiled HTML docs from XML sources (do not edit)
|
||||
txt/ # The compiled text docs from XML sources (do not edit)
|
||||
xml/ # The original XML doc sources (edit these)
|
||||
|
||||
A note about the XML:
|
||||
The documentation is written in DocBook 4.1.2, and attempts to adhere
|
||||
to the LinuxDoc standards where applicable (http://www.tldp.org).
|
||||
Please consult "The LDP Author Guide" at tldp.org for details on how
|
||||
to set up your personal environment for compiling XML files.
|
||||
If you need to make corrections to typographical errors, or other minor
|
||||
editing duties, feel free to use any text editor to make the changes. XML
|
||||
is not rocket science -- simply make sure your text appears between
|
||||
appropriate tags (like <para>This is a paragraph</para>) and we'll be fine.
|
||||
If you are making more extensive changes, please ensure you at least validate
|
||||
your XML before checking it in with something like:
|
||||
nsgmls -s $JADE_PUB/xml.dcl Bugzilla-Guide.xml
|
||||
|
||||
When you validate, please validate the master document (Bugzilla-Guide.xml)
|
||||
as well as the document you edited to ensure there are no critical errors.
|
||||
The following errors are considered "normal" when validating with nsgmls:
|
||||
|
||||
DTDDECL catalog entries are not supported
|
||||
"DOCTYPE" declaration not allowed in instance
|
||||
|
||||
The reason these occur is that free sgml/xml validators do not yet support
|
||||
the DTDDECL catalog entries, and I've included DOCTYPE declarations in
|
||||
entities referenced from Bugzilla-Guide.xml so these entities can compile
|
||||
individually, if necessary. I suppose I ought to comment them out at some
|
||||
point, but for now they are convenient and don't hurt anything.
|
||||
|
||||
Thanks for taking the time to read these notes and consulting the
|
||||
documentation. Please address comments and questions to the newsgroup:
|
||||
news://news.mozilla.org/netscape/public/mozilla/webtools .
|
||||
|
||||
==========
|
||||
HOW TO SET UP YOUR OWN XML EDITING ENVIRONMENT:
|
||||
==========
|
||||
|
||||
Trying to set up an XML Docbook editing environment the
|
||||
first time can be a daunting task.
|
||||
I use Linux-Mandrake, in part, because it has a fully-functional
|
||||
XML Docbook editing environment included as part of the
|
||||
distribution CD's. If you have easier instructions for how to
|
||||
do this for a particular Linux distribution or platform, please
|
||||
let the team know at the mailing list: mozilla-webtools@mozilla.org.
|
||||
|
||||
The following text is taken nearly verbatim from
|
||||
http://bugzilla.mozilla.org/show_bug.cgi?id=95970, where I gave
|
||||
these instructions to someone who wanted the greater manageability
|
||||
maintaining a document in Docbook brings:
|
||||
|
||||
This is just off the top of my head, but here goes. Note some of these may
|
||||
NOT be necessary, but I don't think they hurt anything by being installed.
|
||||
|
||||
rpms:
|
||||
|
||||
openjade
|
||||
jadetex
|
||||
docbook-dtds
|
||||
docbook-style-dsssl
|
||||
docbook-style-dsssl-doc
|
||||
docbook-utils
|
||||
xemacs
|
||||
psgml
|
||||
sgml-tools
|
||||
sgml-common
|
||||
|
||||
|
||||
If you're getting these from RedHat, make sure you get the ones in the
|
||||
rawhide area. The ones in the 7.2 distribution are too old and don't
|
||||
include the XML stuff. The packages distrubuted with RedHat 8.0 and 9
|
||||
and known to work.
|
||||
|
||||
Download "ldp.dsl" from the Resources page on tldp.org. This is the
|
||||
stylesheet I use to get the HTML and text output. It works well, and has a
|
||||
nice, consistent look with the rest of the linuxdoc documents. You'll have to
|
||||
adjust the paths in ldp.dsl at the top of the file to reflect the actual
|
||||
locations of your docbook catalog files. I created a directory,
|
||||
/usr/share/sgml/docbook/ldp, and put the ldp.dsl file there. I then edited
|
||||
ldp.dsl and changed two lines near the top:
|
||||
<!ENTITY docbook.dsl SYSTEM "../dsssl-stylesheets/html/docbook.dsl" CDATA
|
||||
dsssl>
|
||||
...and...
|
||||
<!ENTITY docbook.dsl SYSTEM "../dsssl-stylesheets/print/docbook.dsl" CDATA
|
||||
dsssl>
|
||||
|
||||
Note the difference is the top one points to the HTML docbook stylesheet,
|
||||
and the next one points to the PRINT docbook stylesheet.
|
||||
|
||||
Also note that modifying ldp.dsl doesn't seem to be needed on RedHat 9.
|
||||
|
||||
You know, this sure looks awful involved. Anyway, once you have this in
|
||||
place, add to your .bashrc:
|
||||
export SGML_CATALOG_FILES=/etc/sgml/catalog
|
||||
export LDP_HOME=/usr/share/sgml/docbook/ldp
|
||||
export JADE_PUB=/usr/share/doc/openjade-1.3.1/pubtext
|
||||
|
||||
or in .tcshrc:
|
||||
setenv SGML_CATALOG_FILES /etc/sgml/catalog
|
||||
setenv LDP_HOME /usr/share/sgml/docbook/ldp
|
||||
setenv JADE_PUB /usr/share/doc/openjade-1.3.1/pubtext
|
||||
|
||||
If you have root access and want to set this up for anyone on your box,
|
||||
you can add those lines to /etc/profile for bash users and /etc/csh.login
|
||||
for tcsh users.
|
||||
|
||||
Make sure you edit the paths in the above environment variables if those
|
||||
folders are anywhere else on your system (for example, the openjade version
|
||||
might change if you get a new version at some point).
|
||||
|
||||
I suggest xemacs for editing your XML Docbook documents. The darn
|
||||
thing just works, and generally includes PSGML mode by default. Not to
|
||||
mention you can validate the SGML from right within it without having to
|
||||
remember the command-line syntax for nsgml (not that it's that hard
|
||||
anyway). If not, you can download psgml at
|
||||
http://www.sourceforge.net/projects/psgml.
|
||||
|
||||
Another good editor is the latest releases of vim and gvim. Vim will
|
||||
recognize DocBook tags and give them a different color than unreconized tags.
|
||||
|
||||
==========
|
||||
NOTES:
|
||||
==========
|
||||
|
||||
Here are the commands I use to maintain this documentation.
|
||||
You MUST have DocBook 4.1.2 set up correctly in order for this to work.
|
||||
|
||||
These commands can be run all at once using the ./makedocs.pl script.
|
||||
|
||||
To create HTML documentation:
|
||||
bash$ cd html
|
||||
bash$ jade -t sgml -i html -d $LDP_HOME/ldp.dsl\#html \
|
||||
$JADE_PUB/xml.dcl ../xml/Bugzilla-Guide.xml
|
||||
|
||||
To create HTML documentation as a single big HTML file:
|
||||
bash$ cd html
|
||||
bash$ jade -V nochunks -t sgml -i html -d $LDP_HOME/ldp.dsl\#html \
|
||||
$JADE_PUB/xml.dcl ../xml/Bugzilla-Guide.xml >Bugzilla-Guide.html
|
||||
|
||||
To create TXT documentation as a single big TXT file:
|
||||
bash$ cd txt
|
||||
bash$ lynx -dump -nolist ../html/Bugzilla-Guide.html >Bugzilla-Guide.txt
|
||||
|
||||
|
||||
Sincerely,
|
||||
Matthew P. Barnson
|
||||
The Bugzilla "Doc Knight"
|
||||
mbarnson@sisna.com
|
||||
|
||||
with major edits by Dave Miller <justdave@syndicomm.com> based on
|
||||
experience setting this up on the Landfill test server.
|
||||
|
Before Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 134 B |
|
Before Width: | Height: | Size: 288 KiB |
|
Before Width: | Height: | Size: 226 B |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 140 B |
@@ -1,107 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Matthew Tuck <matty@chariot.net.au>
|
||||
# Jacob Steenhagen <jake@bugzilla.org>
|
||||
|
||||
# This script compiles all the documentation.
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
use File::Basename;
|
||||
|
||||
###############################################################################
|
||||
# Environment Variable Checking
|
||||
###############################################################################
|
||||
|
||||
my ($JADE_PUB, $LDP_HOME);
|
||||
|
||||
if (defined $ENV{JADE_PUB} && $ENV{JADE_PUB} ne '') {
|
||||
$JADE_PUB = $ENV{JADE_PUB};
|
||||
}
|
||||
else {
|
||||
die "You need to set the JADE_PUB environment variable first.";
|
||||
}
|
||||
|
||||
if (defined $ENV{LDP_HOME} && $ENV{LDP_HOME} ne '') {
|
||||
$LDP_HOME = $ENV{LDP_HOME};
|
||||
}
|
||||
else {
|
||||
die "You need to set the LDP_HOME environment variable first.";
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Subs
|
||||
###############################################################################
|
||||
|
||||
sub MakeDocs($$) {
|
||||
|
||||
my ($name, $cmdline) = @_;
|
||||
|
||||
print "Creating $name documentation ...\n" if defined $name;
|
||||
print "$cmdline\n\n";
|
||||
system $cmdline;
|
||||
print "\n";
|
||||
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Make the docs ...
|
||||
###############################################################################
|
||||
|
||||
chdir dirname($0);
|
||||
|
||||
if (!-d 'html') {
|
||||
unlink 'html';
|
||||
mkdir 'html', 0755;
|
||||
}
|
||||
if (!-d 'txt') {
|
||||
unlink 'txt';
|
||||
mkdir 'txt', 0755;
|
||||
}
|
||||
if (!-d 'pdf') {
|
||||
unlink 'pdf';
|
||||
mkdir 'pdf', 0755;
|
||||
}
|
||||
|
||||
chdir 'html';
|
||||
|
||||
MakeDocs('separate HTML', "jade -t sgml -i html -d $LDP_HOME/ldp.dsl\#html " .
|
||||
"$JADE_PUB/xml.dcl ../xml/Bugzilla-Guide.xml");
|
||||
MakeDocs('big HTML', "jade -V nochunks -t sgml -i html -d " .
|
||||
"$LDP_HOME/ldp.dsl\#html $JADE_PUB/xml.dcl " .
|
||||
"../xml/Bugzilla-Guide.xml > Bugzilla-Guide.html");
|
||||
MakeDocs('big text', "lynx -dump -justify=off -nolist Bugzilla-Guide.html " .
|
||||
"> ../txt/Bugzilla-Guide.txt");
|
||||
|
||||
if (! grep("--with-pdf", @ARGV)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
MakeDocs('PDF', "jade -t tex -d $LDP_HOME/ldp.dsl\#print $JADE_PUB/xml.dcl " .
|
||||
'../xml/Bugzilla-Guide.xml');
|
||||
chdir '../pdf';
|
||||
MakeDocs(undef, 'mv ../xml/Bugzilla-Guide.tex .');
|
||||
MakeDocs(undef, 'pdfjadetex Bugzilla-Guide.tex');
|
||||
MakeDocs(undef, 'pdfjadetex Bugzilla-Guide.tex');
|
||||
MakeDocs(undef, 'pdfjadetex Bugzilla-Guide.tex');
|
||||
MakeDocs(undef, 'rm Bugzilla-Guide.tex Bugzilla-Guide.log Bugzilla-Guide.aux Bugzilla-Guide.out');
|
||||
|
||||
@@ -1,173 +0,0 @@
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
|
||||
|
||||
<!-- Include macros -->
|
||||
<!ENTITY about SYSTEM "about.xml">
|
||||
<!ENTITY conventions SYSTEM "conventions.xml">
|
||||
<!ENTITY doc-index SYSTEM "index.xml">
|
||||
<!ENTITY faq SYSTEM "faq.xml">
|
||||
<!ENTITY gfdl SYSTEM "gfdl.xml">
|
||||
<!ENTITY glossary SYSTEM "glossary.xml">
|
||||
<!ENTITY installation SYSTEM "installation.xml">
|
||||
<!ENTITY administration SYSTEM "administration.xml">
|
||||
<!ENTITY using SYSTEM "using.xml">
|
||||
<!ENTITY integration SYSTEM "integration.xml">
|
||||
<!ENTITY future SYSTEM "future.xml">
|
||||
<!ENTITY index SYSTEM "index.xml">
|
||||
<!ENTITY database SYSTEM "database.xml">
|
||||
<!ENTITY patches SYSTEM "patches.xml">
|
||||
<!ENTITY variants SYSTEM "variants.xml">
|
||||
<!ENTITY introduction SYSTEM "introduction.xml">
|
||||
<!ENTITY revhistory SYSTEM "revhistory.xml">
|
||||
|
||||
<!ENTITY bz "http://www.bugzilla.org/">
|
||||
<!ENTITY bz-ver "2.16.11">
|
||||
<!ENTITY bz-date "2006-02-20">
|
||||
<!ENTITY current-year "2006">
|
||||
<!ENTITY bz-cvs-ver "2.22rc1">
|
||||
<!ENTITY landfillbase "http://landfill.bugzilla.org/bugzilla-&bz-ver;/">
|
||||
<!ENTITY bzg-ver "2.16.11">
|
||||
<!ENTITY bzg-cvs-ver "2.22rc1">
|
||||
<!ENTITY bzg-auth "The Bugzilla Team">
|
||||
<!ENTITY bzg-bugs "<ulink url='http://bugzilla.mozilla.org/enter_bug.cgi?product=Bugzilla&component=Documentation'>Bugzilla</ulink>">
|
||||
<!ENTITY mysql "http://www.mysql.com/">
|
||||
<!ENTITY perl-ver "5.6.1">
|
||||
|
||||
]>
|
||||
|
||||
|
||||
<!-- Coding standards for this document
|
||||
|
||||
* Other than the GFDL, please use the "section" tag instead of "sect1", "sect2", etc.
|
||||
* Use Entities to include files for new chapters in Bugzilla-Guide.xml.
|
||||
* Try to use Entities for frequently-used passages of text as well.
|
||||
* Ensure all documents compile cleanly to HTML after modification.
|
||||
The warning, "DTDDECL catalog types not supported" is normal.
|
||||
* Try to index important terms wherever possible.
|
||||
* Use "glossterm" whenever you introduce a new term.
|
||||
* Follow coding standards at http://www.linuxdoc.org, and
|
||||
check out the KDE guidelines (they are nice, too)
|
||||
http://i18n.kde.org/doc/markup.html
|
||||
* All tags should be lowercase (needsfix)
|
||||
* Please use sensible spacing. The comments at the very end of each
|
||||
file define reasonable defaults for PSGML mode in EMACS.
|
||||
Double-indent tags, use double spacing whenever possible, and
|
||||
try to avoid clutter and feel free to waste space in the code to make it more readable.
|
||||
|
||||
-->
|
||||
|
||||
<book id="index">
|
||||
|
||||
<!-- Header -->
|
||||
|
||||
<bookinfo>
|
||||
<title>The Bugzilla Guide - &bzg-ver; Release</title>
|
||||
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Matthew</firstname>
|
||||
<othername>P.</othername>
|
||||
<surname>Barnson</surname>
|
||||
</author>
|
||||
<author>
|
||||
<firstname>The</firstname>
|
||||
<othername>Bugzilla</othername>
|
||||
<surname>Team</surname>
|
||||
</author>
|
||||
</authorgroup>
|
||||
|
||||
<pubdate>&bz-date;</pubdate>
|
||||
|
||||
<abstract>
|
||||
<para>
|
||||
This is the documentation for Bugzilla, the mozilla.org
|
||||
bug-tracking system.
|
||||
Bugzilla is an enterprise-class piece of software
|
||||
that powers issue-tracking for hundreds of
|
||||
organizations around the world, tracking millions of bugs.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This documentation is maintained in DocBook 4.1.2 XML format.
|
||||
Changes are best submitted as plain text or XML diffs, attached
|
||||
to a bug filed in
|
||||
<ulink url="http://bugzilla.mozilla.org/enter_bug.cgi?product=Bugzilla&component=Documentation">mozilla.org's Bugzilla</ulink>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The most current version of this document can always be found on the
|
||||
<ulink url="http://www.bugzilla.org/documentation.html">Bugzilla Documentation Page</ulink>.
|
||||
</para>
|
||||
</abstract>
|
||||
|
||||
<keywordset>
|
||||
<keyword>Bugzilla</keyword>
|
||||
<keyword>Guide</keyword>
|
||||
<keyword>installation</keyword>
|
||||
<keyword>FAQ</keyword>
|
||||
<keyword>administration</keyword>
|
||||
<keyword>integration</keyword>
|
||||
<keyword>MySQL</keyword>
|
||||
<keyword>Mozilla</keyword>
|
||||
<keyword>webtools</keyword>
|
||||
</keywordset>
|
||||
</bookinfo>
|
||||
|
||||
<!-- About This Guide -->
|
||||
&about;
|
||||
|
||||
<!-- Introduction -->
|
||||
&introduction;
|
||||
|
||||
<!-- Using Bugzilla -->
|
||||
&using;
|
||||
|
||||
<!-- Installing Bugzilla -->
|
||||
&installation;
|
||||
|
||||
<!-- Administering Bugzilla -->
|
||||
&administration;
|
||||
|
||||
<!-- Appendix: The Frequently Asked Questions -->
|
||||
&faq;
|
||||
|
||||
<!-- Appendix: The Database Schema -->
|
||||
&database;
|
||||
|
||||
<!-- Appendix: Custom Patches -->
|
||||
&patches;
|
||||
|
||||
<!-- Appendix: Major Bugzilla Variants -->
|
||||
&variants;
|
||||
|
||||
<!-- Appendix: GNU Free Documentation License -->
|
||||
&gfdl;
|
||||
|
||||
<!-- Glossary -->
|
||||
&glossary;
|
||||
|
||||
<!-- Index -->
|
||||
&index;
|
||||
|
||||
|
||||
</book>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-auto-insert-required-elements:t
|
||||
sgml-balanced-tag-edit:t
|
||||
sgml-exposed-tags:nil
|
||||
sgml-general-insert-case:lower
|
||||
sgml-indent-data:t
|
||||
sgml-indent-step:2
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-namecase-general:t
|
||||
sgml-omittag:t
|
||||
sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter")
|
||||
sgml-shorttag:t
|
||||
sgml-tag-region-if-active:t
|
||||
End:
|
||||
-->
|
||||
@@ -1,235 +0,0 @@
|
||||
<!-- <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
|
||||
<!ENTITY conventions SYSTEM "conventions.xml"> ] > -->
|
||||
<!-- $Id: about.xml,v 1.6.2.7 2004-12-13 03:29:58 jake%bugzilla.org Exp $ -->
|
||||
|
||||
<chapter id="about">
|
||||
<title>About This Guide</title>
|
||||
|
||||
<section id="copyright">
|
||||
<title>Copyright Information</title>
|
||||
<blockquote>
|
||||
<attribution>Copyright (c) 2000-¤t-year; Matthew P. Barnson and &bzg-auth;</attribution>
|
||||
<para>
|
||||
Permission is granted to copy, distribute and/or modify this
|
||||
document under the terms of the GNU Free Documentation
|
||||
License, Version 1.1 or any later version published by the
|
||||
Free Software Foundation; with no Invariant Sections, no
|
||||
Front-Cover Texts, and with no Back-Cover Texts. A copy of
|
||||
the license is included in <xref linkend="gfdl"/>.
|
||||
</para>
|
||||
</blockquote>
|
||||
<para>
|
||||
If you have any questions regarding this document, its
|
||||
copyright, or publishing this document in non-electronic form,
|
||||
please contact &bzg-auth;.
|
||||
</para>
|
||||
|
||||
</section>
|
||||
|
||||
<section id="disclaimer">
|
||||
<title>Disclaimer</title>
|
||||
<para>
|
||||
No liability for the contents of this document can be accepted.
|
||||
Use the concepts, examples, and other content at your own risk.
|
||||
This document may contain errors
|
||||
and inaccuracies that may damage your system, cause your partner
|
||||
to leave you, your boss to fire you, your cats to
|
||||
pee on your furniture and clothing, and global thermonuclear
|
||||
war. Proceed with caution.
|
||||
</para>
|
||||
<para>
|
||||
All copyrights are held by their respective owners, unless
|
||||
specifically noted otherwise. Use of a term in this document
|
||||
should not be regarded as affecting the validity of any
|
||||
trademark or service mark.
|
||||
</para>
|
||||
<para>
|
||||
Naming of particular products or brands should not be seen as
|
||||
endorsements, with the exception of the term "GNU/Linux". We
|
||||
wholeheartedly endorse the use of GNU/Linux in every situation
|
||||
where it is appropriate. It is an extremely versatile, stable,
|
||||
and robust operating system that offers an ideal operating
|
||||
environment for Bugzilla.
|
||||
</para>
|
||||
<para>
|
||||
You are strongly recommended to make a backup of your system
|
||||
before installing Bugzilla and at regular intervals thereafter.
|
||||
If you implement any suggestion in this Guide, implement this one!
|
||||
</para>
|
||||
<para>
|
||||
Although the Bugzilla development team has taken great care to
|
||||
ensure that all easily-exploitable bugs or options are
|
||||
documented or fixed in the code, security holes surely exist.
|
||||
Great care should be taken both in the installation and usage of
|
||||
this software. Carefully consider the implications of installing
|
||||
other network services with Bugzilla. The Bugzilla development
|
||||
team members, Netscape Communications, America Online Inc., and
|
||||
any affiliated developers or sponsors assume no liability for
|
||||
your use of this product. You have the source code to this
|
||||
product, and are responsible for auditing it yourself to ensure
|
||||
your security needs are met.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<!-- Section 2: New Versions -->
|
||||
|
||||
<section id="newversions">
|
||||
<title>New Versions</title>
|
||||
<para>
|
||||
This is the &bzg-ver; version of The Bugzilla Guide. It is so named
|
||||
to match the version of Bugzilla it is disributed with. If you are
|
||||
reading this from any source other than those below, please
|
||||
check one of these mirrors to make sure you are reading an
|
||||
up-to-date version of the Guide.
|
||||
</para>
|
||||
<para>
|
||||
The newest version of this guide can always be found at <ulink
|
||||
url="http://www.bugzilla.org">bugzilla.org</ulink>; including
|
||||
documentation for past releases and the current development version.
|
||||
</para>
|
||||
<para>
|
||||
The documentation for the most recent stable release of Bugzilla can also
|
||||
be found at
|
||||
<ulink url="http://www.tldp.org">The Linux Documentation Project</ulink>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The latest version of this document can always be checked out via CVS.
|
||||
Please follow the instructions available at
|
||||
<ulink url="http://www.mozilla.org/cvs.html">the Mozilla CVS page</ulink>,
|
||||
and check out the <filename>mozilla/webtools/bugzilla/docs/</filename>
|
||||
subtree.
|
||||
</para>
|
||||
<para>
|
||||
The Bugzilla Guide is currently only available in English.
|
||||
If you would like to volunteer to translate it, please contact
|
||||
<ulink url="mailto:justdave@syndicomm.com">Dave Miller</ulink>.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="credits">
|
||||
<title>Credits</title>
|
||||
<para>
|
||||
The people listed below have made enormous contributions to the
|
||||
creation of this Guide, through their writing, dedicated hacking efforts,
|
||||
numerous e-mail and IRC support sessions, and overall excellent
|
||||
contribution to the Bugzilla community:
|
||||
</para>
|
||||
<!-- TODO: This is evil... there has to be a valid way to get this look -->
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>Matthew P. Barnson <email>mbarnson@sisna.com</email></term>
|
||||
<listitem>
|
||||
<para>for the Herculaean task of pulling together the Bugzilla Guide
|
||||
and shepherding it to 2.14.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>Terry Weissman <email>terry@mozilla.org</email></term>
|
||||
<listitem>
|
||||
<para>for initially writing Bugzilla and creating the README upon
|
||||
which the UNIX installation documentation is largely based.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>Tara Hernandez <email>tara@tequilarists.org</email></term>
|
||||
<listitem>
|
||||
<para>for keeping Bugzilla development going strong after Terry left
|
||||
mozilla.org and for running landfill.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>Dave Lawrence <email>dkl@redhat.com</email></term>
|
||||
<listitem>
|
||||
<para>for providing insight into the key differences between Red
|
||||
Hat's customized Bugzilla, and being largely responsible for
|
||||
<xref linkend="variant-redhat"/>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>Dawn Endico <email>endico@mozilla.org</email></term>
|
||||
<listitem>
|
||||
<para>for being a hacker extraordinaire and putting up with Matthew's
|
||||
incessant questions and arguments on irc.mozilla.org in #mozwebtools
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>Jacob Steenhagen <email>jake@bugzilla.org</email></term>
|
||||
<listitem>
|
||||
<para>for taking over documentation during the 2.17 development
|
||||
period and backporting relevent docs changes to this 2.16 branch.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>Dave Miller <email>justdave@bugzilla.org</email></term>
|
||||
<listitem>
|
||||
<para>for taking over as project lead when Tara stepped down and
|
||||
continually pusing to have relevant changes pushed back to this
|
||||
2.16 branch of the documentation.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
|
||||
<para>
|
||||
Last but not least, all the members of the
|
||||
<ulink url="news://news.mozilla.org/netscape/public/mozilla/webtools"/>
|
||||
newsgroup. Without your discussions, insight, suggestions, and patches,
|
||||
this could never have happened.
|
||||
</para>
|
||||
<para>
|
||||
Thanks also go to the following people for significant contributions
|
||||
to this documentation (in alphabetical order):
|
||||
<simplelist type="inline">
|
||||
<member>Vlad Dascalu</member>
|
||||
<member>Andrew Pearson</member>
|
||||
<member>Ben FrantzDale</member>
|
||||
<member>Eric Hanson</member>
|
||||
<member>Gervase Markham</member>
|
||||
<member>Joe Robins</member>
|
||||
<member>Kevin Brannen</member>
|
||||
<member>Ron Teitelbaum</member>
|
||||
<member>Shane Travis</member>
|
||||
<member>Spencer Smith</member>
|
||||
<member>Zach Liption</member>
|
||||
</simplelist>
|
||||
.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<!-- conventions used here (didn't want to give it a chapter of its own) -->
|
||||
&conventions;
|
||||
</chapter>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-auto-insert-required-elements:t
|
||||
sgml-balanced-tag-edit:t
|
||||
sgml-exposed-tags:nil
|
||||
sgml-general-insert-case:lower
|
||||
sgml-indent-data:t
|
||||
sgml-indent-step:2
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-namecase-general:t
|
||||
sgml-omittag:t
|
||||
sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter")
|
||||
sgml-shorttag:t
|
||||
sgml-tag-region-if-active:t
|
||||
End: -->
|
||||
@@ -1,179 +0,0 @@
|
||||
<!-- <!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook V4.1//EN"> -->
|
||||
<section id="conventions">
|
||||
<title>Document Conventions</title>
|
||||
|
||||
<indexterm zone="conventions">
|
||||
<primary>conventions</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>This document uses the following conventions:</para>
|
||||
|
||||
<informaltable frame="none">
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Descriptions</entry>
|
||||
|
||||
<entry>Appearance</entry>
|
||||
</row>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>Use caution</entry>
|
||||
|
||||
<entry>
|
||||
<caution>
|
||||
<para>Don't run with scissors!</para>
|
||||
</caution>
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Hint</entry>
|
||||
|
||||
<entry>
|
||||
<tip>
|
||||
<para>Would you like a breath mint?</para>
|
||||
</tip>
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Notes</entry>
|
||||
|
||||
<entry>
|
||||
<note>
|
||||
<para>Dear John...</para>
|
||||
</note>
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Warnings</entry>
|
||||
|
||||
<entry>
|
||||
<warning>
|
||||
<para>Read this or the cat gets it.</para>
|
||||
</warning>
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>File Names</entry>
|
||||
|
||||
<entry>
|
||||
<filename>filename</filename>
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Directory Names</entry>
|
||||
|
||||
<entry>
|
||||
<filename class="directory">directory</filename>
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Commands to be typed</entry>
|
||||
|
||||
<entry>
|
||||
<command>command</command>
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Applications Names</entry>
|
||||
|
||||
<entry>
|
||||
<application>application</application>
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>
|
||||
<foreignphrase>Prompt</foreignphrase>
|
||||
|
||||
of users command under bash shell</entry>
|
||||
|
||||
<entry>bash$</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>
|
||||
<foreignphrase>Prompt</foreignphrase>
|
||||
|
||||
of root users command under bash shell</entry>
|
||||
|
||||
<entry>bash#</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>
|
||||
<foreignphrase>Prompt</foreignphrase>
|
||||
|
||||
of user command under tcsh shell</entry>
|
||||
|
||||
<entry>tcsh$</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Environment Variables</entry>
|
||||
|
||||
<entry>
|
||||
<envar>VARIABLE</envar>
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Emphasized word</entry>
|
||||
|
||||
<entry>
|
||||
<emphasis>word</emphasis>
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Term found in the glossary</entry>
|
||||
|
||||
<entry>
|
||||
<glossterm linkend="gloss-bugzilla">Bugzilla</glossterm>
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Code Example</entry>
|
||||
|
||||
<entry>
|
||||
<programlisting><sgmltag class="starttag">para</sgmltag>
|
||||
Beginning and end of paragraph
|
||||
<sgmltag class="endtag">para</sgmltag></programlisting>
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</section>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-auto-insert-required-elements:t
|
||||
sgml-balanced-tag-edit:t
|
||||
sgml-exposed-tags:nil
|
||||
sgml-general-insert-case:lower
|
||||
sgml-indent-data:t
|
||||
sgml-indent-step:2
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-namecase-general:t
|
||||
sgml-omittag:t
|
||||
sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter")
|
||||
sgml-shorttag:t
|
||||
sgml-tag-region-if-active:t
|
||||
End:
|
||||
-->
|
||||
|
||||
@@ -1,393 +0,0 @@
|
||||
<!-- <!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook V4.1//EN"> -->
|
||||
<appendix id="database">
|
||||
<title>The Bugzilla Database</title>
|
||||
|
||||
<note>
|
||||
<para>This document really needs to be updated with more fleshed out
|
||||
information about primary keys, interrelationships, and maybe some nifty
|
||||
tables to document dependencies. Any takers?</para>
|
||||
</note>
|
||||
|
||||
<section id="dbschema">
|
||||
<title>Database Schema Chart</title>
|
||||
|
||||
<para>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="../images/dbschema.jpg" format="JPG" scale="66" />
|
||||
</imageobject>
|
||||
|
||||
<textobject>
|
||||
<phrase>Database Relationships</phrase>
|
||||
</textobject>
|
||||
|
||||
<caption>
|
||||
<para>Bugzilla database relationships chart</para>
|
||||
</caption>
|
||||
</mediaobject>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="dbdoc">
|
||||
<title>MySQL Bugzilla Database Introduction</title>
|
||||
|
||||
<para>This information comes straight from my life. I was forced to learn
|
||||
how Bugzilla organizes database because of nitpicky requests from users
|
||||
for tiny changes in wording, rather than having people re-educate
|
||||
themselves or figure out how to work our procedures around the tool. It
|
||||
sucks, but it can and will happen to you, so learn how the schema works
|
||||
and deal with it when it comes.</para>
|
||||
|
||||
<para>So, here you are with your brand-new installation of Bugzilla.
|
||||
You've got MySQL set up, Apache working right, Perl DBI and DBD talking
|
||||
to the database flawlessly. Maybe you've even entered a few test bugs to
|
||||
make sure email's working; people seem to be notified of new bugs and
|
||||
changes, and you can enter and edit bugs to your heart's content. Perhaps
|
||||
you've gone through the trouble of setting up a gateway for people to
|
||||
submit bugs to your database via email, have had a few people test it,
|
||||
and received rave reviews from your beta testers.</para>
|
||||
|
||||
<para>What's the next thing you do? Outline a training strategy for your
|
||||
development team, of course, and bring them up to speed on the new tool
|
||||
you've labored over for hours.</para>
|
||||
|
||||
<para>Your first training session starts off very well! You have a
|
||||
captive audience which seems enraptured by the efficiency embodied in
|
||||
this thing called "Bugzilla". You are caught up describing the nifty
|
||||
features, how people can save favorite queries in the database, set them
|
||||
up as headers and footers on their pages, customize their layouts,
|
||||
generate reports, track status with greater efficiency than ever before,
|
||||
leap tall buildings with a single bound and rescue Jane from the clutches
|
||||
of Certain Death!</para>
|
||||
|
||||
<para>But Certain Death speaks up -- a tiny voice, from the dark corners
|
||||
of the conference room. "I have a concern," the voice hisses from the
|
||||
darkness, "about the use of the word 'verified'.</para>
|
||||
|
||||
<para>The room, previously filled with happy chatter, lapses into
|
||||
reverential silence as Certain Death (better known as the Vice President
|
||||
of Software Engineering) continues. "You see, for two years we've used
|
||||
the word 'verified' to indicate that a developer or quality assurance
|
||||
engineer has confirmed that, in fact, a bug is valid. I don't want to
|
||||
lose two years of training to a new software product. You need to change
|
||||
the bug status of 'verified' to 'approved' as soon as possible. To avoid
|
||||
confusion, of course."</para>
|
||||
|
||||
<para>Oh no! Terror strikes your heart, as you find yourself mumbling
|
||||
"yes, yes, I don't think that would be a problem," You review the changes
|
||||
with Certain Death, and continue to jabber on, "no, it's not too big a
|
||||
change. I mean, we have the source code, right? You know, 'Use the
|
||||
Source, Luke' and all that... no problem," All the while you quiver
|
||||
inside like a beached jellyfish bubbling, burbling, and boiling on a hot
|
||||
Jamaican sand dune...</para>
|
||||
|
||||
<para>Thus begins your adventure into the heart of Bugzilla. You've been
|
||||
forced to learn about non-portable enum() fields, varchar columns, and
|
||||
tinyint definitions. The Adventure Awaits You!</para>
|
||||
|
||||
<section>
|
||||
<title>Bugzilla Database Basics</title>
|
||||
|
||||
<para>If you were like me, at this point you're totally clueless about
|
||||
the internals of MySQL, and if it weren't for this executive order from
|
||||
the Vice President you couldn't care less about the difference between
|
||||
a
|
||||
<quote>bigint</quote>
|
||||
|
||||
and a
|
||||
<quote>tinyint</quote>
|
||||
|
||||
entry in MySQL. I recommend you refer to the MySQL documentation,
|
||||
available at
|
||||
<ulink url="http://www.mysql.com/doc.html">MySQL.com</ulink>
|
||||
|
||||
. Below are the basics you need to know about the Bugzilla database.
|
||||
Check the chart above for more details.</para>
|
||||
|
||||
<para>
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>To connect to your database:</para>
|
||||
|
||||
<para>
|
||||
<prompt>bash#</prompt>
|
||||
|
||||
<command>mysql</command>
|
||||
|
||||
<parameter>-u root</parameter>
|
||||
</para>
|
||||
|
||||
<para>If this works without asking you for a password,
|
||||
<emphasis>shame on you</emphasis>
|
||||
|
||||
! You should have locked your security down like the installation
|
||||
instructions told you to. You can find details on locking down
|
||||
your database in the Bugzilla FAQ in this directory (under
|
||||
"Security"), or more robust security generalities in the
|
||||
<ulink url="http://www.mysql.com/php/manual.php3?section=Privilege_system">MySQL
|
||||
searchable documentation</ulink>.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>You should now be at a prompt that looks like this:</para>
|
||||
|
||||
<para>
|
||||
<prompt>mysql></prompt>
|
||||
</para>
|
||||
|
||||
<para>At the prompt, if
|
||||
<quote>bugs</quote>
|
||||
|
||||
is the name you chose in the
|
||||
<filename>localconfig</filename>
|
||||
|
||||
file for your Bugzilla database, type:</para>
|
||||
|
||||
<para>
|
||||
<prompt>mysql</prompt>
|
||||
|
||||
<command>use bugs;</command>
|
||||
</para>
|
||||
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
</para>
|
||||
|
||||
<section>
|
||||
<title>Bugzilla Database Tables</title>
|
||||
|
||||
<para>Imagine your MySQL database as a series of spreadsheets, and
|
||||
you won't be too far off. If you use this command:</para>
|
||||
|
||||
<para>
|
||||
<prompt>mysql></prompt>
|
||||
<command>show tables from bugs;</command>
|
||||
</para>
|
||||
|
||||
<para>you'll be able to see the names of all the
|
||||
<quote>spreadsheets</quote>
|
||||
(tables) in your database.</para>
|
||||
|
||||
<para>From the command issued above, ou should have some
|
||||
output that looks like this:
|
||||
<programlisting>
|
||||
+-------------------+
|
||||
| Tables in bugs |
|
||||
+-------------------+
|
||||
| attachments |
|
||||
| bugs |
|
||||
| bugs_activity |
|
||||
| cc |
|
||||
| components |
|
||||
| dependencies |
|
||||
| fielddefs |
|
||||
| groups |
|
||||
| keyworddefs |
|
||||
| keywords |
|
||||
| logincookies |
|
||||
| longdescs |
|
||||
| milestones |
|
||||
| namedqueries |
|
||||
| products |
|
||||
| profiles |
|
||||
| profiles_activity |
|
||||
| shadowlog |
|
||||
| tokens |
|
||||
| versions |
|
||||
| votes |
|
||||
| watch |
|
||||
+-------------------+
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<literallayout>
|
||||
Here's an overview of what each table does. Most columns in each table have
|
||||
descriptive names that make it fairly trivial to figure out their jobs.
|
||||
|
||||
attachments: This table stores all attachments to bugs. It tends to be your
|
||||
largest table, yet also generally has the fewest entries because file
|
||||
attachments are so (relatively) large.
|
||||
|
||||
bugs: This is the core of your system. The bugs table stores most of the
|
||||
current information about a bug, with the exception of the info stored in the
|
||||
other tables.
|
||||
|
||||
bugs_activity: This stores information regarding what changes are made to bugs
|
||||
when -- a history file.
|
||||
|
||||
cc: This tiny table simply stores all the CC information for any bug which has
|
||||
any entries in the CC field of the bug. Note that, like most other tables in
|
||||
Bugzilla, it does not refer to users by their user names, but by their unique
|
||||
userid, stored as a primary key in the profiles table.
|
||||
|
||||
components: This stores the programs and components (or products and
|
||||
components, in newer Bugzilla parlance) for Bugzilla. Curiously, the "program"
|
||||
(product) field is the full name of the product, rather than some other unique
|
||||
identifier, like bug_id and user_id are elsewhere in the database.
|
||||
|
||||
dependencies: Stores data about those cool dependency trees.
|
||||
|
||||
fielddefs: A nifty table that defines other tables. For instance, when you
|
||||
submit a form that changes the value of "AssignedTo" this table allows
|
||||
translation to the actual field name "assigned_to" for entry into MySQL.
|
||||
|
||||
groups: defines bitmasks for groups. A bitmask is a number that can uniquely
|
||||
identify group memberships. For instance, say the group that is allowed to
|
||||
tweak parameters is assigned a value of "1", the group that is allowed to edit
|
||||
users is assigned a "2", and the group that is allowed to create new groups is
|
||||
assigned the bitmask of "4". By uniquely combining the group bitmasks (much
|
||||
like the chmod command in UNIX,) you can identify a user is allowed to tweak
|
||||
parameters and create groups, but not edit users, by giving him a bitmask of
|
||||
"5", or a user allowed to edit users and create groups, but not tweak
|
||||
parameters, by giving him a bitmask of "6" Simple, huh?
|
||||
If this makes no sense to you, try this at the mysql prompt:
|
||||
mysql> select * from groups;
|
||||
You'll see the list, it makes much more sense that way.
|
||||
|
||||
keyworddefs: Definitions of keywords to be used
|
||||
|
||||
keywords: Unlike what you'd think, this table holds which keywords are
|
||||
associated with which bug id's.
|
||||
|
||||
logincookies: This stores every login cookie ever assigned to you for every
|
||||
machine you've ever logged into Bugzilla from. Curiously, it never does any
|
||||
housecleaning -- I see cookies in this file I've not used for months. However,
|
||||
since Bugzilla never expires your cookie (for convenience' sake), it makes
|
||||
sense.
|
||||
|
||||
longdescs: The meat of bugzilla -- here is where all user comments are stored!
|
||||
You've only got 2^24 bytes per comment (it's a mediumtext field), so speak
|
||||
sparingly -- that's only the amount of space the Old Testament from the Bible
|
||||
would take (uncompressed, 16 megabytes). Each comment is keyed to the
|
||||
bug_id to which it's attached, so the order is necessarily chronological, for
|
||||
comments are played back in the order in which they are received.
|
||||
|
||||
milestones: Interesting that milestones are associated with a specific product
|
||||
in this table, but Bugzilla does not yet support differing milestones by
|
||||
product through the standard configuration interfaces.
|
||||
|
||||
namedqueries: This is where everybody stores their "custom queries". Very
|
||||
cool feature; it beats the tar out of having to bookmark each cool query you
|
||||
construct.
|
||||
|
||||
products: What products you have, whether new bug entries are allowed for the
|
||||
product, what milestone you're working toward on that product, votes, etc. It
|
||||
will be nice when the components table supports these same features, so you
|
||||
could close a particular component for bug entry without having to close an
|
||||
entire product...
|
||||
|
||||
profiles: Ahh, so you were wondering where your precious user information was
|
||||
stored? Here it is! With the passwords in plain text for all to see! (but
|
||||
sshh... don't tell your users!)
|
||||
|
||||
profiles_activity: Need to know who did what when to who's profile? This'll
|
||||
tell you, it's a pretty complete history.
|
||||
|
||||
shadowlog: I could be mistaken here, but I believe this table tells you when
|
||||
your shadow database is updated and what commands were used to update it. We
|
||||
don't use a shadow database at our site yet, so it's pretty empty for us.
|
||||
|
||||
versions: Version information for every product
|
||||
|
||||
votes: Who voted for what when
|
||||
|
||||
watch: Who (according to userid) is watching who's bugs (according to their
|
||||
userid).
|
||||
|
||||
|
||||
===
|
||||
THE DETAILS
|
||||
===
|
||||
|
||||
Ahh, so you're wondering just what to do with the information above? At the
|
||||
mysql prompt, you can view any information about the columns in a table with
|
||||
this command (where "table" is the name of the table you wish to view):
|
||||
|
||||
mysql> show columns from table;
|
||||
|
||||
You can also view all the data in a table with this command:
|
||||
|
||||
mysql> select * from table;
|
||||
|
||||
-- note: this is a very bad idea to do on, for instance, the "bugs" table if
|
||||
you have 50,000 bugs. You'll be sitting there a while until you ctrl-c or
|
||||
50,000 bugs play across your screen.
|
||||
|
||||
You can limit the display from above a little with the command, where
|
||||
"column" is the name of the column for which you wish to restrict information:
|
||||
|
||||
mysql> select * from table where (column = "some info");
|
||||
|
||||
-- or the reverse of this
|
||||
|
||||
mysql> select * from table where (column != "some info");
|
||||
|
||||
Let's take our example from the introduction, and assume you need to change
|
||||
the word "verified" to "approved" in the resolution field. We know from the
|
||||
above information that the resolution is likely to be stored in the "bugs"
|
||||
table. Note we'll need to change a little perl code as well as this database
|
||||
change, but I won't plunge into that in this document. Let's verify the
|
||||
information is stored in the "bugs" table:
|
||||
|
||||
mysql> show columns from bugs
|
||||
|
||||
(exceedingly long output truncated here)
|
||||
| bug_status| enum('UNCONFIRMED','NEW','ASSIGNED','REOPENED','RESOLVED','VERIFIED','CLOSED')||MUL | UNCONFIRMED||
|
||||
|
||||
Sorry about that long line. We see from this that the "bug status" column is
|
||||
an "enum field", which is a MySQL peculiarity where a string type field can
|
||||
only have certain types of entries. While I think this is very cool, it's not
|
||||
standard SQL. Anyway, we need to add the possible enum field entry
|
||||
'APPROVED' by altering the "bugs" table.
|
||||
|
||||
mysql> ALTER table bugs CHANGE bug_status bug_status
|
||||
-> enum("UNCONFIRMED", "NEW", "ASSIGNED", "REOPENED", "RESOLVED",
|
||||
-> "VERIFIED", "APPROVED", "CLOSED") not null;
|
||||
|
||||
(note we can take three lines or more -- whatever you put in before the
|
||||
semicolon is evaluated as a single expression)
|
||||
|
||||
Now if you do this:
|
||||
|
||||
mysql> show columns from bugs;
|
||||
|
||||
you'll see that the bug_status field has an extra "APPROVED" enum that's
|
||||
available! Cool thing, too, is that this is reflected on your query page as
|
||||
well -- you can query by the new status. But how's it fit into the existing
|
||||
scheme of things?
|
||||
Looks like you need to go back and look for instances of the word "verified"
|
||||
in the perl code for Bugzilla -- wherever you find "verified", change it to
|
||||
"approved" and you're in business (make sure that's a case-insensitive search).
|
||||
Although you can query by the enum field, you can't give something a status
|
||||
of "APPROVED" until you make the perl changes. Note that this change I
|
||||
mentioned can also be done by editing checksetup.pl, which automates a lot of
|
||||
this. But you need to know this stuff anyway, right?
|
||||
</literallayout>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
</appendix>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-auto-insert-required-elements:t
|
||||
sgml-balanced-tag-edit:t
|
||||
sgml-exposed-tags:nil
|
||||
sgml-general-insert-case:lower
|
||||
sgml-indent-data:t
|
||||
sgml-indent-step:2
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-namecase-general:t
|
||||
sgml-omittag:t
|
||||
sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter")
|
||||
sgml-shorttag:t
|
||||
sgml-tag-region-if-active:t
|
||||
End:
|
||||
-->
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
--- File/Temp.pm.orig Thu Feb 6 16:26:00 2003
|
||||
+++ File/Temp.pm Thu Feb 6 16:26:23 2003
|
||||
@@ -205,6 +205,7 @@
|
||||
# eg CGI::Carp
|
||||
local $SIG{__DIE__} = sub {};
|
||||
local $SIG{__WARN__} = sub {};
|
||||
+ local *CORE::GLOBAL::die = sub {};
|
||||
$bit = &$func();
|
||||
1;
|
||||
};
|
||||
@@ -226,6 +227,7 @@
|
||||
# eg CGI::Carp
|
||||
local $SIG{__DIE__} = sub {};
|
||||
local $SIG{__WARN__} = sub {};
|
||||
+ local *CORE::GLOBAL::die = sub {};
|
||||
$bit = &$func();
|
||||
1;
|
||||
};
|
||||
@@ -1,22 +0,0 @@
|
||||
--- GD-1.33/Makefile.PL Fri Aug 4 16:59:22 2000
|
||||
+++ GD-1.33-darwin/Makefile.PL Tue Jun 26 01:29:32 2001
|
||||
@@ -3,8 +3,8 @@
|
||||
warn "NOTICE: This module requires libgd 1.8.3 or higher (shared library version 4.X).\n";
|
||||
|
||||
# =====> PATHS: CHECK AND ADJUST <=====
|
||||
-my @INC = qw(-I/usr/local/include -I/usr/local/include/gd);
|
||||
-my @LIBPATH = qw(-L/usr/lib/X11 -L/usr/X11R6/lib -L/usr/X11/lib -L/usr/local/lib );
|
||||
+my @INC = qw(-I/sw/include -I/sw/include/gd -I/usr/local/include -I/usr/local/include/gd);
|
||||
+my @LIBPATH = qw(-L/usr/lib/X11 -L/usr/X11R6/lib -L/usr/X11/lib -L/sw/lib -L/usr/local/lib);
|
||||
my @LIBS = qw(-lgd -lpng -lz);
|
||||
|
||||
# FEATURE FLAGS
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
push @LIBS,'-lttf' if $TTF;
|
||||
push @LIBS,'-ljpeg' if $JPEG;
|
||||
-push @LIBS, '-lm' unless $^O eq 'MSWin32';
|
||||
+push @LIBS, '-lm' unless ($^O =~ /^MSWin32|darwin$/);
|
||||
|
||||
# FreeBSD 3.3 with libgd built from ports croaks if -lXpm is specified
|
||||
if ($^O ne 'freebsd' && $^O ne 'MSWin32') {
|
||||
@@ -1,448 +0,0 @@
|
||||
<!-- <!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook V4.1//EN"> -->
|
||||
<appendix id="gfdl">
|
||||
<title>GNU Free Documentation License</title>
|
||||
|
||||
<!-- - GNU Project - Free Software Foundation (FSF) -->
|
||||
<!-- LINK REV="made" HREF="mailto:webmasters@gnu.org" -->
|
||||
<!-- section>
|
||||
<title>GNU Free Documentation License</title -->
|
||||
<para>Version 1.1, March 2000</para>
|
||||
|
||||
<blockquote>
|
||||
<para>Copyright (C) 2000 Free Software Foundation, Inc. 59 Temple Place,
|
||||
Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and
|
||||
distribute verbatim copies of this license document, but changing it is
|
||||
not allowed.</para>
|
||||
</blockquote>
|
||||
|
||||
<section label="0" id="gfdl-0">
|
||||
<title>PREAMBLE</title>
|
||||
|
||||
<para>The purpose of this License is to make a manual, textbook, or other
|
||||
written document "free" in the sense of freedom: to assure everyone the
|
||||
effective freedom to copy and redistribute it, with or without modifying
|
||||
it, either commercially or noncommercially. Secondarily, this License
|
||||
preserves for the author and publisher a way to get credit for their
|
||||
work, while not being considered responsible for modifications made by
|
||||
others.</para>
|
||||
|
||||
<para>This License is a kind of "copyleft", which means that derivative
|
||||
works of the document must themselves be free in the same sense. It
|
||||
complements the GNU General Public License, which is a copyleft license
|
||||
designed for free software.</para>
|
||||
|
||||
<para>We have designed this License in order to use it for manuals for
|
||||
free software, because free software needs free documentation: a free
|
||||
program should come with manuals providing the same freedoms that the
|
||||
software does. But this License is not limited to software manuals; it
|
||||
can be used for any textual work, regardless of subject matter or whether
|
||||
it is published as a printed book. We recommend this License principally
|
||||
for works whose purpose is instruction or reference.</para>
|
||||
</section>
|
||||
|
||||
<section label="1" id="gfdl-1">
|
||||
<title>APPLICABILITY AND DEFINITIONS</title>
|
||||
|
||||
<para>This License applies to any manual or other work that contains a
|
||||
notice placed by the copyright holder saying it can be distributed under
|
||||
the terms of this License. The "Document", below, refers to any such
|
||||
manual or work. Any member of the public is a licensee, and is addressed
|
||||
as "you".</para>
|
||||
|
||||
<para>A "Modified Version" of the Document means any work containing the
|
||||
Document or a portion of it, either copied verbatim, or with
|
||||
modifications and/or translated into another language.</para>
|
||||
|
||||
<para>A "Secondary Section" is a named appendix or a front-matter section
|
||||
of the Document that deals exclusively with the relationship of the
|
||||
publishers or authors of the Document to the Document's overall subject
|
||||
(or to related matters) and contains nothing that could fall directly
|
||||
within that overall subject. (For example, if the Document is in part a
|
||||
textbook of mathematics, a Secondary Section may not explain any
|
||||
mathematics.) The relationship could be a matter of historical connection
|
||||
with the subject or with related matters, or of legal, commercial,
|
||||
philosophical, ethical or political position regarding them.</para>
|
||||
|
||||
<para>The "Invariant Sections" are certain Secondary Sections whose
|
||||
titles are designated, as being those of Invariant Sections, in the
|
||||
notice that says that the Document is released under this License.</para>
|
||||
|
||||
<para>The "Cover Texts" are certain short passages of text that are
|
||||
listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says
|
||||
that the Document is released under this License.</para>
|
||||
|
||||
<para>A "Transparent" copy of the Document means a machine-readable copy,
|
||||
represented in a format whose specification is available to the general
|
||||
public, whose contents can be viewed and edited directly and
|
||||
straightforwardly with generic text editors or (for images composed of
|
||||
pixels) generic paint programs or (for drawings) some widely available
|
||||
drawing editor, and that is suitable for input to text formatters or for
|
||||
automatic translation to a variety of formats suitable for input to text
|
||||
formatters. A copy made in an otherwise Transparent file format whose
|
||||
markup has been designed to thwart or discourage subsequent modification
|
||||
by readers is not Transparent. A copy that is not "Transparent" is called
|
||||
"Opaque".</para>
|
||||
|
||||
<para>Examples of suitable formats for Transparent copies include plain
|
||||
ASCII without markup, Texinfo input format, LaTeX input format, SGML or
|
||||
XML using a publicly available DTD, and standard-conforming simple HTML
|
||||
designed for human modification. Opaque formats include PostScript, PDF,
|
||||
proprietary formats that can be read and edited only by proprietary word
|
||||
processors, SGML or XML for which the DTD and/or processing tools are not
|
||||
generally available, and the machine-generated HTML produced by some word
|
||||
processors for output purposes only.</para>
|
||||
|
||||
<para>The "Title Page" means, for a printed book, the title page itself,
|
||||
plus such following pages as are needed to hold, legibly, the material
|
||||
this License requires to appear in the title page. For works in formats
|
||||
which do not have any title page as such, "Title Page" means the text
|
||||
near the most prominent appearance of the work's title, preceding the
|
||||
beginning of the body of the text.</para>
|
||||
</section>
|
||||
|
||||
<section label="2" id="gfdl-2">
|
||||
<title>VERBATIM COPYING</title>
|
||||
|
||||
<para>You may copy and distribute the Document in any medium, either
|
||||
commercially or noncommercially, provided that this License, the
|
||||
copyright notices, and the license notice saying this License applies to
|
||||
the Document are reproduced in all copies, and that you add no other
|
||||
conditions whatsoever to those of this License. You may not use technical
|
||||
measures to obstruct or control the reading or further copying of the
|
||||
copies you make or distribute. However, you may accept compensation in
|
||||
exchange for copies. If you distribute a large enough number of copies
|
||||
you must also follow the conditions in section 3.</para>
|
||||
|
||||
<para>You may also lend copies, under the same conditions stated above,
|
||||
and you may publicly display copies.</para>
|
||||
</section>
|
||||
|
||||
<section label="3" id="gfdl-3">
|
||||
<title>COPYING IN QUANTITY</title>
|
||||
|
||||
<para>If you publish printed copies of the Document numbering more than
|
||||
100, and the Document's license notice requires Cover Texts, you must
|
||||
enclose the copies in covers that carry, clearly and legibly, all these
|
||||
Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts
|
||||
on the back cover. Both covers must also clearly and legibly identify you
|
||||
as the publisher of these copies. The front cover must present the full
|
||||
title with all words of the title equally prominent and visible. You may
|
||||
add other material on the covers in addition. Copying with changes
|
||||
limited to the covers, as long as they preserve the title of the Document
|
||||
and satisfy these conditions, can be treated as verbatim copying in other
|
||||
respects.</para>
|
||||
|
||||
<para>If the required texts for either cover are too voluminous to fit
|
||||
legibly, you should put the first ones listed (as many as fit reasonably)
|
||||
on the actual cover, and continue the rest onto adjacent pages.</para>
|
||||
|
||||
<para>If you publish or distribute Opaque copies of the Document
|
||||
numbering more than 100, you must either include a machine-readable
|
||||
Transparent copy along with each Opaque copy, or state in or with each
|
||||
Opaque copy a publicly-accessible computer-network location containing a
|
||||
complete Transparent copy of the Document, free of added material, which
|
||||
the general network-using public has access to download anonymously at no
|
||||
charge using public-standard network protocols. If you use the latter
|
||||
option, you must take reasonably prudent steps, when you begin
|
||||
distribution of Opaque copies in quantity, to ensure that this
|
||||
Transparent copy will remain thus accessible at the stated location until
|
||||
at least one year after the last time you distribute an Opaque copy
|
||||
(directly or through your agents or retailers) of that edition to the
|
||||
public.</para>
|
||||
|
||||
<para>It is requested, but not required, that you contact the authors of
|
||||
the Document well before redistributing any large number of copies, to
|
||||
give them a chance to provide you with an updated version of the
|
||||
Document.</para>
|
||||
</section>
|
||||
|
||||
<section label="4" id="gfdl-4">
|
||||
<title>MODIFICATIONS</title>
|
||||
|
||||
<para>You may copy and distribute a Modified Version of the Document
|
||||
under the conditions of sections 2 and 3 above, provided that you release
|
||||
the Modified Version under precisely this License, with the Modified
|
||||
Version filling the role of the Document, thus licensing distribution and
|
||||
modification of the Modified Version to whoever possesses a copy of it.
|
||||
In addition, you must do these things in the Modified Version:</para>
|
||||
|
||||
<orderedlist numeration="upperalpha">
|
||||
<listitem>
|
||||
<para>Use in the Title Page (and on the covers, if any) a title
|
||||
distinct from that of the Document, and from those of previous
|
||||
versions (which should, if there were any, be listed in the History
|
||||
section of the Document). You may use the same title as a previous
|
||||
version if the original publisher of that version gives
|
||||
permission.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>List on the Title Page, as authors, one or more persons or
|
||||
entities responsible for authorship of the modifications in the
|
||||
Modified Version, together with at least five of the principal
|
||||
authors of the Document (all of its principal authors, if it has less
|
||||
than five).</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>State on the Title page the name of the publisher of the
|
||||
Modified Version, as the publisher.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Preserve all the copyright notices of the Document.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Add an appropriate copyright notice for your modifications
|
||||
adjacent to the other copyright notices.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Include, immediately after the copyright notices, a license
|
||||
notice giving the public permission to use the Modified Version under
|
||||
the terms of this License, in the form shown in the Addendum
|
||||
below.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Preserve in that license notice the full lists of Invariant
|
||||
Sections and required Cover Texts given in the Document's license
|
||||
notice.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Include an unaltered copy of this License.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Preserve the section entitled "History", and its title, and add
|
||||
to it an item stating at least the title, year, new authors, and
|
||||
publisher of the Modified Version as given on the Title Page. If
|
||||
there is no section entitled "History" in the Document, create one
|
||||
stating the title, year, authors, and publisher of the Document as
|
||||
given on its Title Page, then add an item describing the Modified
|
||||
Version as stated in the previous sentence.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Preserve the network location, if any, given in the Document
|
||||
for public access to a Transparent copy of the Document, and likewise
|
||||
the network locations given in the Document for previous versions it
|
||||
was based on. These may be placed in the "History" section. You may
|
||||
omit a network location for a work that was published at least four
|
||||
years before the Document itself, or if the original publisher of the
|
||||
version it refers to gives permission.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>In any section entitled "Acknowledgements" or "Dedications",
|
||||
preserve the section's title, and preserve in the section all the
|
||||
substance and tone of each of the contributor acknowledgements and/or
|
||||
dedications given therein.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Preserve all the Invariant Sections of the Document, unaltered
|
||||
in their text and in their titles. Section numbers or the equivalent
|
||||
are not considered part of the section titles.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Delete any section entitled "Endorsements". Such a section may
|
||||
not be included in the Modified Version.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Do not retitle any existing section as "Endorsements" or to
|
||||
conflict in title with any Invariant Section.</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
|
||||
<para>If the Modified Version includes new front-matter sections or
|
||||
appendices that qualify as Secondary Sections and contain no material
|
||||
copied from the Document, you may at your option designate some or all of
|
||||
these sections as invariant. To do this, add their titles to the list of
|
||||
Invariant Sections in the Modified Version's license notice. These titles
|
||||
must be distinct from any other section titles.</para>
|
||||
|
||||
<para>You may add a section entitled "Endorsements", provided it contains
|
||||
nothing but endorsements of your Modified Version by various parties--for
|
||||
example, statements of peer review or that the text has been approved by
|
||||
an organization as the authoritative definition of a standard.</para>
|
||||
|
||||
<para>You may add a passage of up to five words as a Front-Cover Text,
|
||||
and a passage of up to 25 words as a Back-Cover Text, to the end of the
|
||||
list of Cover Texts in the Modified Version. Only one passage of
|
||||
Front-Cover Text and one of Back-Cover Text may be added by (or through
|
||||
arrangements made by) any one entity. If the Document already includes a
|
||||
cover text for the same cover, previously added by you or by arrangement
|
||||
made by the same entity you are acting on behalf of, you may not add
|
||||
another; but you may replace the old one, on explicit permission from the
|
||||
previous publisher that added the old one.</para>
|
||||
|
||||
<para>The author(s) and publisher(s) of the Document do not by this
|
||||
License give permission to use their names for publicity for or to assert
|
||||
or imply endorsement of any Modified Version.</para>
|
||||
</section>
|
||||
|
||||
<section label="5" id="gfdl-5">
|
||||
<title>COMBINING DOCUMENTS</title>
|
||||
|
||||
<para>You may combine the Document with other documents released under
|
||||
this License, under the terms defined in section 4 above for modified
|
||||
versions, provided that you include in the combination all of the
|
||||
Invariant Sections of all of the original documents, unmodified, and list
|
||||
them all as Invariant Sections of your combined work in its license
|
||||
notice.</para>
|
||||
|
||||
<para>The combined work need only contain one copy of this License, and
|
||||
multiple identical Invariant Sections may be replaced with a single copy.
|
||||
If there are multiple Invariant Sections with the same name but different
|
||||
contents, make the title of each such section unique by adding at the end
|
||||
of it, in parentheses, the name of the original author or publisher of
|
||||
that section if known, or else a unique number. Make the same adjustment
|
||||
to the section titles in the list of Invariant Sections in the license
|
||||
notice of the combined work.</para>
|
||||
|
||||
<para>In the combination, you must combine any sections entitled
|
||||
"History" in the various original documents, forming one section entitled
|
||||
"History"; likewise combine any sections entitled "Acknowledgements", and
|
||||
any sections entitled "Dedications". You must delete all sections
|
||||
entitled "Endorsements."</para>
|
||||
</section>
|
||||
|
||||
<section label="6" id="gfdl-6">
|
||||
<title>COLLECTIONS OF DOCUMENTS</title>
|
||||
|
||||
<para>You may make a collection consisting of the Document and other
|
||||
documents released under this License, and replace the individual copies
|
||||
of this License in the various documents with a single copy that is
|
||||
included in the collection, provided that you follow the rules of this
|
||||
License for verbatim copying of each of the documents in all other
|
||||
respects.</para>
|
||||
|
||||
<para>You may extract a single document from such a collection, and
|
||||
distribute it individually under this License, provided you insert a copy
|
||||
of this License into the extracted document, and follow this License in
|
||||
all other respects regarding verbatim copying of that document.</para>
|
||||
</section>
|
||||
|
||||
<section label="7" id="gfdl-7">
|
||||
<title>AGGREGATION WITH INDEPENDENT WORKS</title>
|
||||
|
||||
<para>A compilation of the Document or its derivatives with other
|
||||
separate and independent documents or works, in or on a volume of a
|
||||
storage or distribution medium, does not as a whole count as a Modified
|
||||
Version of the Document, provided no compilation copyright is claimed for
|
||||
the compilation. Such a compilation is called an "aggregate", and this
|
||||
License does not apply to the other self-contained works thus compiled
|
||||
with the Document, on account of their being thus compiled, if they are
|
||||
not themselves derivative works of the Document.</para>
|
||||
|
||||
<para>If the Cover Text requirement of section 3 is applicable to these
|
||||
copies of the Document, then if the Document is less than one quarter of
|
||||
the entire aggregate, the Document's Cover Texts may be placed on covers
|
||||
that surround only the Document within the aggregate. Otherwise they must
|
||||
appear on covers around the whole aggregate.</para>
|
||||
</section>
|
||||
|
||||
<section label="8" id="gfdl-8">
|
||||
<title>TRANSLATION</title>
|
||||
|
||||
<para>Translation is considered a kind of modification, so you may
|
||||
distribute translations of the Document under the terms of section 4.
|
||||
Replacing Invariant Sections with translations requires special
|
||||
permission from their copyright holders, but you may include translations
|
||||
of some or all Invariant Sections in addition to the original versions of
|
||||
these Invariant Sections. You may include a translation of this License
|
||||
provided that you also include the original English version of this
|
||||
License. In case of a disagreement between the translation and the
|
||||
original English version of this License, the original English version
|
||||
will prevail.</para>
|
||||
</section>
|
||||
|
||||
<section label="9" id="gfdl-9">
|
||||
<title>TERMINATION</title>
|
||||
|
||||
<para>You may not copy, modify, sublicense, or distribute the Document
|
||||
except as expressly provided for under this License. Any other attempt to
|
||||
copy, modify, sublicense or distribute the Document is void, and will
|
||||
automatically terminate your rights under this License. However, parties
|
||||
who have received copies, or rights, from you under this License will not
|
||||
have their licenses terminated so long as such parties remain in full
|
||||
compliance.</para>
|
||||
</section>
|
||||
|
||||
<section label="10" id="gfdl-10">
|
||||
<title>FUTURE REVISIONS OF THIS LICENSE</title>
|
||||
|
||||
<para>The Free Software Foundation may publish new, revised versions of
|
||||
the GNU Free Documentation License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in
|
||||
detail to address new problems or concerns. See
|
||||
<ulink url="http://www.gnu.org/copyleft/">
|
||||
http://www.gnu.org/copyleft/</ulink>
|
||||
|
||||
.</para>
|
||||
|
||||
<para>Each version of the License is given a distinguishing version
|
||||
number. If the Document specifies that a particular numbered version of
|
||||
this License "or any later version" applies to it, you have the option of
|
||||
following the terms and conditions either of that specified version or of
|
||||
any later version that has been published (not as a draft) by the Free
|
||||
Software Foundation. If the Document does not specify a version number of
|
||||
this License, you may choose any version ever published (not as a draft)
|
||||
by the Free Software Foundation.</para>
|
||||
</section>
|
||||
|
||||
<section label="" id="gfdl-howto">
|
||||
<title>How to use this License for your documents</title>
|
||||
|
||||
<para>To use this License in a document you have written, include a copy
|
||||
of the License in the document and put the following copyright and
|
||||
license notices just after the title page:</para>
|
||||
|
||||
<blockquote>
|
||||
<para>Copyright (c) YEAR YOUR NAME. Permission is granted to copy,
|
||||
distribute and/or modify this document under the terms of the GNU Free
|
||||
Documentation License, Version 1.1 or any later version published by
|
||||
the Free Software Foundation; with the Invariant Sections being LIST
|
||||
THEIR TITLES, with the Front-Cover Texts being LIST, and with the
|
||||
Back-Cover Texts being LIST. A copy of the license is included in the
|
||||
section entitled "GNU Free Documentation License".</para>
|
||||
</blockquote>
|
||||
|
||||
<para>If you have no Invariant Sections, write "with no Invariant
|
||||
Sections" instead of saying which ones are invariant. If you have no
|
||||
Front-Cover Texts, write "no Front-Cover Texts" instead of "Front-Cover
|
||||
Texts being LIST"; likewise for Back-Cover Texts.</para>
|
||||
|
||||
<para>If your document contains nontrivial examples of program code, we
|
||||
recommend releasing these examples in parallel under your choice of free
|
||||
software license, such as the GNU General Public License, to permit their
|
||||
use in free software.</para>
|
||||
</section>
|
||||
</appendix>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-auto-insert-required-elements:t
|
||||
sgml-balanced-tag-edit:t
|
||||
sgml-exposed-tags:nil
|
||||
sgml-general-insert-case:lower
|
||||
sgml-indent-data:t
|
||||
sgml-indent-step:2
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-namecase-general:t
|
||||
sgml-omittag:t
|
||||
sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter")
|
||||
sgml-shorttag:t
|
||||
sgml-tag-region-if-active:t
|
||||
End:
|
||||
-->
|
||||
|
||||
@@ -1,456 +0,0 @@
|
||||
<!-- <!DOCTYPE glossary PUBLIC "-//OASIS//DTD DocBook V4.1//EN" > -->
|
||||
<glossary id="glossary">
|
||||
<glossdiv>
|
||||
<title>0-9, high ascii</title>
|
||||
|
||||
<glossentry>
|
||||
<glossterm>.htaccess</glossterm>
|
||||
|
||||
<glossdef>
|
||||
<para>Apache web server, and other NCSA-compliant web servers,
|
||||
observe the convention of using files in directories called
|
||||
<filename>.htaccess</filename>
|
||||
|
||||
to restrict access to certain files. In Bugzilla, they are used
|
||||
to keep secret files which would otherwise
|
||||
compromise your installation - e.g. the
|
||||
<filename>localconfig</filename>
|
||||
file contains the password to your database.
|
||||
curious.</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
</glossdiv>
|
||||
|
||||
<glossdiv id="gloss-a">
|
||||
<title>A</title>
|
||||
|
||||
<glossentry>
|
||||
<glossterm>Apache</glossterm>
|
||||
|
||||
<glossdef>
|
||||
<para>In this context, Apache is the web server most commonly used
|
||||
for serving up
|
||||
<glossterm>Bugzilla</glossterm>
|
||||
|
||||
pages. Contrary to popular belief, the apache web server has nothing
|
||||
to do with the ancient and noble Native American tribe, but instead
|
||||
derived its name from the fact that it was
|
||||
<quote>a patchy</quote>
|
||||
|
||||
version of the original
|
||||
<acronym>NCSA</acronym>
|
||||
|
||||
world-wide-web server.</para>
|
||||
|
||||
<variablelist>
|
||||
<title>Useful Directives when configuring Bugzilla</title>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput><ulink url="http://httpd.apache.org/docs-2.0/mod/core.html#addhandler">AddHandler</ulink></computeroutput></term>
|
||||
<listitem>
|
||||
<para>Tell Apache that it's OK to run CGI scripts.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><computeroutput><ulink url="http://httpd.apache.org/docs-2.0/mod/core.html#allowoverride">AllowOverride</ulink></computeroutput></term>
|
||||
<term><computeroutput><ulink url="http://httpd.apache.org/docs-2.0/mod/core.html#options">Options</ulink></computeroutput></term>
|
||||
<listitem>
|
||||
<para>These directives are used to tell Apache many things about
|
||||
the directory they apply to. For Bugzilla's purposes, we need
|
||||
them to allow script execution and <filename>.htaccess</filename>
|
||||
overrides.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><computeroutput><ulink url="http://httpd.apache.org/docs-2.0/mod/mod_dir.html#directoryindex">DirectoryIndex</ulink></computeroutput></term>
|
||||
<listitem>
|
||||
<para>Used to tell Apache what files are indexes. If you can
|
||||
not add <filename>index.cgi</filename> to the list of valid files,
|
||||
you'll need to set <computeroutput>$index_html</computeroutput> to
|
||||
1 in <filename>localconfig</filename> so
|
||||
<command>./checksetup.pl</command> will create an
|
||||
<filename>index.html</filename> that redirects to
|
||||
<filename>index.cgi</filename>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><computeroutput><ulink url="http://httpd.apache.org/docs-2.0/mod/core.html#scriptinterpretersource">ScriptInterpreterSource</ulink></computeroutput></term>
|
||||
<listitem>
|
||||
<para>Used when running Apache on windows so the shebang line
|
||||
doesn't have to be changed in every Bugzilla script.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
</glossdiv>
|
||||
|
||||
<glossdiv id="gloss-b">
|
||||
<title>B</title>
|
||||
|
||||
<glossentry>
|
||||
<glossterm>Bug</glossterm>
|
||||
|
||||
<glossdef>
|
||||
<para>A
|
||||
<quote>bug</quote>
|
||||
|
||||
in Bugzilla refers to an issue entered into the database which has an
|
||||
associated number, assignments, comments, etc. Some also refer to a
|
||||
<quote>tickets</quote>
|
||||
or
|
||||
<quote>issues</quote>;
|
||||
in the context of Bugzilla, they are synonymous.</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry>
|
||||
<glossterm>Bug Number</glossterm>
|
||||
|
||||
<glossdef>
|
||||
<para>Each Bugzilla bug is assigned a number that uniquely identifies
|
||||
that bug. The bug associated with a bug number can be pulled up via a
|
||||
query, or easily from the very front page by typing the number in the
|
||||
"Find" box.</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="gloss-bugzilla">
|
||||
<glossterm>Bugzilla</glossterm>
|
||||
|
||||
<glossdef>
|
||||
<para>Bugzilla is the world-leading free software bug tracking system.
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
</glossdiv>
|
||||
|
||||
<glossdiv id="gloss-c">
|
||||
<title>C</title>
|
||||
|
||||
<glossentry id="gloss-cgi">
|
||||
<glossterm>Common Gateway Interface</glossterm>
|
||||
<acronym>CGI</acronym>
|
||||
<glossdef>
|
||||
<para><acronym>CGI</acronym> is an acronym for Common Gateway Interface.
|
||||
This is a standard for interfacing an external application with a web
|
||||
server. Bugzilla is an example of a <acronym>CGI</acronym> application.
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
|
||||
<glossentry id="gloss-component">
|
||||
<glossterm>Component</glossterm>
|
||||
|
||||
<glossdef>
|
||||
<para>A Component is a subsection of a Product. It should be a narrow
|
||||
category, tailored to your organization. All Products must contain at
|
||||
least one Component (and, as a matter of fact, creating a Product
|
||||
with no Components will create an error in Bugzilla).</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="gloss-cpan">
|
||||
<glossterm>
|
||||
<acronym>CPAN</acronym>
|
||||
</glossterm>
|
||||
|
||||
<glossdef>
|
||||
<para>
|
||||
<acronym>CPAN</acronym>
|
||||
|
||||
stands for the
|
||||
<quote>Comprehensive Perl Archive Network</quote>.
|
||||
CPAN maintains a large number of extremely useful
|
||||
<glossterm>Perl</glossterm>
|
||||
modules - encapsulated chunks of code for performing a
|
||||
particular task.</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
</glossdiv>
|
||||
|
||||
<glossdiv id="gloss-d">
|
||||
<title>D</title>
|
||||
|
||||
<glossentry>
|
||||
<glossterm>daemon</glossterm>
|
||||
|
||||
<glossdef>
|
||||
<para>A daemon is a computer program which runs in the background. In
|
||||
general, most daemons are started at boot time via System V init
|
||||
scripts, or through RC scripts on BSD-based systems.
|
||||
<glossterm>mysqld</glossterm>,
|
||||
the MySQL server, and
|
||||
<glossterm>apache</glossterm>,
|
||||
a web server, are generally run as daemons.</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
</glossdiv>
|
||||
|
||||
<glossdiv id="gloss-g">
|
||||
<title>G</title>
|
||||
|
||||
<glossentry>
|
||||
<glossterm>Groups</glossterm>
|
||||
|
||||
<glossdef>
|
||||
<para>The word
|
||||
<quote>Groups</quote>
|
||||
|
||||
has a very special meaning to Bugzilla. Bugzilla's main security
|
||||
mechanism comes by placing users in groups, and assigning those
|
||||
groups certain privileges to view bugs in particular
|
||||
<glossterm>Products</glossterm>
|
||||
in the
|
||||
<glossterm>Bugzilla</glossterm>
|
||||
database.</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
</glossdiv>
|
||||
|
||||
<glossdiv id="gloss-m">
|
||||
<title>M</title>
|
||||
|
||||
<glossentry id="gloss-mta">
|
||||
<glossterm>Message Transport Agent</glossterm>
|
||||
<acronym>MTA</acronym>
|
||||
|
||||
<glossdef>
|
||||
<para>A Message Transport Agent is used to control the flow of email
|
||||
on a system. Many unix based systems use
|
||||
<ulink url="http://www.sendmail.org">sendmail</ulink> which is what
|
||||
Bugzilla expects to find by default at <filename>/usr/sbin/sendmail</filename>.
|
||||
Many other MTA's will work, but they all require that the
|
||||
<option>sendmailnow</option> param be set to <literal>on</literal>.
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="gloss-mysql">
|
||||
<glossterm>MySQL</glossterm>
|
||||
|
||||
<glossdef>
|
||||
<para>MySQL is currently the required
|
||||
<glossterm linkend="gloss-rdbms">RDBMS</glossterm> for Bugzilla. MySQL
|
||||
can be downloaded from <ulink url="http://www.mysql.com"/>. While you
|
||||
should familiarize yourself with all of the documentation, some high
|
||||
points are:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para><ulink url="http://www.mysql.com/doc/P/r/Privilege_system.html">MySQL
|
||||
Privilege System</ulink> - Much more detailed information about
|
||||
the suggestions in <xref linkend="security-mysql"/>.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
</glossdiv>
|
||||
|
||||
<glossdiv id="gloss-p">
|
||||
<title>P</title>
|
||||
|
||||
<glossentry>
|
||||
<glossterm id="gloss-product">Product</glossterm>
|
||||
|
||||
<glossdef>
|
||||
<para>A Product is a broad category of types of bugs, normally
|
||||
representing a single piece of software or entity. In general,
|
||||
there are several Components to a Product. A Product may define a
|
||||
group (used for security) for all bugs entered into
|
||||
its Components.</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry>
|
||||
<glossterm>Perl</glossterm>
|
||||
|
||||
<glossdef>
|
||||
<para>First written by Larry Wall, Perl is a remarkable program
|
||||
language. It has the benefits of the flexibility of an interpreted
|
||||
scripting language (such as shell script), combined with the speed
|
||||
and power of a compiled language, such as C.
|
||||
<glossterm>Bugzilla</glossterm>
|
||||
|
||||
is maintained in Perl.</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
</glossdiv>
|
||||
|
||||
<glossdiv id="gloss-q">
|
||||
<title>Q</title>
|
||||
|
||||
<glossentry>
|
||||
<glossterm>QA</glossterm>
|
||||
|
||||
<glossdef>
|
||||
<para>
|
||||
<quote>QA</quote>,
|
||||
<quote>Q/A</quote>, and
|
||||
<quote>Q.A.</quote>
|
||||
are short for
|
||||
<quote>Quality Assurance</quote>.
|
||||
In most large software development organizations, there is a team
|
||||
devoted to ensuring the product meets minimum standards before
|
||||
shipping. This team will also generally want to track the progress of
|
||||
bugs over their life cycle, thus the need for the
|
||||
<quote>QA Contact</quote>
|
||||
|
||||
field in a bug.</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
</glossdiv>
|
||||
|
||||
<glossdiv id="gloss-r">
|
||||
<title>R</title>
|
||||
|
||||
<glossentry id="gloss-rdbms">
|
||||
<glossterm>Relational DataBase Managment System</glossterm>
|
||||
<acronym>RDBMS</acronym>
|
||||
|
||||
<glossdef>
|
||||
<para>A relational database management system is a database system
|
||||
that stores information in tables that are related to each other.
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
</glossdiv>
|
||||
|
||||
<glossdiv id="gloss-s">
|
||||
<title>S</title>
|
||||
|
||||
<glossentry>
|
||||
<glossterm>
|
||||
<acronym>SGML</acronym>
|
||||
</glossterm>
|
||||
|
||||
<glossdef>
|
||||
<para>
|
||||
<acronym>SGML</acronym>
|
||||
|
||||
stands for
|
||||
<quote>Standard Generalized Markup Language</quote>.
|
||||
Created in the 1980's to provide an extensible means to maintain
|
||||
documentation based upon content instead of presentation,
|
||||
<acronym>SGML</acronym>
|
||||
|
||||
has withstood the test of time as a robust, powerful language.
|
||||
<glossterm>
|
||||
<acronym>XML</acronym>
|
||||
</glossterm>
|
||||
|
||||
is the
|
||||
<quote>baby brother</quote>
|
||||
|
||||
of SGML; any valid
|
||||
<acronym>XML</acronym>
|
||||
|
||||
document it, by definition, a valid
|
||||
<acronym>SGML</acronym>
|
||||
|
||||
document. The document you are reading is written and maintained in
|
||||
<acronym>SGML</acronym>,
|
||||
and is also valid
|
||||
<acronym>XML</acronym>
|
||||
|
||||
if you modify the Document Type Definition.</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
</glossdiv>
|
||||
|
||||
<glossdiv id="gloss-t">
|
||||
<title>T</title>
|
||||
|
||||
<glossentry id="gloss-target-milestone" xreflabel="Target Milestone">
|
||||
<glossterm>Target Milestone</glossterm>
|
||||
|
||||
<glossdef>
|
||||
<para>Target Milestones are Product goals. They are configurable on a
|
||||
per-Product basis. Most software development houses have a concept of
|
||||
|
||||
<quote>milestones</quote>
|
||||
|
||||
where the people funding a project expect certain functionality on
|
||||
certain dates. Bugzilla facilitates meeting these milestones by
|
||||
giving you the ability to declare by which milestone a bug will be
|
||||
fixed, or an enhancement will be implemented.</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry id="gloss-tcl">
|
||||
<glossterm>Tool Command Language</glossterm>
|
||||
<acronym>TCL</acronym>
|
||||
<glossdef>
|
||||
<para>TCL is an open source scripting language available for Windows,
|
||||
Macintosh, and Unix based systems. Bugzilla 1.0 was written in TCL but
|
||||
never released. The first release of Bugzilla was 2.0, which was when
|
||||
it was ported to perl.
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
</glossdiv>
|
||||
|
||||
<glossdiv id="gloss-z">
|
||||
<title>Z</title>
|
||||
|
||||
<glossentry id="gloss-zarro">
|
||||
<glossterm>Zarro Boogs Found</glossterm>
|
||||
|
||||
<glossdef>
|
||||
<para>This is just a goofy way of saying that there were no bugs
|
||||
found matching your query. When asked to explain this message,
|
||||
Terry had the following to say:
|
||||
</para>
|
||||
|
||||
<blockquote>
|
||||
<attribution>Terry Weissman</attribution>
|
||||
<para>I've been asked to explain this ... way back when, when
|
||||
Netscape released version 4.0 of its browser, we had a release
|
||||
party. Naturally, there had been a big push to try and fix every
|
||||
known bug before the release. Naturally, that hadn't actually
|
||||
happened. (This is not unique to Netscape or to 4.0; the same thing
|
||||
has happened with every software project I've ever seen.) Anyway,
|
||||
at the release party, T-shirts were handed out that said something
|
||||
like "Netscape 4.0: Zarro Boogs". Just like the software, the
|
||||
T-shirt had no known bugs. Uh-huh.
|
||||
</para>
|
||||
|
||||
<para>So, when you query for a list of bugs, and it gets no results,
|
||||
you can think of this as a friendly reminder. Of *course* there are
|
||||
bugs matching your query, they just aren't in the bugsystem yet...
|
||||
</para>
|
||||
</blockquote>
|
||||
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
</glossdiv>
|
||||
</glossary>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-auto-insert-required-elements:t
|
||||
sgml-balanced-tag-edit:t
|
||||
sgml-exposed-tags:nil
|
||||
sgml-general-insert-case:lower
|
||||
sgml-indent-data:t
|
||||
sgml-indent-step:2
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-namecase-general:t
|
||||
sgml-omittag:t
|
||||
sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter")
|
||||
sgml-shorttag:t
|
||||
sgml-tag-region-if-active:t
|
||||
End:
|
||||
-->
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-auto-insert-required-elements:t
|
||||
sgml-balanced-tag-edit:t
|
||||
sgml-exposed-tags:nil
|
||||
sgml-general-insert-case:lower
|
||||
sgml-indent-data:t
|
||||
sgml-indent-step:2
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-namecase-general:t
|
||||
sgml-omittag:t
|
||||
sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter")
|
||||
sgml-shorttag:t
|
||||
sgml-tag-region-if-active:t
|
||||
End:
|
||||
-->
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
<!-- <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook V4.1//EN" > -->
|
||||
<!-- Keep these tools listings in alphabetical order please. -MPB -->
|
||||
<section id="integration">
|
||||
<title>Integrating Bugzilla with Third-Party Tools</title>
|
||||
|
||||
<section id="bonsai"
|
||||
xreflabel="Bonsai, the Mozilla automated CVS management system">
|
||||
<title>Bonsai</title>
|
||||
|
||||
<para>Bonsai is a web-based tool for managing
|
||||
<xref linkend="cvs" />
|
||||
|
||||
. Using Bonsai, administrators can control open/closed status of trees,
|
||||
query a fast relational database back-end for change, branch, and comment
|
||||
information, and view changes made since the last time the tree was
|
||||
closed. Bonsai
|
||||
also integrates with
|
||||
<xref linkend="tinderbox" />.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="cvs" xreflabel="CVS, the Concurrent Versioning System">
|
||||
<title>CVS</title>
|
||||
|
||||
<para>CVS integration is best accomplished, at this point, using the
|
||||
Bugzilla Email Gateway.</para>
|
||||
|
||||
<para>Follow the instructions in this Guide for enabling Bugzilla e-mail
|
||||
integration. Ensure that your check-in script sends an email to your
|
||||
Bugzilla e-mail gateway with the subject of
|
||||
<quote>[Bug XXXX]</quote>,
|
||||
and you can have CVS check-in comments append to your Bugzilla bug. If
|
||||
you want to have the bug be closed automatically, you'll have to modify
|
||||
the <filename>contrib/bugzilla_email_append.pl</filename> script.
|
||||
</para>
|
||||
|
||||
<para>There is also a CVSZilla project, based upon somewhat dated
|
||||
Bugzilla code, to integrate CVS and Bugzilla through CVS' ability to
|
||||
email. Check it out at:
|
||||
<ulink url="http://homepages.kcbbs.gen.nz/~tonyg/">
|
||||
http://homepages.kcbbs.gen.nz/~tonyg/</ulink>.
|
||||
</para>
|
||||
|
||||
<para>Another system capable of CVS integration with Bugzilla is
|
||||
Scmbug. This system provides generic integration of Source code
|
||||
Configuration Management with Bugtracking. Check it out at: <ulink
|
||||
url="http://freshmeat.net/projects/scmbug/"/>.
|
||||
</para>
|
||||
|
||||
</section>
|
||||
|
||||
<section id="scm"
|
||||
xreflabel="Perforce SCM (Fast Software Configuration Management System, a powerful commercial alternative to CVS">
|
||||
|
||||
<title>Perforce SCM</title>
|
||||
|
||||
<para>You can find the project page for Bugzilla and Teamtrack Perforce
|
||||
integration (p4dti) at:
|
||||
<ulink url="http://www.ravenbrook.com/project/p4dti/">
|
||||
http://www.ravenbrook.com/project/p4dti</ulink>
|
||||
|
||||
.
|
||||
<quote>p4dti</quote>
|
||||
|
||||
is now an officially supported product from Perforce, and you can find
|
||||
the "Perforce Public Depot" p4dti page at
|
||||
<ulink url="http://public.perforce.com/public/perforce/p4dti/index.html">
|
||||
http://public.perforce.com/public/perforce/p4dti/index.html</ulink>
|
||||
|
||||
.</para>
|
||||
|
||||
<para>Integration of Perforce with Bugzilla, once patches are applied, is
|
||||
seamless. Perforce replication information will appear below the comments
|
||||
of each bug. Be certain you have a matching set of patches for the
|
||||
Bugzilla version you are installing. p4dti is designed to support
|
||||
multiple defect trackers, and maintains its own documentation for it.
|
||||
Please consult the pages linked above for further information.</para>
|
||||
</section>
|
||||
|
||||
<section id="svn"
|
||||
xreflabel="Subversion, a compelling replacement for CVS">
|
||||
<title>Subversion</title>
|
||||
<para>Subversion is a free/open-source version control system,
|
||||
designed to overcome various limitations of CVS. Integration of
|
||||
Subversion with Bugzilla is possible using Scmbug, a system
|
||||
providing generic integration of Source Code Configuration
|
||||
Management with Bugtracking. Scmbug is available at <ulink
|
||||
url="http://freshmeat.net/projects/scmbug/"/>.</para>
|
||||
</section>
|
||||
|
||||
<section id="tinderbox"
|
||||
xreflabel="Tinderbox, the Mozilla automated build management system">
|
||||
<title>Tinderbox/Tinderbox2</title>
|
||||
|
||||
<para>We need Tinderbox integration information.</para>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-auto-insert-required-elements:t
|
||||
sgml-balanced-tag-edit:t
|
||||
sgml-exposed-tags:nil
|
||||
sgml-general-insert-case:lower
|
||||
sgml-indent-data:t
|
||||
sgml-indent-step:2
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-namecase-general:t
|
||||
sgml-omittag:t
|
||||
sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter")
|
||||
sgml-shorttag:t
|
||||
sgml-tag-region-if-active:t
|
||||
End:
|
||||
-->
|
||||
|
||||
@@ -1,149 +0,0 @@
|
||||
<chapter id="introduction">
|
||||
<title>Introduction</title>
|
||||
|
||||
<section id="whatis">
|
||||
<title>What is Bugzilla?</title>
|
||||
|
||||
<para>
|
||||
Bugzilla is a bug- or issue-tracking system. Bug-tracking
|
||||
systems allow individual or groups of developers effectively to keep track
|
||||
of outstanding problems with their product.
|
||||
Bugzilla was originally written by Terry Weissman in a programming language
|
||||
called <glossterm linkend="gloss-tcl">TCL</glossterm>, to
|
||||
replace a rudimentary bug-tracking database used internally by Netscape
|
||||
Communications. Terry later ported Bugzilla to Perl from TCL, and in Perl
|
||||
it remains to this day. Most commercial defect-tracking software vendors
|
||||
at the time charged enormous licensing fees, and Bugzilla quickly became
|
||||
a favorite of the open-source crowd (with its genesis in the open-source
|
||||
browser project, Mozilla). It is now the de-facto standard
|
||||
defect-tracking system against which all others are measured.
|
||||
</para>
|
||||
|
||||
<para>Bugzilla boasts many advanced features. These include:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>Powerful searching</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>User-configurable email notifications of bug changes</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Full change history</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Inter-bug dependency tracking and graphing</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Excellent attachment management</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Integrated, product-based, granular security schema</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Fully security-audited, and runs under Perl's taint mode</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>A robust, stable RDBMS back-end</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Web, XML, email and console interfaces</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Completely customisable and/or localisable web user
|
||||
interface</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Extensive configurability</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Smooth upgrade pathway between versions</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="why">
|
||||
<title>Why Should We Use Bugzilla?</title>
|
||||
|
||||
<para>For many years, defect-tracking software has remained principally
|
||||
the domain of large software development houses. Even then, most shops
|
||||
never bothered with bug-tracking software, and instead simply relied on
|
||||
shared lists and email to monitor the status of defects. This procedure
|
||||
is error-prone and tends to cause those bugs judged least significant by
|
||||
developers to be dropped or ignored.</para>
|
||||
|
||||
<para>These days, many companies are finding that integrated
|
||||
defect-tracking systems reduce downtime, increase productivity, and raise
|
||||
customer satisfaction with their systems. Along with full disclosure, an
|
||||
open bug-tracker allows manufacturers to keep in touch with their clients
|
||||
and resellers, to communicate about problems effectively throughout the
|
||||
data management chain. Many corporations have also discovered that
|
||||
defect-tracking helps reduce costs by providing IT support
|
||||
accountability, telephone support knowledge bases, and a common,
|
||||
well-understood system for accounting for unusual system or software
|
||||
issues.</para>
|
||||
|
||||
<para>But why should
|
||||
<emphasis>you</emphasis>
|
||||
|
||||
use Bugzilla?</para>
|
||||
|
||||
<para>Bugzilla is very adaptable to various situations. Known uses
|
||||
currently include IT support queues, Systems Administration deployment
|
||||
management, chip design and development problem tracking (both
|
||||
pre-and-post fabrication), and software and hardware bug tracking for
|
||||
luminaries such as Redhat, NASA, Linux-Mandrake, and VA Systems.
|
||||
Combined with systems such as
|
||||
<ulink url="http://www.cvshome.org">CVS</ulink>,
|
||||
<ulink url="http://www.mozilla.org/bonsai.html">Bonsai</ulink>, or
|
||||
<ulink url="http://www.perforce.com">Perforce SCM</ulink>, Bugzilla
|
||||
provides a powerful, easy-to-use solution to configuration management and
|
||||
replication problems.</para>
|
||||
|
||||
<para>Bugzilla can dramatically increase the productivity and
|
||||
accountability of individual employees by providing a documented workflow
|
||||
and positive feedback for good performance. How many times do you wake up
|
||||
in the morning, remembering that you were supposed to do
|
||||
<emphasis>something</emphasis>
|
||||
today, but you just can't quite remember? Put it in Bugzilla, and you
|
||||
have a record of it from which you can extrapolate milestones, predict
|
||||
product versions for integration, and follow the discussion trail
|
||||
that led to critical decisions.</para>
|
||||
|
||||
<para>Ultimately, Bugzilla puts the power in your hands to improve your
|
||||
value to your employer or business while providing a usable framework for
|
||||
your natural attention to detail and knowledge store to flourish.</para>
|
||||
</section>
|
||||
</chapter>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-auto-insert-required-elements:t
|
||||
sgml-balanced-tag-edit:t
|
||||
sgml-exposed-tags:nil
|
||||
sgml-general-insert-case:lower
|
||||
sgml-indent-data:t
|
||||
sgml-indent-step:2
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-namecase-general:t
|
||||
sgml-omittag:t
|
||||
sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter")
|
||||
sgml-shorttag:t
|
||||
sgml-tag-region-if-active:t
|
||||
End:
|
||||
-->
|
||||
@@ -1,113 +0,0 @@
|
||||
<!-- <!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook V4.1//EN"> -->
|
||||
<appendix id="patches" xreflabel="Useful Patches and Utilities for Bugzilla">
|
||||
<title>Useful Patches and Utilities for Bugzilla</title>
|
||||
|
||||
<para>Are you looking for a way to put your Bugzilla into overdrive? Catch
|
||||
some of the niftiest tricks here in this section.</para>
|
||||
|
||||
<section id="rewrite" xreflabel="Apache mod_rewrite magic">
|
||||
<title>Apache
|
||||
<filename>mod_rewrite</filename>
|
||||
|
||||
magic</title>
|
||||
|
||||
<para>Apache's
|
||||
<filename>mod_rewrite</filename>
|
||||
|
||||
module lets you do some truly amazing things with URL rewriting. Here are
|
||||
a couple of examples of what you can do.</para>
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>Make it so if someone types
|
||||
<computeroutput>http://www.foo.com/12345</computeroutput>
|
||||
|
||||
, Bugzilla spits back http://www.foo.com/show_bug.cgi?id=12345. Try
|
||||
setting up your VirtualHost section for Bugzilla with a rule like
|
||||
this:</para>
|
||||
|
||||
<programlisting><![CDATA[
|
||||
<VirtualHost 12.34.56.78>
|
||||
RewriteEngine On
|
||||
RewriteRule ^/([0-9]+)$ http://foo.bar.com/show_bug.cgi?id=$1 [L,R]
|
||||
</VirtualHost>
|
||||
]]></programlisting>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>There are many, many more things you can do with mod_rewrite.
|
||||
Please refer to the mod_rewrite documentation at
|
||||
<ulink url="http://www.apache.org">http://www.apache.org</ulink>.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
</section>
|
||||
|
||||
<section id="cmdline">
|
||||
<title>Command-line Bugzilla Queries</title>
|
||||
|
||||
<para>There are a suite of Unix utilities for querying Bugzilla from the
|
||||
command line. They live in the
|
||||
<filename class="directory">contrib/cmdline</filename>
|
||||
directory. However, they
|
||||
have not yet been updated to work with 2.16 (post-templatisation.).
|
||||
There are three files - <filename>query.conf</filename>,
|
||||
<filename>buglist</filename> and <filename>bugs</filename>.</para>
|
||||
|
||||
<para><filename>query.conf</filename>
|
||||
contains the mapping from options to field
|
||||
names and comparison types. Quoted option names are "grepped" for, so it
|
||||
should be easy to edit this file. Comments (#) have no effect; you must
|
||||
make sure these lines do not contain any quoted "option".</para>
|
||||
|
||||
<para><filename>buglist</filename>
|
||||
is a shell script which submits a Bugzilla query and writes
|
||||
the resulting HTML page to stdout. It supports both short options, (such
|
||||
as "-Afoo" or "-Rbar") and long options (such as "--assignedto=foo" or
|
||||
"--reporter=bar"). If the first character of an option is not "-", it is
|
||||
treated as if it were prefixed with "--default=".</para>
|
||||
|
||||
<para>The column list is taken from the COLUMNLIST environment variable.
|
||||
This is equivalent to the "Change Columns" option when you list bugs in
|
||||
buglist.cgi. If you have already used Bugzilla, grep for COLUMNLIST
|
||||
in your cookies file to see your current COLUMNLIST setting.</para>
|
||||
|
||||
<para><filename>bugs</filename> is a simple shell script which calls
|
||||
<filename>buglist</filename> and extracts the
|
||||
bug numbers from the output. Adding the prefix
|
||||
"http://bugzilla.mozilla.org/buglist.cgi?bug_id=" turns the bug list into
|
||||
a working link if any bugs are found. Counting bugs is easy. Pipe the
|
||||
results through
|
||||
<command>sed -e 's/,/ /g' | wc | awk '{printf $2 "\n"}'</command>
|
||||
</para>
|
||||
|
||||
<para>Akkana Peck says she has good results piping
|
||||
<filename>buglist</filename> output through
|
||||
<command>w3m -T text/html -dump</command>
|
||||
</para>
|
||||
|
||||
</section>
|
||||
|
||||
</appendix>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-auto-insert-required-elements:t
|
||||
sgml-balanced-tag-edit:t
|
||||
sgml-exposed-tags:nil
|
||||
sgml-general-insert-case:lower
|
||||
sgml-indent-data:t
|
||||
sgml-indent-step:2
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-namecase-general:t
|
||||
sgml-omittag:t
|
||||
sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter")
|
||||
sgml-shorttag:t
|
||||
sgml-tag-region-if-active:t
|
||||
End:
|
||||
-->
|
||||
|
||||
@@ -1,710 +0,0 @@
|
||||
<!-- <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook V4.1//EN"> -->
|
||||
|
||||
<chapter id="using">
|
||||
<title>Using Bugzilla</title>
|
||||
|
||||
<section id="how">
|
||||
<title>How do I use Bugzilla?</title>
|
||||
|
||||
<para>This section contains information for end-users of Bugzilla. There
|
||||
is a Bugzilla test installation, called
|
||||
<ulink url="http://landfill.bugzilla.org/">Landfill</ulink>, which you are
|
||||
welcome to play with (if it's up). However, not all of the Bugzilla
|
||||
installations there will necessarily have all Bugzilla features enabled,
|
||||
and different installations run different versions, so some things may not
|
||||
quite work as this document describes.</para>
|
||||
|
||||
<section id="myaccount">
|
||||
<title>Create a Bugzilla Account</title>
|
||||
|
||||
<para>If you want to use Bugzilla, first you need to create an account.
|
||||
Consult with the administrator responsible for your installation of
|
||||
Bugzilla for the URL you should use to access it. If you're
|
||||
test-driving Bugzilla, use this URL:
|
||||
<ulink url="&landfillbase;"/>
|
||||
</para>
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>Click the
|
||||
<quote>Open a new Bugzilla account</quote>
|
||||
|
||||
link, enter your email address and, optionally, your name in the
|
||||
spaces provided, then click
|
||||
<quote>Create Account</quote>
|
||||
|
||||
.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Within moments, you should receive an email to the address
|
||||
you provided above, which contains your login name (generally the
|
||||
same as the email address), and a password you can use to access
|
||||
your account. This password is randomly generated, and can be
|
||||
changed to something more memorable.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Click the
|
||||
<quote>Log In</quote>
|
||||
link in the yellow area at the bottom of the page in your browser,
|
||||
enter your email address and password into the spaces provided, and
|
||||
click
|
||||
<quote>Login</quote>.
|
||||
</para>
|
||||
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
|
||||
<para>You are now logged in. Bugzilla uses cookies for authentication
|
||||
so, unless your IP address changes, you should not have to log in
|
||||
again.</para>
|
||||
</section>
|
||||
|
||||
<section id="bug_page">
|
||||
<title>Anatomy of a Bug</title>
|
||||
|
||||
<para>The core of Bugzilla is the screen which displays a particular
|
||||
bug. It's a good place to explain some Bugzilla concepts.
|
||||
<ulink
|
||||
url="&landfillbase;show_bug.cgi?id=1">
|
||||
Bug 1 on Landfill</ulink>
|
||||
|
||||
is a good example. Note that the labels for most fields are hyperlinks;
|
||||
clicking them will take you to context-sensitive help on that
|
||||
particular field. Fields marked * may not be present on every
|
||||
installation of Bugzilla.</para>
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>Product and Component</emphasis>:
|
||||
Bugs are divided up by Product and Component, with a Product
|
||||
having one or more Components in it. For example,
|
||||
bugzilla.mozilla.org's "Bugzilla" Product is composed of several
|
||||
Components:
|
||||
<simplelist>
|
||||
<member>
|
||||
<emphasis>Administration:</emphasis>
|
||||
Administration of a Bugzilla installation.</member>
|
||||
|
||||
<member>
|
||||
<emphasis>Bugzilla-General:</emphasis>
|
||||
Anything that doesn't fit in the other components, or spans
|
||||
multiple components.</member>
|
||||
|
||||
<member>
|
||||
<emphasis>Creating/Changing Bugs:</emphasis>
|
||||
Creating, changing, and viewing bugs.</member>
|
||||
|
||||
<member>
|
||||
<emphasis>Documentation:</emphasis>
|
||||
The Bugzilla documentation, including The Bugzilla Guide.</member>
|
||||
|
||||
<member>
|
||||
<emphasis>Email:</emphasis>
|
||||
Anything to do with email sent by Bugzilla.</member>
|
||||
|
||||
<member>
|
||||
<emphasis>Installation:</emphasis>
|
||||
The installation process of Bugzilla.</member>
|
||||
|
||||
<member>
|
||||
<emphasis>Query/Buglist:</emphasis>
|
||||
Anything to do with searching for bugs and viewing the
|
||||
buglists.</member>
|
||||
|
||||
<member>
|
||||
<emphasis>Reporting/Charting:</emphasis>
|
||||
Getting reports from Bugzilla.</member>
|
||||
|
||||
<member>
|
||||
<emphasis>User Accounts:</emphasis>
|
||||
Anything about managing a user account from the user's perspective.
|
||||
Saved queries, creating accounts, changing passwords, logging in,
|
||||
etc.</member>
|
||||
|
||||
<member>
|
||||
<emphasis>User Interface:</emphasis>
|
||||
General issues having to do with the user interface cosmetics (not
|
||||
functionality) including cosmetic issues, HTML templates,
|
||||
etc.</member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>Status and Resolution:</emphasis>
|
||||
|
||||
These define exactly what state the bug is in - from not even
|
||||
being confirmed as a bug, through to being fixed and the fix
|
||||
confirmed by Quality Assurance. The different possible values for
|
||||
Status and Resolution on your installation should be documented in the
|
||||
context-sensitive help for those items.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>Assigned To:</emphasis>
|
||||
The person responsible for fixing the bug.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>*URL:</emphasis>
|
||||
A URL associated with the bug, if any.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>Summary:</emphasis>
|
||||
A one-sentence summary of the problem.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>*Status Whiteboard:</emphasis>
|
||||
(a.k.a. Whiteboard) A free-form text area for adding short notes
|
||||
and tags to a bug.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>*Keywords:</emphasis>
|
||||
The administrator can define keywords which you can use to tag and
|
||||
categorise bugs - e.g. The Mozilla Project has keywords like crash
|
||||
and regression.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>Platform and OS:</emphasis>
|
||||
These indicate the computing environment where the bug was
|
||||
found.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>Version:</emphasis>
|
||||
The "Version" field is usually used for versions of a product which
|
||||
have been released, and is set to indicate which versions of a
|
||||
Component have the particular problem the bug report is
|
||||
about.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>Priority:</emphasis>
|
||||
The bug assignee uses this field to prioritise his or her bugs.
|
||||
It's a good idea not to change this on other people's bugs.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>Severity:</emphasis>
|
||||
This indicates how severe the problem is - from blocker
|
||||
("application unusable") to trivial ("minor cosmetic issue"). You
|
||||
can also use this field to indicate whether a bug is an enhancement
|
||||
request.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>*Target:</emphasis>
|
||||
(a.k.a. Target Milestone) A future version by which the bug is to
|
||||
be fixed. e.g. The Bugzilla Project's milestones for future
|
||||
Bugzilla versions are 2.18, 2.20, 3.0, etc. Milestones are not
|
||||
restricted to numbers, thought - you can use any text strings, such
|
||||
as dates.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>Reporter:</emphasis>
|
||||
The person who filed the bug.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>CC list:</emphasis>
|
||||
A list of people who get mail when the bug changes.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>Attachments:</emphasis>
|
||||
You can attach files (e.g. testcases or patches) to bugs. If there
|
||||
are any attachments, they are listed in this section.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>*Dependencies:</emphasis>
|
||||
If this bug cannot be fixed unless other bugs are fixed (depends
|
||||
on), or this bug stops other bugs being fixed (blocks), their
|
||||
numbers are recorded here.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>*Votes:</emphasis>
|
||||
Whether this bug has any votes.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<emphasis>Additional Comments:</emphasis>
|
||||
You can add your two cents to the bug discussion here, if you have
|
||||
something worthwhile to say.</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
</section>
|
||||
|
||||
<section id="lifecycle">
|
||||
<title>Life Cycle of a Bug</title>
|
||||
|
||||
<para>
|
||||
The life cycle, also known as work flow, of a bug is currently hardcoded
|
||||
into Bugzilla. <xref linkend="lifecycle-image"/> contains a graphical
|
||||
repsentation of this life cycle. If you wish customize this image for
|
||||
your site, the <ulink url="../images/bzLifecycle.xml">diagram file</ulink>
|
||||
is available in <ulink url="http://www.gnome.org/projects/dia">Dia's</ulink>
|
||||
native XML format.
|
||||
</para>
|
||||
|
||||
<figure id="lifecycle-image">
|
||||
<title>Lifecycle of a Bugzilla Bug</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="../images/bzLifecycle.png" scale="66" />
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
</section>
|
||||
|
||||
|
||||
<section id="query">
|
||||
<title>Searching for Bugs</title>
|
||||
|
||||
<para>The Bugzilla Search page is is the interface where you can find
|
||||
any bug report, comment, or patch currently in the Bugzilla system. You
|
||||
can play with it here:
|
||||
<ulink url="&landfillbase;query.cgi"/>
|
||||
|
||||
.</para>
|
||||
|
||||
<para>The Search page has controls for selecting different possible
|
||||
values for all of the fields in a bug, as described above. Once you've
|
||||
defined a search, you can either run it, or save it as a Remembered
|
||||
Query, which can optionally appear in the footer of your pages.</para>
|
||||
|
||||
<para>Highly advanced querying is done using Boolean Charts, which have
|
||||
their own
|
||||
<ulink
|
||||
url="&landfillbase;booleanchart.html">
|
||||
context-sensitive help</ulink>
|
||||
|
||||
.</para>
|
||||
</section>
|
||||
|
||||
<section id="list">
|
||||
<title>Bug Lists</title>
|
||||
|
||||
<para>If you run a search, a list of matching bugs will be returned.
|
||||
The default search is to return all open bugs on the system - don't try
|
||||
running this search on a Bugzilla installation with a lot of
|
||||
bugs!</para>
|
||||
|
||||
<para>The format of the list is configurable. For example, it can be
|
||||
sorted by clicking the column headings. Other useful features can be
|
||||
accessed using the links at the bottom of the list:
|
||||
<simplelist>
|
||||
<member>
|
||||
<emphasis>Long Format:</emphasis>
|
||||
|
||||
this gives you a large page with a non-editable summary of the fields
|
||||
of each bug.</member>
|
||||
|
||||
<member>
|
||||
<emphasis>Change Columns:</emphasis>
|
||||
|
||||
change the bug attributes which appear in the list.</member>
|
||||
|
||||
<member>
|
||||
<emphasis>Change several bugs at once:</emphasis>
|
||||
|
||||
If your account is sufficiently empowered, you can make the same
|
||||
change to all the bugs in the list - for example, changing their
|
||||
owner.</member>
|
||||
|
||||
<member>
|
||||
<emphasis>Send mail to bug owners:</emphasis>
|
||||
|
||||
Sends mail to the owners of all bugs on the list.</member>
|
||||
|
||||
<member>
|
||||
<emphasis>Edit this query:</emphasis>
|
||||
|
||||
If you didn't get exactly the results you were looking for, you can
|
||||
return to the Query page through this link and make small revisions
|
||||
to the query you just made so you get more accurate results.</member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="bugreports">
|
||||
<title>Filing Bugs</title>
|
||||
|
||||
<para>Years of bug writing experience has been distilled for your
|
||||
reading pleasure into the
|
||||
<ulink
|
||||
url="&landfillbase;bugwritinghelp.html">
|
||||
Bug Writing Guidelines</ulink>.
|
||||
While some of the advice is Mozilla-specific, the basic principles of
|
||||
reporting Reproducible, Specific bugs, isolating the Product you are
|
||||
using, the Version of the Product, the Component which failed, the
|
||||
Hardware Platform, and Operating System you were using at the time of
|
||||
the failure go a long way toward ensuring accurate, responsible fixes
|
||||
for the bug that bit you.</para>
|
||||
|
||||
<para>The procedure for filing a test bug is as follows:</para>
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>Go to
|
||||
<ulink url="&landfillbase;">
|
||||
Landfill</ulink>
|
||||
in your browser and click
|
||||
<ulink
|
||||
url="&landfillbase;enter_bug.cgi">
|
||||
Enter a new bug report</ulink>.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Select a product - any one will do.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Fill in the fields. Bugzilla should have made reasonable
|
||||
guesses, based upon your browser, for the "Platform" and "OS"
|
||||
drop-down boxes. If they are wrong, change them.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Select "Commit" and send in your bug report.</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id="hintsandtips">
|
||||
<title>Hints and Tips</title>
|
||||
|
||||
<para>This section distills some Bugzilla tips and best practices
|
||||
that have been developed.</para>
|
||||
|
||||
<section>
|
||||
<title>Autolinkification</title>
|
||||
<para>Bugzilla comments are plain text - so posting HTML will result
|
||||
in literal HTML tags rather than being interpreted by a browser.
|
||||
However, Bugzilla will automatically make hyperlinks out of certain
|
||||
sorts of text in comments. For example, the text
|
||||
http://www.bugzilla.org will be turned into
|
||||
<ulink url="http://www.bugzilla.org">http://www.bugzilla.org</ulink>.
|
||||
Other strings which get linkified in the obvious manner are:
|
||||
<simplelist>
|
||||
<member>bug 12345</member>
|
||||
<member>bug 23456, comment 53</member>
|
||||
<member>attachment 4321</member>
|
||||
<member>mailto:george@example.com</member>
|
||||
<member>george@example.com</member>
|
||||
<member>ftp://ftp.mozilla.org</member>
|
||||
<member>Most other sorts of URL</member>
|
||||
</simplelist>
|
||||
</para>
|
||||
|
||||
<para>A corollary here is that if you type a bug number in a comment,
|
||||
you should put the word "bug" before it, so it gets autolinkified
|
||||
for the convenience of others.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="quicksearch">
|
||||
<title>Quicksearch</title>
|
||||
|
||||
<para>Quicksearch is a single-text-box query tool which uses
|
||||
metacharacters to indicate what is to be searched. For example, typing
|
||||
"<filename>foo|bar</filename>"
|
||||
into Quicksearch would search for "foo" or "bar" in the
|
||||
summary and status whiteboard of a bug; adding
|
||||
"<filename>:BazProduct</filename>" would
|
||||
search only in that product.
|
||||
</para>
|
||||
|
||||
<para>You'll find the Quicksearch box on Bugzilla's
|
||||
front page, along with a
|
||||
<ulink url="../../quicksearch.html">Help</ulink>
|
||||
link which details how to use it.</para>
|
||||
</section>
|
||||
|
||||
<section id="commenting">
|
||||
<title>Comments</title>
|
||||
|
||||
<para>If you are changing the fields on a bug, only comment if
|
||||
either you have something pertinent to say, or Bugzilla requires it.
|
||||
Otherwise, you may spam people unnecessarily with bug mail.
|
||||
To take an example: a user can set up their account to filter out messages
|
||||
where someone just adds themselves to the CC field of a bug
|
||||
(which happens a lot.) If you come along, add yourself to the CC field,
|
||||
and add a comment saying "Adding self to CC", then that person
|
||||
gets a pointless piece of mail they would otherwise have avoided.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Don't use sigs in comments. Signing your name ("Bill") is acceptable,
|
||||
particularly if you do it out of habit, but full mail/news-style
|
||||
four line ASCII art creations are not.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="attachments">
|
||||
<title>Attachments</title>
|
||||
|
||||
<para>
|
||||
Use attachments, rather than comments, for large chunks of ASCII data,
|
||||
such as trace, debugging output files, or log files. That way, it doesn't
|
||||
bloat the bug for everyone who wants to read it, and cause people to
|
||||
receive fat, useless mails.
|
||||
</para>
|
||||
|
||||
<para>Trim screenshots. There's no need to show the whole screen if
|
||||
you are pointing out a single-pixel problem.
|
||||
</para>
|
||||
|
||||
<para>Don't attach simple test cases (e.g. one HTML file, one
|
||||
CSS file and an image) as a ZIP file. Instead, upload them in
|
||||
reverse order and edit the referring file so that they point to the
|
||||
attached files. This way, the test case works immediately
|
||||
out of the bug.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Filing Bugs</title>
|
||||
|
||||
<para>Try to make sure that everything said in the summary is also
|
||||
said in the first comment. Summaries are often updated and this will
|
||||
ensure your original information is easily accessible.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
You do not need to put "any" or similar strings in the URL field.
|
||||
If there is no specific URL associated with the bug, leave this
|
||||
field blank.
|
||||
</para>
|
||||
|
||||
<para>If you feel a bug you filed was incorrectly marked as a
|
||||
DUPLICATE of another, please question it in your bug, not
|
||||
the bug it was duped to. Feel free to CC the person who duped it
|
||||
if they are not already CCed.
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id="userpreferences">
|
||||
<title>User Preferences</title>
|
||||
|
||||
<para>Once you have logged in, you can customise various aspects of
|
||||
Bugzilla via the "Edit prefs" link in the page footer.
|
||||
The preferences are split into four tabs:</para>
|
||||
|
||||
<section id="accountsettings" xreflabel="Account Settings">
|
||||
<title>Account Settings</title>
|
||||
|
||||
<para>On this tab, you can change your basic account information,
|
||||
including your password, email address and real name. For security
|
||||
reasons, in order to change anything on this page you must type your
|
||||
<emphasis>current</emphasis>
|
||||
password into the
|
||||
<quote>Password</quote>
|
||||
field at the top of the page.
|
||||
If you attempt to change your email address, a confirmation
|
||||
email is sent to both the old and new addresses, with a link to use to
|
||||
confirm the change. This helps to prevent account hijacking.</para>
|
||||
</section>
|
||||
|
||||
<section id="emailsettings">
|
||||
<title>Email Settings</title>
|
||||
|
||||
<para>
|
||||
This tab controls the amount of email Bugzilla sends you.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The first item on this page is marked <quote>Users to watch</quote>.
|
||||
When you enter one or more comma-delineated user accounts (usually email
|
||||
addresses) into the text entry box, you will receive a copy of all the
|
||||
bugmail those users are sent (security settings permitting).
|
||||
This powerful functionality enables seamless transitions as developers
|
||||
change projects or users go on holiday.
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
The ability to watch other users may not be available in all
|
||||
Bugzilla installations. If you don't see this feature, and feel
|
||||
that you need it, speak to your administrator.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<para>
|
||||
The <quote>Field/recipient specific options</quote> table
|
||||
allows you to determine how much mail Bugzilla sends you.
|
||||
The rows of the table
|
||||
define events that can happen to a bug -- things like
|
||||
attachments being added, new comments being made, the
|
||||
priority changing, etc. The columns in the table define
|
||||
your relationship with the bug:
|
||||
</para>
|
||||
|
||||
<itemizedlist spacing="compact">
|
||||
<listitem>
|
||||
<para>
|
||||
Reporter - Where you are the person who initially
|
||||
reported the bug. Your name/account appears in the
|
||||
<quote>Reporter:</quote> field.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Assignee - Where you are the person who has been
|
||||
designated as the one responsible for the bug. Your
|
||||
name/account appears in the <quote>Assigned To:</quote>
|
||||
field of the bug.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
QA Contact - You are one of the designated
|
||||
QA Contacts for the bug. Your account appears in the
|
||||
<quote>QA Contact:</quote> text-box of the bug.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
CC - You are on the list CC List for the bug.
|
||||
Your account appears in the <quote>CC:</quote> text box
|
||||
of the bug.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Voter - You have placed one or more votes for the bug.
|
||||
Your account appears only if someone clicks on the
|
||||
<quote>Show votes for this bug</quote> link on the bug.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
|
||||
<note>
|
||||
<para>
|
||||
Some columns may not be visible for your installation, depending
|
||||
on your site's configuration.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<para>
|
||||
To fine-tune your bugmail, decide the events for which you want
|
||||
to receive bugmail; then decide if you want to receive it all
|
||||
the time (enable the checkbox for every column), or only when
|
||||
you have a certain relationship with a bug (enable the checkbox
|
||||
only for those columns). For example: if you didn't want to
|
||||
receive mail when someone added themselves to the CC list, you
|
||||
could uncheck all the boxes in the <quote>CC Field Changes</quote>
|
||||
line. As another example, if you never wanted to receive email
|
||||
on bugs you reported unless the bug was resolved, you would
|
||||
un-check all boxes in the <quote>Reporter</quote> column
|
||||
except for the one on the <quote>The bug is resolved or
|
||||
verified</quote> row.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If you want to receive the
|
||||
maximum amount of email possible, check every box in every column.
|
||||
if you don't want to receive any email from
|
||||
Bugzilla at all, ensure that every box in this table is un-checked.
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
Your Bugzilla administrator can stop a user from receiving
|
||||
bugmail by adding the user's name to the
|
||||
<filename>data/nomail</filename> file. This is a drastic step
|
||||
best taken only for disabled accounts, as it overrides the
|
||||
the user's individual mail preferences.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
Bugzilla adds the <quote>X-Bugzilla-Reason</quote> header to
|
||||
all bugmail it sends, describing the recipient's relationship
|
||||
(AssignedTo, Reporter, QAContact, CC, or Voter) to the bug.
|
||||
This header can be used to do further client-side filtering.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<para>
|
||||
By default, Bugzilla sends out email regardless of who made the
|
||||
change... even if you were the one responsible for generating
|
||||
the email in the first place. If you don't care to receive bugmail
|
||||
from your own changes, check the box marked <quote>Only email me
|
||||
reports of changes made by other people</quote>.
|
||||
</para>
|
||||
|
||||
</section>
|
||||
|
||||
<section id="footersettings">
|
||||
<title>Page Footer</title>
|
||||
|
||||
<para>On the Search page, you can store queries in Bugzilla, so if you
|
||||
regularly run a particular query it is just a drop-down menu away.
|
||||
Once you have a stored query, you can come
|
||||
here to request that it also be displayed in your page footer.</para>
|
||||
</section>
|
||||
|
||||
<section id="permissionsettings">
|
||||
<title>Permissions</title>
|
||||
|
||||
<para>This is a purely informative page which outlines your current
|
||||
permissions on this installation of Bugzilla - what product groups you
|
||||
are in, and whether you can edit bugs or perform various administration
|
||||
functions.</para>
|
||||
</section>
|
||||
</section>
|
||||
</chapter>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-auto-insert-required-elements:t
|
||||
sgml-balanced-tag-edit:t
|
||||
sgml-exposed-tags:nil
|
||||
sgml-general-insert-case:lower
|
||||
sgml-indent-data:t
|
||||
sgml-indent-step:2
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-namecase-general:t
|
||||
sgml-omittag:t
|
||||
sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter")
|
||||
sgml-shorttag:t
|
||||
sgml-tag-region-if-active:t
|
||||
End:
|
||||
-->
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
<!-- <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook V4.1//EN">-->
|
||||
<appendix id="variants" xreflabel="Bugzilla Variants and Competitors">
|
||||
<title>Bugzilla Variants and Competitors</title>
|
||||
|
||||
<para>I created this section to answer questions about Bugzilla competitors
|
||||
and variants, then found a wonderful site which covers an awful lot of what
|
||||
I wanted to discuss. Rather than quote it in its entirety, I'll simply
|
||||
refer you here:
|
||||
<ulink url="http://linas.org/linux/pm.html">
|
||||
http://linas.org/linux/pm.html</ulink>
|
||||
</para>
|
||||
|
||||
<section id="variant-redhat">
|
||||
<title>Red Hat Bugzilla</title>
|
||||
|
||||
<para>Red Hat's old fork of Bugzilla which was based on version 2.8 is now
|
||||
obsolete. The newest version in use is based on version 2.17.1 and is in
|
||||
the process of being integrated into the main Bugzilla source tree. The
|
||||
back-end is modified to work with PostgreSQL instead of MySQL and they have
|
||||
custom templates to get their desired look and feel, but other than that it
|
||||
is Bugzilla 2.17.1. Dave Lawrence of Red Hat put forth a great deal of
|
||||
effort to make sure that the changes he made could be integrated back into
|
||||
the main tree.
|
||||
<ulink url="http://bugzilla.mozilla.org/show_bug.cgi?id=98304">Bug
|
||||
98304</ulink> exists to track this integration.
|
||||
</para>
|
||||
|
||||
<para>URL:
|
||||
<ulink url="http://bugzilla.redhat.com/bugzilla/">
|
||||
http://bugzilla.redhat.com/bugzilla/</ulink>
|
||||
</para>
|
||||
|
||||
<para>This section last updated 24 Dec 2002</para>
|
||||
</section>
|
||||
|
||||
<section id="variant-fenris">
|
||||
<title>Loki Bugzilla (Fenris)</title>
|
||||
|
||||
<para>Fenris was a fork from Bugzilla made by Loki Games; when
|
||||
Loki went into receivership, it died. While Loki's other code lives on,
|
||||
its custodians recommend Bugzilla for future bug-tracker deployments.
|
||||
</para>
|
||||
|
||||
<para>This section last updated 27 Jul 2002</para>
|
||||
</section>
|
||||
|
||||
<section id="variant-issuezilla">
|
||||
<title>Issuezilla</title>
|
||||
|
||||
<para>Issuezilla was another fork from Bugzilla, made by collab.net and
|
||||
hosted at tigris.org. It is also dead; the primary focus of bug-tracking
|
||||
at tigris.org is their Java-based bug-tracker,
|
||||
<xref linkend="variant-scarab"/>.</para>
|
||||
|
||||
<para>This section last updated 27 Jul 2002</para>
|
||||
</section>
|
||||
|
||||
<section id="variant-scarab">
|
||||
<title>Scarab</title>
|
||||
|
||||
<para>Scarab is a new open source bug-tracking system built using Java
|
||||
Servlet technology. It is currently at version 1.0 beta 13.</para>
|
||||
|
||||
<para>URL:
|
||||
<ulink url="http://scarab.tigris.org/">http://scarab.tigris.org</ulink>
|
||||
</para>
|
||||
|
||||
<para>This section last updated 18 Jan 2003</para>
|
||||
</section>
|
||||
|
||||
<section id="variant-perforce">
|
||||
<title>Perforce SCM</title>
|
||||
|
||||
<para>Although Perforce isn't really a bug tracker, it can be used as
|
||||
such through the <quote>jobs</quote>
|
||||
functionality.</para>
|
||||
|
||||
<para>URL:
|
||||
<ulink url="http://www.perforce.com/perforce/technotes/note052.html">
|
||||
http://www.perforce.com/perforce/technotes/note052.html
|
||||
</ulink>
|
||||
</para>
|
||||
|
||||
<para>This section last updated 27 Jul 2002</para>
|
||||
</section>
|
||||
|
||||
<section id="variant-sourceforge">
|
||||
<title>SourceForge</title>
|
||||
|
||||
<para>SourceForge is a way of coordinating geographically
|
||||
distributed free software and open source projects over the Internet.
|
||||
It has a built-in bug tracker, but it's not highly thought of.</para>
|
||||
|
||||
<para>URL:
|
||||
<ulink url="http://www.sourceforge.net">
|
||||
http://www.sourceforge.net</ulink>
|
||||
</para>
|
||||
|
||||
<para>This section last updated 27 Jul 2002</para>
|
||||
</section>
|
||||
</appendix>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-auto-insert-required-elements:t
|
||||
sgml-balanced-tag-edit:t
|
||||
sgml-exposed-tags:nil
|
||||
sgml-general-insert-case:lower
|
||||
sgml-indent-data:t
|
||||
sgml-indent-step:2
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-namecase-general:t
|
||||
sgml-omittag:t
|
||||
sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter")
|
||||
sgml-shorttag:t
|
||||
sgml-tag-region-if-active:t
|
||||
End:
|
||||
-->
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
#!/usr/bonsaitools/bin/perl -wT
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Terry Weissman <terry@mozilla.org>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
use lib qw(.);
|
||||
|
||||
require "CGI.pl";
|
||||
require "defparams.pl";
|
||||
|
||||
# Shut up misguided -w warnings about "used only once":
|
||||
use vars %::param,
|
||||
%::param_default,
|
||||
@::param_list;
|
||||
|
||||
ConnectToDatabase();
|
||||
confirm_login();
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
if (!UserInGroup("tweakparams")) {
|
||||
print "<H1>Sorry, you aren't a member of the 'tweakparams' group.</H1>\n";
|
||||
print "And so, you aren't allowed to edit the parameters.\n";
|
||||
PutFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
PutHeader("Saving new parameters");
|
||||
|
||||
foreach my $i (@::param_list) {
|
||||
# print "Processing $i...<BR>\n";
|
||||
if (exists $::FORM{"reset-$i"}) {
|
||||
$::FORM{$i} = $::param_default{$i};
|
||||
}
|
||||
$::FORM{$i} =~ s/\r\n?/\n/g; # Get rid of windows/mac-style line endings.
|
||||
$::FORM{$i} =~ s/^\n$//; # assume single linefeed is an empty string
|
||||
if ($::FORM{$i} ne Param($i)) {
|
||||
if (defined $::param_checker{$i}) {
|
||||
my $ref = $::param_checker{$i};
|
||||
my $ok = &$ref($::FORM{$i});
|
||||
if ($ok ne "") {
|
||||
print "New value for $i is invalid: $ok<p>\n";
|
||||
print "Please hit <b>Back</b> and try again.\n";
|
||||
PutFooter();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
print "Changed $i.<br>\n";
|
||||
# print "Old: '" . url_quote(Param($i)) . "'<BR>\n";
|
||||
# print "New: '" . url_quote($::FORM{$i}) . "'<BR>\n";
|
||||
$::param{$i} = $::FORM{$i};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
WriteParams();
|
||||
|
||||
unlink "data/versioncache";
|
||||
print "<PRE>";
|
||||
system("./syncshadowdb", "-v");
|
||||
print "</PRE>";
|
||||
|
||||
print "OK, done.<p>\n";
|
||||
print "<a href=editparams.cgi>Edit the params some more.</a><p>\n";
|
||||
print "<a href=query.cgi>Go back to the query page.</a>\n";
|
||||
|
||||
PutFooter();
|
||||
@@ -1,226 +0,0 @@
|
||||
#!/usr/bonsaitools/bin/perl -wT
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Gervase Markham <gerv@gerv.net>
|
||||
#
|
||||
# Generates mostfreq list from data collected by collectstats.pl.
|
||||
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
use AnyDBM_File;
|
||||
|
||||
use lib qw(.);
|
||||
|
||||
require "globals.pl";
|
||||
require "CGI.pl";
|
||||
|
||||
# Use global templatisation variables.
|
||||
use vars qw($template $vars);
|
||||
|
||||
ConnectToDatabase(1);
|
||||
GetVersionTable();
|
||||
|
||||
quietly_check_login();
|
||||
|
||||
use vars qw (%FORM $userid $usergroupset @legal_product);
|
||||
|
||||
my %dbmcount;
|
||||
my %count;
|
||||
my %before;
|
||||
|
||||
# Get params from URL
|
||||
sub formvalue {
|
||||
my ($name, $default) = (@_);
|
||||
return $FORM{$name} || $default || "";
|
||||
}
|
||||
|
||||
my $sortby = formvalue("sortby");
|
||||
my $changedsince = formvalue("changedsince", 7);
|
||||
my $maxrows = formvalue("maxrows", 100);
|
||||
my $openonly = formvalue("openonly");
|
||||
my $reverse = formvalue("reverse") ? 1 : 0;
|
||||
my $product = formvalue("product");
|
||||
my $sortvisible = formvalue("sortvisible");
|
||||
my @buglist = (split(/[:,]/, formvalue("bug_id")));
|
||||
|
||||
# Small backwards-compatibility hack, dated 2002-04-10.
|
||||
$sortby = "count" if $sortby eq "dup_count";
|
||||
|
||||
# Open today's record of dupes
|
||||
my $today = days_ago(0);
|
||||
my $yesterday = days_ago(1);
|
||||
|
||||
# We don't know the exact file name, because the extention depends on the
|
||||
# underlying dbm library, which could be anything. We can't glob, because
|
||||
# perl < 5.6 considers if (<*>) { ... } to be tainted
|
||||
# Instead, just check the return value for today's data and yesterday's,
|
||||
# and ignore file not found errors
|
||||
|
||||
use Errno;
|
||||
use Fcntl;
|
||||
|
||||
if (!tie(%dbmcount, 'AnyDBM_File', "data/duplicates/dupes$today",
|
||||
O_RDONLY, 0644)) {
|
||||
if ($!{ENOENT}) {
|
||||
if (!tie(%dbmcount, 'AnyDBM_File', "data/duplicates/dupes$yesterday",
|
||||
O_RDONLY, 0644)) {
|
||||
if ($!{ENOENT}) {
|
||||
ThrowUserError("There are no duplicate statistics for today " .
|
||||
"($today) or yesterday.",
|
||||
"Cannot find duplicate statistics");
|
||||
} else {
|
||||
ThrowUserError("There are no duplicate statistics for today " .
|
||||
"($today), and an error occurred when " .
|
||||
"accessing yesterday's dupes file: $!.",
|
||||
"Error reading yesterday's dupes file");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ThrowUserError("An error occurred when accessing today ($today)'s " .
|
||||
"dupes file: $!.",
|
||||
"Error reading today's dupes file");
|
||||
}
|
||||
}
|
||||
|
||||
# Copy hash (so we don't mess up the on-disk file when we remove entries)
|
||||
%count = %dbmcount;
|
||||
|
||||
# Remove all those dupes under the threshold parameter.
|
||||
# We do this, before the sorting, for performance reasons.
|
||||
my $threshold = Param("mostfreqthreshold");
|
||||
|
||||
while (my ($key, $value) = each %count) {
|
||||
delete $count{$key} if ($value < $threshold);
|
||||
}
|
||||
|
||||
# Try and open the database from "changedsince" days ago
|
||||
my $dobefore = 0;
|
||||
my %delta;
|
||||
my $whenever = days_ago($changedsince);
|
||||
|
||||
if (!tie(%before, 'AnyDBM_File', "data/duplicates/dupes$whenever",
|
||||
O_RDONLY, 0644)) {
|
||||
# Ignore file not found errors
|
||||
if (!$!{ENOENT}) {
|
||||
ThrowUserError("Can't open $changedsince days ago ($whenever)'s " .
|
||||
"dupes file: $!",
|
||||
"Error reading previous dupes file");
|
||||
}
|
||||
} else {
|
||||
# Calculate the deltas
|
||||
($delta{$_} = $count{$_} - $before{$_}) foreach (keys(%count));
|
||||
|
||||
$dobefore = 1;
|
||||
}
|
||||
|
||||
# Don't add CLOSED, and don't add VERIFIED unless they are INVALID or
|
||||
# WONTFIX. We want to see VERIFIED INVALID and WONTFIX because common
|
||||
# "bugs" which aren't bugs end up in this state.
|
||||
my $generic_query = "
|
||||
SELECT component, bug_severity, op_sys, target_milestone,
|
||||
short_desc, bug_status, resolution
|
||||
FROM bugs
|
||||
WHERE (bug_status != 'CLOSED')
|
||||
AND ((bug_status = 'VERIFIED' AND resolution IN ('INVALID', 'WONTFIX'))
|
||||
OR (bug_status != 'VERIFIED'))
|
||||
AND ";
|
||||
|
||||
# Limit to a single product if requested
|
||||
$generic_query .= (" product = " . SqlQuote($product) . " AND ") if $product;
|
||||
|
||||
my $origmaxrows = $maxrows;
|
||||
detaint_natural($maxrows)
|
||||
|| ThrowUserError("The maximum number of rows, '" . html_quote($origmaxrows) .
|
||||
"', must be a positive integer.",
|
||||
"Invalid Max Rows");
|
||||
|
||||
my $origchangedsince = $changedsince;
|
||||
detaint_natural($changedsince)
|
||||
|| ThrowUserError("The 'changed since' value, '" . html_quote($origchangedsince) .
|
||||
"', must be an integer >= 0.",
|
||||
"Invalid Changed Since");
|
||||
|
||||
my @bugs;
|
||||
my @bug_ids;
|
||||
my $loop = 0;
|
||||
|
||||
foreach my $id (keys(%count)) {
|
||||
# Maximum row count is dealt with in the template.
|
||||
# If there's a buglist, restrict the bugs to that list.
|
||||
next if $sortvisible && $buglist[0] && (lsearch(\@buglist, $id) == -1);
|
||||
|
||||
SendSQL(SelectVisible("$generic_query bugs.bug_id = $id",
|
||||
$userid,
|
||||
$usergroupset));
|
||||
|
||||
next unless MoreSQLData();
|
||||
my ($component, $bug_severity, $op_sys, $target_milestone,
|
||||
$short_desc, $bug_status, $resolution) = FetchSQLData();
|
||||
|
||||
# Limit to open bugs only if requested
|
||||
next if $openonly && ($resolution ne "");
|
||||
|
||||
push (@bugs, { id => $id,
|
||||
count => $count{$id},
|
||||
delta => $delta{$id},
|
||||
component => $component,
|
||||
bug_severity => $bug_severity,
|
||||
op_sys => $op_sys,
|
||||
target_milestone => $target_milestone,
|
||||
short_desc => $short_desc,
|
||||
bug_status => $bug_status,
|
||||
resolution => $resolution });
|
||||
push (@bug_ids, $id);
|
||||
$loop++;
|
||||
}
|
||||
|
||||
$vars->{'bugs'} = \@bugs;
|
||||
$vars->{'bug_ids'} = \@bug_ids;
|
||||
|
||||
$vars->{'dobefore'} = $dobefore;
|
||||
$vars->{'sortby'} = $sortby;
|
||||
$vars->{'sortvisible'} = $sortvisible;
|
||||
$vars->{'changedsince'} = $changedsince;
|
||||
$vars->{'maxrows'} = $maxrows;
|
||||
$vars->{'openonly'} = $openonly;
|
||||
$vars->{'reverse'} = $reverse;
|
||||
$vars->{'format'} = $::FORM{'format'};
|
||||
$vars->{'product'} = $product;
|
||||
my @entry_products = grep {(!Param("usebuggroups")
|
||||
|| !GroupExists($_)
|
||||
|| UserInGroup($_))} @::legal_product;
|
||||
$vars->{'products'} = \@entry_products;
|
||||
|
||||
|
||||
my $format = ValidateOutputFormat($::FORM{'format'}, "duplicates", "reports");
|
||||
|
||||
print "Content-Type: $format->{'contenttype'}\n\n";
|
||||
|
||||
# Generate and return the UI (HTML page) from the appropriate template.
|
||||
$template->process("reports/$format->{'template'}", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
|
||||
|
||||
sub days_ago {
|
||||
my ($dom, $mon, $year) = (localtime(time - ($_[0]*24*60*60)))[3, 4, 5];
|
||||
return sprintf "%04d-%02d-%02d", 1900 + $year, ++$mon, $dom;
|
||||
}
|
||||
@@ -1,344 +0,0 @@
|
||||
#!/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.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.
|
||||
#
|
||||
# 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): Terry Weissman <terry@mozilla.org>
|
||||
# Myk Melez <myk@mozilla.org>
|
||||
|
||||
################################################################################
|
||||
# Script Initialization
|
||||
################################################################################
|
||||
|
||||
# Make it harder for us to do dangerous things in Perl.
|
||||
use diagnostics;
|
||||
use strict;
|
||||
use lib ".";
|
||||
|
||||
use vars qw(
|
||||
$template
|
||||
$vars
|
||||
);
|
||||
|
||||
# Include the Bugzilla CGI and general utility library.
|
||||
require "CGI.pl";
|
||||
|
||||
# Establish a connection to the database backend.
|
||||
ConnectToDatabase();
|
||||
|
||||
# Make sure the user is logged in and is allowed to edit products
|
||||
# (i.e. the user has "editcomponents" privileges), since attachment
|
||||
# statuses are product-specific.
|
||||
confirm_login();
|
||||
UserInGroup("editcomponents")
|
||||
|| DisplayError("You are not authorized to administer attachment statuses.")
|
||||
&& exit;
|
||||
|
||||
################################################################################
|
||||
# Main Body Execution
|
||||
################################################################################
|
||||
|
||||
# All calls to this script should contain an "action" variable whose value
|
||||
# determines what the user wants to do. The code below checks the value of
|
||||
# that variable and runs the appropriate code.
|
||||
|
||||
# Determine whether to use the action specified by the user or the default.
|
||||
my $action = $::FORM{'action'} || 'list';
|
||||
|
||||
if ($action eq "list")
|
||||
{
|
||||
list();
|
||||
}
|
||||
elsif ($action eq "create")
|
||||
{
|
||||
create();
|
||||
}
|
||||
elsif ($action eq "insert")
|
||||
{
|
||||
validateName();
|
||||
validateDescription();
|
||||
validateSortKey();
|
||||
validateProduct();
|
||||
insert();
|
||||
}
|
||||
elsif ($action eq "edit")
|
||||
{
|
||||
edit();
|
||||
}
|
||||
elsif ($action eq "update")
|
||||
{
|
||||
validateID();
|
||||
validateName();
|
||||
validateDescription();
|
||||
validateSortKey();
|
||||
update();
|
||||
}
|
||||
elsif ($action eq "confirmdelete")
|
||||
{
|
||||
validateID();
|
||||
confirmDelete();
|
||||
}
|
||||
elsif ($action eq "delete")
|
||||
{
|
||||
validateID();
|
||||
deleteStatus();
|
||||
}
|
||||
else
|
||||
{
|
||||
DisplayError("I could not figure out what you wanted to do.")
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
################################################################################
|
||||
# Data Validation
|
||||
################################################################################
|
||||
|
||||
sub validateID
|
||||
{
|
||||
$::FORM{'id'} =~ /^[1-9][0-9]*$/
|
||||
|| DisplayError("The status ID is not a positive integer.")
|
||||
&& exit;
|
||||
|
||||
SendSQL("SELECT 1 FROM attachstatusdefs WHERE id = $::FORM{'id'}");
|
||||
my ($defexists) = FetchSQLData();
|
||||
$defexists
|
||||
|| DisplayError("The status with ID #$::FORM{'id'} does not exist.")
|
||||
&& exit;
|
||||
}
|
||||
|
||||
sub validateName
|
||||
{
|
||||
$::FORM{'name'}
|
||||
|| DisplayError("You must enter a name for the status.")
|
||||
&& exit;
|
||||
|
||||
$::FORM{'name'} !~ /[\s,]/
|
||||
|| DisplayError("The status name cannot contain commas or whitespace.")
|
||||
&& exit;
|
||||
|
||||
length($::FORM{'name'}) <= 50
|
||||
|| DisplayError("The status name cannot be more than 50 characters long.")
|
||||
&& exit;
|
||||
}
|
||||
|
||||
sub validateDescription
|
||||
{
|
||||
$::FORM{'desc'}
|
||||
|| DisplayError("You must enter a description of the status.")
|
||||
&& exit;
|
||||
}
|
||||
|
||||
sub validateSortKey
|
||||
{
|
||||
$::FORM{'sortkey'} =~ /^\d+$/
|
||||
&& $::FORM{'sortkey'} < 32768
|
||||
|| DisplayError("The sort key must be an integer between 0 and 32767 inclusive.")
|
||||
&& exit;
|
||||
}
|
||||
|
||||
sub validateProduct
|
||||
{
|
||||
# Retrieve a list of products.
|
||||
SendSQL("SELECT product FROM products");
|
||||
my @products;
|
||||
push(@products, FetchSQLData()) while MoreSQLData();
|
||||
|
||||
grep($_ eq $::FORM{'product'}, @products)
|
||||
|| DisplayError("You must select an existing product for the status.")
|
||||
&& exit;
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Functions
|
||||
################################################################################
|
||||
|
||||
sub list
|
||||
{
|
||||
# Administer attachment status flags, which is the set of status flags
|
||||
# that can be applied to an attachment.
|
||||
|
||||
# If the user is seeing this screen as a result of doing something to
|
||||
# an attachment status flag, display a message about what happened
|
||||
# to that flag (i.e. "The attachment status flag was updated.").
|
||||
my ($message) = (@_);
|
||||
|
||||
# Retrieve a list of attachment status flags and create an array of hashes
|
||||
# in which each hash contains the data for one flag.
|
||||
SendSQL("SELECT id, name, description, sortkey, product, count(statusid)
|
||||
FROM attachstatusdefs LEFT JOIN attachstatuses
|
||||
ON attachstatusdefs.id=attachstatuses.statusid
|
||||
GROUP BY id
|
||||
ORDER BY sortkey");
|
||||
my @statusdefs;
|
||||
while ( MoreSQLData() )
|
||||
{
|
||||
my ($id, $name, $description, $sortkey, $product, $attachcount) = FetchSQLData();
|
||||
push @statusdefs, { 'id' => $id , 'name' => $name , 'description' => $description ,
|
||||
'sortkey' => $sortkey , 'product' => $product,
|
||||
'attachcount' => $attachcount };
|
||||
}
|
||||
|
||||
# Define the variables and functions that will be passed to the UI template.
|
||||
$vars->{'message'} = $message;
|
||||
$vars->{'statusdefs'} = \@statusdefs;
|
||||
|
||||
# Return the appropriate HTTP response headers.
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
# Generate and return the UI (HTML page) from the appropriate template.
|
||||
$template->process("admin/attachstatus/list.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
}
|
||||
|
||||
|
||||
sub create
|
||||
{
|
||||
# Display a form for creating a new attachment status flag.
|
||||
|
||||
# Retrieve a list of products to which the attachment status may apply.
|
||||
SendSQL("SELECT product FROM products ORDER BY product");
|
||||
my @products;
|
||||
push(@products, FetchSQLData()) while MoreSQLData();
|
||||
|
||||
# Define the variables and functions that will be passed to the UI template.
|
||||
$vars->{'products'} = \@products;
|
||||
|
||||
# Return the appropriate HTTP response headers.
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
# Generate and return the UI (HTML page) from the appropriate template.
|
||||
$template->process("admin/attachstatus/create.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
}
|
||||
|
||||
|
||||
sub insert
|
||||
{
|
||||
# Insert a new attachment status flag into the database.
|
||||
|
||||
# Quote the flag's name and description as appropriate for inclusion
|
||||
# in a SQL statement.
|
||||
my $name = SqlQuote($::FORM{'name'});
|
||||
my $desc = SqlQuote($::FORM{'desc'});
|
||||
my $product = SqlQuote($::FORM{'product'});
|
||||
|
||||
SendSQL("LOCK TABLES attachstatusdefs WRITE");
|
||||
SendSQL("SELECT MAX(id) FROM attachstatusdefs");
|
||||
my $id = FetchSQLData() || 0;
|
||||
$id++;
|
||||
SendSQL("INSERT INTO attachstatusdefs (id, name, description, sortkey, product)
|
||||
VALUES ($id, $name, $desc, $::FORM{'sortkey'}, $product)");
|
||||
SendSQL("UNLOCK TABLES");
|
||||
|
||||
# Display the "administer attachment status flags" page
|
||||
# along with a message that the flag has been created.
|
||||
list("The attachment status has been created.");
|
||||
}
|
||||
|
||||
|
||||
sub edit
|
||||
{
|
||||
# Display a form for editing an existing attachment status flag.
|
||||
|
||||
# Retrieve the definition from the database.
|
||||
SendSQL("SELECT name, description, sortkey, product
|
||||
FROM attachstatusdefs WHERE id = $::FORM{'id'}");
|
||||
my ($name, $desc, $sortkey, $product) = FetchSQLData();
|
||||
|
||||
# Define the variables and functions that will be passed to the UI template.
|
||||
$vars->{'id'} = $::FORM{'id'};
|
||||
$vars->{'name'} = $name;
|
||||
$vars->{'desc'} = $desc;
|
||||
$vars->{'sortkey'} = $sortkey;
|
||||
$vars->{'product'} = $product;
|
||||
|
||||
# Return the appropriate HTTP response headers.
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
# Generate and return the UI (HTML page) from the appropriate template.
|
||||
$template->process("admin/attachstatus/edit.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
}
|
||||
|
||||
|
||||
sub update
|
||||
{
|
||||
# Update an attachment status flag in the database.
|
||||
|
||||
# Quote the flag's name and description as appropriate for inclusion
|
||||
# in a SQL statement.
|
||||
my $name = SqlQuote($::FORM{'name'});
|
||||
my $desc = SqlQuote($::FORM{'desc'});
|
||||
|
||||
SendSQL("LOCK TABLES attachstatusdefs WRITE");
|
||||
SendSQL("
|
||||
UPDATE attachstatusdefs
|
||||
SET name = $name ,
|
||||
description = $desc ,
|
||||
sortkey = $::FORM{'sortkey'}
|
||||
WHERE id = $::FORM{'id'}
|
||||
");
|
||||
SendSQL("UNLOCK TABLES");
|
||||
|
||||
# Display the "administer attachment status flags" page
|
||||
# along with a message that the flag has been updated.
|
||||
list("The attachment status has been updated.");
|
||||
}
|
||||
|
||||
sub confirmDelete
|
||||
{
|
||||
# check if we need confirmation to delete:
|
||||
|
||||
SendSQL("SELECT COUNT(attach_id), name
|
||||
FROM attachstatusdefs LEFT JOIN attachstatuses
|
||||
ON attachstatuses.statusid=attachstatusdefs.id
|
||||
WHERE statusid = $::FORM{'id'}
|
||||
GROUP BY attachstatuses.statusid;");
|
||||
|
||||
my ($attachcount, $name) = FetchSQLData();
|
||||
|
||||
if ($attachcount > 0) {
|
||||
|
||||
$vars->{'id'} = $::FORM{'id'};
|
||||
$vars->{'attachcount'} = $attachcount;
|
||||
$vars->{'name'} = $name;
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
$template->process("admin/attachstatus/delete.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
}
|
||||
else {
|
||||
deleteStatus();
|
||||
}
|
||||
}
|
||||
|
||||
sub deleteStatus
|
||||
{
|
||||
# Delete an attachment status flag from the database.
|
||||
|
||||
SendSQL("LOCK TABLES attachstatusdefs WRITE, attachstatuses WRITE");
|
||||
SendSQL("DELETE FROM attachstatuses WHERE statusid = $::FORM{'id'}");
|
||||
SendSQL("DELETE FROM attachstatusdefs WHERE id = $::FORM{'id'}");
|
||||
SendSQL("UNLOCK TABLES");
|
||||
|
||||
# Display the "administer attachment status flags" page
|
||||
# along with a message that the flag has been deleted.
|
||||
list("The attachment status has been deleted.");
|
||||
}
|
||||
@@ -1,825 +0,0 @@
|
||||
#!/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.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.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Holger
|
||||
# Schurig. Portions created by Holger Schurig are
|
||||
# Copyright (C) 1999 Holger Schurig. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s): Holger Schurig <holgerschurig@nikocity.de>
|
||||
# Terry Weissman <terry@mozilla.org>
|
||||
#
|
||||
# Direct any questions on this source code to
|
||||
#
|
||||
# Holger Schurig <holgerschurig@nikocity.de>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
use lib ".";
|
||||
|
||||
require "CGI.pl";
|
||||
require "globals.pl";
|
||||
|
||||
# Shut up misguided -w warnings about "used only once". For some reason,
|
||||
# "use vars" chokes on me when I try it here.
|
||||
|
||||
sub sillyness {
|
||||
my $zz;
|
||||
$zz = $::buffer;
|
||||
}
|
||||
|
||||
|
||||
my $dobugcounts = (defined $::FORM{'dobugcounts'});
|
||||
|
||||
|
||||
|
||||
# TestProduct: just returns if the specified product does exists
|
||||
# CheckProduct: same check, optionally emit an error text
|
||||
# TestComponent: just returns if the specified product/component combination exists
|
||||
# CheckComponent: same check, optionally emit an error text
|
||||
|
||||
sub TestProduct ($)
|
||||
{
|
||||
my $prod = shift;
|
||||
|
||||
# does the product exist?
|
||||
SendSQL("SELECT product
|
||||
FROM products
|
||||
WHERE product=" . SqlQuote($prod));
|
||||
return FetchOneColumn();
|
||||
}
|
||||
|
||||
sub CheckProduct ($)
|
||||
{
|
||||
my $prod = shift;
|
||||
|
||||
# do we have a product?
|
||||
unless ($prod) {
|
||||
print "Sorry, you haven't specified a product.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
unless (TestProduct $prod) {
|
||||
print "Sorry, product '$prod' does not exist.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
sub TestComponent ($$)
|
||||
{
|
||||
my ($prod,$comp) = @_;
|
||||
|
||||
# does the product exist?
|
||||
SendSQL("SELECT program,value
|
||||
FROM components
|
||||
WHERE program=" . SqlQuote($prod) . " and value=" . SqlQuote($comp));
|
||||
return FetchOneColumn();
|
||||
}
|
||||
|
||||
sub CheckComponent ($$)
|
||||
{
|
||||
my ($prod,$comp) = @_;
|
||||
|
||||
# do we have the component?
|
||||
unless ($comp) {
|
||||
print "Sorry, you haven't specified a component.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
CheckProduct($prod);
|
||||
|
||||
unless (TestComponent $prod,$comp) {
|
||||
print "Sorry, component '$comp' for product '$prod' does not exist.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Displays the form to edit component parameters
|
||||
#
|
||||
|
||||
sub EmitFormElements ($$$$$)
|
||||
{
|
||||
my ($product, $component, $initialownerid, $initialqacontactid, $description) = @_;
|
||||
|
||||
my ($initialowner, $initialqacontact) = ($initialownerid ? DBID_to_name ($initialownerid) : '',
|
||||
$initialqacontactid ? DBID_to_name ($initialqacontactid) : '');
|
||||
|
||||
print " <TH ALIGN=\"right\">Component:</TH>\n";
|
||||
print " <TD><INPUT SIZE=64 MAXLENGTH=50 NAME=\"component\" VALUE=\"" .
|
||||
value_quote($component) . "\">\n";
|
||||
print " <INPUT TYPE=HIDDEN NAME=\"product\" VALUE=\"" .
|
||||
value_quote($product) . "\"></TD>\n";
|
||||
|
||||
print "</TR><TR>\n";
|
||||
print " <TH ALIGN=\"right\">Description:</TH>\n";
|
||||
print " <TD><TEXTAREA ROWS=4 COLS=64 WRAP=VIRTUAL NAME=\"description\">" .
|
||||
value_quote($description) . "</TEXTAREA></TD>\n";
|
||||
|
||||
print "</TR><TR>\n";
|
||||
print " <TH ALIGN=\"right\">Initial owner:</TH>\n";
|
||||
print " <TD><INPUT TYPE=TEXT SIZE=64 MAXLENGTH=255 NAME=\"initialowner\" VALUE=\"" .
|
||||
value_quote($initialowner) . "\"></TD>\n";
|
||||
|
||||
if (Param('useqacontact')) {
|
||||
print "</TR><TR>\n";
|
||||
print " <TH ALIGN=\"right\">Initial QA contact:</TH>\n";
|
||||
print " <TD><INPUT TYPE=TEXT SIZE=64 MAXLENGTH=255 NAME=\"initialqacontact\" VALUE=\"" .
|
||||
value_quote($initialqacontact) . "\"></TD>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Displays a text like "a.", "a or b.", "a, b or c.", "a, b, c or d."
|
||||
#
|
||||
|
||||
sub PutTrailer (@)
|
||||
{
|
||||
my (@links) = ("Back to the <A HREF=\"query.cgi\">query page</A>", @_);
|
||||
|
||||
my $count = $#links;
|
||||
my $num = 0;
|
||||
print "<P>\n";
|
||||
if (!$dobugcounts) {
|
||||
print qq{<a href="editcomponents.cgi?dobugcounts=1&$::buffer">};
|
||||
print qq{Redisplay table with bug counts (slower)</a><p>\n};
|
||||
}
|
||||
foreach (@links) {
|
||||
print $_;
|
||||
if ($num == $count) {
|
||||
print ".\n";
|
||||
}
|
||||
elsif ($num == $count-1) {
|
||||
print " or ";
|
||||
}
|
||||
else {
|
||||
print ", ";
|
||||
}
|
||||
$num++;
|
||||
}
|
||||
PutFooter();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Preliminary checks:
|
||||
#
|
||||
|
||||
ConnectToDatabase();
|
||||
confirm_login();
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
unless (UserInGroup("editcomponents")) {
|
||||
PutHeader("Not allowed");
|
||||
print "Sorry, you aren't a member of the 'editcomponents' group.\n";
|
||||
print "And so, you aren't allowed to add, modify or delete components.\n";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# often used variables
|
||||
#
|
||||
my $product = trim($::FORM{product} || '');
|
||||
my $component = trim($::FORM{component} || '');
|
||||
my $action = trim($::FORM{action} || '');
|
||||
my $localtrailer;
|
||||
if ($product) {
|
||||
$localtrailer = "<A HREF=\"editcomponents.cgi?product=" . url_quote($product) . "\">edit</A> more components";
|
||||
} else {
|
||||
$localtrailer = "<A HREF=\"editcomponents.cgi\">edit</A> more components";
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# product = '' -> Show nice list of products
|
||||
#
|
||||
|
||||
unless ($product) {
|
||||
PutHeader("Select product");
|
||||
|
||||
if ($dobugcounts){
|
||||
SendSQL("SELECT products.product,products.description,COUNT(bug_id)
|
||||
FROM products LEFT JOIN bugs
|
||||
ON products.product=bugs.product
|
||||
GROUP BY products.product
|
||||
ORDER BY products.product");
|
||||
} else {
|
||||
SendSQL("SELECT products.product,products.description
|
||||
FROM products
|
||||
ORDER BY products.product");
|
||||
}
|
||||
print "<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0><TR BGCOLOR=\"#6666FF\">\n";
|
||||
print " <TH ALIGN=\"left\">Edit components of ...</TH>\n";
|
||||
print " <TH ALIGN=\"left\">Description</TH>\n";
|
||||
if ($dobugcounts) {
|
||||
print " <TH ALIGN=\"left\">Bugs</TH>\n";
|
||||
}
|
||||
#print " <TH ALIGN=\"left\">Edit</TH>\n";
|
||||
print "</TR>";
|
||||
while ( MoreSQLData() ) {
|
||||
my ($product, $description, $bugs) = FetchSQLData();
|
||||
$description ||= "<FONT COLOR=\"red\">missing</FONT>";
|
||||
print "<TR>\n";
|
||||
print " <TD VALIGN=\"top\"><A HREF=\"editcomponents.cgi?product=", url_quote($product), "\"><B>$product</B></A></TD>\n";
|
||||
print " <TD VALIGN=\"top\">$description</TD>\n";
|
||||
if ($dobugcounts) {
|
||||
$bugs ||= "none";
|
||||
print " <TD VALIGN=\"top\">$bugs</TD>\n";
|
||||
}
|
||||
#print " <TD VALIGN=\"top\"><A HREF=\"editproducts.cgi?action=edit&product=", url_quote($product), "\">Edit</A></TD>\n";
|
||||
}
|
||||
print "</TR></TABLE>\n";
|
||||
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='' -> Show nice list of components
|
||||
#
|
||||
|
||||
unless ($action) {
|
||||
PutHeader("Select component of $product");
|
||||
CheckProduct($product);
|
||||
|
||||
if ($dobugcounts) {
|
||||
SendSQL("SELECT value,description,initialowner,initialqacontact,COUNT(bug_id)
|
||||
FROM components LEFT JOIN bugs
|
||||
ON components.program=bugs.product AND components.value=bugs.component
|
||||
WHERE program=" . SqlQuote($product) . "
|
||||
GROUP BY value");
|
||||
} else {
|
||||
SendSQL("SELECT value,description,initialowner,initialqacontact
|
||||
FROM components
|
||||
WHERE program=" . SqlQuote($product) . "
|
||||
GROUP BY value");
|
||||
}
|
||||
print "<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0><TR BGCOLOR=\"#6666FF\">\n";
|
||||
print " <TH ALIGN=\"left\">Edit component ...</TH>\n";
|
||||
print " <TH ALIGN=\"left\">Description</TH>\n";
|
||||
print " <TH ALIGN=\"left\">Initial owner</TH>\n";
|
||||
print " <TH ALIGN=\"left\">Initial QA contact</TH>\n"
|
||||
if Param('useqacontact');
|
||||
print " <TH ALIGN=\"left\">Bugs</TH>\n"
|
||||
if $dobugcounts;
|
||||
print " <TH ALIGN=\"left\">Delete</TH>\n";
|
||||
print "</TR>";
|
||||
my @data;
|
||||
while (MoreSQLData()) {
|
||||
push @data, [FetchSQLData()];
|
||||
}
|
||||
foreach (@data) {
|
||||
my ($component,$desc,$initialownerid,$initialqacontactid, $bugs) = @$_;
|
||||
|
||||
$desc ||= "<FONT COLOR=\"red\">missing</FONT>";
|
||||
my $initialowner = $initialownerid ? DBID_to_name ($initialownerid) : "<FONT COLOR=\"red\">missing</FONT>";
|
||||
my $initialqacontact = $initialqacontactid ? DBID_to_name ($initialqacontactid) : "<FONT COLOR=\"red\">missing</FONT>";
|
||||
print "<TR>\n";
|
||||
print " <TD VALIGN=\"top\"><A HREF=\"editcomponents.cgi?product=", url_quote($product), "&component=", url_quote($component), "&action=edit\"><B>$component</B></A></TD>\n";
|
||||
print " <TD VALIGN=\"top\">$desc</TD>\n";
|
||||
print " <TD VALIGN=\"top\">$initialowner</TD>\n";
|
||||
print " <TD VALIGN=\"top\">$initialqacontact</TD>\n"
|
||||
if Param('useqacontact');
|
||||
if ($dobugcounts) {
|
||||
$bugs ||= 'none';
|
||||
print " <TD VALIGN=\"top\">$bugs</TD>\n";
|
||||
}
|
||||
print " <TD VALIGN=\"top\"><A HREF=\"editcomponents.cgi?product=", url_quote($product), "&component=", url_quote($component), "&action=del\"><B>Delete</B></A></TD>\n";
|
||||
print "</TR>";
|
||||
}
|
||||
print "<TR>\n";
|
||||
my $span = 3;
|
||||
$span++ if Param('useqacontact');
|
||||
$span++ if $dobugcounts;
|
||||
print " <TD VALIGN=\"top\" COLSPAN=$span>Add a new component</TD>\n";
|
||||
print " <TD VALIGN=\"top\" ALIGN=\"middle\"><A HREF=\"editcomponents.cgi?product=", url_quote($product) . "&action=add\">Add</A></TD>\n";
|
||||
print "</TR></TABLE>\n";
|
||||
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dobugcounts = 1; # Stupid hack to force further PutTrailer()
|
||||
# calls to not offer a "bug count" option.
|
||||
|
||||
|
||||
#
|
||||
# action='add' -> present form for parameters for new component
|
||||
#
|
||||
# (next action will be 'new')
|
||||
#
|
||||
|
||||
if ($action eq 'add') {
|
||||
PutHeader("Add component of $product");
|
||||
CheckProduct($product);
|
||||
|
||||
#print "This page lets you add a new product to bugzilla.\n";
|
||||
|
||||
print "<FORM METHOD=POST ACTION=editcomponents.cgi>\n";
|
||||
print "<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0><TR>\n";
|
||||
|
||||
EmitFormElements($product, '', 0, 0, '');
|
||||
|
||||
print "</TR></TABLE>\n<HR>\n";
|
||||
print "<INPUT TYPE=SUBMIT VALUE=\"Add\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"action\" VALUE=\"new\">\n";
|
||||
print "</FORM>";
|
||||
|
||||
my $other = $localtrailer;
|
||||
$other =~ s/more/other/;
|
||||
PutTrailer($other);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='new' -> add component entered in the 'action=add' screen
|
||||
#
|
||||
|
||||
if ($action eq 'new') {
|
||||
PutHeader("Adding new component of $product");
|
||||
CheckProduct($product);
|
||||
|
||||
# Cleanups and valididy checks
|
||||
|
||||
unless ($component) {
|
||||
print "You must enter a name for the new component. Please press\n";
|
||||
print "<b>Back</b> and try again.\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
if (TestComponent($product,$component)) {
|
||||
print "The component '$component' already exists. Please press\n";
|
||||
print "<b>Back</b> and try again.\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
if (length($component) > 50) {
|
||||
print "Sorry, the name of a component is limited to 50 characters.";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
my $description = trim($::FORM{description} || '');
|
||||
|
||||
if ($description eq '') {
|
||||
print "You must enter a description for the component '$component'. Please press\n";
|
||||
print "<b>Back</b> and try again.\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
my $initialowner = trim($::FORM{initialowner} || '');
|
||||
|
||||
if ($initialowner eq '') {
|
||||
print "You must enter an initial owner for the component '$component'. Please press\n";
|
||||
print "<b>Back</b> and try again.\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
my $initialownerid = DBname_to_id ($initialowner);
|
||||
if (!$initialownerid) {
|
||||
print "You must use an existing Bugzilla account as initial owner for the component
|
||||
'$component'. Please press\n";
|
||||
print "<b>Back</b> and try again.\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
my $initialqacontact = trim($::FORM{initialqacontact} || '');
|
||||
my $initialqacontactid = DBname_to_id ($initialqacontact);
|
||||
if (Param('useqacontact')) {
|
||||
if (!$initialqacontactid && $initialqacontact ne '') {
|
||||
print "You must use an existing Bugzilla account as initial QA contact for the component '$component'. Please press\n";
|
||||
print "<b>Back</b> and try again.\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
# Add the new component
|
||||
SendSQL("INSERT INTO components ( " .
|
||||
"program, value, description, initialowner, initialqacontact " .
|
||||
" ) VALUES ( " .
|
||||
SqlQuote($product) . "," .
|
||||
SqlQuote($component) . "," .
|
||||
SqlQuote($description) . "," .
|
||||
SqlQuote($initialownerid) . "," .
|
||||
SqlQuote($initialqacontactid) . ")");
|
||||
|
||||
# Make versioncache flush
|
||||
unlink "data/versioncache";
|
||||
|
||||
print "OK, done.<p>\n";
|
||||
if ($product) {
|
||||
PutTrailer("<A HREF=\"editcomponents.cgi?product=" . url_quote($product) . "\">edit</A> more components or <A HREF=\"editcomponents.cgi?product=". url_quote($product) . "&action=add\">Add</A> another component");
|
||||
} else {
|
||||
PutTrailer("<A HREF=\"editcomponents.cgi\">edit</A> more components or <A HREF=\"editcomponents.cgi?action=add\">Add</A> another component");
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='del' -> ask if user really wants to delete
|
||||
#
|
||||
# (next action would be 'delete')
|
||||
#
|
||||
|
||||
if ($action eq 'del') {
|
||||
PutHeader("Delete component of $product");
|
||||
CheckComponent($product, $component);
|
||||
|
||||
# display some data about the component
|
||||
SendSQL("SELECT products.product,products.description,
|
||||
products.milestoneurl,products.disallownew,
|
||||
components.program,components.value,components.initialowner,
|
||||
components.initialqacontact,components.description
|
||||
FROM products
|
||||
LEFT JOIN components on product=program
|
||||
WHERE product=" . SqlQuote($product) . "
|
||||
AND value=" . SqlQuote($component) );
|
||||
|
||||
|
||||
my ($product,$pdesc,$milestoneurl,$disallownew,
|
||||
$dummy,$component,$initialownerid,$initialqacontactid,$cdesc) = FetchSQLData();
|
||||
|
||||
my $initialowner = $initialownerid ? DBID_to_name ($initialownerid) : "<FONT COLOR=\"red\">missing</FONT>";
|
||||
my $initialqacontact = $initialqacontactid ? DBID_to_name ($initialqacontactid) : "<FONT COLOR=\"red\">missing</FONT>";
|
||||
my $milestonelink = $milestoneurl ? "<A HREF=\"$milestoneurl\">$milestoneurl</A>"
|
||||
: "<FONT COLOR=\"red\">missing</FONT>";
|
||||
$pdesc ||= "<FONT COLOR=\"red\">missing</FONT>";
|
||||
$disallownew = $disallownew ? 'closed' : 'open';
|
||||
$cdesc ||= "<FONT COLOR=\"red\">missing</FONT>";
|
||||
|
||||
print "<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0><TR BGCOLOR=\"#6666FF\">\n";
|
||||
print " <TH VALIGN=\"top\" ALIGN=\"left\">Part</TH>\n";
|
||||
print " <TH VALIGN=\"top\" ALIGN=\"left\">Value</TH>\n";
|
||||
|
||||
print "</TR><TR>\n";
|
||||
print " <TD VALIGN=\"top\">Component:</TD>\n";
|
||||
print " <TD VALIGN=\"top\">$component</TD>";
|
||||
|
||||
print "</TR><TR>\n";
|
||||
print " <TD VALIGN=\"top\">Component description:</TD>\n";
|
||||
print " <TD VALIGN=\"top\">$cdesc</TD>";
|
||||
|
||||
print "</TR><TR>\n";
|
||||
print " <TD VALIGN=\"top\">Initial owner:</TD>\n";
|
||||
print " <TD VALIGN=\"top\">$initialowner</TD>";
|
||||
|
||||
if (Param('useqacontact')) {
|
||||
print "</TR><TR>\n";
|
||||
print " <TD VALIGN=\"top\">Initial QA contact:</TD>\n";
|
||||
print " <TD VALIGN=\"top\">$initialqacontact</TD>";
|
||||
}
|
||||
SendSQL("SELECT count(bug_id)
|
||||
FROM bugs
|
||||
WHERE product=" . SqlQuote($product) . "
|
||||
AND component=" . SqlQuote($component));
|
||||
|
||||
print "</TR><TR>\n";
|
||||
print " <TD VALIGN=\"top\">Component of product:</TD>\n";
|
||||
print " <TD VALIGN=\"top\">$product</TD>\n";
|
||||
|
||||
print "</TR><TR>\n";
|
||||
print " <TD VALIGN=\"top\">Description:</TD>\n";
|
||||
print " <TD VALIGN=\"top\">$pdesc</TD>\n";
|
||||
|
||||
if (Param('usetargetmilestone')) {
|
||||
print "</TR><TR>\n";
|
||||
print " <TD VALIGN=\"top\">Milestone URL:</TD>\n";
|
||||
print " <TD VALIGN=\"top\">$milestonelink</TD>\n";
|
||||
}
|
||||
|
||||
print "</TR><TR>\n";
|
||||
print " <TD VALIGN=\"top\">Closed for bugs:</TD>\n";
|
||||
print " <TD VALIGN=\"top\">$disallownew</TD>\n";
|
||||
|
||||
print "</TR><TR>\n";
|
||||
print " <TD VALIGN=\"top\">Bugs</TD>\n";
|
||||
print " <TD VALIGN=\"top\">";
|
||||
my $bugs = FetchOneColumn();
|
||||
print $bugs || 'none';
|
||||
|
||||
|
||||
print "</TD>\n</TR></TABLE>";
|
||||
|
||||
print "<H2>Confirmation</H2>\n";
|
||||
|
||||
if ($bugs) {
|
||||
if (!Param("allowbugdeletion")) {
|
||||
print "Sorry, there are $bugs bugs outstanding for this component.
|
||||
You must reassign those bugs to another component before you can delete this
|
||||
one.";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
print "<TABLE BORDER=0 CELLPADDING=20 WIDTH=\"70%\" BGCOLOR=\"red\"><TR><TD>\n",
|
||||
"There are bugs entered for this component! When you delete this ",
|
||||
"component, <B><BLINK>all</BLINK></B> stored bugs will be deleted, too. ",
|
||||
"You could not even see the bug history for this component anymore!\n",
|
||||
"</TD></TR></TABLE>\n";
|
||||
}
|
||||
|
||||
print "<P>Do you really want to delete this component?<P>\n";
|
||||
|
||||
print "<FORM METHOD=POST ACTION=editcomponents.cgi>\n";
|
||||
print "<INPUT TYPE=SUBMIT VALUE=\"Yes, delete\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"action\" VALUE=\"delete\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"product\" VALUE=\"" .
|
||||
value_quote($product) . "\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"component\" VALUE=\"" .
|
||||
value_quote($component) . "\">\n";
|
||||
print "</FORM>";
|
||||
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='delete' -> really delete the component
|
||||
#
|
||||
|
||||
if ($action eq 'delete') {
|
||||
PutHeader("Deleting component of $product");
|
||||
CheckComponent($product,$component);
|
||||
|
||||
# lock the tables before we start to change everything:
|
||||
|
||||
SendSQL("LOCK TABLES attachments WRITE,
|
||||
bugs WRITE,
|
||||
bugs_activity WRITE,
|
||||
components WRITE,
|
||||
dependencies WRITE");
|
||||
|
||||
# According to MySQL doc I cannot do a DELETE x.* FROM x JOIN Y,
|
||||
# so I have to iterate over bugs and delete all the indivial entries
|
||||
# in bugs_activies and attachments.
|
||||
|
||||
if (Param("allowbugdeletion")) {
|
||||
SendSQL("SELECT bug_id
|
||||
FROM bugs
|
||||
WHERE product=" . SqlQuote($product) . "
|
||||
AND component=" . SqlQuote($component));
|
||||
while (MoreSQLData()) {
|
||||
my $bugid = FetchOneColumn();
|
||||
|
||||
PushGlobalSQLState();
|
||||
SendSQL("DELETE FROM attachments WHERE bug_id=$bugid");
|
||||
SendSQL("DELETE FROM bugs_activity WHERE bug_id=$bugid");
|
||||
SendSQL("DELETE FROM dependencies WHERE blocked=$bugid");
|
||||
PopGlobalSQLState();
|
||||
}
|
||||
print "Attachments, bug activity and dependencies deleted.<BR>\n";
|
||||
|
||||
|
||||
# Deleting the rest is easier:
|
||||
|
||||
SendSQL("DELETE FROM bugs
|
||||
WHERE product=" . SqlQuote($product) . "
|
||||
AND component=" . SqlQuote($component));
|
||||
print "Bugs deleted.<BR>\n";
|
||||
}
|
||||
|
||||
SendSQL("DELETE FROM components
|
||||
WHERE program=" . SqlQuote($product) . "
|
||||
AND value=" . SqlQuote($component));
|
||||
print "Components deleted.<P>\n";
|
||||
SendSQL("UNLOCK TABLES");
|
||||
|
||||
unlink "data/versioncache";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='edit' -> present the edit component form
|
||||
#
|
||||
# (next action would be 'update')
|
||||
#
|
||||
|
||||
if ($action eq 'edit') {
|
||||
PutHeader("Edit component of $product");
|
||||
CheckComponent($product,$component);
|
||||
|
||||
# get data of component
|
||||
SendSQL("SELECT products.product,products.description,
|
||||
products.milestoneurl,products.disallownew,
|
||||
components.program,components.value,components.initialowner,
|
||||
components.initialqacontact,components.description
|
||||
FROM products
|
||||
LEFT JOIN components on product=program
|
||||
WHERE product=" . SqlQuote($product) . "
|
||||
AND value=" . SqlQuote($component) );
|
||||
|
||||
my ($product,$pdesc,$milestoneurl,$disallownew,
|
||||
$dummy,$component,$initialownerid,$initialqacontactid,$cdesc) = FetchSQLData();
|
||||
|
||||
my $initialowner = $initialownerid ? DBID_to_name ($initialownerid) : '';
|
||||
my $initialqacontact = $initialqacontactid ? DBID_to_name ($initialqacontactid) : '';
|
||||
|
||||
print "<FORM METHOD=POST ACTION=editcomponents.cgi>\n";
|
||||
print "<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0><TR>\n";
|
||||
|
||||
#+++ display product/product description
|
||||
|
||||
EmitFormElements($product, $component, $initialownerid, $initialqacontactid, $cdesc);
|
||||
|
||||
print "</TR><TR>\n";
|
||||
print " <TH ALIGN=\"right\">Bugs:</TH>\n";
|
||||
print " <TD>";
|
||||
SendSQL("SELECT count(*)
|
||||
FROM bugs
|
||||
WHERE product=" . SqlQuote($product) .
|
||||
" and component=" . SqlQuote($component));
|
||||
my $bugs = '';
|
||||
$bugs = FetchOneColumn() if MoreSQLData();
|
||||
print $bugs || 'none';
|
||||
|
||||
print "</TD>\n</TR></TABLE>\n";
|
||||
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"componentold\" VALUE=\"" .
|
||||
value_quote($component) . "\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"descriptionold\" VALUE=\"" .
|
||||
value_quote($cdesc) . "\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"initialownerold\" VALUE=\"" .
|
||||
value_quote($initialowner) . "\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"initialqacontactold\" VALUE=\"" .
|
||||
value_quote($initialqacontact) . "\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"action\" VALUE=\"update\">\n";
|
||||
print "<INPUT TYPE=SUBMIT VALUE=\"Update\">\n";
|
||||
|
||||
print "</FORM>";
|
||||
|
||||
my $other = $localtrailer;
|
||||
$other =~ s/more/other/;
|
||||
PutTrailer($other);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='update' -> update the component
|
||||
#
|
||||
|
||||
if ($action eq 'update') {
|
||||
PutHeader("Update component of $product");
|
||||
|
||||
my $componentold = trim($::FORM{componentold} || '');
|
||||
my $description = trim($::FORM{description} || '');
|
||||
my $descriptionold = trim($::FORM{descriptionold} || '');
|
||||
my $initialowner = trim($::FORM{initialowner} || '');
|
||||
my $initialownerold = trim($::FORM{initialownerold} || '');
|
||||
my $initialqacontact = trim($::FORM{initialqacontact} || '');
|
||||
my $initialqacontactold = trim($::FORM{initialqacontactold} || '');
|
||||
|
||||
CheckComponent($product,$componentold);
|
||||
|
||||
if (length($component) > 50) {
|
||||
print "Sorry, the name of a component is limited to 50 characters.";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
# Note that the order of this tests is important. If you change
|
||||
# them, be sure to test for WHERE='$component' or WHERE='$componentold'
|
||||
|
||||
SendSQL("LOCK TABLES bugs WRITE,
|
||||
components WRITE, profiles READ");
|
||||
|
||||
if ($description ne $descriptionold) {
|
||||
unless ($description) {
|
||||
print "Sorry, I can't delete the description.";
|
||||
PutTrailer($localtrailer);
|
||||
SendSQL("UNLOCK TABLES");
|
||||
exit;
|
||||
}
|
||||
SendSQL("UPDATE components
|
||||
SET description=" . SqlQuote($description) . "
|
||||
WHERE program=" . SqlQuote($product) . "
|
||||
AND value=" . SqlQuote($componentold));
|
||||
print "Updated description.<BR>\n";
|
||||
}
|
||||
|
||||
|
||||
if ($initialowner ne $initialownerold) {
|
||||
unless ($initialowner) {
|
||||
print "Sorry, I can't delete the initial owner.";
|
||||
SendSQL("UNLOCK TABLES");
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
my $initialownerid = DBname_to_id($initialowner);
|
||||
unless ($initialownerid) {
|
||||
print "Sorry, you must use an existing Bugzilla account as initial owner.";
|
||||
SendSQL("UNLOCK TABLES");
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
SendSQL("UPDATE components
|
||||
SET initialowner=" . SqlQuote($initialownerid) . "
|
||||
WHERE program=" . SqlQuote($product) . "
|
||||
AND value=" . SqlQuote($componentold));
|
||||
print "Updated initial owner.<BR>\n";
|
||||
}
|
||||
|
||||
if (Param('useqacontact') && $initialqacontact ne $initialqacontactold) {
|
||||
my $initialqacontactid = DBname_to_id($initialqacontact);
|
||||
if (!$initialqacontactid && $initialqacontact ne '') {
|
||||
print "Sorry, you must use an existing Bugzilla account as initial QA contact.";
|
||||
SendSQL("UNLOCK TABLES");
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
SendSQL("UPDATE components
|
||||
SET initialqacontact=" . SqlQuote($initialqacontactid) . "
|
||||
WHERE program=" . SqlQuote($product) . "
|
||||
AND value=" . SqlQuote($componentold));
|
||||
print "Updated initial QA contact.<BR>\n";
|
||||
}
|
||||
|
||||
|
||||
if ($component ne $componentold) {
|
||||
unless ($component) {
|
||||
print "Sorry, I can't delete the product name.";
|
||||
PutTrailer($localtrailer);
|
||||
SendSQL("UNLOCK TABLES");
|
||||
exit;
|
||||
}
|
||||
if (TestComponent($product,$component)) {
|
||||
print "Sorry, component name '$component' is already in use.";
|
||||
PutTrailer($localtrailer);
|
||||
SendSQL("UNLOCK TABLES");
|
||||
exit;
|
||||
}
|
||||
|
||||
SendSQL("UPDATE bugs
|
||||
SET component=" . SqlQuote($component) . ",
|
||||
delta_ts = delta_ts
|
||||
WHERE component=" . SqlQuote($componentold) . "
|
||||
AND product=" . SqlQuote($product));
|
||||
SendSQL("UPDATE components
|
||||
SET value=" . SqlQuote($component) . "
|
||||
WHERE value=" . SqlQuote($componentold) . "
|
||||
AND program=" . SqlQuote($product));
|
||||
|
||||
unlink "data/versioncache";
|
||||
print "Updated product name.<BR>\n";
|
||||
}
|
||||
SendSQL("UNLOCK TABLES");
|
||||
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# No valid action found
|
||||
#
|
||||
|
||||
PutHeader("Error");
|
||||
print "I don't have a clue what you want.<BR>\n";
|
||||
|
||||
@@ -1,643 +0,0 @@
|
||||
#!/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.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.
|
||||
#
|
||||
# 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): Dave Miller <justdave@syndicomm.com>
|
||||
# Jake Steenhagen <jake@acutexx.net>
|
||||
|
||||
# Code derived from editowners.cgi and editusers.cgi
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
use lib ".";
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
ConnectToDatabase();
|
||||
confirm_login();
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
if (!UserInGroup("creategroups")) {
|
||||
PutHeader("Not Authorized","Edit Groups","","Not Authorized for this function!");
|
||||
print "<H1>Sorry, you aren't a member of the 'creategroups' group.</H1>\n";
|
||||
print "And so, you aren't allowed to edit the groups.\n";
|
||||
print "<p>\n";
|
||||
PutFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
my $action = trim($::FORM{action} || '');
|
||||
|
||||
# TestGroup: check if the group name exists
|
||||
sub TestGroup ($)
|
||||
{
|
||||
my $group = shift;
|
||||
|
||||
# does the group exist?
|
||||
SendSQL("SELECT name
|
||||
FROM groups
|
||||
WHERE name=" . SqlQuote($group));
|
||||
return FetchOneColumn();
|
||||
}
|
||||
|
||||
sub ShowError ($)
|
||||
{
|
||||
my $msgtext = shift;
|
||||
print "<TABLE BGCOLOR=\"#FF0000\" CELLPADDING=15><TR><TD>";
|
||||
print "<B>$msgtext</B>";
|
||||
print "</TD></TR></TABLE><P>";
|
||||
return 1;
|
||||
}
|
||||
|
||||
#
|
||||
# Displays a text like "a.", "a or b.", "a, b or c.", "a, b, c or d."
|
||||
#
|
||||
|
||||
sub PutTrailer (@)
|
||||
{
|
||||
my (@links) = ("<a href=\"./\">Back to the Main Bugs Page</a>", @_);
|
||||
|
||||
my $count = $#links;
|
||||
my $num = 0;
|
||||
print "<P>\n";
|
||||
foreach (@links) {
|
||||
print $_;
|
||||
if ($num == $count) {
|
||||
print ".\n";
|
||||
}
|
||||
elsif ($num == $count-1) {
|
||||
print " or ";
|
||||
}
|
||||
else {
|
||||
print ", ";
|
||||
}
|
||||
$num++;
|
||||
}
|
||||
PutFooter();
|
||||
}
|
||||
|
||||
#
|
||||
# action='' -> No action specified, get a list.
|
||||
#
|
||||
|
||||
unless ($action) {
|
||||
PutHeader("Edit Groups","Edit Groups","This lets you edit the groups available to put users in.");
|
||||
|
||||
print "<form method=post action=editgroups.cgi>\n";
|
||||
print "<table border=1>\n";
|
||||
print "<tr>";
|
||||
print "<th>Bit</th>";
|
||||
print "<th>Name</th>";
|
||||
print "<th>Description</th>";
|
||||
print "<th>User RegExp</th>";
|
||||
print "<th>Active</th>";
|
||||
print "<th>Action</th>";
|
||||
print "</tr>\n";
|
||||
|
||||
SendSQL("SELECT bit,name,description,userregexp,isactive " .
|
||||
"FROM groups " .
|
||||
"WHERE isbuggroup != 0 " .
|
||||
"ORDER BY bit");
|
||||
|
||||
while (MoreSQLData()) {
|
||||
my ($bit, $name, $desc, $regexp, $isactive) = FetchSQLData();
|
||||
print "<tr>\n";
|
||||
print "<td valign=middle>$bit</td>\n";
|
||||
print "<td><input size=20 name=\"name-$bit\" value=\"$name\">\n";
|
||||
print "<input type=hidden name=\"oldname-$bit\" value=\"$name\"></td>\n";
|
||||
print "<td><input size=40 name=\"desc-$bit\" value=\"$desc\">\n";
|
||||
print "<input type=hidden name=\"olddesc-$bit\" value=\"$desc\"></td>\n";
|
||||
print "<td><input size=30 name=\"regexp-$bit\" value=\"$regexp\">\n";
|
||||
print "<input type=hidden name=\"oldregexp-$bit\" value=\"$regexp\"></td>\n";
|
||||
print "<td><input type=\"checkbox\" name=\"isactive-$bit\" value=\"1\"" . ($isactive ? " checked" : "") . ">\n";
|
||||
print "<input type=hidden name=\"oldisactive-$bit\" value=\"$isactive\"></td>\n";
|
||||
print "<td align=center valign=middle><a href=\"editgroups.cgi?action=del&group=$bit\">Delete</a></td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td colspan=5></td>\n";
|
||||
print "<td><a href=\"editgroups.cgi?action=add\">Add Group</a></td>\n";
|
||||
print "</tr>\n";
|
||||
print "</table>\n";
|
||||
print "<input type=hidden name=\"action\" value=\"update\">";
|
||||
print "<input type=submit value=\"Submit changes\">\n";
|
||||
|
||||
print "<p>";
|
||||
print "<b>Name</b> is what is used with the UserInGroup() function in any
|
||||
customized cgi files you write that use a given group. It can also be used by
|
||||
people submitting bugs by email to limit a bug to a certain groupset. <p>";
|
||||
print "<b>Description</b> is what will be shown in the bug reports to
|
||||
members of the group where they can choose whether the bug will be restricted
|
||||
to others in the same group.<p>";
|
||||
print "<b>User RegExp</b> is optional, and if filled in, will automatically
|
||||
grant membership to this group to anyone creating a new account with an
|
||||
email address that matches this regular expression.<p>";
|
||||
print "The <b>Active</b> flag determines whether or not the group is active.
|
||||
If you deactivate a group it will no longer be possible for users to add bugs
|
||||
to that group, although bugs already in the group will remain in the group.
|
||||
Deactivating a group is a much less drastic way to stop a group from growing
|
||||
than deleting the group would be.<p>";
|
||||
print "In addition, the following groups that determine user privileges
|
||||
exist. You can only edit the User rexexp on these groups. You should also take
|
||||
care not to duplicate the Names of any of them in your user groups.<p>";
|
||||
print "Also please note that both of the Submit Changes buttons on this page
|
||||
will submit the changes in both tables. There are two buttons simply for the
|
||||
sake of convience.<p>";
|
||||
|
||||
print "<table border=1>\n";
|
||||
print "<tr>";
|
||||
print "<th>Bit</th>";
|
||||
print "<th>Name</th>";
|
||||
print "<th>Description</th>";
|
||||
print "<th>User RegExp</th>";
|
||||
print "</tr>\n";
|
||||
|
||||
SendSQL("SELECT bit,name,description,userregexp " .
|
||||
"FROM groups " .
|
||||
"WHERE isbuggroup = 0 " .
|
||||
"ORDER BY bit");
|
||||
|
||||
while (MoreSQLData()) {
|
||||
my ($bit, $name, $desc, $regexp) = FetchSQLData();
|
||||
print "<tr>\n";
|
||||
print "<td>$bit</td>\n";
|
||||
print "<td>$name</td>\n";
|
||||
print "<input type=hidden name=\"name-$bit\" value=\"$name\">\n";
|
||||
print "<input type=hidden name=\"oldname-$bit\" value=\"$name\">\n";
|
||||
print "<td>$desc</td>\n";
|
||||
print "<td><input type=text size=30 name=\"regexp-$bit\" value=\"$regexp\"></td>\n";
|
||||
print "<input type=hidden name=\"oldregexp-$bit\" value=\"$regexp\">\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
print "</table><p>\n";
|
||||
print "<input type=submit value=\"Submit changes\">\n";
|
||||
print "</form>\n";
|
||||
|
||||
PutFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
#
|
||||
# action='add' -> present form for parameters for new group
|
||||
#
|
||||
# (next action will be 'new')
|
||||
#
|
||||
|
||||
if ($action eq 'add') {
|
||||
PutHeader("Add group");
|
||||
|
||||
print "<FORM METHOD=POST ACTION=editgroups.cgi>\n";
|
||||
print "<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0><TR>\n";
|
||||
print "<th>New Name</th>";
|
||||
print "<th>New Description</th>";
|
||||
print "<th>New User RegExp</th>";
|
||||
print "<th>Active</th>";
|
||||
print "</tr><tr>";
|
||||
print "<td><input size=20 name=\"name\"></td>\n";
|
||||
print "<td><input size=40 name=\"desc\"></td>\n";
|
||||
print "<td><input size=30 name=\"regexp\"></td>\n";
|
||||
print "<td><input type=\"checkbox\" name=\"isactive\" value=\"1\" checked></td>\n";
|
||||
print "</TR></TABLE>\n<HR>\n";
|
||||
print "<INPUT TYPE=SUBMIT VALUE=\"Add\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"action\" VALUE=\"new\">\n";
|
||||
print "</FORM>";
|
||||
|
||||
print "<p>";
|
||||
print "<b>Name</b> is what is used with the UserInGroup() function in any
|
||||
customized cgi files you write that use a given group. It can also be used by
|
||||
people submitting bugs by email to limit a bug to a certain groupset. It
|
||||
may not contain any spaces.<p>";
|
||||
print "<b>Description</b> is what will be shown in the bug reports to
|
||||
members of the group where they can choose whether the bug will be restricted
|
||||
to others in the same group.<p>";
|
||||
print "The <b>Active</b> flag determines whether or not the group is active.
|
||||
If you deactivate a group it will no longer be possible for users to add bugs
|
||||
to that group, although bugs already in the group will remain in the group.
|
||||
Deactivating a group is a much less drastic way to stop a group from growing
|
||||
than deleting the group would be. <b>Note: If you are creating a group, you
|
||||
probably want it to be active, in which case you should leave this checked.</b><p>";
|
||||
print "<b>User RegExp</b> is optional, and if filled in, will automatically
|
||||
grant membership to this group to anyone creating a new account with an
|
||||
email address that matches this regular expression.<p>";
|
||||
|
||||
PutTrailer("<a href=editgroups.cgi>Back to the group list</a>");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='new' -> add group entered in the 'action=add' screen
|
||||
#
|
||||
|
||||
if ($action eq 'new') {
|
||||
PutHeader("Adding new group");
|
||||
|
||||
# Cleanups and valididy checks
|
||||
my $name = trim($::FORM{name} || '');
|
||||
my $desc = trim($::FORM{desc} || '');
|
||||
my $regexp = trim($::FORM{regexp} || '');
|
||||
# convert an undefined value in the inactive field to zero
|
||||
# (this occurs when the inactive checkbox is not checked
|
||||
# and the browser does not send the field to the server)
|
||||
my $isactive = $::FORM{isactive} || 0;
|
||||
|
||||
unless ($name) {
|
||||
ShowError("You must enter a name for the new group.<BR>" .
|
||||
"Please click the <b>Back</b> button and try again.");
|
||||
PutFooter();
|
||||
exit;
|
||||
}
|
||||
unless ($desc) {
|
||||
ShowError("You must enter a description for the new group.<BR>" .
|
||||
"Please click the <b>Back</b> button and try again.");
|
||||
PutFooter();
|
||||
exit;
|
||||
}
|
||||
if (TestGroup($name)) {
|
||||
ShowError("The group '" . $name . "' already exists.<BR>" .
|
||||
"Please click the <b>Back</b> button and try again.");
|
||||
PutFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($isactive != 0 && $isactive != 1) {
|
||||
ShowError("The active flag was improperly set. There may be " .
|
||||
"a problem with Bugzilla or a bug in your browser.<br>" .
|
||||
"Please click the <b>Back</b> button and try again.");
|
||||
PutFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
# Major hack for bit values... perl can't handle 64-bit ints, so I can't
|
||||
# just do the math to get the next available bit number, gotta handle
|
||||
# them as strings... also, we're actually only going to allow 63 bits
|
||||
# because that's all that opblessgroupset masks for (the high bit is off
|
||||
# to avoid signing issues).
|
||||
|
||||
my @bitvals = ('1','2','4','8','16','32','64','128','256','512','1024',
|
||||
'2048','4096','8192','16384','32768',
|
||||
|
||||
'65536','131072','262144','524288','1048576','2097152',
|
||||
'4194304','8388608','16777216','33554432','67108864',
|
||||
'134217728','268435456','536870912','1073741824',
|
||||
'2147483648',
|
||||
|
||||
'4294967296','8589934592','17179869184','34359738368',
|
||||
'68719476736','137438953472','274877906944',
|
||||
'549755813888','1099511627776','2199023255552',
|
||||
'4398046511104','8796093022208','17592186044416',
|
||||
'35184372088832','70368744177664','140737488355328',
|
||||
|
||||
'281474976710656','562949953421312','1125899906842624',
|
||||
'2251799813685248','4503599627370496','9007199254740992',
|
||||
'18014398509481984','36028797018963968','72057594037927936',
|
||||
'144115188075855872','288230376151711744',
|
||||
'576460752303423488','1152921504606846976',
|
||||
'2305843009213693952','4611686018427387904');
|
||||
|
||||
# First the next available bit
|
||||
my $bit = "";
|
||||
foreach (@bitvals) {
|
||||
if ($bit eq "") {
|
||||
SendSQL("SELECT bit FROM groups WHERE bit=" . SqlQuote($_));
|
||||
if (!FetchOneColumn()) { $bit = $_; }
|
||||
}
|
||||
}
|
||||
if ($bit eq "") {
|
||||
ShowError("Sorry, you already have the maximum number of groups " .
|
||||
"defined.<BR><BR>You must delete a group first before you " .
|
||||
"can add any more.</B>");
|
||||
PutTrailer("<a href=editgroups.cgi>Back to the group list</a>");
|
||||
exit;
|
||||
}
|
||||
|
||||
# Add the new group
|
||||
SendSQL("INSERT INTO groups ( " .
|
||||
"bit, name, description, isbuggroup, userregexp, isactive" .
|
||||
" ) VALUES ( " .
|
||||
$bit . "," .
|
||||
SqlQuote($name) . "," .
|
||||
SqlQuote($desc) . "," .
|
||||
"1," .
|
||||
SqlQuote($regexp) . "," .
|
||||
$isactive . ")" );
|
||||
|
||||
print "OK, done.<p>\n";
|
||||
print "Your new group was assigned bit #$bit.<p>";
|
||||
PutTrailer("<a href=\"editgroups.cgi?action=add\">Add another group</a>",
|
||||
"<a href=\"editgroups.cgi\">Back to the group list</a>");
|
||||
exit;
|
||||
}
|
||||
|
||||
#
|
||||
# action='del' -> ask if user really wants to delete
|
||||
#
|
||||
# (next action would be 'delete')
|
||||
#
|
||||
|
||||
if ($action eq 'del') {
|
||||
PutHeader("Delete group");
|
||||
my $bit = trim($::FORM{group} || '');
|
||||
unless ($bit) {
|
||||
ShowError("No group specified.<BR>" .
|
||||
"Click the <b>Back</b> button and try again.");
|
||||
PutFooter();
|
||||
exit;
|
||||
}
|
||||
SendSQL("SELECT bit FROM groups WHERE bit=" . SqlQuote($bit));
|
||||
if (!FetchOneColumn()) {
|
||||
ShowError("That group doesn't exist.<BR>" .
|
||||
"Click the <b>Back</b> button and try again.");
|
||||
PutFooter();
|
||||
exit;
|
||||
}
|
||||
SendSQL("SELECT name,description " .
|
||||
"FROM groups " .
|
||||
"WHERE bit = " . SqlQuote($bit));
|
||||
|
||||
my ($name, $desc) = FetchSQLData();
|
||||
print "<table border=1>\n";
|
||||
print "<tr>";
|
||||
print "<th>Bit</th>";
|
||||
print "<th>Name</th>";
|
||||
print "<th>Description</th>";
|
||||
print "</tr>\n";
|
||||
print "<tr>\n";
|
||||
print "<td>$bit</td>\n";
|
||||
print "<td>$name</td>\n";
|
||||
print "<td>$desc</td>\n";
|
||||
print "</tr>\n";
|
||||
print "</table>\n";
|
||||
|
||||
print "<FORM METHOD=POST ACTION=editgroups.cgi>\n";
|
||||
my $cantdelete = 0;
|
||||
SendSQL("SELECT login_name FROM profiles WHERE " .
|
||||
"(groupset & $bit) OR (blessgroupset & $bit)");
|
||||
if (!FetchOneColumn()) {} else {
|
||||
$cantdelete = 1;
|
||||
print "
|
||||
<B>One or more users belong to this group. You cannot delete this group while
|
||||
there are users in it.</B><BR>
|
||||
<A HREF=\"editusers.cgi?action=list&group=$bit\">
|
||||
Show me which users.</A> -
|
||||
<INPUT TYPE=CHECKBOX NAME=\"removeusers\">Remove all users from
|
||||
this group for me<P>
|
||||
";
|
||||
}
|
||||
SendSQL("SELECT bug_id FROM bugs WHERE (groupset & $bit)");
|
||||
if (MoreSQLData()) {
|
||||
$cantdelete = 1;
|
||||
my $buglist = "0";
|
||||
while (MoreSQLData()) {
|
||||
my ($bug) = FetchSQLData();
|
||||
$buglist .= "," . $bug;
|
||||
}
|
||||
print "
|
||||
<B>One or more bug reports are visible only to this group.
|
||||
You cannot delete this group while any bugs are using it.</B><BR>
|
||||
<A HREF=\"buglist.cgi?bug_id=$buglist\">Show me which bugs.</A> -
|
||||
<INPUT TYPE=CHECKBOX NAME=\"removebugs\">Remove all bugs from this group
|
||||
restriction for me<BR>
|
||||
<B>NOTE:</B> It's quite possible to make confidential bugs public by checking
|
||||
this box. It is <B>strongly</B> suggested that you review the bugs in this
|
||||
group before checking the box.<P>
|
||||
";
|
||||
}
|
||||
SendSQL("SELECT product FROM products WHERE product=" . SqlQuote($name));
|
||||
if (MoreSQLData()) {
|
||||
$cantdelete = 1;
|
||||
print "
|
||||
<B>This group is tied to the <U>$name</U> product.
|
||||
You cannot delete this group while it is tied to a product.</B><BR>
|
||||
<INPUT TYPE=CHECKBOX NAME=\"unbind\">Delete this group anyway, and make the
|
||||
<U>$name</U> product publicly visible.<BR>
|
||||
";
|
||||
}
|
||||
|
||||
print "<H2>Confirmation</H2>\n";
|
||||
print "<P>Do you really want to delete this group?\n";
|
||||
if ($cantdelete) {
|
||||
print "<BR><B>You must check all of the above boxes or correct the " .
|
||||
"indicated problems first before you can proceed.</B>";
|
||||
}
|
||||
print "<P><INPUT TYPE=SUBMIT VALUE=\"Yes, delete\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"action\" VALUE=\"delete\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"group\" VALUE=\"$bit\">\n";
|
||||
print "</FORM>";
|
||||
|
||||
PutTrailer("<a href=editgroups.cgi>No, go back to the group list</a>");
|
||||
exit;
|
||||
}
|
||||
|
||||
#
|
||||
# action='delete' -> really delete the group
|
||||
#
|
||||
|
||||
if ($action eq 'delete') {
|
||||
PutHeader("Deleting group");
|
||||
my $bit = trim($::FORM{group} || '');
|
||||
unless ($bit) {
|
||||
ShowError("No group specified.<BR>" .
|
||||
"Click the <b>Back</b> button and try again.");
|
||||
PutFooter();
|
||||
exit;
|
||||
}
|
||||
SendSQL("SELECT name " .
|
||||
"FROM groups " .
|
||||
"WHERE bit = " . SqlQuote($bit));
|
||||
my ($name) = FetchSQLData();
|
||||
|
||||
my $cantdelete = 0;
|
||||
my $opblessgroupset = '9223372036854775807'; # This is all 64 bits.
|
||||
|
||||
SendSQL("SELECT userid FROM profiles " .
|
||||
"WHERE (groupset & $opblessgroupset)=$opblessgroupset");
|
||||
my @opusers = ();
|
||||
while (MoreSQLData()) {
|
||||
my ($userid) = FetchSQLData();
|
||||
push @opusers, $userid; # cache a list of the users with admin powers
|
||||
}
|
||||
SendSQL("SELECT login_name FROM profiles WHERE " .
|
||||
"(groupset & $bit)=$bit OR (blessgroupset & $bit)=$bit");
|
||||
if (FetchOneColumn()) {
|
||||
if (!defined $::FORM{'removeusers'}) {
|
||||
$cantdelete = 1;
|
||||
}
|
||||
}
|
||||
SendSQL("SELECT bug_id FROM bugs WHERE (groupset & $bit)=$bit");
|
||||
if (FetchOneColumn()) {
|
||||
if (!defined $::FORM{'removebugs'}) {
|
||||
$cantdelete = 1;
|
||||
}
|
||||
}
|
||||
SendSQL("SELECT product FROM products WHERE product=" . SqlQuote($name));
|
||||
if (FetchOneColumn()) {
|
||||
if (!defined $::FORM{'unbind'}) {
|
||||
$cantdelete = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($cantdelete == 1) {
|
||||
ShowError("This group cannot be deleted because there are child " .
|
||||
"records in the database which refer to it. All child records " .
|
||||
"must be removed or altered to remove the reference to this " .
|
||||
"group before the group can be deleted.");
|
||||
print "<A HREF=\"editgroups.cgi?action=del&group=$bit\">" .
|
||||
"View the list of which records are affected</A><BR>";
|
||||
PutTrailer("<a href=editgroups.cgi>Back to group list</a>");
|
||||
exit;
|
||||
}
|
||||
|
||||
SendSQL("SELECT login_name,groupset,blessgroupset FROM profiles WHERE " .
|
||||
"(groupset & $bit) OR (blessgroupset & $bit)");
|
||||
if (FetchOneColumn()) {
|
||||
SendSQL("UPDATE profiles SET groupset=(groupset-$bit) " .
|
||||
"WHERE (groupset & $bit)");
|
||||
print "All users have been removed from group $bit.<BR>";
|
||||
SendSQL("UPDATE profiles SET blessgroupset=(blessgroupset-$bit) " .
|
||||
"WHERE (blessgroupset & $bit)");
|
||||
print "All users with authority to add users to group $bit have " .
|
||||
"had that authority removed.<BR>";
|
||||
}
|
||||
SendSQL("SELECT bug_id FROM bugs WHERE (groupset & $bit)");
|
||||
if (FetchOneColumn()) {
|
||||
SendSQL("UPDATE bugs SET groupset=(groupset-$bit), delta_ts=delta_ts " .
|
||||
"WHERE (groupset & $bit)");
|
||||
print "All bugs have had group bit $bit cleared. Any of these " .
|
||||
"bugs that were not also in another group are now " .
|
||||
"publicly visible.<BR>";
|
||||
}
|
||||
SendSQL("DELETE FROM groups WHERE bit=$bit");
|
||||
print "<B>Group $bit has been deleted.</B><BR>";
|
||||
|
||||
foreach my $userid (@opusers) {
|
||||
SendSQL("UPDATE profiles SET groupset=$opblessgroupset " .
|
||||
"WHERE userid=$userid");
|
||||
print "Group bits restored for " . DBID_to_name($userid) .
|
||||
" (maintainer)<BR>\n";
|
||||
}
|
||||
|
||||
PutTrailer("<a href=editgroups.cgi>Back to group list</a>");
|
||||
exit;
|
||||
}
|
||||
|
||||
#
|
||||
# action='update' -> update the groups
|
||||
#
|
||||
|
||||
if ($action eq 'update') {
|
||||
PutHeader("Updating groups");
|
||||
|
||||
my $chgs = 0;
|
||||
|
||||
foreach my $b (grep(/^name-\d*$/, keys %::FORM)) {
|
||||
if ($::FORM{$b}) {
|
||||
my $v = substr($b, 5);
|
||||
|
||||
# print "Old: '" . $::FORM{"oldname-$v"} . "', '" . $::FORM{"olddesc-$v"} .
|
||||
# "', '" . $::FORM{"oldregexp-$v"} . "'<br>";
|
||||
# print "New: '" . $::FORM{"name-$v"} . "', '" . $::FORM{"desc-$v"} .
|
||||
# "', '" . $::FORM{"regexp-$v"} . "'<br>";
|
||||
|
||||
if ($::FORM{"oldname-$v"} ne $::FORM{"name-$v"}) {
|
||||
$chgs = 1;
|
||||
SendSQL("SELECT name FROM groups WHERE name=" .
|
||||
SqlQuote($::FORM{"name-$v"}));
|
||||
if (!FetchOneColumn()) {
|
||||
SendSQL("SELECT name FROM groups WHERE name=" .
|
||||
SqlQuote($::FORM{"oldname-$v"}) .
|
||||
" && isbuggroup = 0");
|
||||
if (FetchOneColumn()) {
|
||||
ShowError("You cannot update the name of a " .
|
||||
"system group. Skipping $v");
|
||||
} else {
|
||||
SendSQL("UPDATE groups SET name=" .
|
||||
SqlQuote($::FORM{"name-$v"}) .
|
||||
" WHERE bit=" . SqlQuote($v));
|
||||
print "Group $v name updated.<br>\n";
|
||||
}
|
||||
} else {
|
||||
ShowError("Duplicate name '" . $::FORM{"name-$v"} .
|
||||
"' specified for group $v.<BR>" .
|
||||
"Update of group $v name skipped.");
|
||||
}
|
||||
}
|
||||
if ($::FORM{"olddesc-$v"} ne $::FORM{"desc-$v"}) {
|
||||
$chgs = 1;
|
||||
SendSQL("SELECT description FROM groups WHERE description=" .
|
||||
SqlQuote($::FORM{"desc-$v"}));
|
||||
if (!FetchOneColumn()) {
|
||||
SendSQL("UPDATE groups SET description=" .
|
||||
SqlQuote($::FORM{"desc-$v"}) .
|
||||
" WHERE bit=" . SqlQuote($v));
|
||||
print "Group $v description updated.<br>\n";
|
||||
} else {
|
||||
ShowError("Duplicate description '" . $::FORM{"desc-$v"} .
|
||||
"' specified for group $v.<BR>" .
|
||||
"Update of group $v description skipped.");
|
||||
}
|
||||
}
|
||||
if ($::FORM{"oldregexp-$v"} ne $::FORM{"regexp-$v"}) {
|
||||
$chgs = 1;
|
||||
SendSQL("UPDATE groups SET userregexp=" .
|
||||
SqlQuote($::FORM{"regexp-$v"}) .
|
||||
" WHERE bit=" . SqlQuote($v));
|
||||
print "Group $v user regexp updated.<br>\n";
|
||||
}
|
||||
# convert an undefined value in the inactive field to zero
|
||||
# (this occurs when the inactive checkbox is not checked
|
||||
# and the browser does not send the field to the server)
|
||||
my $isactive = $::FORM{"isactive-$v"} || 0;
|
||||
if ($::FORM{"oldisactive-$v"} != $isactive) {
|
||||
$chgs = 1;
|
||||
if ($isactive == 0 || $isactive == 1) {
|
||||
SendSQL("UPDATE groups SET isactive=$isactive" .
|
||||
" WHERE bit=" . SqlQuote($v));
|
||||
print "Group $v active flag updated.<br>\n";
|
||||
} else {
|
||||
ShowError("The value '" . $isactive .
|
||||
"' is not a valid value for the active flag.<BR>" .
|
||||
"There may be a problem with Bugzilla or a bug in your browser.<br>" .
|
||||
"Update of active flag for group $v skipped.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$chgs) {
|
||||
print "You didn't change anything!<BR>\n";
|
||||
print "If you really meant it, hit the <B>Back</B> button and try again.<p>\n";
|
||||
} else {
|
||||
print "Done.<p>\n";
|
||||
}
|
||||
PutTrailer("<a href=editgroups.cgi>Back to the group list</a>");
|
||||
exit;
|
||||
}
|
||||
|
||||
#
|
||||
# No valid action found
|
||||
#
|
||||
|
||||
PutHeader("Error");
|
||||
print "I don't have a clue what you want.<BR>\n";
|
||||
|
||||
PutTrailer("<a href=editgroups.cgi>Try the group list</a>");
|
||||
@@ -1,414 +0,0 @@
|
||||
#!/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.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.
|
||||
#
|
||||
# The Original Code is the Bugzilla Bug Tracking System.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Terry Weissman.
|
||||
# Portions created by Terry Weissman are
|
||||
# Copyright (C) 2000 Terry Weissman. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s): Terry Weissman <terry@mozilla.org>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
use lib ".";
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
my $localtrailer = "<A HREF=\"editkeywords.cgi\">edit</A> more keywords";
|
||||
|
||||
|
||||
#
|
||||
# Displays a text like "a.", "a or b.", "a, b or c.", "a, b, c or d."
|
||||
#
|
||||
|
||||
sub PutTrailer (@)
|
||||
{
|
||||
my (@links) = ("Back to the <A HREF=\"query.cgi\">query page</A>", @_);
|
||||
|
||||
my $count = $#links;
|
||||
my $num = 0;
|
||||
print "<P>\n";
|
||||
foreach (@links) {
|
||||
print $_;
|
||||
if ($num == $count) {
|
||||
print ".\n";
|
||||
}
|
||||
elsif ($num == $count-1) {
|
||||
print " or ";
|
||||
}
|
||||
else {
|
||||
print ", ";
|
||||
}
|
||||
$num++;
|
||||
}
|
||||
PutFooter();
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Displays the form to edit a keyword's parameters
|
||||
#
|
||||
|
||||
sub EmitFormElements ($$$)
|
||||
{
|
||||
my ($id, $name, $description) = @_;
|
||||
|
||||
$name = value_quote($name);
|
||||
$description = value_quote($description);
|
||||
|
||||
print qq{<INPUT TYPE="HIDDEN" NAME=id VALUE=$id>};
|
||||
|
||||
print " <TR><TH ALIGN=\"right\">Name:</TH>\n";
|
||||
print " <TD><INPUT SIZE=64 MAXLENGTH=64 NAME=\"name\" VALUE=\"$name\"></TD>\n";
|
||||
print "</TR><TR>\n";
|
||||
|
||||
print " <TH ALIGN=\"right\">Description:</TH>\n";
|
||||
print " <TD><TEXTAREA ROWS=4 COLS=64 WRAP=VIRTUAL NAME=\"description\">$description</TEXTAREA></TD>\n";
|
||||
print "</TR>\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
sub Validate ($$) {
|
||||
my ($name, $description) = @_;
|
||||
if ($name eq "") {
|
||||
print "You must enter a non-blank name for the keyword. Please press\n";
|
||||
print "<b>Back</b> and try again.\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
if ($name =~ /[\s,]/) {
|
||||
print "You may not use commas or whitespace in a keyword name.\n";
|
||||
print "Please press <b>Back</b> and try again.\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
if ($description eq "") {
|
||||
print "You must enter a non-blank description of the keyword.\n";
|
||||
print "Please press <b>Back</b> and try again.\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Preliminary checks:
|
||||
#
|
||||
|
||||
ConnectToDatabase();
|
||||
confirm_login();
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
unless (UserInGroup("editkeywords")) {
|
||||
PutHeader("Not allowed");
|
||||
print "Sorry, you aren't a member of the 'editkeywords' group.\n";
|
||||
print "And so, you aren't allowed to add, modify or delete keywords.\n";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
my $action = trim($::FORM{action} || '');
|
||||
detaint_natural($::FORM{id});
|
||||
|
||||
|
||||
if ($action eq "") {
|
||||
PutHeader("Select keyword");
|
||||
my $tableheader = qq{
|
||||
<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0>
|
||||
<TR BGCOLOR="#6666FF">
|
||||
<TH ALIGN="left">Edit keyword ...</TH>
|
||||
<TH ALIGN="left">Description</TH>
|
||||
<TH ALIGN="left">Bugs</TH>
|
||||
<TH ALIGN="left">Action</TH>
|
||||
</TR>
|
||||
};
|
||||
print $tableheader;
|
||||
my $line_count = 0;
|
||||
my $max_table_size = 50;
|
||||
|
||||
SendSQL("SELECT keyworddefs.id, keyworddefs.name, keyworddefs.description,
|
||||
COUNT(keywords.bug_id), keywords.bug_id
|
||||
FROM keyworddefs LEFT JOIN keywords ON keyworddefs.id = keywords.keywordid
|
||||
GROUP BY keyworddefs.id
|
||||
ORDER BY keyworddefs.name");
|
||||
while (MoreSQLData()) {
|
||||
my ($id, $name, $description, $bugs, $onebug) = FetchSQLData();
|
||||
$description ||= "<FONT COLOR=\"red\">missing</FONT>";
|
||||
$bugs ||= 'none';
|
||||
if (!$onebug) {
|
||||
# This is silly hackery for old versions of MySQL that seem to
|
||||
# return a count() of 1 even if there are no matching. So, we
|
||||
# ask for an actual bug number. If it can't find any bugs that
|
||||
# match the keyword, then we set the count to be zero, ignoring
|
||||
# what it had responded.
|
||||
$bugs = 'none';
|
||||
}
|
||||
if ($line_count == $max_table_size) {
|
||||
print "</table>\n$tableheader";
|
||||
$line_count = 0;
|
||||
}
|
||||
$line_count++;
|
||||
|
||||
print qq{
|
||||
<TR>
|
||||
<TH VALIGN="top"><A HREF="editkeywords.cgi?action=edit&id=$id">$name</TH>
|
||||
<TD VALIGN="top">$description</TD>
|
||||
<TD VALIGN="top" ALIGN="right">$bugs</TD>
|
||||
<TH VALIGN="top"><A HREF="editkeywords.cgi?action=delete&id=$id">Delete</TH>
|
||||
</TR>
|
||||
};
|
||||
}
|
||||
print qq{
|
||||
<TR>
|
||||
<TD VALIGN="top" COLSPAN=3>Add a new keyword</TD><TD><A HREF="editkeywords.cgi?action=add">Add</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
};
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if ($action eq 'add') {
|
||||
PutHeader("Add keyword");
|
||||
print "<FORM METHOD=POST ACTION=editkeywords.cgi>\n";
|
||||
print "<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0>\n";
|
||||
|
||||
EmitFormElements(-1, '', '');
|
||||
|
||||
print "</TABLE>\n<HR>\n";
|
||||
print "<INPUT TYPE=SUBMIT VALUE=\"Add\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"action\" VALUE=\"new\">\n";
|
||||
print "</FORM>";
|
||||
|
||||
my $other = $localtrailer;
|
||||
$other =~ s/more/other/;
|
||||
PutTrailer($other);
|
||||
exit;
|
||||
}
|
||||
|
||||
#
|
||||
# action='new' -> add keyword entered in the 'action=add' screen
|
||||
#
|
||||
|
||||
if ($action eq 'new') {
|
||||
PutHeader("Adding new keyword");
|
||||
|
||||
# Cleanups and valididy checks
|
||||
|
||||
my $name = trim($::FORM{name} || '');
|
||||
my $description = trim($::FORM{description} || '');
|
||||
|
||||
Validate($name, $description);
|
||||
|
||||
SendSQL("SELECT id FROM keyworddefs WHERE name = " . SqlQuote($name));
|
||||
|
||||
if (FetchOneColumn()) {
|
||||
print "The keyword '$name' already exists. Please press\n";
|
||||
print "<b>Back</b> and try again.\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
# Pick an unused number. Be sure to recycle numbers that may have been
|
||||
# deleted in the past. This code is potentially slow, but it happens
|
||||
# rarely enough, and there really aren't ever going to be that many
|
||||
# keywords anyway.
|
||||
|
||||
SendSQL("SELECT id FROM keyworddefs ORDER BY id");
|
||||
|
||||
my $newid = 1;
|
||||
|
||||
while (MoreSQLData()) {
|
||||
my $oldid = FetchOneColumn();
|
||||
if ($oldid > $newid) {
|
||||
last;
|
||||
}
|
||||
$newid = $oldid + 1;
|
||||
}
|
||||
|
||||
# Add the new keyword.
|
||||
SendSQL("INSERT INTO keyworddefs (id, name, description) VALUES ($newid, " .
|
||||
SqlQuote($name) . "," .
|
||||
SqlQuote($description) . ")");
|
||||
|
||||
# Make versioncache flush
|
||||
unlink "data/versioncache";
|
||||
|
||||
print "OK, done.<p>\n";
|
||||
PutTrailer("<A HREF=\"editkeywords.cgi\">edit</A> more keywords or <A HREF=\"editkeywords.cgi?action=add\">add</a> another keyword");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='edit' -> present the edit keywords from
|
||||
#
|
||||
# (next action would be 'update')
|
||||
#
|
||||
|
||||
if ($action eq 'edit') {
|
||||
PutHeader("Edit keyword");
|
||||
|
||||
my $id = trim($::FORM{id} || 0);
|
||||
# get data of keyword
|
||||
SendSQL("SELECT name,description
|
||||
FROM keyworddefs
|
||||
WHERE id=$id");
|
||||
my ($name, $description) = FetchSQLData();
|
||||
if (!$name) {
|
||||
print "Something screwy is going on. Please try again.\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
print "<FORM METHOD=POST ACTION=editkeywords.cgi>\n";
|
||||
print "<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0>\n";
|
||||
|
||||
EmitFormElements($id, $name, $description);
|
||||
|
||||
print "<TR>\n";
|
||||
print " <TH ALIGN=\"right\">Bugs:</TH>\n";
|
||||
print " <TD>";
|
||||
SendSQL("SELECT count(*)
|
||||
FROM keywords
|
||||
WHERE keywordid = $id");
|
||||
my $bugs = '';
|
||||
$bugs = FetchOneColumn() if MoreSQLData();
|
||||
print $bugs || 'none';
|
||||
|
||||
print "</TD>\n</TR></TABLE>\n";
|
||||
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"action\" VALUE=\"update\">\n";
|
||||
print "<INPUT TYPE=SUBMIT VALUE=\"Update\">\n";
|
||||
|
||||
print "</FORM>";
|
||||
|
||||
my $x = $localtrailer;
|
||||
$x =~ s/more/other/;
|
||||
PutTrailer($x);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# action='update' -> update the keyword
|
||||
#
|
||||
|
||||
if ($action eq 'update') {
|
||||
PutHeader("Update keyword");
|
||||
|
||||
my $id = $::FORM{id};
|
||||
my $name = trim($::FORM{name} || '');
|
||||
my $description = trim($::FORM{description} || '');
|
||||
|
||||
Validate($name, $description);
|
||||
|
||||
SendSQL("SELECT id FROM keyworddefs WHERE name = " . SqlQuote($name));
|
||||
|
||||
my $tmp = FetchOneColumn();
|
||||
|
||||
if ($tmp && $tmp != $id) {
|
||||
print "The keyword '$name' already exists. Please press\n";
|
||||
print "<b>Back</b> and try again.\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
SendSQL("UPDATE keyworddefs SET name = " . SqlQuote($name) .
|
||||
", description = " . SqlQuote($description) .
|
||||
" WHERE id = $id");
|
||||
|
||||
print "Keyword updated.<BR>\n";
|
||||
|
||||
&RebuildCacheWarning;
|
||||
# Make versioncache flush
|
||||
unlink "data/versioncache";
|
||||
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if ($action eq 'delete') {
|
||||
PutHeader("Delete keyword");
|
||||
my $id = $::FORM{id};
|
||||
|
||||
SendSQL("SELECT name FROM keyworddefs WHERE id=$id");
|
||||
my $name = FetchOneColumn();
|
||||
|
||||
if (!$::FORM{reallydelete}) {
|
||||
|
||||
SendSQL("SELECT count(*)
|
||||
FROM keywords
|
||||
WHERE keywordid = $id");
|
||||
|
||||
my $bugs = FetchOneColumn();
|
||||
|
||||
if ($bugs) {
|
||||
|
||||
|
||||
print qq{
|
||||
There are $bugs bugs which have this keyword set. Are you <b>sure</b> you want
|
||||
to delete the <code>$name</code> keyword?
|
||||
|
||||
<FORM METHOD=POST ACTION=editkeywords.cgi>
|
||||
<INPUT TYPE=HIDDEN NAME="id" VALUE="$id">
|
||||
<INPUT TYPE=HIDDEN NAME="action" VALUE="delete">
|
||||
<INPUT TYPE=HIDDEN NAME="reallydelete" VALUE="1">
|
||||
<INPUT TYPE=SUBMIT VALUE="Yes, really delete the keyword">
|
||||
</FORM>
|
||||
};
|
||||
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
SendSQL("DELETE FROM keywords WHERE keywordid = $id");
|
||||
SendSQL("DELETE FROM keyworddefs WHERE id = $id");
|
||||
|
||||
print "Keyword $name deleted.\n";
|
||||
|
||||
&RebuildCacheWarning;
|
||||
# Make versioncache flush
|
||||
unlink "data/versioncache";
|
||||
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
PutHeader("Error");
|
||||
print "I don't have a clue what you want.<BR>\n";
|
||||
|
||||
foreach ( sort keys %::FORM) {
|
||||
print "$_: $::FORM{$_}<BR>\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub RebuildCacheWarning {
|
||||
|
||||
print "<BR><BR><B>You have deleted or modified a keyword. You must rebuild the keyword cache!<BR></B>";
|
||||
print "You can rebuild the cache using sanitycheck.cgi. On very large installations of Bugzilla,<BR>";
|
||||
print "This can take several minutes.<BR><BR><B><A HREF=\"sanitycheck.cgi?rebuildkeywordcache=1\">Rebuild cache</A><BR></B>";
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,564 +0,0 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
|
||||
#
|
||||
# This is a script to edit the target milestones. It is largely a copy of
|
||||
# the editversions.cgi script, since the two fields were set up in a
|
||||
# very similar fashion.
|
||||
#
|
||||
# (basically replace each occurance of 'milestone' with 'version', and
|
||||
# you'll have the original script)
|
||||
#
|
||||
# Matt Masson <matthew@zeroknowledge.com>
|
||||
#
|
||||
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
use lib ".";
|
||||
|
||||
require "CGI.pl";
|
||||
require "globals.pl";
|
||||
|
||||
|
||||
|
||||
|
||||
# TestProduct: just returns if the specified product does exists
|
||||
# CheckProduct: same check, optionally emit an error text
|
||||
# TestMilestone: just returns if the specified product/version combination exists
|
||||
# CheckMilestone: same check, optionally emit an error text
|
||||
|
||||
sub TestProduct ($)
|
||||
{
|
||||
my $prod = shift;
|
||||
|
||||
# does the product exist?
|
||||
SendSQL("SELECT product
|
||||
FROM products
|
||||
WHERE product=" . SqlQuote($prod));
|
||||
return FetchOneColumn();
|
||||
}
|
||||
|
||||
sub CheckProduct ($)
|
||||
{
|
||||
my $prod = shift;
|
||||
|
||||
# do we have a product?
|
||||
unless ($prod) {
|
||||
print "Sorry, you haven't specified a product.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
unless (TestProduct $prod) {
|
||||
print "Sorry, product '$prod' does not exist.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
sub TestMilestone ($$)
|
||||
{
|
||||
my ($prod,$mile) = @_;
|
||||
|
||||
# does the product exist?
|
||||
SendSQL("SELECT product,value
|
||||
FROM milestones
|
||||
WHERE product=" . SqlQuote($prod) . " and value=" . SqlQuote($mile));
|
||||
return FetchOneColumn();
|
||||
}
|
||||
|
||||
sub CheckMilestone ($$)
|
||||
{
|
||||
my ($prod,$mile) = @_;
|
||||
|
||||
# do we have the milestone?
|
||||
unless ($mile) {
|
||||
print "Sorry, you haven't specified a milestone.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
CheckProduct($prod);
|
||||
|
||||
unless (TestMilestone $prod,$mile) {
|
||||
print "Sorry, milestone '$mile' for product '$prod' does not exist.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Displays the form to edit a milestone
|
||||
#
|
||||
|
||||
sub EmitFormElements ($$$)
|
||||
{
|
||||
my ($product, $milestone, $sortkey) = @_;
|
||||
|
||||
print " <TH ALIGN=\"right\">Milestone:</TH>\n";
|
||||
print " <TD><INPUT SIZE=64 MAXLENGTH=64 NAME=\"milestone\" VALUE=\"" .
|
||||
value_quote($milestone) . "\">\n";
|
||||
print "</TR><TR>\n";
|
||||
print " <TH ALIGN=\"right\">Sortkey:</TH>\n";
|
||||
print " <TD><INPUT SIZE=64 MAXLENGTH=64 NAME=\"sortkey\" VALUE=\"" .
|
||||
value_quote($sortkey) . "\">\n";
|
||||
print " <INPUT TYPE=HIDDEN NAME=\"product\" VALUE=\"" .
|
||||
value_quote($product) . "\"></TD>\n";
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Displays a text like "a.", "a or b.", "a, b or c.", "a, b, c or d."
|
||||
#
|
||||
|
||||
sub PutTrailer (@)
|
||||
{
|
||||
my (@links) = ("Back to the <A HREF=\"query.cgi\">query page</A>", @_);
|
||||
|
||||
my $count = $#links;
|
||||
my $num = 0;
|
||||
print "<P>\n";
|
||||
foreach (@links) {
|
||||
print $_;
|
||||
if ($num == $count) {
|
||||
print ".\n";
|
||||
}
|
||||
elsif ($num == $count-1) {
|
||||
print " or ";
|
||||
}
|
||||
else {
|
||||
print ", ";
|
||||
}
|
||||
$num++;
|
||||
}
|
||||
PutFooter();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Preliminary checks:
|
||||
#
|
||||
|
||||
ConnectToDatabase();
|
||||
confirm_login();
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
unless (UserInGroup("editcomponents")) {
|
||||
PutHeader("Not allowed");
|
||||
print "Sorry, you aren't a member of the 'editcomponents' group.\n";
|
||||
print "And so, you aren't allowed to add, modify or delete milestones.\n";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# often used variables
|
||||
#
|
||||
my $product = trim($::FORM{product} || '');
|
||||
my $milestone = trim($::FORM{milestone} || '');
|
||||
my $sortkey = trim($::FORM{sortkey} || '0');
|
||||
my $action = trim($::FORM{action} || '');
|
||||
my $localtrailer;
|
||||
if ($milestone) {
|
||||
$localtrailer = "<A HREF=\"editmilestones.cgi?product=" . url_quote($product) . "\">edit</A> more milestones";
|
||||
} else {
|
||||
$localtrailer = "<A HREF=\"editmilestones.cgi\">edit</A> more milestones";
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# product = '' -> Show nice list of milestones
|
||||
#
|
||||
|
||||
unless ($product) {
|
||||
PutHeader("Select product");
|
||||
|
||||
SendSQL("SELECT products.product,products.description,'xyzzy'
|
||||
FROM products
|
||||
GROUP BY products.product
|
||||
ORDER BY products.product");
|
||||
print "<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0><TR BGCOLOR=\"#6666FF\">\n";
|
||||
print " <TH ALIGN=\"left\">Edit milestones of ...</TH>\n";
|
||||
print " <TH ALIGN=\"left\">Description</TH>\n";
|
||||
print " <TH ALIGN=\"left\">Bugs</TH>\n";
|
||||
print "</TR>";
|
||||
while ( MoreSQLData() ) {
|
||||
my ($product, $description, $bugs) = FetchSQLData();
|
||||
$description ||= "<FONT COLOR=\"red\">missing</FONT>";
|
||||
$bugs ||= "none";
|
||||
print "<TR>\n";
|
||||
print " <TD VALIGN=\"top\"><A HREF=\"editmilestones.cgi?product=", url_quote($product), "\"><B>$product</B></A></TD>\n";
|
||||
print " <TD VALIGN=\"top\">$description</TD>\n";
|
||||
print " <TD VALIGN=\"top\">$bugs</TD>\n";
|
||||
}
|
||||
print "</TR></TABLE>\n";
|
||||
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='' -> Show nice list of milestones
|
||||
#
|
||||
|
||||
unless ($action) {
|
||||
PutHeader("Select milestone for $product");
|
||||
CheckProduct($product);
|
||||
|
||||
SendSQL("SELECT value,sortkey
|
||||
FROM milestones
|
||||
WHERE product=" . SqlQuote($product) . "
|
||||
ORDER BY sortkey,value");
|
||||
|
||||
print "<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0><TR BGCOLOR=\"#6666FF\">\n";
|
||||
print " <TH ALIGN=\"left\">Edit milestone ...</TH>\n";
|
||||
#print " <TH ALIGN=\"left\">Bugs</TH>\n";
|
||||
print " <TH ALIGN=\"left\">Sortkey</TH>\n";
|
||||
print " <TH ALIGN=\"left\">Action</TH>\n";
|
||||
print "</TR>";
|
||||
while ( MoreSQLData() ) {
|
||||
my ($milestone,$sortkey,$bugs) = FetchSQLData();
|
||||
$bugs ||= 'none';
|
||||
print "<TR>\n";
|
||||
print " <TD VALIGN=\"top\"><A HREF=\"editmilestones.cgi?product=", url_quote($product), "&milestone=", url_quote($milestone), "&action=edit\"><B>$milestone</B></A></TD>\n";
|
||||
#print " <TD VALIGN=\"top\">$bugs</TD>\n";
|
||||
print " <TD VALIGN=\"top\" ALIGN=\"right\">$sortkey</TD>\n";
|
||||
print " <TD VALIGN=\"top\"><A HREF=\"editmilestones.cgi?product=", url_quote($product), "&milestone=", url_quote($milestone), "&action=del\"><B>Delete</B></A></TD>\n";
|
||||
print "</TR>";
|
||||
}
|
||||
print "<TR>\n";
|
||||
print " <TD VALIGN=\"top\" COLSPAN=\"2\">Add a new milestone</TD>\n";
|
||||
print " <TD VALIGN=\"top\" ALIGN=\"middle\"><A HREF=\"editmilestones.cgi?product=", url_quote($product) . "&action=add\">Add</A></TD>\n";
|
||||
print "</TR></TABLE>\n";
|
||||
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='add' -> present form for parameters for new milestone
|
||||
#
|
||||
# (next action will be 'new')
|
||||
#
|
||||
|
||||
if ($action eq 'add') {
|
||||
PutHeader("Add milestone for $product");
|
||||
CheckProduct($product);
|
||||
|
||||
#print "This page lets you add a new milestone to a $::bugzilla_name tracked product.\n";
|
||||
|
||||
print "<FORM METHOD=POST ACTION=editmilestones.cgi>\n";
|
||||
print "<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0><TR>\n";
|
||||
|
||||
EmitFormElements($product, $milestone, 0);
|
||||
|
||||
print "</TABLE>\n<HR>\n";
|
||||
print "<INPUT TYPE=SUBMIT VALUE=\"Add\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"action\" VALUE=\"new\">\n";
|
||||
print "</FORM>";
|
||||
|
||||
my $other = $localtrailer;
|
||||
$other =~ s/more/other/;
|
||||
PutTrailer($other);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='new' -> add milestone entered in the 'action=add' screen
|
||||
#
|
||||
|
||||
if ($action eq 'new') {
|
||||
PutHeader("Adding new milestone for $product");
|
||||
CheckProduct($product);
|
||||
|
||||
# Cleanups and valididy checks
|
||||
|
||||
unless ($milestone) {
|
||||
print "You must enter a text for the new milestone. Please press\n";
|
||||
print "<b>Back</b> and try again.\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
if (TestMilestone($product,$milestone)) {
|
||||
print "The milestone '$milestone' already exists. Please press\n";
|
||||
print "<b>Back</b> and try again.\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
# Add the new milestone
|
||||
SendSQL("INSERT INTO milestones ( " .
|
||||
"value, product, sortkey" .
|
||||
" ) VALUES ( " .
|
||||
SqlQuote($milestone) . "," .
|
||||
SqlQuote($product) . ", $sortkey)");
|
||||
|
||||
# Make versioncache flush
|
||||
unlink "data/versioncache";
|
||||
|
||||
print "OK, done.<p>\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='del' -> ask if user really wants to delete
|
||||
#
|
||||
# (next action would be 'delete')
|
||||
#
|
||||
|
||||
if ($action eq 'del') {
|
||||
PutHeader("Delete milestone of $product");
|
||||
CheckMilestone($product, $milestone);
|
||||
|
||||
SendSQL("SELECT count(bug_id),product,target_milestone
|
||||
FROM bugs
|
||||
GROUP BY product,target_milestone
|
||||
HAVING product=" . SqlQuote($product) . "
|
||||
AND target_milestone=" . SqlQuote($milestone));
|
||||
my $bugs = FetchOneColumn();
|
||||
|
||||
SendSQL("SELECT defaultmilestone FROM products " .
|
||||
"WHERE product=" . SqlQuote($product));
|
||||
my $defaultmilestone = FetchOneColumn();
|
||||
|
||||
print "<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0>\n";
|
||||
print "<TR BGCOLOR=\"#6666FF\">\n";
|
||||
print " <TH VALIGN=\"top\" ALIGN=\"left\">Part</TH>\n";
|
||||
print " <TH VALIGN=\"top\" ALIGN=\"left\">Value</TH>\n";
|
||||
|
||||
print "</TR><TR>\n";
|
||||
print " <TH ALIGN=\"left\" VALIGN=\"top\">Product:</TH>\n";
|
||||
print " <TD VALIGN=\"top\">$product</TD>\n";
|
||||
print "</TR><TR>\n";
|
||||
print " <TH ALIGN=\"left\" VALIGN=\"top\">Milestone:</TH>\n";
|
||||
print " <TD VALIGN=\"top\">$milestone</TD>\n";
|
||||
print "</TR><TR>\n";
|
||||
print " <TH ALIGN=\"left\" VALIGN=\"top\">Bugs:</TH>\n";
|
||||
print " <TD VALIGN=\"top\">", $bugs || 'none' , "</TD>\n";
|
||||
print "</TR></TABLE>\n";
|
||||
|
||||
print "<H2>Confirmation</H2>\n";
|
||||
|
||||
if ($bugs) {
|
||||
if (!Param("allowbugdeletion")) {
|
||||
print "Sorry, there are $bugs bugs outstanding for this milestone.
|
||||
You must reassign those bugs to another milestone before you can delete this
|
||||
one.";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
print "<TABLE BORDER=0 CELLPADDING=20 WIDTH=\"70%\" BGCOLOR=\"red\"><TR><TD>\n",
|
||||
"There are bugs entered for this milestone! When you delete this ",
|
||||
"milestone, <B><BLINK>all</BLINK></B> stored bugs will be deleted, too. ",
|
||||
"You could not even see the bug history for this milestone anymore!\n",
|
||||
"</TD></TR></TABLE>\n";
|
||||
}
|
||||
|
||||
if ($defaultmilestone eq $milestone) {
|
||||
print "Sorry; this is the default milestone for this product, and " .
|
||||
"so it can not be deleted.";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
print "<P>Do you really want to delete this milestone?<P>\n";
|
||||
print "<FORM METHOD=POST ACTION=editmilestones.cgi>\n";
|
||||
print "<INPUT TYPE=SUBMIT VALUE=\"Yes, delete\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"action\" VALUE=\"delete\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"product\" VALUE=\"" .
|
||||
value_quote($product) . "\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"milestone\" VALUE=\"" .
|
||||
value_quote($milestone) . "\">\n";
|
||||
print "</FORM>";
|
||||
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='delete' -> really delete the milestone
|
||||
#
|
||||
|
||||
if ($action eq 'delete') {
|
||||
PutHeader("Deleting milestone of $product");
|
||||
CheckMilestone($product,$milestone);
|
||||
|
||||
# lock the tables before we start to change everything:
|
||||
|
||||
SendSQL("LOCK TABLES attachments WRITE,
|
||||
bugs WRITE,
|
||||
bugs_activity WRITE,
|
||||
milestones WRITE,
|
||||
dependencies WRITE");
|
||||
|
||||
# According to MySQL doc I cannot do a DELETE x.* FROM x JOIN Y,
|
||||
# so I have to iterate over bugs and delete all the indivial entries
|
||||
# in bugs_activies and attachments.
|
||||
|
||||
if (Param("allowbugdeletion")) {
|
||||
|
||||
SendSQL("SELECT bug_id
|
||||
FROM bugs
|
||||
WHERE product=" . SqlQuote($product) . "
|
||||
AND target_milestone=" . SqlQuote($milestone));
|
||||
while (MoreSQLData()) {
|
||||
my $bugid = FetchOneColumn();
|
||||
|
||||
PushGlobalSQLState();
|
||||
SendSQL("DELETE FROM attachments WHERE bug_id=$bugid");
|
||||
SendSQL("DELETE FROM bugs_activity WHERE bug_id=$bugid");
|
||||
SendSQL("DELETE FROM dependencies WHERE blocked=$bugid");
|
||||
PopGlobalSQLState();
|
||||
}
|
||||
print "Attachments, bug activity and dependencies deleted.<BR>\n";
|
||||
|
||||
|
||||
# Deleting the rest is easier:
|
||||
|
||||
SendSQL("DELETE FROM bugs
|
||||
WHERE product=" . SqlQuote($product) . "
|
||||
AND target_milestone=" . SqlQuote($milestone));
|
||||
print "Bugs deleted.<BR>\n";
|
||||
}
|
||||
|
||||
SendSQL("DELETE FROM milestones
|
||||
WHERE product=" . SqlQuote($product) . "
|
||||
AND value=" . SqlQuote($milestone));
|
||||
print "Milestone deleted.<P>\n";
|
||||
SendSQL("UNLOCK TABLES");
|
||||
|
||||
unlink "data/versioncache";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='edit' -> present the edit milestone form
|
||||
#
|
||||
# (next action would be 'update')
|
||||
#
|
||||
|
||||
if ($action eq 'edit') {
|
||||
PutHeader("Edit milestone of $product");
|
||||
CheckMilestone($product,$milestone);
|
||||
|
||||
SendSQL("SELECT sortkey FROM milestones WHERE product=" .
|
||||
SqlQuote($product) . " AND value = " . SqlQuote($milestone));
|
||||
my $sortkey = FetchOneColumn();
|
||||
|
||||
print "<FORM METHOD=POST ACTION=editmilestones.cgi>\n";
|
||||
print "<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0><TR>\n";
|
||||
|
||||
EmitFormElements($product, $milestone, $sortkey);
|
||||
|
||||
print "</TR></TABLE>\n";
|
||||
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"milestoneold\" VALUE=\"" .
|
||||
value_quote($milestone) . "\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"sortkeyold\" VALUE=\"" .
|
||||
value_quote($sortkey) . "\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"action\" VALUE=\"update\">\n";
|
||||
print "<INPUT TYPE=SUBMIT VALUE=\"Update\">\n";
|
||||
|
||||
print "</FORM>";
|
||||
|
||||
my $other = $localtrailer;
|
||||
$other =~ s/more/other/;
|
||||
PutTrailer($other);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='update' -> update the milestone
|
||||
#
|
||||
|
||||
if ($action eq 'update') {
|
||||
PutHeader("Update milestone of $product");
|
||||
|
||||
my $milestoneold = trim($::FORM{milestoneold} || '');
|
||||
my $sortkeyold = trim($::FORM{sortkeyold} || '0');
|
||||
|
||||
CheckMilestone($product,$milestoneold);
|
||||
|
||||
SendSQL("LOCK TABLES bugs WRITE,
|
||||
milestones WRITE,
|
||||
products WRITE");
|
||||
|
||||
if ($sortkey != $sortkeyold) {
|
||||
SendSQL("UPDATE milestones SET sortkey=$sortkey
|
||||
WHERE product=" . SqlQuote($product) . "
|
||||
AND value=" . SqlQuote($milestoneold));
|
||||
unlink "data/versioncache";
|
||||
print "Updated sortkey.<BR>\n";
|
||||
}
|
||||
if ($milestone ne $milestoneold) {
|
||||
unless ($milestone) {
|
||||
print "Sorry, I can't delete the milestone text.";
|
||||
PutTrailer($localtrailer);
|
||||
SendSQL("UNLOCK TABLES");
|
||||
exit;
|
||||
}
|
||||
if (TestMilestone($product,$milestone)) {
|
||||
print "Sorry, milestone '$milestone' is already in use.";
|
||||
PutTrailer($localtrailer);
|
||||
SendSQL("UNLOCK TABLES");
|
||||
exit;
|
||||
}
|
||||
SendSQL("UPDATE bugs
|
||||
SET target_milestone=" . SqlQuote($milestone) . ",
|
||||
delta_ts=delta_ts
|
||||
WHERE target_milestone=" . SqlQuote($milestoneold) . "
|
||||
AND product=" . SqlQuote($product));
|
||||
SendSQL("UPDATE milestones
|
||||
SET value=" . SqlQuote($milestone) . "
|
||||
WHERE product=" . SqlQuote($product) . "
|
||||
AND value=" . SqlQuote($milestoneold));
|
||||
SendSQL("UPDATE products " .
|
||||
"SET defaultmilestone = " . SqlQuote($milestone) .
|
||||
"WHERE product = " . SqlQuote($product) .
|
||||
" AND defaultmilestone = " . SqlQuote($milestoneold));
|
||||
unlink "data/versioncache";
|
||||
print "Updated milestone.<BR>\n";
|
||||
}
|
||||
SendSQL("UNLOCK TABLES");
|
||||
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# No valid action found
|
||||
#
|
||||
|
||||
PutHeader("Error");
|
||||
print "I don't have a clue what you want.<BR>\n";
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
#!/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.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.
|
||||
#
|
||||
# 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): Terry Weissman <terry@mozilla.org>
|
||||
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
use lib ".";
|
||||
|
||||
require "CGI.pl";
|
||||
require "defparams.pl";
|
||||
|
||||
# Shut up misguided -w warnings about "used only once":
|
||||
use vars @::param_desc,
|
||||
@::param_list;
|
||||
|
||||
ConnectToDatabase();
|
||||
confirm_login();
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
if (!UserInGroup("tweakparams")) {
|
||||
print "<H1>Sorry, you aren't a member of the 'tweakparams' group.</H1>\n";
|
||||
print "And so, you aren't allowed to edit the parameters.\n";
|
||||
PutFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PutHeader("Edit parameters");
|
||||
|
||||
print "This lets you edit the basic operating parameters of bugzilla.\n";
|
||||
print "Be careful!\n";
|
||||
print "<p>\n";
|
||||
print "Any item you check Reset on will get reset to its default value.\n";
|
||||
|
||||
print "<form method=post action=doeditparams.cgi><table>\n";
|
||||
|
||||
my $rowbreak = "<tr><td colspan=2><hr></td></tr>";
|
||||
print $rowbreak;
|
||||
|
||||
foreach my $i (@::param_list) {
|
||||
print "<tr><th align=right valign=top>$i:</th><td>$::param_desc{$i}</td></tr>\n";
|
||||
print "<tr><td valign=top><input type=checkbox name=reset-$i>Reset</td><td>\n";
|
||||
my $value = Param($i);
|
||||
SWITCH: for ($::param_type{$i}) {
|
||||
/^t$/ && do {
|
||||
print "<input size=80 name=$i value=\"" .
|
||||
value_quote($value) . "\">\n";
|
||||
last SWITCH;
|
||||
};
|
||||
/^l$/ && do {
|
||||
print "<textarea wrap=hard name=$i rows=10 cols=80>" .
|
||||
value_quote($value) . "</textarea>\n";
|
||||
last SWITCH;
|
||||
};
|
||||
/^b$/ && do {
|
||||
my $on;
|
||||
my $off;
|
||||
if ($value) {
|
||||
$on = "checked";
|
||||
$off = "";
|
||||
} else {
|
||||
$on = "";
|
||||
$off = "checked";
|
||||
}
|
||||
print "<input type=radio name=$i value=1 $on>On\n";
|
||||
print "<input type=radio name=$i value=0 $off>Off\n";
|
||||
last SWITCH;
|
||||
};
|
||||
# DEFAULT
|
||||
print "<font color=red><blink>Unknown param type $::param_type{$i}!!!</blink></font>\n";
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
print $rowbreak;
|
||||
}
|
||||
|
||||
print "<tr><th align=right valign=top>version:</th><td>
|
||||
What version of Bugzilla this is. This can't be modified here, but
|
||||
<tt>%version%</tt> can be used as a parameter in places that understand
|
||||
such parameters</td></tr>
|
||||
<tr><td></td><td>" . Param('version') . "</td></tr>";
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
print "<input type=reset value=\"Reset form\"><br>\n";
|
||||
print "<input type=submit value=\"Submit changes\">\n";
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
print "<p><a href=query.cgi>Skip all this, and go back to the query page</a>\n";
|
||||
PutFooter();
|
||||
@@ -1,885 +0,0 @@
|
||||
#!/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.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.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Holger
|
||||
# Schurig. Portions created by Holger Schurig are
|
||||
# Copyright (C) 1999 Holger Schurig. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s): Holger Schurig <holgerschurig@nikocity.de>
|
||||
# Dave Miller <justdave@syndicomm.com>
|
||||
# Joe Robins <jmrobins@tgix.com>
|
||||
# Dan Mosedale <dmose@mozilla.org>
|
||||
#
|
||||
# Direct any questions on this source code to
|
||||
#
|
||||
# Holger Schurig <holgerschurig@nikocity.de>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
use lib ".";
|
||||
|
||||
require "CGI.pl";
|
||||
require "globals.pl";
|
||||
|
||||
# Shut up misguided -w warnings about "used only once". "use vars" just
|
||||
# doesn't work for me.
|
||||
|
||||
sub sillyness {
|
||||
my $zz;
|
||||
$zz = $::userid;
|
||||
$zz = $::superusergroupset;
|
||||
}
|
||||
|
||||
my $editall;
|
||||
my $opblessgroupset = '9223372036854775807'; # This is all 64 bits.
|
||||
|
||||
|
||||
|
||||
# TestUser: just returns if the specified user does exists
|
||||
# CheckUser: same check, optionally emit an error text
|
||||
|
||||
sub TestUser ($)
|
||||
{
|
||||
my $user = shift;
|
||||
|
||||
# does the product exist?
|
||||
SendSQL("SELECT login_name
|
||||
FROM profiles
|
||||
WHERE login_name=" . SqlQuote($user));
|
||||
return FetchOneColumn();
|
||||
}
|
||||
|
||||
sub CheckUser ($)
|
||||
{
|
||||
my $user = shift;
|
||||
|
||||
# do we have a product?
|
||||
unless ($user) {
|
||||
print "Sorry, you haven't specified a user.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
unless (TestUser $user) {
|
||||
print "Sorry, user '$user' does not exist.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub EmitElement ($$)
|
||||
{
|
||||
my ($name, $value) = (@_);
|
||||
$value = value_quote($value);
|
||||
if ($editall) {
|
||||
print qq{<TD><INPUT SIZE=64 MAXLENGTH=255 NAME="$name" VALUE="$value"></TD>\n};
|
||||
} else {
|
||||
print qq{<TD>$value<INPUT TYPE=HIDDEN NAME="$name" VALUE="$value"></TD>\n};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Displays the form to edit a user parameters
|
||||
#
|
||||
|
||||
sub EmitFormElements ($$$$$)
|
||||
{
|
||||
my ($user, $realname, $groupset, $blessgroupset, $disabledtext) = @_;
|
||||
|
||||
print " <TH ALIGN=\"right\">Login name:</TH>\n";
|
||||
EmitElement("user", $user);
|
||||
|
||||
print "</TR><TR>\n";
|
||||
print " <TH ALIGN=\"right\">Real name:</TH>\n";
|
||||
EmitElement("realname", $realname);
|
||||
|
||||
if ($editall) {
|
||||
print "</TR><TR>\n";
|
||||
print " <TH ALIGN=\"right\">Password:</TH>\n";
|
||||
if(Param('useLDAP')) {
|
||||
print " <TD><FONT COLOR=RED>This site is using LDAP for authentication!</FONT></TD>\n";
|
||||
} else {
|
||||
print qq|
|
||||
<TD><INPUT TYPE="PASSWORD" SIZE="16" MAXLENGTH="16" NAME="password" VALUE=""><br>
|
||||
(enter new password to change)
|
||||
</TD>
|
||||
|;
|
||||
}
|
||||
print "</TR><TR>\n";
|
||||
|
||||
print " <TH ALIGN=\"right\">Disable text:</TH>\n";
|
||||
print " <TD ROWSPAN=2><TEXTAREA NAME=\"disabledtext\" ROWS=10 COLS=60>" .
|
||||
value_quote($disabledtext) . "</TEXTAREA>\n";
|
||||
print " </TD>\n";
|
||||
print "</TR><TR>\n";
|
||||
print " <TD VALIGN=\"top\">If non-empty, then the account will\n";
|
||||
print "be disabled, and this text should explain why.</TD>\n";
|
||||
}
|
||||
|
||||
|
||||
if($user ne "") {
|
||||
print "</TR><TR><TH VALIGN=TOP ALIGN=RIGHT>Group Access:</TH><TD><TABLE><TR>";
|
||||
SendSQL("SELECT bit,name,description,bit & $groupset != 0, " .
|
||||
" bit & $blessgroupset " .
|
||||
"FROM groups " .
|
||||
"WHERE bit & $opblessgroupset != 0 AND isbuggroup " .
|
||||
"ORDER BY name");
|
||||
if (MoreSQLData()) {
|
||||
if ($editall) {
|
||||
print "<TD COLSPAN=3 ALIGN=LEFT><B>Can turn this bit on for other users</B></TD>\n";
|
||||
print "</TR><TR>\n<TD ALIGN=CENTER><B>|</B></TD>\n";
|
||||
}
|
||||
print "<TD COLSPAN=2 ALIGN=LEFT><B>User is a member of these groups</B></TD>\n";
|
||||
while (MoreSQLData()) {
|
||||
my ($bit,$name,$description,$checked,$blchecked) = FetchSQLData();
|
||||
print "</TR><TR>\n";
|
||||
if ($editall) {
|
||||
$blchecked = ($blchecked) ? "CHECKED" : "";
|
||||
print "<TD ALIGN=CENTER><INPUT TYPE=CHECKBOX NAME=\"blbit_$name\" $blchecked VALUE=\"$bit\"></TD>";
|
||||
}
|
||||
$checked = ($checked) ? "CHECKED" : "";
|
||||
print "<TD ALIGN=CENTER><INPUT TYPE=CHECKBOX NAME=\"bit_$name\" $checked VALUE=\"$bit\"></TD>";
|
||||
print "<TD><B>" . ucfirst($name) . "</B>: $description</TD>\n";
|
||||
}
|
||||
}
|
||||
print "</TR></TABLE></TD>\n";
|
||||
|
||||
print "</TR><TR><TH VALIGN=TOP ALIGN=RIGHT>Privileges:</TH><TD><TABLE><TR>";
|
||||
SendSQL("SELECT bit,name,description,bit & $groupset != 0, " .
|
||||
" bit & $blessgroupset " .
|
||||
"FROM groups " .
|
||||
"WHERE bit & $opblessgroupset != 0 AND !isbuggroup " .
|
||||
"ORDER BY name");
|
||||
if (MoreSQLData()) {
|
||||
if ($editall) {
|
||||
print "<TD COLSPAN=3 ALIGN=LEFT><B>Can turn this bit on for other users</B></TD>\n";
|
||||
print "</TR><TR>\n<TD ALIGN=CENTER><B>|</B></TD>\n";
|
||||
}
|
||||
print "<TD COLSPAN=2 ALIGN=LEFT><B>User has these privileges</B></TD>\n";
|
||||
while (MoreSQLData()) {
|
||||
my ($bit,$name,$description,$checked,$blchecked) = FetchSQLData();
|
||||
print "</TR><TR>\n";
|
||||
if ($editall) {
|
||||
$blchecked = ($blchecked) ? "CHECKED" : "";
|
||||
print "<TD ALIGN=CENTER><INPUT TYPE=CHECKBOX NAME=\"blbit_$name\" $blchecked VALUE=\"$bit\"></TD>";
|
||||
}
|
||||
$checked = ($checked) ? "CHECKED" : "";
|
||||
print "<TD ALIGN=CENTER><INPUT TYPE=CHECKBOX NAME=\"bit_$name\" $checked VALUE=\"$bit\"></TD>";
|
||||
print "<TD><B>" . ucfirst($name) . "</B>: $description</TD>\n";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
print "</TR><TR><TH ALIGN=RIGHT>Groups and<br>Privileges:</TH><TD><TABLE><TR>";
|
||||
print "<TD COLSPAN=3>The new user will be inserted into groups " .
|
||||
"based on their userregexps.<BR>To change the group " .
|
||||
"permissions for this user, you must edit the account after ".
|
||||
"creating it.</TD>\n";
|
||||
}
|
||||
print "</TR></TABLE></TD>\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Displays a text like "a.", "a or b.", "a, b or c.", "a, b, c or d."
|
||||
#
|
||||
|
||||
sub PutTrailer (@)
|
||||
{
|
||||
my (@links) = ("Back to the <A HREF=\"./\">index</A>",
|
||||
"<A HREF=\"editusers.cgi?action=add\">Add a new user</A>", @_);
|
||||
|
||||
my $count = $#links;
|
||||
my $num = 0;
|
||||
print "<P>\n";
|
||||
foreach (@links) {
|
||||
print $_;
|
||||
if ($num == $count) {
|
||||
print ".\n";
|
||||
}
|
||||
elsif ($num == $count-1) {
|
||||
print " or ";
|
||||
}
|
||||
else {
|
||||
print ", ";
|
||||
}
|
||||
$num++;
|
||||
}
|
||||
PutFooter();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Preliminary checks:
|
||||
#
|
||||
|
||||
ConnectToDatabase();
|
||||
confirm_login();
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
$editall = UserInGroup("editusers");
|
||||
|
||||
if (!$editall) {
|
||||
SendSQL("SELECT blessgroupset FROM profiles WHERE userid = $::userid");
|
||||
$opblessgroupset = FetchOneColumn();
|
||||
if (!$opblessgroupset) {
|
||||
PutHeader("Not allowed");
|
||||
print "Sorry, you aren't a member of the 'editusers' group, and you\n";
|
||||
print "don't have permissions to put people in or out of any group.\n";
|
||||
print "And so, you aren't allowed to add, modify or delete users.\n";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# often used variables
|
||||
#
|
||||
my $user = trim($::FORM{user} || '');
|
||||
my $action = trim($::FORM{action} || '');
|
||||
my $localtrailer = "<A HREF=\"editusers.cgi\">edit</A> more users";
|
||||
my $candelete = Param('allowuserdeletion');
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='' -> Ask for match string for users.
|
||||
#
|
||||
|
||||
unless ($action) {
|
||||
PutHeader("Select match string");
|
||||
print qq{
|
||||
<FORM METHOD=GET ACTION="editusers.cgi">
|
||||
<INPUT TYPE=HIDDEN NAME="action" VALUE="list">
|
||||
List users with login name matching:
|
||||
<INPUT SIZE=32 NAME="matchstr">
|
||||
<SELECT NAME="matchtype">
|
||||
<OPTION VALUE="substr" SELECTED>case-insensitive substring
|
||||
<OPTION VALUE="regexp">case-sensitive regexp
|
||||
<OPTION VALUE="notregexp">not (case-sensitive regexp)
|
||||
</SELECT>
|
||||
<BR>
|
||||
<INPUT TYPE=SUBMIT VALUE="Submit">
|
||||
</FORM>
|
||||
};
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# action='list' -> Show nice list of matching users
|
||||
#
|
||||
|
||||
if ($action eq 'list') {
|
||||
PutHeader("Select user");
|
||||
my $query = "";
|
||||
my $matchstr = $::FORM{'matchstr'};
|
||||
if (exists $::FORM{'matchtype'}) {
|
||||
$query = "SELECT login_name,realname,disabledtext " .
|
||||
"FROM profiles WHERE login_name ";
|
||||
if ($::FORM{'matchtype'} eq 'substr') {
|
||||
$query .= "like";
|
||||
$matchstr = '%' . $matchstr . '%';
|
||||
} elsif ($::FORM{'matchtype'} eq 'regexp') {
|
||||
$query .= "regexp";
|
||||
$matchstr = '.'
|
||||
unless $matchstr;
|
||||
} elsif ($::FORM{'matchtype'} eq 'notregexp') {
|
||||
$query .= "not regexp";
|
||||
$matchstr = '.'
|
||||
unless $matchstr;
|
||||
} else {
|
||||
die "Unknown match type";
|
||||
}
|
||||
$query .= SqlQuote($matchstr) . " ORDER BY login_name";
|
||||
} elsif (exists $::FORM{'group'}) {
|
||||
my $group = $::FORM{'group'};
|
||||
detaint_natural($group);
|
||||
die "Invalid group" unless $group;
|
||||
$query = "SELECT login_name,realname,disabledtext " .
|
||||
"FROM profiles WHERE ((groupset & $group) " .
|
||||
" OR (blessgroupset & $group)) " .
|
||||
"ORDER BY login_name";
|
||||
} else {
|
||||
die "Missing parameters";
|
||||
}
|
||||
|
||||
SendSQL($query);
|
||||
my $count = 0;
|
||||
my $header = "<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0><TR BGCOLOR=\"#6666FF\">
|
||||
<TH ALIGN=\"left\">Edit user ...</TH>
|
||||
<TH ALIGN=\"left\">Real name</TH>
|
||||
";
|
||||
if ($candelete) {
|
||||
$header .= "<TH ALIGN=\"left\">Action</TH>\n";
|
||||
}
|
||||
$header .= "</TR>\n";
|
||||
print $header;
|
||||
while ( MoreSQLData() ) {
|
||||
$count++;
|
||||
if ($count % 100 == 0) {
|
||||
print "</table>$header";
|
||||
}
|
||||
my ($user, $realname, $disabledtext) = FetchSQLData();
|
||||
my $s = "";
|
||||
my $e = "";
|
||||
if ($disabledtext) {
|
||||
$s = "<STRIKE>";
|
||||
$e = "</STRIKE>";
|
||||
}
|
||||
$realname = ($realname ? html_quote($realname) : "<FONT COLOR=\"red\">missing</FONT>");
|
||||
print "<TR>\n";
|
||||
print " <TD VALIGN=\"top\"><A HREF=\"editusers.cgi?action=edit&user=", url_quote($user), "\"><B>$s", html_quote($user), "$e</B></A></TD>\n";
|
||||
print " <TD VALIGN=\"top\">$s$realname$e</TD>\n";
|
||||
if ($candelete) {
|
||||
print " <TD VALIGN=\"top\"><A HREF=\"editusers.cgi?action=del&user=", url_quote($user), "\">Delete</A></TD>\n";
|
||||
}
|
||||
print "</TR>";
|
||||
}
|
||||
if ($editall && !Param('useLDAP')) {
|
||||
print "<TR>\n";
|
||||
my $span = $candelete ? 3 : 2;
|
||||
print qq{
|
||||
<TD VALIGN="top" COLSPAN=$span ALIGN="right">
|
||||
<A HREF=\"editusers.cgi?action=add\">Add a new user</A>
|
||||
</TD>
|
||||
};
|
||||
print "</TR>";
|
||||
}
|
||||
print "</TABLE>\n";
|
||||
print "$count users found.\n";
|
||||
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='add' -> present form for parameters for new user
|
||||
#
|
||||
# (next action will be 'new')
|
||||
#
|
||||
|
||||
if ($action eq 'add') {
|
||||
PutHeader("Add user");
|
||||
if (!$editall) {
|
||||
print "Sorry, you don't have permissions to add new users.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
if(Param('useLDAP')) {
|
||||
print "This site is using LDAP for authentication. To add a new user, ";
|
||||
print "please contact the LDAP administrators.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
print "<FORM METHOD=POST ACTION=editusers.cgi>\n";
|
||||
print "<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0><TR>\n";
|
||||
|
||||
EmitFormElements('', '', 0, 0, '');
|
||||
|
||||
print "</TR></TABLE>\n<HR>\n";
|
||||
print "<INPUT TYPE=SUBMIT VALUE=\"Add\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"action\" VALUE=\"new\">\n";
|
||||
print "</FORM>";
|
||||
|
||||
my $other = $localtrailer;
|
||||
$other =~ s/more/other/;
|
||||
PutTrailer($other);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='new' -> add user entered in the 'action=add' screen
|
||||
#
|
||||
|
||||
if ($action eq 'new') {
|
||||
PutHeader("Adding new user");
|
||||
|
||||
if (!$editall) {
|
||||
print "Sorry, you don't have permissions to add new users.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
if(Param('useLDAP')) {
|
||||
print "This site is using LDAP for authentication. To add a new user, ";
|
||||
print "please contact the LDAP administrators.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
# Cleanups and valididy checks
|
||||
my $realname = trim($::FORM{realname} || '');
|
||||
# We don't trim the password since that could falsely lead the user
|
||||
# to believe a password with a space was accepted even though a space
|
||||
# is an illegal character in a Bugzilla password.
|
||||
my $password = $::FORM{'password'};
|
||||
my $disabledtext = trim($::FORM{disabledtext} || '');
|
||||
my $emailregexp = Param("emailregexp");
|
||||
|
||||
unless ($user) {
|
||||
print "You must enter a name for the new user. Please press\n";
|
||||
print "<b>Back</b> and try again.\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
unless ($user =~ m/$emailregexp/) {
|
||||
print "The user name entered must be a valid e-mail address.\n";
|
||||
print "Please press <b>Back</b> and try again.\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
if (!ValidateNewUser($user)) {
|
||||
print "The user '$user' does already exist. Please press\n";
|
||||
print "<b>Back</b> and try again.\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
my $passworderror = ValidatePassword($password);
|
||||
if ( $passworderror ) {
|
||||
print $passworderror;
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
# For new users, we use the regexps from the groups table to determine
|
||||
# their initial group membership.
|
||||
# We also keep a list of groups the user was added to for display on the
|
||||
# confirmation page.
|
||||
my $bits = "0";
|
||||
my @grouplist = ();
|
||||
SendSQL("select bit, name, userregexp from groups where userregexp != ''");
|
||||
while (MoreSQLData()) {
|
||||
my @row = FetchSQLData();
|
||||
if ($user =~ m/$row[2]/i) {
|
||||
$bits .= "+ $row[0]"; # Silly hack to let MySQL do the math,
|
||||
# not Perl, since we're dealing with 64
|
||||
# bit ints here, and I don't *think* Perl
|
||||
# does that.
|
||||
push(@grouplist, $row[1]);
|
||||
}
|
||||
}
|
||||
|
||||
# Add the new user
|
||||
SendSQL("INSERT INTO profiles ( " .
|
||||
"login_name, cryptpassword, realname, groupset, " .
|
||||
"disabledtext" .
|
||||
" ) VALUES ( " .
|
||||
SqlQuote($user) . "," .
|
||||
SqlQuote(Crypt($password)) . "," .
|
||||
SqlQuote($realname) . "," .
|
||||
$bits . "," .
|
||||
SqlQuote($disabledtext) . ")" );
|
||||
|
||||
#+++ send e-mail away
|
||||
|
||||
print "OK, done.<br>\n";
|
||||
if($#grouplist > -1) {
|
||||
print "New user added to these groups based on group regexps:\n";
|
||||
print "<ul>\n";
|
||||
foreach (@grouplist) {
|
||||
print "<li>$_</li>\n";
|
||||
}
|
||||
print "</ul>\n";
|
||||
} else {
|
||||
print "New user not added to any groups.<br><br>\n";
|
||||
}
|
||||
print "To change ${user}'s permissions, go back and <a href=\"editusers.cgi?action=edit&user=" . url_quote($user)."\">edit this user</A>";
|
||||
print "<p>\n";
|
||||
PutTrailer($localtrailer,
|
||||
"<a href=\"editusers.cgi?action=add\">add</a> another user.");
|
||||
exit;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='del' -> ask if user really wants to delete
|
||||
#
|
||||
# (next action would be 'delete')
|
||||
#
|
||||
|
||||
if ($action eq 'del') {
|
||||
PutHeader("Delete user");
|
||||
if (!$candelete) {
|
||||
print "Sorry, deleting users isn't allowed.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
if (!$editall) {
|
||||
print "Sorry, you don't have permissions to delete users.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
CheckUser($user);
|
||||
|
||||
# display some data about the user
|
||||
SendSQL("SELECT realname, groupset FROM profiles
|
||||
WHERE login_name=" . SqlQuote($user));
|
||||
my ($realname, $groupset) =
|
||||
FetchSQLData();
|
||||
$realname = ($realname ? html_quote($realname) : "<FONT COLOR=\"red\">missing</FONT>");
|
||||
|
||||
print "<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0>\n";
|
||||
print "<TR BGCOLOR=\"#6666FF\">\n";
|
||||
print " <TH VALIGN=\"top\" ALIGN=\"left\">Part</TH>\n";
|
||||
print " <TH VALIGN=\"top\" ALIGN=\"left\">Value</TH>\n";
|
||||
|
||||
print "</TR><TR>\n";
|
||||
print " <TD VALIGN=\"top\">Login name:</TD>\n";
|
||||
print " <TD VALIGN=\"top\">$user</TD>\n";
|
||||
|
||||
print "</TR><TR>\n";
|
||||
print " <TD VALIGN=\"top\">Real name:</TD>\n";
|
||||
print " <TD VALIGN=\"top\">$realname</TD>\n";
|
||||
|
||||
print "</TR><TR>\n";
|
||||
print " <TD VALIGN=\"top\">Group set:</TD>\n";
|
||||
print " <TD VALIGN=\"top\">";
|
||||
SendSQL("SELECT name
|
||||
FROM groups
|
||||
WHERE bit & $groupset = bit
|
||||
ORDER BY isbuggroup, name");
|
||||
my $found = 0;
|
||||
while ( MoreSQLData() ) {
|
||||
my ($name) = FetchSQLData();
|
||||
print "<br>\n" if $found;
|
||||
print ucfirst $name;
|
||||
$found = 1;
|
||||
}
|
||||
print "none" unless $found;
|
||||
print "</TD>\n</TR>";
|
||||
|
||||
|
||||
# Check if the user is an initialowner
|
||||
my $nodelete = '';
|
||||
|
||||
SendSQL("SELECT program, value
|
||||
FROM components
|
||||
WHERE initialowner=" . DBname_to_id($user));
|
||||
$found = 0;
|
||||
while (MoreSQLData()) {
|
||||
if ($found) {
|
||||
print "<BR>\n";
|
||||
} else {
|
||||
print "<TR>\n";
|
||||
print " <TD VALIGN=\"top\">Initial owner:</TD>\n";
|
||||
print " <TD VALIGN=\"top\">";
|
||||
}
|
||||
my ($product, $component) = FetchSQLData();
|
||||
print "<a href=\"editcomponents.cgi?product=", url_quote($product),
|
||||
"&component=", url_quote($component),
|
||||
"&action=edit\">$product: $component</a>";
|
||||
$found = 1;
|
||||
$nodelete = 'initial bug owner';
|
||||
}
|
||||
print "</TD>\n</TR>" if $found;
|
||||
|
||||
|
||||
# Check if the user is an initialqacontact
|
||||
|
||||
SendSQL("SELECT program, value
|
||||
FROM components
|
||||
WHERE initialqacontact=" . DBname_to_id($user));
|
||||
$found = 0;
|
||||
while (MoreSQLData()) {
|
||||
if ($found) {
|
||||
print "<BR>\n";
|
||||
} else {
|
||||
print "<TR>\n";
|
||||
print " <TD VALIGN=\"top\">Initial QA contact:</TD>\n";
|
||||
print " <TD VALIGN=\"top\">";
|
||||
}
|
||||
my ($product, $component) = FetchSQLData();
|
||||
print "<a href=\"editcomponents.cgi?product=", url_quote($product),
|
||||
"&component=", url_quote($component),
|
||||
"&action=edit\">$product: $component</a>";
|
||||
$found = 1;
|
||||
$nodelete = 'initial QA contact';
|
||||
}
|
||||
print "</TD>\n</TR>" if $found;
|
||||
|
||||
print "</TABLE>\n";
|
||||
|
||||
|
||||
if ($nodelete) {
|
||||
print "<P>You can't delete this user because '$user' is an $nodelete ",
|
||||
"for at least one product.";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
print "<H2>Confirmation</H2>\n";
|
||||
print "<P>Do you really want to delete this user?<P>\n";
|
||||
|
||||
print "<FORM METHOD=POST ACTION=editusers.cgi>\n";
|
||||
print "<INPUT TYPE=SUBMIT VALUE=\"Yes, delete\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"action\" VALUE=\"delete\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"user\" VALUE=\"$user\">\n";
|
||||
print "</FORM>";
|
||||
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='delete' -> really delete the user
|
||||
#
|
||||
|
||||
if ($action eq 'delete') {
|
||||
PutHeader("Deleting user");
|
||||
if (!$candelete) {
|
||||
print "Sorry, deleting users isn't allowed.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
if (!$editall) {
|
||||
print "Sorry, you don't have permissions to delete users.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
CheckUser($user);
|
||||
|
||||
SendSQL("SELECT userid
|
||||
FROM profiles
|
||||
WHERE login_name=" . SqlQuote($user));
|
||||
my $userid = FetchOneColumn();
|
||||
|
||||
SendSQL("DELETE FROM profiles
|
||||
WHERE login_name=" . SqlQuote($user));
|
||||
SendSQL("DELETE FROM logincookies
|
||||
WHERE userid=" . $userid);
|
||||
print "User deleted.<BR>\n";
|
||||
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='edit' -> present the user edit from
|
||||
#
|
||||
# (next action would be 'update')
|
||||
#
|
||||
|
||||
if ($action eq 'edit') {
|
||||
PutHeader("Edit user");
|
||||
CheckUser($user);
|
||||
|
||||
# get data of user
|
||||
SendSQL("SELECT realname, groupset, blessgroupset, disabledtext
|
||||
FROM profiles
|
||||
WHERE login_name=" . SqlQuote($user));
|
||||
my ($realname, $groupset, $blessgroupset,
|
||||
$disabledtext) = FetchSQLData();
|
||||
|
||||
print "<FORM METHOD=POST ACTION=editusers.cgi>\n";
|
||||
print "<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0><TR>\n";
|
||||
|
||||
EmitFormElements($user, $realname, $groupset, $blessgroupset, $disabledtext);
|
||||
|
||||
print "</TR></TABLE>\n";
|
||||
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"userold\" VALUE=\"$user\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"realnameold\" VALUE=\"$realname\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"groupsetold\" VALUE=\"$groupset\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"blessgroupsetold\" VALUE=\"$blessgroupset\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"disabledtextold\" VALUE=\"" .
|
||||
value_quote($disabledtext) . "\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"action\" VALUE=\"update\">\n";
|
||||
print "<INPUT TYPE=SUBMIT VALUE=\"Update\">\n";
|
||||
|
||||
print "</FORM>";
|
||||
|
||||
my $x = $localtrailer;
|
||||
$x =~ s/more/other/;
|
||||
PutTrailer($x);
|
||||
exit;
|
||||
}
|
||||
|
||||
#
|
||||
# action='update' -> update the user
|
||||
#
|
||||
|
||||
if ($action eq 'update') {
|
||||
PutHeader("Updated user");
|
||||
|
||||
my $userold = trim($::FORM{userold} || '');
|
||||
my $realname = trim($::FORM{realname} || '');
|
||||
my $realnameold = trim($::FORM{realnameold} || '');
|
||||
my $password = $::FORM{password} || '';
|
||||
my $disabledtext = trim($::FORM{disabledtext} || '');
|
||||
my $disabledtextold = trim($::FORM{disabledtextold} || '');
|
||||
my $groupsetold = trim($::FORM{groupsetold} || '0');
|
||||
my $blessgroupsetold = trim($::FORM{blessgroupsetold} || '0');
|
||||
|
||||
my $groupset = "0";
|
||||
foreach (keys %::FORM) {
|
||||
next unless /^bit_/;
|
||||
#print "$_=$::FORM{$_}<br>\n";
|
||||
detaint_natural($::FORM{$_}) || die "Groupset field tampered with";
|
||||
$groupset .= " + $::FORM{$_}";
|
||||
}
|
||||
my $blessgroupset = "0";
|
||||
foreach (keys %::FORM) {
|
||||
next unless /^blbit_/;
|
||||
#print "$_=$::FORM{$_}<br>\n";
|
||||
detaint_natural($::FORM{$_}) || die "Blessgroupset field tampered with";
|
||||
$blessgroupset .= " + $::FORM{$_}";
|
||||
}
|
||||
|
||||
CheckUser($userold);
|
||||
|
||||
my $emailregexp = Param("emailregexp");
|
||||
unless ($user =~ m/$emailregexp/) {
|
||||
print "The user name entered must be a valid e-mail address.\n";
|
||||
print "Please press <b>Back</b> and try again.\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
# Note that the order of this tests is important. If you change
|
||||
# them, be sure to test for WHERE='$product' or WHERE='$productold'
|
||||
|
||||
if ($groupset ne $groupsetold) {
|
||||
SendSQL("SELECT groupset FROM profiles WHERE login_name=" .
|
||||
SqlQuote($userold));
|
||||
$groupsetold = FetchOneColumn();
|
||||
# Updated, 5/7/00, Joe Robins
|
||||
# We don't want to change the groupset of a superuser.
|
||||
if($groupsetold eq $::superusergroupset) {
|
||||
print "Cannot change permissions of superuser.\n";
|
||||
} else {
|
||||
SendSQL("UPDATE profiles
|
||||
SET groupset =
|
||||
groupset - (groupset & $opblessgroupset) +
|
||||
(($groupset) & $opblessgroupset)
|
||||
WHERE login_name=" . SqlQuote($userold));
|
||||
|
||||
# I'm paranoid that someone who I give the ability to bless people
|
||||
# will start misusing it. Let's log who blesses who (even though
|
||||
# nothing actually uses this log right now).
|
||||
my $fieldid = GetFieldID("groupset");
|
||||
SendSQL("SELECT userid, groupset FROM profiles WHERE login_name=" .
|
||||
SqlQuote($userold));
|
||||
my $u;
|
||||
($u, $groupset) = (FetchSQLData());
|
||||
if ($groupset ne $groupsetold) {
|
||||
SendSQL("INSERT INTO profiles_activity " .
|
||||
"(userid,who,profiles_when,fieldid,oldvalue,newvalue) " .
|
||||
"VALUES " .
|
||||
"($u, $::userid, now(), $fieldid, " .
|
||||
" $groupsetold, $groupset)");
|
||||
}
|
||||
print "Updated permissions.\n";
|
||||
}
|
||||
}
|
||||
|
||||
if ($editall && $blessgroupset ne $blessgroupsetold) {
|
||||
SendSQL("UPDATE profiles
|
||||
SET blessgroupset=" . $blessgroupset . "
|
||||
WHERE login_name=" . SqlQuote($userold));
|
||||
print "Updated ability to tweak permissions of other users.\n";
|
||||
}
|
||||
|
||||
# Update the database with the user's new password if they changed it.
|
||||
if ( !Param('useLDAP') && $editall && $password ) {
|
||||
my $passworderror = ValidatePassword($password);
|
||||
if ( !$passworderror ) {
|
||||
my $cryptpassword = SqlQuote(Crypt($password));
|
||||
my $loginname = SqlQuote($userold);
|
||||
SendSQL("UPDATE profiles
|
||||
SET cryptpassword = $cryptpassword
|
||||
WHERE login_name = $loginname");
|
||||
SendSQL("SELECT userid
|
||||
FROM profiles
|
||||
WHERE login_name=" . SqlQuote($userold));
|
||||
my $userid = FetchOneColumn();
|
||||
InvalidateLogins($userid);
|
||||
print "Updated password.<BR>\n";
|
||||
} else {
|
||||
print "Did not update password: $passworderror<br>\n";
|
||||
}
|
||||
}
|
||||
if ($editall && $realname ne $realnameold) {
|
||||
SendSQL("UPDATE profiles
|
||||
SET realname=" . SqlQuote($realname) . "
|
||||
WHERE login_name=" . SqlQuote($userold));
|
||||
print "Updated real name.<BR>\n";
|
||||
}
|
||||
if ($editall && $disabledtext ne $disabledtextold) {
|
||||
SendSQL("UPDATE profiles
|
||||
SET disabledtext=" . SqlQuote($disabledtext) . "
|
||||
WHERE login_name=" . SqlQuote($userold));
|
||||
SendSQL("SELECT userid
|
||||
FROM profiles
|
||||
WHERE login_name=" . SqlQuote($userold));
|
||||
my $userid = FetchOneColumn();
|
||||
InvalidateLogins($userid);
|
||||
print "Updated disabled text.<BR>\n";
|
||||
}
|
||||
if ($editall && $user ne $userold) {
|
||||
unless ($user) {
|
||||
print "Sorry, I can't delete the user's name.";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
if (TestUser($user)) {
|
||||
print "Sorry, user name '$user' is already in use.";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
SendSQL("UPDATE profiles
|
||||
SET login_name=" . SqlQuote($user) . "
|
||||
WHERE login_name=" . SqlQuote($userold));
|
||||
|
||||
print "Updated user's name.<BR>\n";
|
||||
}
|
||||
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# No valid action found
|
||||
#
|
||||
|
||||
PutHeader("Error");
|
||||
print "I don't have a clue what you want.<BR>\n";
|
||||
@@ -1,558 +0,0 @@
|
||||
#!/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.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.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Holger
|
||||
# Schurig. Portions created by Holger Schurig are
|
||||
# Copyright (C) 1999 Holger Schurig. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s): Holger Schurig <holgerschurig@nikocity.de>
|
||||
# Terry Weissman <terry@mozilla.org>
|
||||
#
|
||||
#
|
||||
# Direct any questions on this source code to
|
||||
#
|
||||
# Holger Schurig <holgerschurig@nikocity.de>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
use lib ".";
|
||||
|
||||
require "CGI.pl";
|
||||
require "globals.pl";
|
||||
|
||||
|
||||
|
||||
|
||||
# TestProduct: just returns if the specified product does exists
|
||||
# CheckProduct: same check, optionally emit an error text
|
||||
# TestVersion: just returns if the specified product/version combination exists
|
||||
# CheckVersion: same check, optionally emit an error text
|
||||
|
||||
sub TestProduct ($)
|
||||
{
|
||||
my $prod = shift;
|
||||
|
||||
# does the product exist?
|
||||
SendSQL("SELECT product
|
||||
FROM products
|
||||
WHERE product=" . SqlQuote($prod));
|
||||
return FetchOneColumn();
|
||||
}
|
||||
|
||||
sub CheckProduct ($)
|
||||
{
|
||||
my $prod = shift;
|
||||
|
||||
# do we have a product?
|
||||
unless ($prod) {
|
||||
print "Sorry, you haven't specified a product.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
unless (TestProduct $prod) {
|
||||
print "Sorry, product '$prod' does not exist.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
sub TestVersion ($$)
|
||||
{
|
||||
my ($prod,$ver) = @_;
|
||||
|
||||
# does the product exist?
|
||||
SendSQL("SELECT program,value
|
||||
FROM versions
|
||||
WHERE program=" . SqlQuote($prod) . " and value=" . SqlQuote($ver));
|
||||
return FetchOneColumn();
|
||||
}
|
||||
|
||||
sub CheckVersion ($$)
|
||||
{
|
||||
my ($prod,$ver) = @_;
|
||||
|
||||
# do we have the version?
|
||||
unless ($ver) {
|
||||
print "Sorry, you haven't specified a version.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
CheckProduct($prod);
|
||||
|
||||
unless (TestVersion $prod,$ver) {
|
||||
print "Sorry, version '$ver' for product '$prod' does not exist.";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Displays the form to edit a version
|
||||
#
|
||||
|
||||
sub EmitFormElements ($$)
|
||||
{
|
||||
my ($product, $version) = @_;
|
||||
|
||||
print " <TH ALIGN=\"right\">Version:</TH>\n";
|
||||
print " <TD><INPUT SIZE=64 MAXLENGTH=64 NAME=\"version\" VALUE=\"" .
|
||||
value_quote($version) . "\">\n";
|
||||
print " <INPUT TYPE=HIDDEN NAME=\"product\" VALUE=\"" .
|
||||
value_quote($product) . "\"></TD>\n";
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Displays a text like "a.", "a or b.", "a, b or c.", "a, b, c or d."
|
||||
#
|
||||
|
||||
sub PutTrailer (@)
|
||||
{
|
||||
my (@links) = ("Back to the <A HREF=\"query.cgi\">query page</A>", @_);
|
||||
|
||||
my $count = $#links;
|
||||
my $num = 0;
|
||||
print "<P>\n";
|
||||
foreach (@links) {
|
||||
print $_;
|
||||
if ($num == $count) {
|
||||
print ".\n";
|
||||
}
|
||||
elsif ($num == $count-1) {
|
||||
print " or ";
|
||||
}
|
||||
else {
|
||||
print ", ";
|
||||
}
|
||||
$num++;
|
||||
}
|
||||
PutFooter();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Preliminary checks:
|
||||
#
|
||||
|
||||
ConnectToDatabase();
|
||||
confirm_login();
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
unless (UserInGroup("editcomponents")) {
|
||||
PutHeader("Not allowed");
|
||||
print "Sorry, you aren't a member of the 'editcomponents' group.\n";
|
||||
print "And so, you aren't allowed to add, modify or delete versions.\n";
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# often used variables
|
||||
#
|
||||
my $product = trim($::FORM{product} || '');
|
||||
my $version = trim($::FORM{version} || '');
|
||||
my $action = trim($::FORM{action} || '');
|
||||
my $localtrailer;
|
||||
if ($version) {
|
||||
$localtrailer = "<A HREF=\"editversions.cgi?product=" . url_quote($product) . "\">edit</A> more versions";
|
||||
} else {
|
||||
$localtrailer = "<A HREF=\"editversions.cgi\">edit</A> more versions";
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# product = '' -> Show nice list of versions
|
||||
#
|
||||
|
||||
unless ($product) {
|
||||
PutHeader("Select product");
|
||||
|
||||
SendSQL("SELECT products.product,products.description,'xyzzy'
|
||||
FROM products
|
||||
GROUP BY products.product
|
||||
ORDER BY products.product");
|
||||
print "<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0><TR BGCOLOR=\"#6666FF\">\n";
|
||||
print " <TH ALIGN=\"left\">Edit versions of ...</TH>\n";
|
||||
print " <TH ALIGN=\"left\">Description</TH>\n";
|
||||
print " <TH ALIGN=\"left\">Bugs</TH>\n";
|
||||
#print " <TH ALIGN=\"left\">Edit</TH>\n";
|
||||
print "</TR>";
|
||||
while ( MoreSQLData() ) {
|
||||
my ($product, $description, $bugs) = FetchSQLData();
|
||||
$description ||= "<FONT COLOR=\"red\">missing</FONT>";
|
||||
$bugs ||= "none";
|
||||
print "<TR>\n";
|
||||
print " <TD VALIGN=\"top\"><A HREF=\"editversions.cgi?product=", url_quote($product), "\"><B>$product</B></A></TD>\n";
|
||||
print " <TD VALIGN=\"top\">$description</TD>\n";
|
||||
print " <TD VALIGN=\"top\">$bugs</TD>\n";
|
||||
#print " <TD VALIGN=\"top\"><A HREF=\"editversions.cgi?action=edit&product=", url_quote($product), "\">Edit</A></TD>\n";
|
||||
}
|
||||
print "</TR></TABLE>\n";
|
||||
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='' -> Show nice list of versions
|
||||
#
|
||||
|
||||
unless ($action) {
|
||||
PutHeader("Select version of $product");
|
||||
CheckProduct($product);
|
||||
|
||||
=for me
|
||||
|
||||
# Das geht nicht wie vermutet. Ich bekomme nicht alle Versionen
|
||||
# angezeigt! Schade. Ich würde gerne sehen, wieviel Bugs pro
|
||||
# Version angegeben sind ...
|
||||
|
||||
SendSQL("SELECT value,program,COUNT(bug_id)
|
||||
FROM versions LEFT JOIN bugs
|
||||
ON program=product AND value=version
|
||||
WHERE program=" . SqlQuote($product) . "
|
||||
GROUP BY value");
|
||||
|
||||
=cut
|
||||
|
||||
SendSQL("SELECT value,program
|
||||
FROM versions
|
||||
WHERE program=" . SqlQuote($product) . "
|
||||
ORDER BY value");
|
||||
|
||||
print "<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0><TR BGCOLOR=\"#6666FF\">\n";
|
||||
print " <TH ALIGN=\"left\">Edit version ...</TH>\n";
|
||||
#print " <TH ALIGN=\"left\">Bugs</TH>\n";
|
||||
print " <TH ALIGN=\"left\">Action</TH>\n";
|
||||
print "</TR>";
|
||||
while ( MoreSQLData() ) {
|
||||
my ($version,$dummy,$bugs) = FetchSQLData();
|
||||
$bugs ||= 'none';
|
||||
print "<TR>\n";
|
||||
print " <TD VALIGN=\"top\"><A HREF=\"editversions.cgi?product=", url_quote($product), "&version=", url_quote($version), "&action=edit\"><B>$version</B></A></TD>\n";
|
||||
#print " <TD VALIGN=\"top\">$bugs</TD>\n";
|
||||
print " <TD VALIGN=\"top\"><A HREF=\"editversions.cgi?product=", url_quote($product), "&version=", url_quote($version), "&action=del\"><B>Delete</B></A></TD>\n";
|
||||
print "</TR>";
|
||||
}
|
||||
print "<TR>\n";
|
||||
print " <TD VALIGN=\"top\">Add a new version</TD>\n";
|
||||
print " <TD VALIGN=\"top\" ALIGN=\"middle\"><A HREF=\"editversions.cgi?product=", url_quote($product) . "&action=add\">Add</A></TD>\n";
|
||||
print "</TR></TABLE>\n";
|
||||
|
||||
PutTrailer();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='add' -> present form for parameters for new version
|
||||
#
|
||||
# (next action will be 'new')
|
||||
#
|
||||
|
||||
if ($action eq 'add') {
|
||||
PutHeader("Add version of $product");
|
||||
CheckProduct($product);
|
||||
|
||||
#print "This page lets you add a new version to a bugzilla-tracked product.\n";
|
||||
|
||||
print "<FORM METHOD=POST ACTION=editversions.cgi>\n";
|
||||
print "<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0><TR>\n";
|
||||
|
||||
EmitFormElements($product, $version);
|
||||
|
||||
print "</TABLE>\n<HR>\n";
|
||||
print "<INPUT TYPE=SUBMIT VALUE=\"Add\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"action\" VALUE=\"new\">\n";
|
||||
print "</FORM>";
|
||||
|
||||
my $other = $localtrailer;
|
||||
$other =~ s/more/other/;
|
||||
PutTrailer($other);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='new' -> add version entered in the 'action=add' screen
|
||||
#
|
||||
|
||||
if ($action eq 'new') {
|
||||
PutHeader("Adding new version");
|
||||
CheckProduct($product);
|
||||
|
||||
# Cleanups and valididy checks
|
||||
|
||||
unless ($version) {
|
||||
print "You must enter a text for the new version. Please press\n";
|
||||
print "<b>Back</b> and try again.\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
if (TestVersion($product,$version)) {
|
||||
print "The version '$version' already exists. Please press\n";
|
||||
print "<b>Back</b> and try again.\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
# Add the new version
|
||||
SendSQL("INSERT INTO versions ( " .
|
||||
"value, program" .
|
||||
" ) VALUES ( " .
|
||||
SqlQuote($version) . "," .
|
||||
SqlQuote($product) . ")");
|
||||
|
||||
# Make versioncache flush
|
||||
unlink "data/versioncache";
|
||||
|
||||
print "OK, done.<p>\n";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='del' -> ask if user really wants to delete
|
||||
#
|
||||
# (next action would be 'delete')
|
||||
#
|
||||
|
||||
if ($action eq 'del') {
|
||||
PutHeader("Delete version of $product");
|
||||
CheckVersion($product, $version);
|
||||
|
||||
SendSQL("SELECT count(bug_id),product,version
|
||||
FROM bugs
|
||||
GROUP BY product,version
|
||||
HAVING product=" . SqlQuote($product) . "
|
||||
AND version=" . SqlQuote($version));
|
||||
my $bugs = FetchOneColumn();
|
||||
|
||||
print "<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0>\n";
|
||||
print "<TR BGCOLOR=\"#6666FF\">\n";
|
||||
print " <TH VALIGN=\"top\" ALIGN=\"left\">Part</TH>\n";
|
||||
print " <TH VALIGN=\"top\" ALIGN=\"left\">Value</TH>\n";
|
||||
|
||||
print "</TR><TR>\n";
|
||||
print " <TH ALIGN=\"left\" VALIGN=\"top\">Product:</TH>\n";
|
||||
print " <TD VALIGN=\"top\">$product</TD>\n";
|
||||
print "</TR><TR>\n";
|
||||
print " <TH ALIGN=\"left\" VALIGN=\"top\">Version:</TH>\n";
|
||||
print " <TD VALIGN=\"top\">$version</TD>\n";
|
||||
print "</TR><TR>\n";
|
||||
print " <TH ALIGN=\"left\" VALIGN=\"top\">Bugs:</TH>\n";
|
||||
print " <TD VALIGN=\"top\">", $bugs || 'none' , "</TD>\n";
|
||||
print "</TR></TABLE>\n";
|
||||
|
||||
print "<H2>Confirmation</H2>\n";
|
||||
|
||||
if ($bugs) {
|
||||
if (!Param("allowbugdeletion")) {
|
||||
print "Sorry, there are $bugs bugs outstanding for this version.
|
||||
You must reassign those bugs to another version before you can delete this
|
||||
one.";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
print "<TABLE BORDER=0 CELLPADDING=20 WIDTH=\"70%\" BGCOLOR=\"red\"><TR><TD>\n",
|
||||
"There are bugs entered for this version! When you delete this ",
|
||||
"version, <B><BLINK>all</BLINK></B> stored bugs will be deleted, too. ",
|
||||
"You could not even see the bug history for this version anymore!\n",
|
||||
"</TD></TR></TABLE>\n";
|
||||
}
|
||||
|
||||
print "<P>Do you really want to delete this version?<P>\n";
|
||||
print "<FORM METHOD=POST ACTION=editversions.cgi>\n";
|
||||
print "<INPUT TYPE=SUBMIT VALUE=\"Yes, delete\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"action\" VALUE=\"delete\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"product\" VALUE=\"" .
|
||||
value_quote($product) . "\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"version\" VALUE=\"" .
|
||||
value_quote($version) . "\">\n";
|
||||
print "</FORM>";
|
||||
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='delete' -> really delete the version
|
||||
#
|
||||
|
||||
if ($action eq 'delete') {
|
||||
PutHeader("Deleting version of $product");
|
||||
CheckVersion($product,$version);
|
||||
|
||||
# lock the tables before we start to change everything:
|
||||
|
||||
SendSQL("LOCK TABLES attachments WRITE,
|
||||
bugs WRITE,
|
||||
bugs_activity WRITE,
|
||||
versions WRITE,
|
||||
dependencies WRITE");
|
||||
|
||||
# According to MySQL doc I cannot do a DELETE x.* FROM x JOIN Y,
|
||||
# so I have to iterate over bugs and delete all the indivial entries
|
||||
# in bugs_activies and attachments.
|
||||
|
||||
if (Param("allowbugdeletion")) {
|
||||
|
||||
SendSQL("SELECT bug_id
|
||||
FROM bugs
|
||||
WHERE product=" . SqlQuote($product) . "
|
||||
AND version=" . SqlQuote($version));
|
||||
while (MoreSQLData()) {
|
||||
my $bugid = FetchOneColumn();
|
||||
|
||||
PushGlobalSQLState();
|
||||
SendSQL("DELETE FROM attachments WHERE bug_id=$bugid");
|
||||
SendSQL("DELETE FROM bugs_activity WHERE bug_id=$bugid");
|
||||
SendSQL("DELETE FROM dependencies WHERE blocked=$bugid");
|
||||
PopGlobalSQLState();
|
||||
}
|
||||
print "Attachments, bug activity and dependencies deleted.<BR>\n";
|
||||
|
||||
|
||||
# Deleting the rest is easier:
|
||||
|
||||
SendSQL("DELETE FROM bugs
|
||||
WHERE product=" . SqlQuote($product) . "
|
||||
AND version=" . SqlQuote($version));
|
||||
print "Bugs deleted.<BR>\n";
|
||||
}
|
||||
|
||||
SendSQL("DELETE FROM versions
|
||||
WHERE program=" . SqlQuote($product) . "
|
||||
AND value=" . SqlQuote($version));
|
||||
print "Version deleted.<P>\n";
|
||||
SendSQL("UNLOCK TABLES");
|
||||
|
||||
unlink "data/versioncache";
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='edit' -> present the edit version form
|
||||
#
|
||||
# (next action would be 'update')
|
||||
#
|
||||
|
||||
if ($action eq 'edit') {
|
||||
PutHeader("Edit version of $product");
|
||||
CheckVersion($product,$version);
|
||||
|
||||
print "<FORM METHOD=POST ACTION=editversions.cgi>\n";
|
||||
print "<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0><TR>\n";
|
||||
|
||||
EmitFormElements($product, $version);
|
||||
|
||||
print "</TR></TABLE>\n";
|
||||
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"versionold\" VALUE=\"" .
|
||||
value_quote($version) . "\">\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=\"action\" VALUE=\"update\">\n";
|
||||
print "<INPUT TYPE=SUBMIT VALUE=\"Update\">\n";
|
||||
|
||||
print "</FORM>";
|
||||
|
||||
my $other = $localtrailer;
|
||||
$other =~ s/more/other/;
|
||||
PutTrailer($other);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# action='update' -> update the version
|
||||
#
|
||||
|
||||
if ($action eq 'update') {
|
||||
PutHeader("Update version of $product");
|
||||
|
||||
my $versionold = trim($::FORM{versionold} || '');
|
||||
|
||||
CheckVersion($product,$versionold);
|
||||
|
||||
# Note that the order of this tests is important. If you change
|
||||
# them, be sure to test for WHERE='$version' or WHERE='$versionold'
|
||||
|
||||
SendSQL("LOCK TABLES bugs WRITE,
|
||||
versions WRITE");
|
||||
|
||||
if ($version ne $versionold) {
|
||||
unless ($version) {
|
||||
print "Sorry, I can't delete the version text.";
|
||||
PutTrailer($localtrailer);
|
||||
SendSQL("UNLOCK TABLES");
|
||||
exit;
|
||||
}
|
||||
if (TestVersion($product,$version)) {
|
||||
print "Sorry, version '$version' is already in use.";
|
||||
PutTrailer($localtrailer);
|
||||
SendSQL("UNLOCK TABLES");
|
||||
exit;
|
||||
}
|
||||
SendSQL("UPDATE bugs
|
||||
SET version=" . SqlQuote($version) . ",
|
||||
delta_ts = delta_ts
|
||||
WHERE version=" . SqlQuote($versionold) . "
|
||||
AND product=" . SqlQuote($product));
|
||||
SendSQL("UPDATE versions
|
||||
SET value=" . SqlQuote($version) . "
|
||||
WHERE program=" . SqlQuote($product) . "
|
||||
AND value=" . SqlQuote($versionold));
|
||||
unlink "data/versioncache";
|
||||
print "Updated version.<BR>\n";
|
||||
}
|
||||
SendSQL("UNLOCK TABLES");
|
||||
|
||||
PutTrailer($localtrailer);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# No valid action found
|
||||
#
|
||||
|
||||
PutHeader("Error");
|
||||
print "I don't have a clue what you want.<BR>\n";
|
||||
@@ -1,361 +0,0 @@
|
||||
#!/usr/bonsaitools/bin/perl -wT
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Terry Weissman <terry@mozilla.org>
|
||||
# Dave Miller <justdave@syndicomm.com>
|
||||
# Joe Robins <jmrobins@tgix.com>
|
||||
# Gervase Markham <gerv@gerv.net>
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# enter_bug.cgi
|
||||
# -------------
|
||||
# Displays bug entry form. Bug fields are specified through popup menus,
|
||||
# drop-down lists, or text fields. Default for these values can be
|
||||
# passed in as parameters to the cgi.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
use lib qw(.);
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
use vars qw(
|
||||
$unconfirmedstate
|
||||
$template
|
||||
$vars
|
||||
%COOKIE
|
||||
@enterable_products
|
||||
@legal_opsys
|
||||
@legal_platform
|
||||
@legal_priority
|
||||
@legal_severity
|
||||
%MFORM
|
||||
%versions
|
||||
);
|
||||
|
||||
# We have to connect to the database, even though we don't use it in this code,
|
||||
# because we might occasionally rebuild the version cache, which causes tokens
|
||||
# to get deleted from the database, which needs a database connection.
|
||||
ConnectToDatabase();
|
||||
|
||||
# If we're using bug groups to restrict bug entry, we need to know who the
|
||||
# user is right from the start.
|
||||
confirm_login() if (Param("usebuggroupsentry"));
|
||||
|
||||
if (!defined $::FORM{'product'}) {
|
||||
GetVersionTable();
|
||||
quietly_check_login();
|
||||
|
||||
my %products;
|
||||
|
||||
foreach my $p (@enterable_products) {
|
||||
if (!(Param("usebuggroupsentry")
|
||||
&& GroupExists($p)
|
||||
&& !UserInGroup($p)))
|
||||
{
|
||||
$products{$p} = $::proddesc{$p};
|
||||
}
|
||||
}
|
||||
|
||||
my $prodsize = scalar(keys %products);
|
||||
if ($prodsize == 0) {
|
||||
DisplayError("Either no products have been defined to enter bugs ".
|
||||
"against or you have not been given access to any.\n");
|
||||
exit;
|
||||
}
|
||||
elsif ($prodsize > 1) {
|
||||
$vars->{'proddesc'} = \%products;
|
||||
|
||||
$vars->{'target'} = "enter_bug.cgi";
|
||||
$vars->{'format'} = $::FORM{'format'};
|
||||
$vars->{'title'} = "Enter Bug";
|
||||
$vars->{'h2'} =
|
||||
"First, you must pick a product on which to enter a bug.";
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
$template->process("global/choose-product.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
exit;
|
||||
}
|
||||
|
||||
$::FORM{'product'} = (keys %products)[0];
|
||||
$::MFORM{'product'} = [$::FORM{'product'}];
|
||||
|
||||
}
|
||||
|
||||
my $product = $::FORM{'product'};
|
||||
|
||||
##############################################################################
|
||||
# Useful Subroutines
|
||||
##############################################################################
|
||||
sub formvalue {
|
||||
my ($name, $default) = (@_);
|
||||
return $::FORM{$name} || $default || "";
|
||||
}
|
||||
|
||||
sub pickplatform {
|
||||
return formvalue("rep_platform") if formvalue("rep_platform");
|
||||
|
||||
if ( Param('usebrowserinfo') ) {
|
||||
for ($ENV{'HTTP_USER_AGENT'}) {
|
||||
#PowerPC
|
||||
/\(.*PowerPC.*\)/i && do {return "Macintosh";};
|
||||
/\(.*PPC.*\)/ && do {return "Macintosh";};
|
||||
/\(.*AIX.*\)/ && do {return "Macintosh";};
|
||||
#Intel x86
|
||||
/\(.*[ix0-9]86.*\)/ && do {return "PC";};
|
||||
#Versions of Windows that only run on Intel x86
|
||||
/\(.*Windows 9.*\)/ && do {return "PC";};
|
||||
/\(.*Win9.*\)/ && do {return "PC";};
|
||||
/\(.*Windows 3.*\)/ && do {return "PC";};
|
||||
/\(.*Win16.*\)/ && do {return "PC";};
|
||||
#Sparc
|
||||
/\(.*sparc.*\)/ && do {return "Sun";};
|
||||
/\(.*sun4.*\)/ && do {return "Sun";};
|
||||
#Alpha
|
||||
/\(.*Alpha.*\)/i && do {return "DEC";};
|
||||
#MIPS
|
||||
/\(.*IRIX.*\)/i && do {return "SGI";};
|
||||
/\(.*MIPS.*\)/i && do {return "SGI";};
|
||||
#68k
|
||||
/\(.*68K.*\)/ && do {return "Macintosh";};
|
||||
/\(.*680[x0]0.*\)/ && do {return "Macintosh";};
|
||||
#ARM
|
||||
# /\(.*ARM.*\) && do {return "ARM";};
|
||||
#Stereotypical and broken
|
||||
/\(.*Macintosh.*\)/ && do {return "Macintosh";};
|
||||
/\(.*Mac OS [89].*\)/ && do {return "Macintosh";};
|
||||
/\(Win.*\)/ && do {return "PC";};
|
||||
/\(.*Windows NT.*\)/ && do {return "PC";};
|
||||
/\(.*OSF.*\)/ && do {return "DEC";};
|
||||
/\(.*HP-?UX.*\)/i && do {return "HP";};
|
||||
/\(.*IRIX.*\)/i && do {return "SGI";};
|
||||
/\(.*(SunOS|Solaris).*\)/ && do {return "Sun";};
|
||||
#Braindead old browsers who didn't follow convention:
|
||||
/Amiga/ && do {return "Macintosh";};
|
||||
}
|
||||
}
|
||||
# default
|
||||
return "Other";
|
||||
}
|
||||
|
||||
sub pickos {
|
||||
if (formvalue('op_sys') ne "") {
|
||||
return formvalue('op_sys');
|
||||
}
|
||||
if ( Param('usebrowserinfo') ) {
|
||||
for ($ENV{'HTTP_USER_AGENT'}) {
|
||||
/\(.*IRIX.*\)/ && do {return "IRIX";};
|
||||
/\(.*OSF.*\)/ && do {return "OSF/1";};
|
||||
/\(.*Linux.*\)/ && do {return "Linux";};
|
||||
/\(.*SunOS 5.*\)/ && do {return "Solaris";};
|
||||
/\(.*SunOS.*\)/ && do {return "SunOS";};
|
||||
/\(.*HP-?UX.*\)/ && do {return "HP-UX";};
|
||||
/\(.*BSD\/OS.*\)/ && do {return "BSDI";};
|
||||
/\(.*FreeBSD.*\)/ && do {return "FreeBSD";};
|
||||
/\(.*OpenBSD.*\)/ && do {return "OpenBSD";};
|
||||
/\(.*NetBSD.*\)/ && do {return "NetBSD";};
|
||||
/\(.*BeOS.*\)/ && do {return "BeOS";};
|
||||
/\(.*AIX.*\)/ && do {return "AIX";};
|
||||
/\(.*IBM.*\)/ && do {return "OS/2";};
|
||||
/\(.*QNX.*\)/ && do {return "Neutrino";};
|
||||
/\(.*VMS.*\)/ && do {return "OpenVMS";};
|
||||
/\(.*Windows XP.*\)/ && do {return "Windows XP";};
|
||||
/\(.*Windows NT 5\.1.*\)/ && do {return "Windows XP";};
|
||||
/\(.*Windows 2000.*\)/ && do {return "Windows 2000";};
|
||||
/\(.*Windows NT 5.*\)/ && do {return "Windows 2000";};
|
||||
/\(.*Windows.*NT.*\)/ && do {return "Windows NT";};
|
||||
/\(.*Win.*98.*4\.9.*\)/ && do {return "Windows ME";};
|
||||
/\(.*Win98.*\)/ && do {return "Windows 98";};
|
||||
/\(.*Win95.*\)/ && do {return "Windows 95";};
|
||||
/\(.*Win16.*\)/ && do {return "Windows 3.1";};
|
||||
/\(.*WinNT.*\)/ && do {return "Windows NT";};
|
||||
/\(.*32bit.*\)/ && do {return "Windows 95";};
|
||||
/\(.*16bit.*\)/ && do {return "Windows 3.1";};
|
||||
/\(.*Mac OS 9.*\)/ && do {return "Mac System 9.x";};
|
||||
/\(.*Mac OS 8\.6.*\)/ && do {return "Mac System 8.6";};
|
||||
/\(.*Mac OS 8\.5.*\)/ && do {return "Mac System 8.5";};
|
||||
# Bugzilla doesn't have an entry for 8.1
|
||||
/\(.*Mac OS 8\.1.*\)/ && do {return "Mac System 8.0";};
|
||||
/\(.*Mac OS 8\.0.*\)/ && do {return "Mac System 8.0";};
|
||||
/\(.*Mac OS 8[^.].*\)/ && do {return "Mac System 8.0";};
|
||||
/\(.*Mac OS 8.*\)/ && do {return "Mac System 8.6";};
|
||||
/\(.*Mac OS X.*\)/ && do {return "MacOS X";};
|
||||
/\(.*Darwin.*\)/ && do {return "MacOS X";};
|
||||
# Silly
|
||||
/\(.*Mac.*PowerPC.*\)/ && do {return "Mac System 9.x";};
|
||||
/\(.*Mac.*PPC.*\)/ && do {return "Mac System 9.x";};
|
||||
/\(.*Mac.*68k.*\)/ && do {return "Mac System 8.0";};
|
||||
# Evil
|
||||
/Amiga/i && do {return "other";};
|
||||
/\(.*PowerPC.*\)/ && do {return "Mac System 9.x";};
|
||||
/\(.*PPC.*\)/ && do {return "Mac System 9.x";};
|
||||
/\(.*68K.*\)/ && do {return "Mac System 8.0";};
|
||||
}
|
||||
}
|
||||
# default
|
||||
return "other";
|
||||
}
|
||||
##############################################################################
|
||||
# End of subroutines
|
||||
##############################################################################
|
||||
|
||||
confirm_login() if (!(Param("usebuggroupsentry")));
|
||||
|
||||
# If the usebuggroupsentry parameter is set, we need to check and make sure
|
||||
# that the user has permission to enter a bug against this product.
|
||||
CanEnterProductOrWarn($product);
|
||||
|
||||
GetVersionTable();
|
||||
|
||||
if (1 == @{$::components{$product}}) {
|
||||
# Only one component; just pick it.
|
||||
$::FORM{'component'} = $::components{$product}->[0];
|
||||
}
|
||||
|
||||
my @components;
|
||||
SendSQL("SELECT value, description FROM components " .
|
||||
"WHERE program = " . SqlQuote($product) . " ORDER BY value");
|
||||
while (MoreSQLData()) {
|
||||
my ($name, $description) = FetchSQLData();
|
||||
|
||||
my %component;
|
||||
|
||||
$component{'name'} = $name;
|
||||
$component{'description'} = $description;
|
||||
|
||||
push @components, \%component;
|
||||
}
|
||||
|
||||
my %default;
|
||||
|
||||
$vars->{'component_'} = \@components;
|
||||
$default{'component_'} = formvalue('component');
|
||||
|
||||
$vars->{'assigned_to'} = formvalue('assigned_to');
|
||||
$vars->{'cc'} = formvalue('cc');
|
||||
$vars->{'reporter'} = $::COOKIE{'Bugzilla_login'};
|
||||
$vars->{'user_agent'} = $ENV{'HTTP_USER_AGENT'};
|
||||
$vars->{'product'} = $product;
|
||||
$vars->{'bug_file_loc'} = formvalue('bug_file_loc', "http://");
|
||||
$vars->{'short_desc'} = formvalue('short_desc');
|
||||
$vars->{'comment'} = formvalue('comment');
|
||||
|
||||
$vars->{'priority'} = \@legal_priority;
|
||||
$default{'priority'} = formvalue('priority', Param('defaultpriority'));
|
||||
|
||||
$vars->{'bug_severity'} = \@legal_severity;
|
||||
$default{'bug_severity'} = formvalue('bug_severity', 'normal');
|
||||
|
||||
$vars->{'rep_platform'} = \@legal_platform;
|
||||
$default{'rep_platform'} = pickplatform();
|
||||
|
||||
$vars->{'op_sys'} = \@legal_opsys;
|
||||
$default{'op_sys'} = pickos();
|
||||
|
||||
# Posting a bug sets a cookie for the current version, if one exists. Else,
|
||||
# the default version is the last one in the list (hopefully the latest one).
|
||||
# Eventually maybe each product should have a "current version" parameter.
|
||||
$vars->{'version'} = $::versions{$product} || [];
|
||||
if (exists $::COOKIE{"VERSION-$product"} &&
|
||||
lsearch($vars->{'version'}, $::COOKIE{"VERSION-$product"}) != -1) {
|
||||
$default{'version'} = $::COOKIE{"VERSION-$product"};
|
||||
} else {
|
||||
$default{'version'} = $vars->{'version'}->[$#{$vars->{'version'}}];
|
||||
}
|
||||
|
||||
# There must be at least one status in @status.
|
||||
my @status = "NEW";
|
||||
|
||||
if (UserInGroup("editbugs") || UserInGroup("canconfirm")) {
|
||||
SendSQL("SELECT votestoconfirm FROM products WHERE product = " .
|
||||
SqlQuote($product));
|
||||
push(@status, $unconfirmedstate) if (FetchOneColumn());
|
||||
}
|
||||
|
||||
$vars->{'bug_status'} = \@status;
|
||||
$default{'bug_status'} = $status[0];
|
||||
|
||||
# Select whether to restrict this bug to the product's bug group or not,
|
||||
# if the usebuggroups parameter is set, and if this product has a bug group.
|
||||
if ($::usergroupset ne '0') {
|
||||
# First we get the bit and description for the group.
|
||||
my $group_bit = '0';
|
||||
|
||||
if(Param("usebuggroups") && GroupExists($product)) {
|
||||
SendSQL("SELECT bit FROM groups ".
|
||||
"WHERE name = " . SqlQuote($product) . " " .
|
||||
"AND isbuggroup != 0");
|
||||
($group_bit) = FetchSQLData();
|
||||
}
|
||||
|
||||
SendSQL("SELECT bit, name, description FROM groups " .
|
||||
"WHERE bit & $::usergroupset != 0 " .
|
||||
"AND isbuggroup != 0 AND isactive = 1 ORDER BY description");
|
||||
|
||||
my @groups;
|
||||
|
||||
while (MoreSQLData()) {
|
||||
my ($bit, $prodname, $description) = FetchSQLData();
|
||||
# Don't want to include product groups other than this product.
|
||||
next unless($prodname eq $product ||
|
||||
!defined($::proddesc{$prodname}));
|
||||
|
||||
my $check;
|
||||
|
||||
# If this is the group for this product, make it checked.
|
||||
if(formvalue("maketemplate") eq
|
||||
"Remember values as bookmarkable template")
|
||||
{
|
||||
# If this is a bookmarked template, then we only want to set the
|
||||
# bit for those bits set in the template.
|
||||
$check = formvalue("bit-$bit", 0);
|
||||
}
|
||||
else {
|
||||
# $group_bit will only have a non-zero value if we're using
|
||||
# bug groups and have one for this product.
|
||||
# If $group_bit is 0, it won't match the current group, so compare
|
||||
# it to the current bit instead of checking for non-zero.
|
||||
$check = ($group_bit == $bit);
|
||||
}
|
||||
|
||||
my $group =
|
||||
{
|
||||
'bit' => $bit ,
|
||||
'checked' => $check ,
|
||||
'description' => $description
|
||||
};
|
||||
|
||||
push @groups, $group;
|
||||
}
|
||||
|
||||
$vars->{'group'} = \@groups;
|
||||
}
|
||||
|
||||
$vars->{'default'} = \%default;
|
||||
|
||||
my $format = ValidateOutputFormat($::FORM{'format'}, "create", "bug/create");
|
||||
|
||||
print "Content-type: $format->{'contenttype'}\n\n";
|
||||
$template->process("bug/create/$format->{'template'}", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
@@ -1,70 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<HTML>
|
||||
<!--
|
||||
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.
|
||||
|
||||
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):
|
||||
|
||||
Contributor(s): Terry Weissman <terry@mozilla.org>
|
||||
-->
|
||||
|
||||
<head>
|
||||
<TITLE>Clue</TITLE>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
</head><body>
|
||||
<H1>A Clue</H1>
|
||||
This form will allow you to call up a subset of the bug list.
|
||||
You should be able to add the URL of the resulting list to
|
||||
your bookmark file in order to preserve queries.
|
||||
<p>
|
||||
The way the query works, if you have nothing checked in a box,
|
||||
then all values for that field are legal, for example if you checked nothing
|
||||
in any of the boxes, you would get the entire bug list.
|
||||
<p>
|
||||
The default value of this form should correspond roughly to a "personal"
|
||||
bug list.
|
||||
<HR>
|
||||
<H2>Running queries not supported by the pretty boxes</H2>
|
||||
There is a hacky way to do some searches that aren't supported by the
|
||||
form. The buglist script will build queries based on the URL, so
|
||||
you can add other criteria.
|
||||
<P>
|
||||
For example, if you wanted to see all bugs reported against the X platform
|
||||
and assigned to jwz, you could ask for all bugs assign to jwz, then
|
||||
edit the URL in the "Location" box, adding the clause "&rep_platform=X-Windows"
|
||||
to the URL.
|
||||
<P>
|
||||
Here is a list of some of the field names you could use for additional
|
||||
unsupported searches ...
|
||||
|
||||
<PRE>
|
||||
version
|
||||
rep_platform
|
||||
op_sys
|
||||
reporter area
|
||||
bug_file_loc
|
||||
short_desc
|
||||
</PRE>
|
||||
<HR>
|
||||
<H1>Browser Notes</H1>
|
||||
<P>Bugzilla uses several non-standard Netscape extentions, but this does not seem
|
||||
to case any problem with other browsers. The lynx browser does work, but lynx
|
||||
seems to cache results of a .cgi. You'll sometimes need to press CONTROL-R to reload
|
||||
the screen to see an update.
|
||||
|
||||
</body></html>
|
||||
@@ -1,38 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html> <head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<title>Help on searching by email address.</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Help on searching by email address.</h1>
|
||||
|
||||
<p>
|
||||
This used to be simpler, but not very powerful. Now it's really
|
||||
powerful and useful, but it may not be obvious how to use it...
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To search for bugs associated with an email address:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li> Type a portion of an email address into the text field.</li>
|
||||
<li> Select which fields of the bug you expect that address to be in
|
||||
the bugs you're looking for.</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
You can look for up to two different email addresses; if you specify
|
||||
both, then only bugs which match both will show up. This is useful to
|
||||
find bugs that were, for example, created by Ralph and assigned to
|
||||
Fred.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You can also use the drop down menus to specify whether you want to
|
||||
match addresses by doing a substring match, by using regular
|
||||
expressions, or by exactly matching a fully specified email address.
|
||||
</p>
|
||||
|
||||
</body> </html>
|
||||
@@ -1,90 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<HTML>
|
||||
<head>
|
||||
|
||||
<!--
|
||||
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.
|
||||
|
||||
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):
|
||||
|
||||
Contributor(s): Terry Weissman <terry@mozilla.org>
|
||||
-->
|
||||
|
||||
|
||||
<TITLE>How to Mail to bugzilla</TITLE>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<H1>THIS DOESN'T WORK RIGHT NOW. Coming someday.</H1>
|
||||
|
||||
Mailing to "bugzilla" will be piped through a script which examines
|
||||
your message, stripping out control lines, and passing the rest of the
|
||||
message in as the description of a new bug. The control lines look like: <P>
|
||||
|
||||
<PRE>
|
||||
@FIELD-LABEL VALUE
|
||||
LABEL Legal Values
|
||||
Priority critical major normal minor trivial
|
||||
Type BUG RFE
|
||||
Product Cheddar
|
||||
Platform PC X-Windows Macintosh All
|
||||
Area CODE JAVA TEST BUILD UI PERF
|
||||
Version version 2.0b1 2.0b2 2.0b2 2.0b4 2.1a0 2.1a1 2.1b0 2.1b1 2.1b2
|
||||
OS Windows 3.1 Windows 95 Windows NT System 7 System 7.5
|
||||
AIX BSDI HP-UX IRIX Linux OSF/1 Solaris SunOS other
|
||||
Summary -anything-
|
||||
URL -anything-
|
||||
Assign someone in eng
|
||||
|
||||
|
||||
and
|
||||
|
||||
@description
|
||||
This tells the bug parse to stop looking for control lines,
|
||||
allowing the bug description to contain lines which start with @
|
||||
</PRE>
|
||||
|
||||
There are default values for all these fields. If you don't specify a
|
||||
Summary, the subject of the mail message is used. <P>
|
||||
|
||||
If you specify an illegal value, the default value is used, the
|
||||
bug is assigned to you, and the answerback message will describe
|
||||
the error. <P>
|
||||
|
||||
After the bug is posted, you will get mail verifying the posting
|
||||
and informing you of the bug number if you wish to fix any
|
||||
mistakes made by the auto-processor. <P>
|
||||
|
||||
EXAMPLE: <P>
|
||||
|
||||
|
||||
<PRE>
|
||||
% Mail bugzilla
|
||||
Subject: WinFE crashes with GPF when I pour beer on my keyboard
|
||||
@priority critical
|
||||
@platform PC
|
||||
@assign troy
|
||||
|
||||
After the beer bash I emptied the rest of the keg onto my keyboard
|
||||
and my sharp build of Navigator got a GPF.
|
||||
.
|
||||
|
||||
</PRE>
|
||||
|
||||
</body></html>
|
||||
@@ -1,645 +0,0 @@
|
||||
#!/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.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.
|
||||
#
|
||||
# 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): Dawn Endico <endico@mozilla.org>
|
||||
|
||||
|
||||
# This script reads in xml bug data from standard input and inserts
|
||||
# a new bug into bugzilla. Everything before the beginning <?xml line
|
||||
# is removed so you can pipe in email messages.
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
#####################################################################
|
||||
#
|
||||
# This script is used import bugs from another installation of bugzilla.
|
||||
# Moving a bug on another system will send mail to an alias provided by
|
||||
# the administrator of the target installation (you). Set up an alias
|
||||
# similar to the one given below so this mail will be automatically
|
||||
# run by this script and imported into your database. Run 'newaliases'
|
||||
# after adding this alias to your aliases file. Make sure your sendmail
|
||||
# installation is configured to allow mail aliases to execute code.
|
||||
#
|
||||
# bugzilla-import: "|/usr/bin/perl /opt/bugzilla/importxml.pl"
|
||||
#
|
||||
#####################################################################
|
||||
|
||||
|
||||
# figure out which path this script lives in. Set the current path to
|
||||
# this and add it to @INC so this will work when run as part of mail
|
||||
# alias by the mailer daemon
|
||||
# since "use lib" is run at compile time, we need to enclose the
|
||||
# $::path declaration in a BEGIN block so that it is executed before
|
||||
# the rest of the file is compiled.
|
||||
BEGIN {
|
||||
$::path = $0;
|
||||
$::path =~ m#(.*)/[^/]+#;
|
||||
$::path = $1;
|
||||
$::path ||= '.'; # $0 is empty at compile time. This line will
|
||||
# have no effect on this script at runtime.
|
||||
}
|
||||
|
||||
chdir $::path;
|
||||
use lib ($::path);
|
||||
|
||||
use XML::Parser;
|
||||
use Data::Dumper;
|
||||
$Data::Dumper::Useqq = 1;
|
||||
|
||||
require "CGI.pl";
|
||||
require "globals.pl";
|
||||
$::lockcount = 0;
|
||||
|
||||
ConnectToDatabase();
|
||||
GetVersionTable();
|
||||
|
||||
|
||||
sub sillyness {
|
||||
my $zz;
|
||||
$zz = $Data::Dumper::Useqq;
|
||||
$zz = %::components;
|
||||
$zz = %::versions;
|
||||
$zz = %::keywordsbyname;
|
||||
$zz = @::legal_bug_status;
|
||||
$zz = @::legal_opsys;
|
||||
$zz = @::legal_platform;
|
||||
$zz = @::legal_priority;
|
||||
$zz = @::legal_product;
|
||||
$zz = @::legal_severity;
|
||||
$zz = @::legal_resolution;
|
||||
$zz = %::target_milestone;
|
||||
}
|
||||
|
||||
# XML::Parser automatically unquotes characters when it
|
||||
# parses the XML, so this routine shouldn't be needed
|
||||
# for anything (see bug 109530).
|
||||
sub UnQuoteXMLChars {
|
||||
$_[0] =~ s/&/&/g;
|
||||
$_[0] =~ s/</</g;
|
||||
$_[0] =~ s/>/>/g;
|
||||
$_[0] =~ s/'/'/g; # ' # Darned emacs colors
|
||||
$_[0] =~ s/"/"/g; # " # Darned emacs colors
|
||||
# $_[0] =~ s/([\x80-\xFF])/&XmlUtf8Encode(ord($1))/ge;
|
||||
return($_[0]);
|
||||
}
|
||||
|
||||
sub MailMessage {
|
||||
my $subject = shift @_;
|
||||
my $message = shift @_;
|
||||
my @recipients = @_;
|
||||
|
||||
my $to = join (", ", @recipients);
|
||||
my $header = "To: $to\n";
|
||||
my $from = Param("moved-from-address");
|
||||
$from =~ s/@/\@/g;
|
||||
$header.= "From: Bugzilla <$from>\n";
|
||||
$header.= "Subject: $subject\n\n";
|
||||
|
||||
open(SENDMAIL,
|
||||
"|/usr/lib/sendmail -ODeliveryMode=background -t -i") ||
|
||||
die "Can't open sendmail";
|
||||
print SENDMAIL $header . $message . "\n";
|
||||
close SENDMAIL;
|
||||
|
||||
Log($subject . " sent to: $to");
|
||||
}
|
||||
|
||||
|
||||
sub Log {
|
||||
my ($str) = (@_);
|
||||
Lock();
|
||||
open(FID, ">>data/maillog") || die "Can't write to data/maillog";
|
||||
print FID time2str("%D %H:%M", time()) . ": $str\n";
|
||||
close FID;
|
||||
Unlock();
|
||||
}
|
||||
|
||||
sub Lock {
|
||||
if ($::lockcount <= 0) {
|
||||
$::lockcount = 0;
|
||||
open(LOCKFID, ">>data/maillock") || die "Can't open data/maillock: $!";
|
||||
my $val = flock(LOCKFID,2);
|
||||
if (!$val) { # '2' is magic 'exclusive lock' const.
|
||||
print "Content-type: text/html\n\n";
|
||||
print "Lock failed: $val\n";
|
||||
}
|
||||
chmod 0666, "data/maillock";
|
||||
}
|
||||
$::lockcount++;
|
||||
}
|
||||
|
||||
sub Unlock {
|
||||
$::lockcount--;
|
||||
if ($::lockcount <= 0) {
|
||||
flock(LOCKFID,8); # '8' is magic 'unlock' const.
|
||||
close LOCKFID;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my $xml;
|
||||
while (<>) {
|
||||
$xml .= $_;
|
||||
}
|
||||
# remove everything in file before xml header (i.e. remove the mail header)
|
||||
$xml =~ s/^.+(<\?xml version.+)$/$1/s;
|
||||
|
||||
my $parser = new XML::Parser(Style => 'Tree');
|
||||
my $tree = $parser->parse($xml);
|
||||
|
||||
my $maintainer;
|
||||
if (defined $tree->[1][0]->{'maintainer'}) {
|
||||
$maintainer= $tree->[1][0]->{'maintainer'};
|
||||
} else {
|
||||
my $subject = "Bug import error: no maintainer";
|
||||
my $message = "Cannot import these bugs because no maintainer for ";
|
||||
$message .= "the exporting db is given.\n";
|
||||
$message .= "\n\nPlease re-open the original bug.\n";
|
||||
$message .= "\n\n$xml";
|
||||
my @to = (Param("maintainer"));
|
||||
MailMessage ($subject, $message, @to);
|
||||
exit;
|
||||
}
|
||||
|
||||
my $exporter;
|
||||
if (defined $tree->[1][0]->{'exporter'}) {
|
||||
$exporter = $tree->[1][0]->{'exporter'};
|
||||
} else {
|
||||
my $subject = "Bug import error: no exporter";
|
||||
my $message = "Cannot import these bugs because no exporter is given.\n";
|
||||
$message .= "\n\nPlease re-open the original bug.\n";
|
||||
$message .= "\n\n$xml";
|
||||
my @to = (Param("maintainer"), $maintainer);
|
||||
MailMessage ($subject, $message, @to);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
unless ( Param("move-enabled") ) {
|
||||
my $subject = "Error: bug importing is disabled here";
|
||||
my $message = "Cannot import these bugs because importing is disabled\n";
|
||||
$message .= "at this site. For more info, contact ";
|
||||
$message .= Param("maintainer") . ".\n";
|
||||
my @to = (Param("maintainer"), $maintainer, $exporter);
|
||||
MailMessage ($subject, $message, @to);
|
||||
exit;
|
||||
}
|
||||
|
||||
my $exporterid = DBname_to_id($exporter);
|
||||
if ( ! $exporterid ) {
|
||||
my $subject = "Bug import error: invalid exporter";
|
||||
my $message = "The user <$tree->[1][0]->{'exporter'}> who tried to move\n";
|
||||
$message .= "bugs here does not have an account in this database.\n";
|
||||
$message .= "\n\nPlease re-open the original bug.\n";
|
||||
$message .= "\n\n$xml";
|
||||
my @to = (Param("maintainer"), $maintainer, $exporter);
|
||||
MailMessage ($subject, $message, @to);
|
||||
exit;
|
||||
}
|
||||
|
||||
my $urlbase;
|
||||
if (defined $tree->[1][0]->{'urlbase'}) {
|
||||
$urlbase= $tree->[1][0]->{'urlbase'};
|
||||
} else {
|
||||
my $subject = "Bug import error: invalid exporting database";
|
||||
my $message = "Cannot import these bugs because the name of the exporting db was not given.\n";
|
||||
$message .= "\n\nPlease re-open the original bug.\n";
|
||||
$message .= "\n\n$xml";
|
||||
my @to = (Param("maintainer"), $maintainer, $exporter);
|
||||
MailMessage ($subject, $message, @to);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
my $bugqty = ($#{$tree->[1]} +1 -3) / 4;
|
||||
my $log = "Imported $bugqty bug(s) from $urlbase,\n sent by $exporter.\n\n";
|
||||
for (my $k=1 ; $k <= $bugqty ; $k++) {
|
||||
my $cur = $k*4;
|
||||
|
||||
if (defined $tree->[1][$cur][0]->{'error'}) {
|
||||
$log .= "\nError in bug $tree->[1][$cur][4][2]\@$urlbase:";
|
||||
$log .= " $tree->[1][$cur][0]->{'error'}\n";
|
||||
if ($tree->[1][$cur][0]->{'error'} =~ /NotFound/) {
|
||||
$log .= "$exporter tried to move bug $tree->[1][$cur][4][2] here";
|
||||
$log .= " but $urlbase reports that this bug does not exist.\n";
|
||||
} elsif ( $tree->[1][$cur][0]->{'error'} =~ /NotPermitted/) {
|
||||
$log .= "$exporter tried to move bug $tree->[1][$cur][4][2] here";
|
||||
$log .= " but $urlbase reports that $exporter does not have access";
|
||||
$log .= " to that bug.\n";
|
||||
}
|
||||
next;
|
||||
}
|
||||
|
||||
my %multiple_fields;
|
||||
foreach my $field (qw (dependson cc long_desc blocks)) {
|
||||
$multiple_fields{$field} = "x";
|
||||
}
|
||||
my %all_fields;
|
||||
foreach my $field (qw (dependson product bug_status priority cc version
|
||||
bug_id rep_platform short_desc assigned_to bug_file_loc resolution
|
||||
delta_ts component reporter urlbase target_milestone bug_severity
|
||||
creation_ts qa_contact keywords status_whiteboard op_sys blocks)) {
|
||||
$all_fields{$field} = "x";
|
||||
}
|
||||
|
||||
|
||||
my %bug_fields;
|
||||
my $err = "";
|
||||
for (my $i=3 ; $i < $#{$tree->[1][$cur]} ; $i=$i+4) {
|
||||
if (defined $multiple_fields{$tree->[1][$cur][$i]}) {
|
||||
if (defined $bug_fields{$tree->[1][$cur][$i]}) {
|
||||
$bug_fields{$tree->[1][$cur][$i]} .= " " . $tree->[1][$cur][$i+1][2];
|
||||
} else {
|
||||
$bug_fields{$tree->[1][$cur][$i]} = $tree->[1][$cur][$i+1][2];
|
||||
}
|
||||
} elsif (defined $all_fields{$tree->[1][$cur][$i]}) {
|
||||
$bug_fields{$tree->[1][$cur][$i]} = $tree->[1][$cur][$i+1][2];
|
||||
} else {
|
||||
$err .= "---\n";
|
||||
$err .= "Unknown bug field \"$tree->[1][$cur][$i]\"";
|
||||
$err .= " encountered while moving bug\n";
|
||||
$err .= "<$tree->[1][$cur][$i]>";
|
||||
if (defined $tree->[1][$cur][$i+1][3]) {
|
||||
$err .= "\n";
|
||||
for (my $j=3 ; $j < $#{$tree->[1][$cur][$i+1]} ; $j=$j+4) {
|
||||
$err .= " <". $tree->[1][$cur][$i+1][$j] . ">";
|
||||
$err .= " $tree->[1][$cur][$i+1][$j+1][2] ";
|
||||
$err .= "</". $tree->[1][$cur][$i+1][$j] . ">\n";
|
||||
}
|
||||
} else {
|
||||
$err .= " $tree->[1][$cur][$i+1][2] ";
|
||||
}
|
||||
$err .= "</$tree->[1][$cur][$i]>\n";
|
||||
}
|
||||
}
|
||||
|
||||
my @long_descs;
|
||||
for (my $i=3 ; $i < $#{$tree->[1][$cur]} ; $i=$i+4) {
|
||||
if ($tree->[1][$cur][$i] =~ /long_desc/) {
|
||||
my %long_desc;
|
||||
$long_desc{'who'} = $tree->[1][$cur][$i+1][4][2];
|
||||
$long_desc{'bug_when'} = $tree->[1][$cur][$i+1][8][2];
|
||||
$long_desc{'thetext'} = $tree->[1][$cur][$i+1][12][2];
|
||||
push @long_descs, \%long_desc;
|
||||
}
|
||||
}
|
||||
|
||||
# instead of giving each comment its own item in the longdescs
|
||||
# table like it should have, lets cat them all into one big
|
||||
# comment otherwise we would have to lie often about who
|
||||
# authored the comment since commenters in one bugzilla probably
|
||||
# don't have accounts in the other one.
|
||||
sub by_date {my @a; my @b; $a->{'bug_when'} cmp $b->{'bug_when'}; }
|
||||
my @sorted_descs = sort by_date @long_descs;
|
||||
my $long_description = "";
|
||||
for (my $z=0 ; $z <= $#sorted_descs ; $z++) {
|
||||
unless ( $z==0 ) {
|
||||
$long_description .= "\n\n\n------- Additional Comments From ";
|
||||
$long_description .= "$sorted_descs[$z]->{'who'} ";
|
||||
$long_description .= "$sorted_descs[$z]->{'bug_when'}";
|
||||
$long_description .= " ----\n\n";
|
||||
}
|
||||
$long_description .= $sorted_descs[$z]->{'thetext'};
|
||||
$long_description .= "\n";
|
||||
}
|
||||
|
||||
my $comments;
|
||||
|
||||
$comments .= "\n\n------- Bug moved to this database by $exporter ";
|
||||
$comments .= time2str("%Y-%m-%d %H:%M", time);
|
||||
$comments .= " -------\n\n";
|
||||
$comments .= "This bug previously known as bug $bug_fields{'bug_id'} at ";
|
||||
$comments .= $urlbase . "\n";
|
||||
$comments .= $urlbase . "show_bug.cgi?";
|
||||
$comments .= "id=" . $bug_fields{'bug_id'} . "\n";
|
||||
$comments .= "Originally filed under the $bug_fields{'product'} ";
|
||||
$comments .= "product and $bug_fields{'component'} component.\n";
|
||||
if (defined $bug_fields{'dependson'}) {
|
||||
$comments .= "Bug depends on bug(s) $bug_fields{'dependson'}.\n";
|
||||
}
|
||||
if (defined $bug_fields{'blocks'}) {
|
||||
$comments .= "Bug blocks bug(s) $bug_fields{'blocks'}.\n";
|
||||
}
|
||||
|
||||
my @query = ();
|
||||
my @values = ();
|
||||
foreach my $field ( qw(creation_ts delta_ts status_whiteboard) ) {
|
||||
if ( (defined $bug_fields{$field}) && ($bug_fields{$field}) ){
|
||||
push (@query, "$field");
|
||||
push (@values, SqlQuote($bug_fields{$field}));
|
||||
}
|
||||
}
|
||||
|
||||
if ( (defined $bug_fields{'bug_file_loc'}) && ($bug_fields{'bug_file_loc'}) ){
|
||||
push (@query, "bug_file_loc");
|
||||
push (@values, SqlQuote($bug_fields{'bug_file_loc'}));
|
||||
}
|
||||
|
||||
if ( (defined $bug_fields{'short_desc'}) && ($bug_fields{'short_desc'}) ){
|
||||
push (@query, "short_desc");
|
||||
push (@values, SqlQuote($bug_fields{'short_desc'}) );
|
||||
}
|
||||
|
||||
|
||||
my $prod;
|
||||
my $comp;
|
||||
my $default_prod = Param("moved-default-product");
|
||||
my $default_comp = Param("moved-default-component");
|
||||
if ( (defined ($bug_fields{'product'})) &&
|
||||
(defined ($bug_fields{'component'})) ) {
|
||||
$prod = $bug_fields{'product'};
|
||||
$comp = $bug_fields{'component'};
|
||||
} else {
|
||||
$prod = $default_prod;
|
||||
$comp = $default_comp;
|
||||
}
|
||||
|
||||
my @product;
|
||||
my @component;
|
||||
if ((@product = grep { lc($prod) eq lc($_) } @::legal_product) &&
|
||||
(@component = grep { lc($comp) eq lc($_) } @{$::components{$product[0]}}) ) {
|
||||
push (@query, "product");
|
||||
push (@values, SqlQuote($product[0]) );
|
||||
push (@query, "component");
|
||||
push (@values, SqlQuote($component[0]) );
|
||||
} elsif ((@product = grep { lc($default_prod) eq lc($_) } @::legal_product) &&
|
||||
(@component = grep { lc($default_comp) eq lc($_) } @{$::components{$product[0]}}) ) {
|
||||
push (@query, "product");
|
||||
push (@values, SqlQuote($product[0]) );
|
||||
push (@query, "component");
|
||||
push (@values, SqlQuote($component[0]) );
|
||||
} else {
|
||||
my $subject = "Bug import error: invalid default product or component";
|
||||
my $message = "Cannot import these bugs because an invalid default ";
|
||||
$message .= "product and/or component was defined for the target db.\n";
|
||||
$message .= Param("maintainer") . " needs to fix the definitions of ";
|
||||
$message .= "moved-default-product and moved-default-component.\n";
|
||||
$message .= "\n\nPlease re-open the original bug.\n";
|
||||
$message .= "\n\n$xml";
|
||||
my @to = (Param("maintainer"), $maintainer, $exporter);
|
||||
MailMessage ($subject, $message, @to);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (defined ($::versions{$product[0]} ) &&
|
||||
(my @version = grep(lc($_) eq lc($bug_fields{'version'}),
|
||||
@{$::versions{$product[0]}})) ){
|
||||
push (@values, SqlQuote($version[0]) );
|
||||
push (@query, "version");
|
||||
} else {
|
||||
push (@query, "version");
|
||||
push (@values, SqlQuote($::versions{$product[0]}->[0]));
|
||||
$err .= "Unknown version $bug_fields{'version'} in product $product[0]. ";
|
||||
$err .= "Setting version to \"$::versions{$product[0]}->[0]\".\n";
|
||||
}
|
||||
|
||||
if (defined ($bug_fields{'priority'}) &&
|
||||
(my @priority = grep(lc($_) eq lc($bug_fields{'priority'}), @::legal_priority)) ){
|
||||
push (@values, SqlQuote($priority[0]) );
|
||||
push (@query, "priority");
|
||||
} else {
|
||||
push (@values, SqlQuote("P3"));
|
||||
push (@query, "priority");
|
||||
$err .= "Unknown priority ";
|
||||
$err .= (defined $bug_fields{'priority'})?$bug_fields{'priority'}:"unknown";
|
||||
$err .= ". Setting to default priority \"P3\".\n";
|
||||
}
|
||||
|
||||
if (defined ($bug_fields{'rep_platform'}) &&
|
||||
(my @platform = grep(lc($_) eq lc($bug_fields{'rep_platform'}), @::legal_platform)) ){
|
||||
push (@values, SqlQuote($platform[0]) );
|
||||
push (@query, "rep_platform");
|
||||
} else {
|
||||
push (@values, SqlQuote("Other") );
|
||||
push (@query, "rep_platform");
|
||||
$err .= "Unknown platform ";
|
||||
$err .= (defined $bug_fields{'rep_platform'})?
|
||||
$bug_fields{'rep_platform'}:"unknown";
|
||||
$err .= ". Setting to default platform \"Other\".\n";
|
||||
}
|
||||
|
||||
if (defined ($bug_fields{'op_sys'}) &&
|
||||
(my @opsys = grep(lc($_) eq lc($bug_fields{'op_sys'}), @::legal_opsys)) ){
|
||||
push (@values, SqlQuote($opsys[0]) );
|
||||
push (@query, "op_sys");
|
||||
} else {
|
||||
push (@values, SqlQuote("other"));
|
||||
push (@query, "op_sys");
|
||||
$err .= "Unknown operating system ";
|
||||
$err .= (defined $bug_fields{'op_sys'})?$bug_fields{'op_sys'}:"unknown";
|
||||
$err .= ". Setting to default OS \"other\".\n";
|
||||
}
|
||||
|
||||
if (Param("usetargetmilestone")) {
|
||||
if (defined ($::target_milestone{$product[0]} ) &&
|
||||
(my @tm = grep(lc($_) eq lc($bug_fields{'target_milestone'}),
|
||||
@{$::target_milestone{$product[0]}})) ){
|
||||
push (@values, SqlQuote($tm[0]) );
|
||||
push (@query, "target_milestone");
|
||||
} else {
|
||||
SendSQL("SELECT defaultmilestone FROM products " .
|
||||
"WHERE product = " . SqlQuote($product[0]));
|
||||
my $tm = FetchOneColumn();
|
||||
push (@values, SqlQuote($tm));
|
||||
push (@query, "target_milestone");
|
||||
$err .= "Unknown milestone \"";
|
||||
$err .= (defined $bug_fields{'target_milestone'})?
|
||||
$bug_fields{'target_milestone'}:"unknown";
|
||||
$err .= "\" in product \"$product[0]\".\n";
|
||||
$err .= " Setting to default milestone for this product, ";
|
||||
$err .= "\'" . $tm . "\'\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (defined ($bug_fields{'bug_severity'}) &&
|
||||
(my @severity= grep(lc($_) eq lc($bug_fields{'bug_severity'}),
|
||||
@::legal_severity)) ){
|
||||
push (@values, SqlQuote($severity[0]) );
|
||||
push (@query, "bug_severity");
|
||||
} else {
|
||||
push (@values, SqlQuote("normal"));
|
||||
push (@query, "bug_severity");
|
||||
$err .= "Unknown severity ";
|
||||
$err .= (defined $bug_fields{'bug_severity'})?
|
||||
$bug_fields{'bug_severity'}:"unknown";
|
||||
$err .= ". Setting to default severity \"normal\".\n";
|
||||
}
|
||||
|
||||
my $reporterid = DBname_to_id($bug_fields{'reporter'});
|
||||
if ( ($bug_fields{'reporter'}) && ( $reporterid ) ) {
|
||||
push (@values, SqlQuote($reporterid));
|
||||
push (@query, "reporter");
|
||||
} else {
|
||||
push (@values, SqlQuote($exporterid));
|
||||
push (@query, "reporter");
|
||||
$err .= "The original reporter of this bug does not have\n";
|
||||
$err .= " an account here. Reassigning to the person who moved\n";
|
||||
$err .= " it here, $exporter.\n";
|
||||
if ( $bug_fields{'reporter'} ) {
|
||||
$err .= " Previous reporter was $bug_fields{'reporter'}.\n";
|
||||
} else {
|
||||
$err .= " Previous reporter is unknown.\n";
|
||||
}
|
||||
}
|
||||
|
||||
my $changed_owner = 0;
|
||||
if ( ($bug_fields{'assigned_to'}) &&
|
||||
( DBname_to_id($bug_fields{'assigned_to'})) ) {
|
||||
push (@values, SqlQuote(DBname_to_id($bug_fields{'assigned_to'})));
|
||||
push (@query, "assigned_to");
|
||||
} else {
|
||||
push (@values, SqlQuote($exporterid) );
|
||||
push (@query, "assigned_to");
|
||||
$changed_owner = 1;
|
||||
$err .= "The original owner of this bug does not have\n";
|
||||
$err .= " an account here. Reassigning to the person who moved\n";
|
||||
$err .= " it here, $exporter.\n";
|
||||
if ( $bug_fields{'assigned_to'} ) {
|
||||
$err .= " Previous owner was $bug_fields{'assigned_to'}.\n";
|
||||
} else {
|
||||
$err .= " Previous owner is unknown.\n";
|
||||
}
|
||||
}
|
||||
|
||||
my @resolution;
|
||||
if (defined ($bug_fields{'resolution'}) &&
|
||||
(@resolution= grep(lc($_) eq lc($bug_fields{'resolution'}), @::legal_resolution)) ){
|
||||
push (@values, SqlQuote($resolution[0]) );
|
||||
push (@query, "resolution");
|
||||
} elsif ( (defined $bug_fields{'resolution'}) && (!$resolution[0]) ){
|
||||
$err .= "Unknown resolution \"$bug_fields{'resolution'}\".\n";
|
||||
}
|
||||
|
||||
# if the bug's owner changed, mark the bug NEW, unless a valid
|
||||
# resolution is set, which indicates that the bug should be closed.
|
||||
#
|
||||
if ( ($changed_owner) && (!$resolution[0]) ) {
|
||||
push (@values, SqlQuote("NEW"));
|
||||
push (@query, "bug_status");
|
||||
$err .= "Bug assigned to new owner, setting status to \"NEW\".\n";
|
||||
$err .= " Previous status was \"";
|
||||
$err .= (defined $bug_fields{'bug_status'})?
|
||||
$bug_fields{'bug_status'}:"unknown";
|
||||
$err .= "\".\n";
|
||||
} elsif ( (defined ($bug_fields{'resolution'})) && (!$resolution[0]) ){
|
||||
#if the resolution was illegal then set status to NEW
|
||||
push (@values, SqlQuote("NEW"));
|
||||
push (@query, "bug_status");
|
||||
$err .= "Resolution was invalid. Setting status to \"NEW\".\n";
|
||||
$err .= " Previous status was \"";
|
||||
$err .= (defined $bug_fields{'bug_status'})?
|
||||
$bug_fields{'bug_status'}:"unknown";
|
||||
$err .= "\".\n";
|
||||
} elsif (defined ($bug_fields{'bug_status'}) &&
|
||||
(my @status = grep(lc($_) eq lc($bug_fields{'bug_status'}), @::legal_bug_status)) ){
|
||||
#if a bug status was set then use it, if its legal
|
||||
push (@values, SqlQuote($status[0]));
|
||||
push (@query, "bug_status");
|
||||
} else {
|
||||
# if all else fails, make the bug new
|
||||
push (@values, SqlQuote("NEW"));
|
||||
push (@query, "bug_status");
|
||||
$err .= "Unknown status ";
|
||||
$err .= (defined $bug_fields{'bug_status'})?
|
||||
$bug_fields{'bug_status'}:"unknown";
|
||||
$err .= ". Setting to default status \"NEW\".\n";
|
||||
}
|
||||
|
||||
if (Param("useqacontact")) {
|
||||
my $qa_contact;
|
||||
if ( (defined $bug_fields{'qa_contact'}) &&
|
||||
($qa_contact = DBname_to_id($bug_fields{'qa_contact'})) ){
|
||||
push (@values, SqlQuote($qa_contact));
|
||||
push (@query, "qa_contact");
|
||||
} else {
|
||||
SendSQL("select initialqacontact from components where program=" .
|
||||
SqlQuote($product[0]) .
|
||||
" and value=" . SqlQuote($component[0]) );
|
||||
$qa_contact = FetchOneColumn();
|
||||
push (@values, SqlQuote(DBname_to_id($qa_contact)) );
|
||||
push (@query, "qa_contact");
|
||||
$err .= "Setting qa contact to the default for this product.\n";
|
||||
$err .= " This bug either had no qa contact or an invalid one.\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my $query = "INSERT INTO bugs (\n"
|
||||
. join (",\n", @query)
|
||||
. "\n) VALUES (\n"
|
||||
. join (",\n", @values)
|
||||
. "\n)\n";
|
||||
SendSQL($query);
|
||||
SendSQL("select LAST_INSERT_ID()");
|
||||
my $id = FetchOneColumn();
|
||||
|
||||
if (defined $bug_fields{'cc'}) {
|
||||
foreach my $person (split(/[ ,]/, $bug_fields{'cc'})) {
|
||||
my $uid;
|
||||
if ( ($person ne "") && ($uid = DBname_to_id($person)) ) {
|
||||
SendSQL("insert into cc (bug_id, who) values ($id, " . SqlQuote($uid) .")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (defined ($bug_fields{'keywords'})) {
|
||||
my %keywordseen;
|
||||
foreach my $keyword (split(/[\s,]+/, $bug_fields{'keywords'})) {
|
||||
if ($keyword eq '') {
|
||||
next;
|
||||
}
|
||||
my $i = $::keywordsbyname{$keyword};
|
||||
if (!$i) {
|
||||
$err .= "Skipping unknown keyword: $keyword.\n";
|
||||
next;
|
||||
}
|
||||
if (!$keywordseen{$i}) {
|
||||
SendSQL("INSERT INTO keywords (bug_id, keywordid) VALUES ($id, $i)");
|
||||
$keywordseen{$i} = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$long_description .= "\n" . $comments;
|
||||
if ($err) {
|
||||
$long_description .= "\n$err\n";
|
||||
}
|
||||
|
||||
SendSQL("INSERT INTO longdescs (bug_id, who, bug_when, thetext) VALUES " .
|
||||
"($id, $exporterid, now(), " . SqlQuote($long_description) . ")");
|
||||
|
||||
$log .= "Bug $urlbase/show_bug.cgi?id=$bug_fields{'bug_id'} ";
|
||||
$log .= "imported as bug $id.\n";
|
||||
$log .= Param("urlbase") . "/show_bug.cgi?id=$id\n\n";
|
||||
if ($err) {
|
||||
$log .= "The following problems were encountered creating bug $id.\n";
|
||||
$log .= "You may have to set certain fields in the new bug by hand.\n\n";
|
||||
$log .= $err;
|
||||
$log .= "\n\n\n";
|
||||
}
|
||||
|
||||
system("./processmail", $id, $exporter);
|
||||
}
|
||||
|
||||
my $subject = "$bugqty bug(s) successfully moved from $urlbase to "
|
||||
. Param("urlbase") ;
|
||||
my @to = ($exporter);
|
||||
MailMessage ($subject, $log, @to);
|
||||
@@ -1,63 +0,0 @@
|
||||
#!/usr/bonsaitools/bin/perl -wT
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Jacob Steenhagen <jake@acutex.net>
|
||||
#
|
||||
|
||||
# Suppress silly "used only once" warnings
|
||||
use vars qw{ %COOKIE };
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Script Initialization
|
||||
###############################################################################
|
||||
|
||||
# Make it harder for us to do dangerous things in Perl.
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
# Include the Bugzilla CGI and general utility library.
|
||||
use lib ".";
|
||||
require "CGI.pl";
|
||||
|
||||
use vars qw(
|
||||
$template
|
||||
$vars
|
||||
);
|
||||
|
||||
# Establish a connection to the database backend.
|
||||
ConnectToDatabase();
|
||||
|
||||
# Check whether or not the user is logged in and, if so, set the $::userid
|
||||
# and $::usergroupset variables.
|
||||
quietly_check_login();
|
||||
|
||||
###############################################################################
|
||||
# Main Body Execution
|
||||
###############################################################################
|
||||
|
||||
$vars->{'username'} = $::COOKIE{'Bugzilla_login'} || '';
|
||||
|
||||
# Return the appropriate HTTP response headers.
|
||||
print "Content-Type: text/html\n\n";
|
||||
|
||||
# Generate and return the UI (HTML page) from the appropriate template.
|
||||
$template->process("index.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
@@ -1,75 +0,0 @@
|
||||
//
|
||||
// This file contains the installation specific values for QuickSearch.
|
||||
// See quicksearch.js for more details.
|
||||
//
|
||||
|
||||
// the global bugzilla url
|
||||
|
||||
var bugzilla = "";
|
||||
//var bugzilla = "http://bugzilla.mozilla.org/";
|
||||
|
||||
// Status and Resolution
|
||||
// =====================
|
||||
|
||||
var statuses_open = new Array("UNCONFIRMED","NEW","ASSIGNED","REOPENED");
|
||||
var statuses_resolved = new Array("RESOLVED","VERIFIED","CLOSED");
|
||||
var resolutions = new Array("FIXED","INVALID","WONTFIX","LATER",
|
||||
"REMIND","DUPLICATE","WORKSFORME","MOVED");
|
||||
|
||||
// Keywords
|
||||
// ========
|
||||
//
|
||||
// Enumerate all your keywords here. This is necessary to avoid
|
||||
// "foo is not a legal keyword" errors. This makes it possible
|
||||
// to include the keywords field in the search by default.
|
||||
|
||||
var keywords = new Array(
|
||||
// "foo", "bar", "baz"
|
||||
);
|
||||
|
||||
// Platforms
|
||||
// =========
|
||||
//
|
||||
// A list of words <w> (substrings of platform values)
|
||||
// that will automatically be translated to "platform:<w>"
|
||||
// E.g. if "mac" is defined as a platform, then searching
|
||||
// for it will find all bugs with platform="Macintosh",
|
||||
// but no other bugs with e.g. "mac" in the summary.
|
||||
|
||||
var platforms = new Array(
|
||||
"pc","sun","macintosh","mac" //shortcut added
|
||||
//,"dec","hp","sgi"
|
||||
//,"all" //this is a legal value for OpSys, too :(
|
||||
//,"other"
|
||||
);
|
||||
|
||||
// Severities
|
||||
// ==========
|
||||
//
|
||||
// A list of words <w> (substrings of severity values)
|
||||
// that will automatically be translated to "severity:<w>"
|
||||
// E.g with this default set of severities, searching for
|
||||
// "blo,cri,maj" will find all severe bugs.
|
||||
|
||||
var severities = new Array("blo","cri","maj","nor","min","tri","enh");
|
||||
|
||||
// Products and Components
|
||||
// =======================
|
||||
//
|
||||
// It is not necessary to list all products and components here.
|
||||
// Instead, you can define a "blacklist" for some commonly used
|
||||
// words or word fragments that occur in a product or component name
|
||||
// but should _not_ trigger product/component search.
|
||||
|
||||
var product_exceptions = new Array(
|
||||
"row" // [Browser]
|
||||
// ^^^
|
||||
,"new" // [MailNews]
|
||||
// ^^^
|
||||
);
|
||||
|
||||
var component_exceptions = new Array(
|
||||
"hang" // [mozilla.org] Bugzilla: Component/Keyword Changes
|
||||
// ^^^^
|
||||
);
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
#!/usr/bonsaitools/bin/perl -wT
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Terry Weissman <terry@mozilla.org>
|
||||
# Gervase Markham <gerv@gerv.net>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
use lib qw(.);
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
use vars qw($userid $usergroupset @legal_keywords %FORM);
|
||||
|
||||
# Use global template variables.
|
||||
use vars qw($template $vars);
|
||||
|
||||
ConnectToDatabase();
|
||||
|
||||
quietly_check_login();
|
||||
|
||||
GetVersionTable();
|
||||
|
||||
my $generic_query = "
|
||||
SELECT
|
||||
bugs.bug_id,
|
||||
bugs.product,
|
||||
bugs.version,
|
||||
bugs.rep_platform,
|
||||
bugs.op_sys,
|
||||
bugs.bug_status,
|
||||
bugs.resolution,
|
||||
bugs.priority,
|
||||
bugs.bug_severity,
|
||||
bugs.component,
|
||||
assign.login_name,
|
||||
report.login_name,
|
||||
bugs.bug_file_loc,
|
||||
bugs.short_desc,
|
||||
bugs.target_milestone,
|
||||
bugs.qa_contact,
|
||||
bugs.status_whiteboard,
|
||||
bugs.keywords
|
||||
FROM bugs,profiles assign,profiles report
|
||||
WHERE assign.userid = bugs.assigned_to AND report.userid = bugs.reporter";
|
||||
|
||||
my $buglist = $::FORM{'buglist'} ||
|
||||
$::FORM{'bug_id'} ||
|
||||
$::FORM{'id'} || "";
|
||||
|
||||
my @bugs;
|
||||
|
||||
foreach my $bug_id (split(/[:,]/, $buglist)) {
|
||||
detaint_natural($bug_id) || next;
|
||||
SendSQL(SelectVisible("$generic_query AND bugs.bug_id = $bug_id",
|
||||
$::userid, $::usergroupset));
|
||||
|
||||
my %bug;
|
||||
my @row = FetchSQLData();
|
||||
|
||||
foreach my $field ("bug_id", "product", "version", "rep_platform",
|
||||
"op_sys", "bug_status", "resolution", "priority",
|
||||
"bug_severity", "component", "assigned_to", "reporter",
|
||||
"bug_file_loc", "short_desc", "target_milestone",
|
||||
"qa_contact", "status_whiteboard", "keywords")
|
||||
{
|
||||
$bug{$field} = shift @row;
|
||||
}
|
||||
|
||||
if ($bug{'bug_id'}) {
|
||||
$bug{'comments'} = GetComments($bug{'bug_id'});
|
||||
$bug{'qa_contact'} = $bug{'qa_contact'} > 0 ?
|
||||
DBID_to_name($bug{'qa_contact'}) : "";
|
||||
|
||||
push (@bugs, \%bug);
|
||||
}
|
||||
}
|
||||
|
||||
# Add the list of bug hashes to the variables
|
||||
$vars->{'bugs'} = \@bugs;
|
||||
|
||||
$vars->{'use_keywords'} = 1 if (@::legal_keywords);
|
||||
|
||||
$vars->{'quoteUrls'} = \"eUrls;
|
||||
$vars->{'time2str'} = \&time2str;
|
||||
$vars->{'str2time'} = \&str2time;
|
||||
|
||||
# Work out a sensible filename for Content-Disposition.
|
||||
# Sadly, I don't think we can tell if this was a named query.
|
||||
my @time = localtime(time());
|
||||
my $date = sprintf "%04d-%02d-%02d", 1900+$time[5],$time[4]+1,$time[3];
|
||||
my $filename = "bugs-$date.html";
|
||||
|
||||
print "Content-Type: text/html\n";
|
||||
print "Content-Disposition: inline; filename=$filename\n\n";
|
||||
|
||||
# Generate and return the UI (HTML page) from the appropriate template.
|
||||
$template->process("bug/show-multiple.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
@@ -1,159 +0,0 @@
|
||||
#!/usr/bonsaitools/bin/perl -wT
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Dawn Endico <endico@mozilla.org>
|
||||
# Terry Weissman <terry@mozilla.org>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
use lib qw(.);
|
||||
|
||||
use Bug;
|
||||
require "CGI.pl";
|
||||
$::lockcount = 0;
|
||||
|
||||
unless ( Param("move-enabled") ) {
|
||||
print "\n<P>Sorry. Bug moving is not enabled here. ";
|
||||
print "If you need to move a bug, contact " . Param("maintainer");
|
||||
exit;
|
||||
}
|
||||
|
||||
ConnectToDatabase();
|
||||
confirm_login();
|
||||
|
||||
sub Log {
|
||||
my ($str) = (@_);
|
||||
Lock();
|
||||
open(FID, ">>data/maillog") || die "Can't write to data/maillog";
|
||||
print FID time2str("%D %H:%M", time()) . ": $str\n";
|
||||
close FID;
|
||||
Unlock();
|
||||
}
|
||||
|
||||
sub Lock {
|
||||
if ($::lockcount <= 0) {
|
||||
$::lockcount = 0;
|
||||
open(LOCKFID, ">>data/maillock") || die "Can't open data/maillock: $!";
|
||||
my $val = flock(LOCKFID,2);
|
||||
if (!$val) { # '2' is magic 'exclusive lock' const.
|
||||
print "Content-type: text/html\n\n";
|
||||
print "Lock failed: $val\n";
|
||||
}
|
||||
chmod 0666, "data/maillock";
|
||||
}
|
||||
$::lockcount++;
|
||||
}
|
||||
|
||||
sub Unlock {
|
||||
$::lockcount--;
|
||||
if ($::lockcount <= 0) {
|
||||
flock(LOCKFID,8); # '8' is magic 'unlock' const.
|
||||
close LOCKFID;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !defined $::FORM{'buglist'} ) {
|
||||
print "Content-type: text/html\n\n";
|
||||
PutHeader("Move Bugs");
|
||||
print "Move bugs either from the bug display page or perform a ";
|
||||
print "<A HREF=\"query.cgi\">query</A> and change several bugs at once.\n";
|
||||
print "If you don't see the move button, then you either aren't ";
|
||||
print "logged in or aren't permitted to.";
|
||||
PutFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
my $exporter = $::COOKIE{"Bugzilla_login"};
|
||||
my $movers = Param("movers");
|
||||
$movers =~ s/\w?,\w?/|/g;
|
||||
$movers =~ s/@/\@/g;
|
||||
unless ($exporter =~ /($movers)/) {
|
||||
print "Content-type: text/html\n\n";
|
||||
PutHeader("Move Bugs");
|
||||
print "<P>You do not have permission to move bugs<P>\n";
|
||||
PutFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
my $xml = "";
|
||||
$xml .= Bug::XML_Header( Param("urlbase"), $::param{'version'},
|
||||
Param("maintainer"), $exporter );
|
||||
print "<P>\n";
|
||||
foreach my $id (split(/:/, $::FORM{'buglist'})) {
|
||||
my $bug = new Bug($id, $::userid);
|
||||
$xml .= $bug->emitXML;
|
||||
if (!$bug->error) {
|
||||
my $exporterid = DBNameToIdAndCheck($exporter);
|
||||
|
||||
my $fieldid = GetFieldID("bug_status");
|
||||
my $cur_status= $bug->bug_status;
|
||||
SendSQL("INSERT INTO bugs_activity " .
|
||||
"(bug_id,who,bug_when,fieldid,removed,added) VALUES " .
|
||||
"($id,$exporterid,now(),$fieldid,'$cur_status','RESOLVED')");
|
||||
$fieldid = GetFieldID("resolution");
|
||||
my $cur_res= $bug->resolution;
|
||||
SendSQL("INSERT INTO bugs_activity " .
|
||||
"(bug_id,who,bug_when,fieldid,removed,added) VALUES " .
|
||||
"($id,$exporterid,now(),$fieldid,'$cur_res','MOVED')");
|
||||
|
||||
SendSQL("UPDATE bugs SET bug_status =\"RESOLVED\" where bug_id=\"$id\"");
|
||||
SendSQL("UPDATE bugs SET resolution =\"MOVED\" where bug_id=\"$id\"");
|
||||
|
||||
my $comment = "";
|
||||
if (defined $::FORM{'comment'} && $::FORM{'comment'} !~ /^\s*$/) {
|
||||
$comment .= $::FORM{'comment'} . "\n\n";
|
||||
}
|
||||
$comment .= "Bug moved to " . Param("move-to-url") . ".\n\n";
|
||||
$comment .= "If the move succeeded, $exporter will receive a mail\n";
|
||||
$comment .= "containing the number of the new bug in the other database.\n";
|
||||
$comment .= "If all went well, please mark this bug verified, and paste\n";
|
||||
$comment .= "in a link to the new bug. Otherwise, reopen this bug.\n";
|
||||
SendSQL("INSERT INTO longdescs (bug_id, who, bug_when, thetext) VALUES " .
|
||||
"($id, $exporterid, now(), " . SqlQuote($comment) . ")");
|
||||
|
||||
print "<P>Bug $id moved to " . Param("move-to-url") . ".<BR>\n";
|
||||
system("./processmail", $id, $exporter);
|
||||
}
|
||||
}
|
||||
print "<P>\n";
|
||||
$xml .= Bug::XML_Footer;
|
||||
|
||||
my $buglist = $::FORM{'buglist'};
|
||||
$buglist =~ s/:/,/g;
|
||||
my $host = Param("urlbase");
|
||||
$host =~ s#http://([^/]+)/.*#$1#;
|
||||
my $to = Param("move-to-address");
|
||||
$to =~ s/@/\@/;
|
||||
my $msg = "To: $to\n";
|
||||
my $from = Param("moved-from-address");
|
||||
$from =~ s/@/\@/;
|
||||
$msg .= "From: Bugzilla <" . $from . ">\n";
|
||||
$msg .= "Subject: Moving bug(s) $buglist\n\n";
|
||||
$msg .= $xml . "\n";
|
||||
|
||||
open(SENDMAIL,
|
||||
"|/usr/lib/sendmail -ODeliveryMode=background -t -i") ||
|
||||
die "Can't open sendmail";
|
||||
print SENDMAIL $msg;
|
||||
close SENDMAIL;
|
||||
|
||||
my $logstr = "XML: bugs $buglist sent to $to";
|
||||
Log($logstr);
|
||||
@@ -1,16 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html> <head>
|
||||
<title>No target milestones</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>No target milestones.</h1>
|
||||
|
||||
<p>
|
||||
No target milestones have been defined for this product. You can set
|
||||
the Target Milestone field to things, but there is not currently any
|
||||
agreed definition of what the milestones are.
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,317 +0,0 @@
|
||||
#!/usr/bonsaitools/bin/perl -wT
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Terry Weissman <terry@mozilla.org>
|
||||
# Dan Mosedale <dmose@mozilla.org>
|
||||
# Joe Robins <jmrobins@tgix.com>
|
||||
# Gervase Markham <gerv@gerv.net>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
use lib qw(.);
|
||||
|
||||
require "CGI.pl";
|
||||
require "bug_form.pl";
|
||||
|
||||
# Shut up misguided -w warnings about "used only once". For some reason,
|
||||
# "use vars" chokes on me when I try it here.
|
||||
sub sillyness {
|
||||
my $zz;
|
||||
$zz = $::buffer;
|
||||
$zz = $::usergroupset;
|
||||
$zz = %::COOKIE;
|
||||
$zz = %::components;
|
||||
$zz = %::versions;
|
||||
$zz = @::legal_opsys;
|
||||
$zz = @::legal_platform;
|
||||
$zz = @::legal_priority;
|
||||
$zz = @::legal_product;
|
||||
$zz = @::legal_severity;
|
||||
$zz = %::target_milestone;
|
||||
}
|
||||
|
||||
# Use global template variables.
|
||||
use vars qw($vars $template);
|
||||
|
||||
ConnectToDatabase();
|
||||
confirm_login();
|
||||
|
||||
|
||||
# The format of the initial comment can be structured by adding fields to the
|
||||
# enter_bug template and then referencing them in the comment template.
|
||||
my $comment;
|
||||
|
||||
$vars->{'form'} = \%::FORM;
|
||||
|
||||
# We can't use ValidateOutputFormat here because it defaults to HTML.
|
||||
my $template_name = "bug/create/comment";
|
||||
$template_name .= ($::FORM{'format'} ? "-$::FORM{'format'}" : "");
|
||||
|
||||
$template->process("$template_name.txt.tmpl", $vars, \$comment)
|
||||
|| ThrowTemplateError($template->error());
|
||||
|
||||
ValidateComment($comment);
|
||||
|
||||
my $product = $::FORM{'product'};
|
||||
|
||||
# Set cookies
|
||||
my $cookiepath = Param("cookiepath");
|
||||
if (exists $::FORM{'product'}) {
|
||||
if (exists $::FORM{'version'}) {
|
||||
print "Set-Cookie: VERSION-$product=$::FORM{'version'} ; " .
|
||||
"path=$cookiepath ; expires=Sat, 30-Jun-2029 00:00:00 GMT\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (defined $::FORM{'maketemplate'}) {
|
||||
$vars->{'url'} = $::buffer;
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
$template->process("bug/create/make-template.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
exit;
|
||||
}
|
||||
|
||||
umask 0;
|
||||
|
||||
# Some sanity checking
|
||||
CanEnterProductOrWarn($product);
|
||||
|
||||
if (!$::FORM{'component'}) {
|
||||
DisplayError("You must choose a component that corresponds to this bug.
|
||||
If necessary, just guess.");
|
||||
exit;
|
||||
}
|
||||
|
||||
$::FORM{'short_desc'} = clean_text($::FORM{'short_desc'});
|
||||
if (!defined $::FORM{'short_desc'} || $::FORM{'short_desc'} eq "") {
|
||||
DisplayError("You must enter a summary for this bug.");
|
||||
exit;
|
||||
}
|
||||
|
||||
# If bug_file_loc is "http://", the default, strip it out and use an empty
|
||||
# value.
|
||||
$::FORM{'bug_file_loc'} = "" if $::FORM{'bug_file_loc'} eq 'http://';
|
||||
|
||||
my $sql_product = SqlQuote($::FORM{'product'});
|
||||
my $sql_component = SqlQuote($::FORM{'component'});
|
||||
|
||||
# Default assignee is the component owner.
|
||||
if ($::FORM{'assigned_to'} eq "") {
|
||||
SendSQL("SELECT initialowner FROM components " .
|
||||
"WHERE program=$sql_product AND value=$sql_component");
|
||||
$::FORM{'assigned_to'} = FetchOneColumn();
|
||||
} else {
|
||||
$::FORM{'assigned_to'} = DBNameToIdAndCheck(trim($::FORM{'assigned_to'}));
|
||||
}
|
||||
|
||||
my @bug_fields = ("product", "version", "rep_platform",
|
||||
"bug_severity", "priority", "op_sys", "assigned_to",
|
||||
"bug_status", "bug_file_loc", "short_desc", "component",
|
||||
"target_milestone");
|
||||
|
||||
if (Param("useqacontact")) {
|
||||
SendSQL("SELECT initialqacontact FROM components " .
|
||||
"WHERE program=$sql_product AND value=$sql_component");
|
||||
my $qa_contact = FetchOneColumn();
|
||||
if (defined $qa_contact && $qa_contact != 0) {
|
||||
$::FORM{'qa_contact'} = $qa_contact;
|
||||
push(@bug_fields, "qa_contact");
|
||||
}
|
||||
}
|
||||
|
||||
if (exists $::FORM{'bug_status'}) {
|
||||
# Ignore the given status, so that we can set it to UNCONFIRMED
|
||||
# or NEW, depending on votestoconfirm if either the given state was
|
||||
# unconfirmed (so that a user can't override the below check), or if
|
||||
# the user doesn't have permission to change the default status anyway
|
||||
if ($::FORM{'bug_status'} eq $::unconfirmedstate
|
||||
|| (!UserInGroup("canedit") && !UserInGroup("canconfirm"))) {
|
||||
delete $::FORM{'bug_status'};
|
||||
}
|
||||
}
|
||||
|
||||
if (!exists $::FORM{'bug_status'}) {
|
||||
$::FORM{'bug_status'} = $::unconfirmedstate;
|
||||
SendSQL("SELECT votestoconfirm FROM products WHERE product=$sql_product");
|
||||
if (!FetchOneColumn()) {
|
||||
$::FORM{'bug_status'} = "NEW";
|
||||
}
|
||||
}
|
||||
|
||||
if (!exists $::FORM{'target_milestone'}) {
|
||||
SendSQL("SELECT defaultmilestone FROM products WHERE product=$sql_product");
|
||||
$::FORM{'target_milestone'} = FetchOneColumn();
|
||||
}
|
||||
|
||||
if (!Param('letsubmitterchoosepriority')) {
|
||||
$::FORM{'priority'} = Param('defaultpriority');
|
||||
}
|
||||
|
||||
GetVersionTable();
|
||||
|
||||
# Some more sanity checking
|
||||
CheckFormField(\%::FORM, 'product', \@::legal_product);
|
||||
CheckFormField(\%::FORM, 'rep_platform', \@::legal_platform);
|
||||
CheckFormField(\%::FORM, 'bug_severity', \@::legal_severity);
|
||||
CheckFormField(\%::FORM, 'priority', \@::legal_priority);
|
||||
CheckFormField(\%::FORM, 'op_sys', \@::legal_opsys);
|
||||
CheckFormField(\%::FORM, 'bug_status', [$::unconfirmedstate, 'NEW']);
|
||||
CheckFormField(\%::FORM, 'version', $::versions{$product});
|
||||
CheckFormField(\%::FORM, 'component', $::components{$product});
|
||||
CheckFormField(\%::FORM, 'target_milestone', $::target_milestone{$product});
|
||||
CheckFormFieldDefined(\%::FORM, 'assigned_to');
|
||||
CheckFormFieldDefined(\%::FORM, 'bug_file_loc');
|
||||
CheckFormFieldDefined(\%::FORM, 'comment');
|
||||
|
||||
my @used_fields;
|
||||
foreach my $field (@bug_fields) {
|
||||
if (exists $::FORM{$field}) {
|
||||
push (@used_fields, $field);
|
||||
}
|
||||
}
|
||||
|
||||
if (exists $::FORM{'bug_status'}
|
||||
&& $::FORM{'bug_status'} ne $::unconfirmedstate)
|
||||
{
|
||||
push(@used_fields, "everconfirmed");
|
||||
$::FORM{'everconfirmed'} = 1;
|
||||
}
|
||||
|
||||
my %ccids;
|
||||
my @cc;
|
||||
|
||||
# Create the ccid hash for inserting into the db
|
||||
# and the list for passing to processmail
|
||||
# use a hash rather than a list to avoid adding users twice
|
||||
if (defined $::FORM{'cc'}) {
|
||||
foreach my $person (split(/[ ,]/, $::FORM{'cc'})) {
|
||||
if ($person ne "") {
|
||||
my $ccid = DBNameToIdAndCheck($person);
|
||||
if ($ccid && !$ccids{$ccid}) {
|
||||
$ccids{$ccid} = 1;
|
||||
# if we got here, the DB has already verified that the email
|
||||
# is legit. Unless the admin has screwed with the emailregexp
|
||||
# it'll be safe.
|
||||
trick_taint($person);
|
||||
push(@cc, $person);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Build up SQL string to add bug.
|
||||
my $sql = "INSERT INTO bugs " .
|
||||
"(" . join(",", @used_fields) . ", reporter, creation_ts, groupset) " .
|
||||
"VALUES (";
|
||||
|
||||
foreach my $field (@used_fields) {
|
||||
$sql .= SqlQuote($::FORM{$field}) . ",";
|
||||
}
|
||||
|
||||
$comment =~ s/\r\n?/\n/g; # Get rid of \r.
|
||||
$comment = trim($comment);
|
||||
# If comment is all whitespace, it'll be null at this point. That's
|
||||
# OK except for the fact that it causes e-mail to be suppressed.
|
||||
$comment = $comment ? $comment : " ";
|
||||
|
||||
$sql .= "$::userid, now(), (0";
|
||||
|
||||
# Groups
|
||||
foreach my $b (grep(/^bit-\d*$/, keys %::FORM)) {
|
||||
if ($::FORM{$b}) {
|
||||
my $v = substr($b, 4);
|
||||
$v =~ /^(\d+)$/
|
||||
|| ThrowCodeError("One of the group bits submitted was invalid.",
|
||||
undef, "abort");
|
||||
if (!GroupIsActive($v)) {
|
||||
# Prevent the user from adding the bug to an inactive group.
|
||||
# Should only happen if there is a bug in Bugzilla or the user
|
||||
# hacked the "enter bug" form since otherwise the UI
|
||||
# for adding the bug to the group won't appear on that form.
|
||||
ThrowCodeError("Attempted to add bug to an inactive group, " .
|
||||
"identified by the bit '$v'.", undef, "abort");
|
||||
}
|
||||
$sql .= " + $v"; # Carefully written so that the math is
|
||||
# done by MySQL, which can handle 64-bit math,
|
||||
# and not by Perl, which I *think* can not.
|
||||
}
|
||||
}
|
||||
|
||||
$sql .= ") & $::usergroupset)\n";
|
||||
|
||||
# Lock tables before inserting records for the new bug into the database
|
||||
# if we are using a shadow database to prevent shadow database corruption
|
||||
# when two bugs get created at the same time.
|
||||
SendSQL("LOCK TABLES bugs WRITE, longdescs WRITE, cc WRITE, profiles READ") if Param("shadowdb");
|
||||
|
||||
# Add the bug report to the DB.
|
||||
SendSQL($sql);
|
||||
|
||||
# Get the bug ID back.
|
||||
SendSQL("select LAST_INSERT_ID()");
|
||||
my $id = FetchOneColumn();
|
||||
|
||||
# Add the comment
|
||||
SendSQL("INSERT INTO longdescs (bug_id, who, bug_when, thetext)
|
||||
VALUES ($id, $::userid, now(), " . SqlQuote($comment) . ")");
|
||||
|
||||
# Insert the cclist into the database
|
||||
foreach my $ccid (keys(%ccids)) {
|
||||
SendSQL("INSERT INTO cc (bug_id, who) VALUES ($id, $ccid)");
|
||||
}
|
||||
|
||||
SendSQL("UNLOCK TABLES") if Param("shadowdb");
|
||||
|
||||
# Assemble the -force* strings so this counts as "Added to this capacity"
|
||||
my @ARGLIST = ();
|
||||
if (@cc) {
|
||||
push (@ARGLIST, "-forcecc", join(",", @cc));
|
||||
}
|
||||
|
||||
push (@ARGLIST, "-forceowner", DBID_to_name($::FORM{assigned_to}));
|
||||
|
||||
if (defined $::FORM{'qa_contact'}) {
|
||||
push (@ARGLIST, "-forceqacontact", DBID_to_name($::FORM{'qa_contact'}));
|
||||
}
|
||||
|
||||
push (@ARGLIST, "-forcereporter", DBID_to_name($::userid));
|
||||
|
||||
push (@ARGLIST, $id, $::COOKIE{'Bugzilla_login'});
|
||||
|
||||
# Send mail to let people know the bug has been created.
|
||||
# See attachment.cgi for explanation of why it's done this way.
|
||||
my $mailresults = '';
|
||||
open(PMAIL, "-|") or exec('./processmail', @ARGLIST);
|
||||
$mailresults .= $_ while <PMAIL>;
|
||||
close(PMAIL);
|
||||
|
||||
# Tell the user all about it
|
||||
$vars->{'id'} = $id;
|
||||
$vars->{'mail'} = $mailresults;
|
||||
$vars->{'type'} = "created";
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
$template->process("bug/create/created.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
|
||||
$::FORM{'id'} = $id;
|
||||
|
||||
show_bug("header is already done");
|
||||
@@ -1,880 +0,0 @@
|
||||
#!/usr/bonsaitools/bin/perl -wT
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Terry Weissman <terry@mozilla.org>,
|
||||
# Bryce Nesbitt <bryce-mozilla@nextbus.com>
|
||||
# Dan Mosedale <dmose@mozilla.org>
|
||||
# Alan Raetz <al_raetz@yahoo.com>
|
||||
# Jacob Steenhagen <jake@actex.net>
|
||||
# Matthew Tuck <matty@chariot.net.au>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
use lib ".";
|
||||
|
||||
require "globals.pl";
|
||||
|
||||
use RelationSet;
|
||||
|
||||
|
||||
# Shut up misguided -w warnings about "used only once".
|
||||
sub processmail_sillyness {
|
||||
my $zz;
|
||||
$zz = $::db;
|
||||
}
|
||||
|
||||
$| = 1;
|
||||
|
||||
umask(0);
|
||||
|
||||
my $nametoexclude = "";
|
||||
my %nomail;
|
||||
|
||||
my @excludedAddresses = ();
|
||||
|
||||
# disable email flag for offline debugging work
|
||||
my $enableSendMail = 1;
|
||||
|
||||
my %force;
|
||||
@{$force{'QAcontact'}} = ();
|
||||
@{$force{'Owner'}} = ();
|
||||
@{$force{'Reporter'}} = ();
|
||||
@{$force{'CClist'}} = ();
|
||||
@{$force{'Voter'}} = ();
|
||||
|
||||
|
||||
my %seen;
|
||||
my @sentlist;
|
||||
|
||||
sub FormatTriple {
|
||||
my ($a, $b, $c) = (@_);
|
||||
$^A = "";
|
||||
my $temp = formline << 'END', $a, $b, $c;
|
||||
^>>>>>>>>>>>>>>>>>>|^<<<<<<<<<<<<<<<<<<<<<<<<<<<|^<<<<<<<<<<<<<<<<<<<<<<<<<<<~~
|
||||
END
|
||||
; # This semicolon appeases my emacs editor macros. :-)
|
||||
return $^A;
|
||||
}
|
||||
|
||||
sub FormatDouble {
|
||||
my ($a, $b) = (@_);
|
||||
$a .= ":";
|
||||
$^A = "";
|
||||
my $temp = formline << 'END', $a, $b;
|
||||
^>>>>>>>>>>>>>>>>>> ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~
|
||||
END
|
||||
; # This semicolon appeases my emacs editor macros. :-)
|
||||
return $^A;
|
||||
}
|
||||
|
||||
|
||||
sub ProcessOneBug {
|
||||
my ($id) = (@_);
|
||||
|
||||
my @headerlist;
|
||||
my %values;
|
||||
my %defmailhead;
|
||||
my %fielddescription;
|
||||
|
||||
my $msg = "";
|
||||
|
||||
SendSQL("SELECT name, description, mailhead FROM fielddefs " .
|
||||
"ORDER BY sortkey");
|
||||
while (MoreSQLData()) {
|
||||
my ($field, $description, $mailhead) = (FetchSQLData());
|
||||
push(@headerlist, $field);
|
||||
$defmailhead{$field} = $mailhead;
|
||||
$fielddescription{$field} = $description;
|
||||
}
|
||||
SendSQL("SELECT " . join(',', @::log_columns) . ", lastdiffed, now() " .
|
||||
"FROM bugs WHERE bug_id = $id");
|
||||
my @row = FetchSQLData();
|
||||
foreach my $i (@::log_columns) {
|
||||
$values{$i} = shift(@row);
|
||||
}
|
||||
my ($start, $end) = (@row);
|
||||
# $start and $end are considered safe because users can't touch them
|
||||
trick_taint($start);
|
||||
trick_taint($end);
|
||||
|
||||
my $ccSet = new RelationSet();
|
||||
$ccSet->mergeFromDB("SELECT who FROM cc WHERE bug_id = $id");
|
||||
$values{'cc'} = $ccSet->toString();
|
||||
|
||||
my @voterList;
|
||||
SendSQL("SELECT profiles.login_name FROM votes, profiles " .
|
||||
"WHERE votes.bug_id = $id AND profiles.userid = votes.who");
|
||||
while (MoreSQLData()) {
|
||||
push(@voterList, FetchOneColumn());
|
||||
}
|
||||
|
||||
$values{'assigned_to'} = DBID_to_name($values{'assigned_to'});
|
||||
$values{'reporter'} = DBID_to_name($values{'reporter'});
|
||||
if ($values{'qa_contact'}) {
|
||||
$values{'qa_contact'} = DBID_to_name($values{'qa_contact'});
|
||||
}
|
||||
|
||||
my @diffs;
|
||||
|
||||
|
||||
SendSQL("SELECT profiles.login_name, fielddefs.description, " .
|
||||
" bug_when, removed, added, attach_id " .
|
||||
"FROM bugs_activity, fielddefs, profiles " .
|
||||
"WHERE bug_id = $id " .
|
||||
" AND fielddefs.fieldid = bugs_activity.fieldid " .
|
||||
" AND profiles.userid = who " .
|
||||
" AND bug_when > '$start' " .
|
||||
" AND bug_when <= '$end' " .
|
||||
"ORDER BY bug_when"
|
||||
);
|
||||
|
||||
while (MoreSQLData()) {
|
||||
my @row = FetchSQLData();
|
||||
push(@diffs, \@row);
|
||||
}
|
||||
|
||||
my $difftext = "";
|
||||
my $lastwho = "";
|
||||
foreach my $ref (@diffs) {
|
||||
my ($who, $what, $when, $old, $new, $attachid) = (@$ref);
|
||||
if ($who ne $lastwho) {
|
||||
$lastwho = $who;
|
||||
$difftext .= "\n$who" . Param('emailsuffix') . " changed:\n\n";
|
||||
$difftext .= FormatTriple("What ", "Removed", "Added");
|
||||
$difftext .= ('-' x 76) . "\n";
|
||||
}
|
||||
$what =~ s/^Attachment/Attachment #$attachid/ if $attachid;
|
||||
$difftext .= FormatTriple($what, $old, $new);
|
||||
}
|
||||
|
||||
$difftext = trim($difftext);
|
||||
|
||||
|
||||
my $deptext = "";
|
||||
|
||||
my $resid =
|
||||
|
||||
SendSQL("SELECT bugs_activity.bug_id, bugs.short_desc, fielddefs.name, " .
|
||||
" removed, added " .
|
||||
"FROM bugs_activity, bugs, dependencies, fielddefs ".
|
||||
"WHERE bugs_activity.bug_id = dependencies.dependson " .
|
||||
" AND bugs.bug_id = bugs_activity.bug_id ".
|
||||
" AND dependencies.blocked = $id " .
|
||||
" AND fielddefs.fieldid = bugs_activity.fieldid" .
|
||||
" AND (fielddefs.name = 'bug_status' " .
|
||||
" OR fielddefs.name = 'resolution') " .
|
||||
" AND bug_when > '$start' " .
|
||||
" AND bug_when <= '$end' " .
|
||||
"ORDER BY bug_when, bug_id");
|
||||
|
||||
my $thisdiff = "";
|
||||
my $lastbug = "";
|
||||
my $interestingchange = 0;
|
||||
my $depbug = 0;
|
||||
my @depbugs;
|
||||
while (MoreSQLData()) {
|
||||
my ($summary, $what, $old, $new);
|
||||
($depbug, $summary, $what, $old, $new) = (FetchSQLData());
|
||||
if ($depbug ne $lastbug) {
|
||||
if ($interestingchange) {
|
||||
$deptext .= $thisdiff;
|
||||
}
|
||||
$lastbug = $depbug;
|
||||
my $urlbase = Param("urlbase");
|
||||
$thisdiff =
|
||||
"\nBug $id depends on bug $depbug, which changed state.\n\n" .
|
||||
"Bug $depbug Summary: $summary\n" .
|
||||
"${urlbase}show_bug.cgi?id=$depbug\n\n";
|
||||
$thisdiff .= FormatTriple("What ", "Old Value", "New Value");
|
||||
$thisdiff .= ('-' x 76) . "\n";
|
||||
$interestingchange = 0;
|
||||
}
|
||||
$thisdiff .= FormatTriple($fielddescription{$what}, $old, $new);
|
||||
if ($what eq 'bug_status' && IsOpenedState($old) ne IsOpenedState($new)) {
|
||||
$interestingchange = 1;
|
||||
}
|
||||
|
||||
push(@depbugs, $depbug);
|
||||
}
|
||||
|
||||
if ($interestingchange) {
|
||||
$deptext .= $thisdiff;
|
||||
}
|
||||
|
||||
$deptext = trim($deptext);
|
||||
|
||||
if ($deptext) {
|
||||
$difftext = trim($difftext . "\n\n" . $deptext);
|
||||
}
|
||||
|
||||
|
||||
my $newcomments = GetLongDescriptionAsText($id, $start, $end);
|
||||
|
||||
#
|
||||
# Start of email filtering code
|
||||
#
|
||||
my $count = 0;
|
||||
|
||||
my @currentEmailAttributes = getEmailAttributes($newcomments, @diffs);
|
||||
my (@assigned_toList,@reporterList,@qa_contactList,@ccList) = ();
|
||||
|
||||
#open(LOG, ">>/tmp/maillog");
|
||||
#print LOG "\nBug ID: $id CurrentEmailAttributes:";
|
||||
#print LOG join(',', @currentEmailAttributes) . "\n";
|
||||
|
||||
@excludedAddresses = (); # zero out global list
|
||||
|
||||
@assigned_toList = filterEmailGroup('Owner',
|
||||
\@currentEmailAttributes,
|
||||
$values{'assigned_to'});
|
||||
@reporterList = filterEmailGroup('Reporter',
|
||||
\@currentEmailAttributes,
|
||||
$values{'reporter'});
|
||||
if (Param('useqacontact') && $values{'qa_contact'}) {
|
||||
@qa_contactList = filterEmailGroup('QAcontact',
|
||||
\@currentEmailAttributes,
|
||||
$values{'qa_contact'});
|
||||
} else {
|
||||
@qa_contactList = ();
|
||||
}
|
||||
|
||||
@ccList = filterEmailGroup('CClist', \@currentEmailAttributes,
|
||||
$values{'cc'});
|
||||
|
||||
@voterList = filterEmailGroup('Voter', \@currentEmailAttributes,
|
||||
join(',',@voterList));
|
||||
|
||||
my @emailList = (@assigned_toList, @reporterList,
|
||||
@qa_contactList, @ccList, @voterList);
|
||||
|
||||
# only need one entry per person
|
||||
my @allEmail = ();
|
||||
my %AlreadySeen = ();
|
||||
my $checkperson = "";
|
||||
foreach my $person (@emailList) {
|
||||
# don't modify the original so it sends out with the right case
|
||||
# based on who came first.
|
||||
$checkperson = lc($person);
|
||||
if ( !($AlreadySeen{$checkperson}) ) {
|
||||
push(@allEmail,$person);
|
||||
$AlreadySeen{$checkperson}++;
|
||||
}
|
||||
}
|
||||
|
||||
#print LOG "\nbug $id email sent: " . join(',', @allEmail) . "\n";
|
||||
|
||||
@excludedAddresses = filterExcludeList(\@excludedAddresses,
|
||||
\@allEmail);
|
||||
|
||||
# print LOG "excluded: " . join(',',@excludedAddresses) . "\n\n";
|
||||
|
||||
foreach my $person ( @allEmail ) {
|
||||
my @reasons;
|
||||
|
||||
$count++;
|
||||
|
||||
push(@reasons, 'AssignedTo') if lsearch(\@assigned_toList, $person) != -1;
|
||||
push(@reasons, 'Reporter') if lsearch(\@reporterList, $person) != -1;
|
||||
push(@reasons, 'QAContact') if lsearch(\@qa_contactList, $person) != -1;
|
||||
push(@reasons, 'CC') if lsearch(\@ccList, $person) != -1;
|
||||
push(@reasons, 'Voter') if lsearch(\@voterList, $person) != -1;
|
||||
|
||||
if ( !defined(NewProcessOnePerson($person, $count, \@headerlist,
|
||||
\@reasons, \%values,
|
||||
\%defmailhead,
|
||||
\%fielddescription, $difftext,
|
||||
$newcomments, $start, $id,
|
||||
\@depbugs)))
|
||||
{
|
||||
|
||||
# if a value is not returned, this means that the person
|
||||
# was not sent mail. add them to the excludedAddresses list.
|
||||
# it will be filtered later for dups.
|
||||
#
|
||||
push @excludedAddresses, $person;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SendSQL("UPDATE bugs SET lastdiffed = '$end', delta_ts = delta_ts " .
|
||||
"WHERE bug_id = $id");
|
||||
|
||||
# Filter the exclude list for dupes one last time
|
||||
@excludedAddresses = filterExcludeList(\@excludedAddresses,
|
||||
\@sentlist);
|
||||
if (@sentlist) {
|
||||
print "<b>Email sent to:</b> " . join(", ", @sentlist) ."<br>\n";
|
||||
} else {
|
||||
print "<b>Email sent to:</b> no one<br>\n";
|
||||
}
|
||||
|
||||
if (@excludedAddresses) {
|
||||
print "<b>Excluding:</b> " . join(", ", @excludedAddresses) . "\n";
|
||||
}
|
||||
|
||||
print "<br><center>If you wish to tweak the kinds of mail Bugzilla sends you, you can";
|
||||
print " <a href=\"userprefs.cgi?tab=email\">change your preferences</a></center>\n";
|
||||
|
||||
}
|
||||
|
||||
# When one person is in different fields on one bug, they may be
|
||||
# excluded from email because of one relationship to the bug (eg
|
||||
# they're the QA contact) but included because of another (eg they
|
||||
# also reported the bug). Inclusion takes precedence, so this
|
||||
# function looks for and removes any users from the exclude list who
|
||||
# are also on the include list. Additionally, it removes duplicate
|
||||
# entries from the exclude list.
|
||||
#
|
||||
# Arguments are the exclude list and the include list; the cleaned up
|
||||
# exclude list is returned.
|
||||
#
|
||||
sub filterExcludeList ($$) {
|
||||
|
||||
if ($#_ != 1) {
|
||||
die ("filterExcludeList called with wrong number of args");
|
||||
}
|
||||
|
||||
my ($refExcluded, $refAll) = @_;
|
||||
|
||||
my @excludedAddrs = @$refExcluded;
|
||||
my @allEmail = @$refAll;
|
||||
my @tmpList = @excludedAddrs;
|
||||
my (@result,@uniqueResult) = ();
|
||||
my %alreadySeen;
|
||||
|
||||
foreach my $excluded (@tmpList) {
|
||||
|
||||
push (@result,$excluded);
|
||||
foreach my $included (@allEmail) {
|
||||
|
||||
# match found, so we remove the entry
|
||||
if (lc($included) eq lc($excluded)) {
|
||||
pop(@result);
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# only need one entry per person
|
||||
my $checkperson = "";
|
||||
|
||||
foreach my $person (@result) {
|
||||
$checkperson = lc($person);
|
||||
if ( !($alreadySeen{$checkperson}) ) {
|
||||
push(@uniqueResult,$person);
|
||||
$alreadySeen{$checkperson}++;
|
||||
}
|
||||
}
|
||||
|
||||
return @uniqueResult;
|
||||
}
|
||||
|
||||
# if the Status was changed to Resolved or Verified
|
||||
# set the Resolved flag
|
||||
#
|
||||
# else if Severity, Status OR Priority fields have any change
|
||||
# set the Status flag
|
||||
#
|
||||
# else if Keywords has changed
|
||||
# set the Keywords flag
|
||||
#
|
||||
# else if CC has changed
|
||||
# set the CC flag
|
||||
#
|
||||
# if the Comments field shows an attachment
|
||||
# set the Attachment flag
|
||||
#
|
||||
# else if Comments exist
|
||||
# set the Comments flag
|
||||
#
|
||||
# if no flags are set and there was some other field change
|
||||
# set the Status flag
|
||||
#
|
||||
sub getEmailAttributes ($@) {
|
||||
|
||||
my ($commentField,@fieldDiffs) = @_;
|
||||
my (@flags,@uniqueFlags,%alreadySeen) = ();
|
||||
|
||||
foreach my $ref (@fieldDiffs) {
|
||||
my ($who, $fieldName, $when, $old, $new) = (@$ref);
|
||||
|
||||
#print qq{field: $fieldName $new<br>};
|
||||
|
||||
# the STATUS will be flagged for Severity, Status and
|
||||
# Priority changes
|
||||
#
|
||||
if ( $fieldName eq 'Status') {
|
||||
if ($new eq 'RESOLVED' || $new eq 'VERIFIED') {
|
||||
push (@flags, 'Resolved');
|
||||
}
|
||||
}
|
||||
elsif ( $fieldName eq 'Severity' || $fieldName eq 'Status' ||
|
||||
$fieldName eq 'Priority' ) {
|
||||
push (@flags, 'Status');
|
||||
} elsif ( $fieldName eq 'Keywords') {
|
||||
push (@flags, 'Keywords');
|
||||
} elsif ( $fieldName eq 'CC') {
|
||||
push (@flags, 'CC');
|
||||
}
|
||||
|
||||
# These next few lines are for finding out who's been added
|
||||
# to the Owner, QA, CC, etc. fields. It does not effect
|
||||
# the @flags array at all, but is run here because it does
|
||||
# effect filtering later and we're already in the loop.
|
||||
if ($fieldName eq 'Owner') {
|
||||
push (@{$force{'Owner'}}, $new);
|
||||
} elsif ($fieldName eq 'QAContact') {
|
||||
push (@{$force{'QAContact'}}, $new);
|
||||
} elsif ($fieldName eq 'CC') {
|
||||
my @added = split (/[ ,]/, $new);
|
||||
push (@{$force{'CClist'}}, @added);
|
||||
}
|
||||
}
|
||||
|
||||
if ( $commentField =~ /Created an attachment \(/ ) {
|
||||
push (@flags, 'Attachments');
|
||||
}
|
||||
elsif ( ($commentField ne '') && !(scalar(@flags) == 1 && $flags[0] eq 'Resolved')) {
|
||||
push (@flags, 'Comments');
|
||||
}
|
||||
|
||||
# default fallthrough for any unflagged change is 'Other'
|
||||
if ( @flags == 0 && @fieldDiffs != 0 ) {
|
||||
push (@flags, 'Other');
|
||||
}
|
||||
|
||||
# only need one flag per attribute type
|
||||
foreach my $flag (@flags) {
|
||||
if ( !($alreadySeen{$flag}) ) {
|
||||
push(@uniqueFlags,$flag);
|
||||
$alreadySeen{$flag}++;
|
||||
}
|
||||
}
|
||||
#print "\nEmail Attributes: ", join(' ,',@uniqueFlags), "<br>\n";
|
||||
|
||||
# catch-all default, just in case the above logic is faulty
|
||||
if ( @uniqueFlags == 0) {
|
||||
push (@uniqueFlags, 'Comments');
|
||||
}
|
||||
|
||||
return @uniqueFlags;
|
||||
}
|
||||
|
||||
sub filterEmailGroup ($$$) {
|
||||
|
||||
my ($emailGroup,$refAttributes,$emailList) = @_;
|
||||
my @emailAttributes = @$refAttributes;
|
||||
my @emailList = split(/,/,$emailList);
|
||||
my @filteredList = ();
|
||||
|
||||
|
||||
# the force list for this email group needs to be checked as well
|
||||
#
|
||||
push @emailList, @{$force{$emailGroup}};
|
||||
|
||||
# Check this user for any watchers... doing this here allows them to inhert the
|
||||
# relationship to the bug of the person they are watching (if the person they
|
||||
# are watching is an owner, their mail is filtered as if they were the owner).
|
||||
if (Param("supportwatchers")) {
|
||||
my @watchers;
|
||||
foreach my $person(@emailList) {
|
||||
my $personId = DBname_to_id($person);
|
||||
SendSQL("SELECT watcher FROM watch WHERE watched = $personId");
|
||||
while(MoreSQLData()) {
|
||||
my ($watcher) = FetchSQLData();
|
||||
if ($watcher) {
|
||||
push (@watchers, DBID_to_name($watcher));
|
||||
}
|
||||
}
|
||||
}
|
||||
push(@emailList, @watchers);
|
||||
}
|
||||
|
||||
|
||||
foreach my $person (@emailList) {
|
||||
|
||||
my $lastCount = @filteredList;
|
||||
|
||||
if ( $person eq '' ) { next; }
|
||||
|
||||
my $userid = DBname_to_id($person);
|
||||
|
||||
if ( ! $userid ) {
|
||||
push(@filteredList,$person);
|
||||
next;
|
||||
}
|
||||
|
||||
SendSQL("SELECT emailflags FROM profiles WHERE " .
|
||||
"userid = $userid" );
|
||||
|
||||
my ($userFlagString) = FetchSQLData();
|
||||
|
||||
# If the sender doesn't want email, exclude them from list
|
||||
|
||||
if (lc($person) eq $nametoexclude) {
|
||||
|
||||
if ( defined ($userFlagString) &&
|
||||
$userFlagString =~ /ExcludeSelf\~on/ ) {
|
||||
|
||||
push (@excludedAddresses,$person);
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
# if the users database entry is empty, send them all email
|
||||
# by default (they have not accessed userprefs.cgi recently).
|
||||
|
||||
if ( !defined($userFlagString) || !($userFlagString =~ /email/) ) {
|
||||
push(@filteredList,$person);
|
||||
}
|
||||
else {
|
||||
|
||||
# the 255 param is here, because without a third param,
|
||||
# split will trim any trailing null fields, which causes perl
|
||||
# to eject lots of warnings. any suitably large number would
|
||||
# do.
|
||||
|
||||
my %userFlags = split(/~/, $userFlagString, 255);
|
||||
|
||||
# The default condition is to send each person email.
|
||||
# If we match the email attribute with the user flag, and
|
||||
# they do not want email, then remove them from the list.
|
||||
|
||||
push(@filteredList,$person);
|
||||
|
||||
my $detectedOn = 0;
|
||||
|
||||
foreach my $attribute (@emailAttributes) {
|
||||
|
||||
my $matchName = 'email' . $emailGroup . $attribute;
|
||||
|
||||
# **** Kludge... quick and dirty fix for 2.12
|
||||
# http://bugzilla.mozilla.org/show_bug.cgi?id=73665
|
||||
# If this pref is new (it's been added since this user
|
||||
# last updated their filtering prefs, $userFlags{$matchName}
|
||||
# will be undefined. This should be considered a match
|
||||
# so that new prefs will default to 'on'
|
||||
if (!defined($userFlags{$matchName})) {
|
||||
$detectedOn = 1;
|
||||
}
|
||||
|
||||
while ((my $flagName, my $flagValue) = each %userFlags) {
|
||||
|
||||
if ($flagName !~ /$emailGroup/) {
|
||||
next;
|
||||
}
|
||||
|
||||
if ($flagName eq $matchName){
|
||||
if ($flagValue eq 'on') {
|
||||
$detectedOn = 1;
|
||||
}
|
||||
}
|
||||
|
||||
} # for each userFlag
|
||||
|
||||
} # for each email attribute
|
||||
|
||||
# if the current flag hasn't been detected on at least once,
|
||||
# this person gets filtered from this group.
|
||||
#
|
||||
if (! $detectedOn) {
|
||||
pop(@filteredList);
|
||||
}
|
||||
|
||||
# check to see if the person was added to or removed from
|
||||
# this email group.
|
||||
# Note: This was originally written as only removed from
|
||||
# and was rewritten to be Added/Removed, but for simplicity
|
||||
# sake, the name "Removeme" wasn't changed.
|
||||
# http://bugzilla.mozilla.org/show_bug.cgi?id=71912
|
||||
|
||||
if ( grep ($_ eq $person, @{$force{$emailGroup}} ) ) {
|
||||
|
||||
# if so, see if they want mail about that
|
||||
#
|
||||
if ( $userFlags{'email' . $emailGroup . 'Removeme'} eq 'on' ) {
|
||||
|
||||
# we definitely want mail sent to this person, since
|
||||
# inclusion on a mail takes precedence over the previous
|
||||
# exclusion
|
||||
|
||||
# have they been filtered for some other reason?
|
||||
#
|
||||
if (@filteredList == $lastCount) {
|
||||
|
||||
# if so, put them back
|
||||
#
|
||||
push (@filteredList, $person);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} # if $userFlagString is valid
|
||||
|
||||
# has the person been moved off the filtered list?
|
||||
#
|
||||
if (@filteredList == $lastCount ) {
|
||||
|
||||
# mark them as excluded
|
||||
#
|
||||
push (@excludedAddresses,$person);
|
||||
}
|
||||
|
||||
} # for each person
|
||||
|
||||
return @filteredList;
|
||||
}
|
||||
|
||||
sub NewProcessOnePerson ($$$$$$$$$$$$) {
|
||||
my ($person, $count, $hlRef, $reasonsRef, $valueRef, $dmhRef, $fdRef, $difftext,
|
||||
$newcomments, $start, $id, $depbugsRef) = @_;
|
||||
|
||||
my %values = %$valueRef;
|
||||
my @headerlist = @$hlRef;
|
||||
my @reasons = @$reasonsRef;
|
||||
my %defmailhead = %$dmhRef;
|
||||
my %fielddescription = %$fdRef;
|
||||
my @depbugs = @$depbugsRef;
|
||||
|
||||
if ($seen{$person}) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($nomail{$person}) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
SendSQL("SELECT userid, groupset " .
|
||||
"FROM profiles WHERE login_name = " . SqlQuote($person));
|
||||
my ($userid, $groupset) = (FetchSQLData());
|
||||
|
||||
$seen{$person} = 1;
|
||||
|
||||
detaint_natural($userid);
|
||||
detaint_natural($groupset);
|
||||
|
||||
# if this person doesn't have permission to see info on this bug,
|
||||
# return.
|
||||
#
|
||||
# XXX - This currently means that if a bug is suddenly given
|
||||
# more restrictive permissions, people without those permissions won't
|
||||
# see the action of restricting the bug itself; the bug will just
|
||||
# quietly disappear from their radar.
|
||||
#
|
||||
return unless CanSeeBug($id, $userid, $groupset);
|
||||
|
||||
# We shouldn't send changedmail if this is a dependency mail, and any of
|
||||
# the depending bugs is not visible to the user.
|
||||
foreach my $dep_id (@depbugs) {
|
||||
my $save_id = $dep_id;
|
||||
detaint_natural($dep_id) || warn("Unexpected Error: \@depbugs contains a non-numeric value: '$save_id'")
|
||||
&& return;
|
||||
return unless CanSeeBug($dep_id, $userid, $groupset);
|
||||
}
|
||||
|
||||
my %mailhead = %defmailhead;
|
||||
|
||||
my $head = "";
|
||||
|
||||
foreach my $f (@headerlist) {
|
||||
if ($mailhead{$f}) {
|
||||
my $value = $values{$f};
|
||||
# If there isn't anything to show, don't include this header
|
||||
if (! $value) {
|
||||
next;
|
||||
}
|
||||
my $desc = $fielddescription{$f};
|
||||
$head .= FormatDouble($desc, $value);
|
||||
}
|
||||
}
|
||||
|
||||
if ($difftext eq "" && $newcomments eq "") {
|
||||
# Whoops, no differences!
|
||||
return;
|
||||
}
|
||||
|
||||
my $reasonsbody = "------- You are receiving this mail because: -------\n";
|
||||
|
||||
if (scalar(@reasons) == 0) {
|
||||
$reasonsbody .= "Whoops! I have no idea!\n";
|
||||
} else {
|
||||
foreach my $reason (@reasons) {
|
||||
if ($reason eq 'AssignedTo') {
|
||||
$reasonsbody .= "You are the assignee for the bug, or are watching the assignee.\n";
|
||||
} elsif ($reason eq 'Reporter') {
|
||||
$reasonsbody .= "You reported the bug, or are watching the reporter.\n";
|
||||
} elsif ($reason eq 'QAContact') {
|
||||
$reasonsbody .= "You are the QA contact for the bug, or are watching the QA contact.\n";
|
||||
} elsif ($reason eq 'CC') {
|
||||
$reasonsbody .= "You are on the CC list for the bug, or are watching someone who is.\n";
|
||||
} elsif ($reason eq 'Voter') {
|
||||
$reasonsbody .= "You are a voter for the bug, or are watching someone who is.\n";
|
||||
} else {
|
||||
$reasonsbody .= "Whoops! There is an unknown reason!\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my $isnew = ($start !~ m/[1-9]/);
|
||||
|
||||
my %substs;
|
||||
|
||||
# If an attachment was created, then add an URL. (Note: the 'g'lobal
|
||||
# replace should work with comments with multiple attachments.)
|
||||
|
||||
if ( $newcomments =~ /Created an attachment \(/ ) {
|
||||
|
||||
my $showattachurlbase =
|
||||
Param('urlbase') . "attachment.cgi?id=";
|
||||
|
||||
$newcomments =~ s/(Created an attachment \(id=([0-9]+)\))/$1\n --> \(${showattachurlbase}$2&action=view\)/g;
|
||||
}
|
||||
|
||||
$person .= Param('emailsuffix');
|
||||
# 09/13/2000 cyeh@bluemartini.com
|
||||
# If a bug is changed, don't put the word "Changed" in the subject mail
|
||||
# since if the bug didn't change, you wouldn't be getting mail
|
||||
# in the first place! see http://bugzilla.mozilla.org/show_bug.cgi?id=29820
|
||||
# for details.
|
||||
$substs{"neworchanged"} = $isnew ? 'New: ' : '';
|
||||
$substs{"to"} = $person;
|
||||
$substs{"cc"} = '';
|
||||
$substs{"bugid"} = $id;
|
||||
if ($isnew) {
|
||||
$substs{"diffs"} = $head . "\n\n" . $newcomments;
|
||||
} else {
|
||||
$substs{"diffs"} = $difftext . "\n\n" . $newcomments;
|
||||
}
|
||||
$substs{"summary"} = $values{'short_desc'};
|
||||
$substs{"reasonsheader"} = join(" ", @reasons);
|
||||
$substs{"reasonsbody"} = $reasonsbody;
|
||||
|
||||
my $template = Param("newchangedmail");
|
||||
|
||||
my $msg = PerformSubsts($template, \%substs);
|
||||
|
||||
my $sendmailparam = "-ODeliveryMode=deferred";
|
||||
if (Param("sendmailnow")) {
|
||||
$sendmailparam = "";
|
||||
}
|
||||
|
||||
if ($enableSendMail == 1) {
|
||||
open(SENDMAIL, "|/usr/lib/sendmail $sendmailparam -t -i") ||
|
||||
die "Can't open sendmail";
|
||||
|
||||
print SENDMAIL trim($msg) . "\n";
|
||||
close SENDMAIL;
|
||||
}
|
||||
push(@sentlist, $person);
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Code starts here
|
||||
|
||||
ConnectToDatabase();
|
||||
# Set Taint mode for the SQL
|
||||
$::db->{Taint} = 1;
|
||||
# ^^^ Taint mode is still a work in progress...
|
||||
GetVersionTable();
|
||||
|
||||
if (open(FID, "<data/nomail")) {
|
||||
while (<FID>) {
|
||||
$nomail{trim($_)} = 1;
|
||||
}
|
||||
close FID;
|
||||
}
|
||||
|
||||
if ($#ARGV >= 0 && $ARGV[0] eq "regenerate") {
|
||||
print "Regenerating is no longer required or supported\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($#ARGV >= 0 && $ARGV[0] eq "-forcecc") {
|
||||
shift(@ARGV);
|
||||
foreach my $i (split(/,/, shift(@ARGV))) {
|
||||
push(@{$force{'CClist'}}, trim($i));
|
||||
}
|
||||
}
|
||||
|
||||
if ($#ARGV >= 0 && $ARGV[0] eq "-forceowner") {
|
||||
shift(@ARGV);
|
||||
@{$force{'Owner'}} = (trim(shift(@ARGV)));
|
||||
}
|
||||
|
||||
if ($#ARGV >= 0 && $ARGV[0] eq "-forceqacontact") {
|
||||
shift(@ARGV);
|
||||
@{$force{'QAcontact'}} = (trim(shift(@ARGV)));
|
||||
}
|
||||
|
||||
if ($#ARGV >= 0 && $ARGV[0] eq "-forcereporter") {
|
||||
shift(@ARGV);
|
||||
@{$force{'Reporter'}} = trim(shift(@ARGV));
|
||||
}
|
||||
|
||||
if (($#ARGV < 0) || ($#ARGV > 1)) {
|
||||
print "Usage:\n processmail {bugid} {nametoexclude} " .
|
||||
"[-forcecc list,of,users]\n [-forceowner name] " .
|
||||
"[-forceqacontact name]\n [-forcereporter name]\nor\n" .
|
||||
" processmail rescanall\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($#ARGV == 1) {
|
||||
$nametoexclude = lc($ARGV[1]);
|
||||
}
|
||||
|
||||
if ($ARGV[0] eq "rescanall") {
|
||||
print "Collecting bug ids...\n";
|
||||
SendSQL("select bug_id, lastdiffed, delta_ts from bugs where lastdiffed < delta_ts AND delta_ts < date_sub(now(), INTERVAL 30 minute) order by bug_id");
|
||||
my @list;
|
||||
while (my @row = FetchSQLData()) {
|
||||
my $time = $row[2];
|
||||
if ($time =~ /^(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/) {
|
||||
$time = "$1-$2-$3 $4:$5:$6";
|
||||
}
|
||||
print STDERR "Bug $row[0] has unsent mail. lastdiffed is $row[1], delta_ts is $time.\n";
|
||||
push @list, $row[0];
|
||||
}
|
||||
if (scalar(@list) > 0) {
|
||||
print STDERR scalar(@list) . " bugs found with possibly unsent mail\n";
|
||||
print STDERR "Updating bugs, sending mail if required\n";
|
||||
} else {
|
||||
print "All appropriate mail appears to have been sent\n"
|
||||
}
|
||||
foreach my $id (@list) {
|
||||
%seen = ();
|
||||
if (detaint_natural($id)) {
|
||||
ProcessOneBug($id);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
my $bugnum;
|
||||
if ($ARGV[0] =~ m/^([1-9][0-9]*)$/) {
|
||||
$bugnum = $1;
|
||||
} else {
|
||||
print "Error calling processmail (bug id is not an integer)<br>\n";
|
||||
exit;
|
||||
}
|
||||
ProcessOneBug($bugnum);
|
||||
}
|
||||
|
||||
exit;
|
||||
@@ -1,389 +0,0 @@
|
||||
#!/usr/bonsaitools/bin/perl -wT
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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): Terry Weissman <terry@mozilla.org>
|
||||
# David Gardiner <david.gardiner@unisa.edu.au>
|
||||
# Matthias Radestock <matthias@sorted.org>
|
||||
# Gervase Markham <gerv@gerv.net>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
use lib ".";
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
use vars qw(
|
||||
@CheckOptionValues
|
||||
@legal_resolution
|
||||
@legal_bug_status
|
||||
@legal_components
|
||||
@legal_keywords
|
||||
@legal_opsys
|
||||
@legal_platform
|
||||
@legal_priority
|
||||
@legal_product
|
||||
@legal_severity
|
||||
@legal_target_milestone
|
||||
@legal_versions
|
||||
@log_columns
|
||||
%versions
|
||||
%components
|
||||
%FORM
|
||||
$template
|
||||
$vars
|
||||
);
|
||||
|
||||
ConnectToDatabase();
|
||||
|
||||
if (defined $::FORM{"GoAheadAndLogIn"}) {
|
||||
# We got here from a login page, probably from relogin.cgi. We better
|
||||
# make sure the password is legit.
|
||||
confirm_login();
|
||||
} else {
|
||||
quietly_check_login();
|
||||
}
|
||||
|
||||
# Backwards compatibility hack -- if there are any of the old QUERY_*
|
||||
# cookies around, and we are logged in, then move them into the database
|
||||
# and nuke the cookie. This is required for Bugzilla 2.8 and earlier.
|
||||
if ($::userid) {
|
||||
my @oldquerycookies;
|
||||
foreach my $i (keys %::COOKIE) {
|
||||
if ($i =~ /^QUERY_(.*)$/) {
|
||||
push(@oldquerycookies, [$1, $i, $::COOKIE{$i}]);
|
||||
}
|
||||
}
|
||||
if (defined $::COOKIE{'DEFAULTQUERY'}) {
|
||||
push(@oldquerycookies, [$::defaultqueryname, 'DEFAULTQUERY',
|
||||
$::COOKIE{'DEFAULTQUERY'}]);
|
||||
}
|
||||
if (@oldquerycookies) {
|
||||
foreach my $ref (@oldquerycookies) {
|
||||
my ($name, $cookiename, $value) = (@$ref);
|
||||
if ($value) {
|
||||
my $qname = SqlQuote($name);
|
||||
SendSQL("SELECT query FROM namedqueries " .
|
||||
"WHERE userid = $::userid AND name = $qname");
|
||||
my $query = FetchOneColumn();
|
||||
if (!$query) {
|
||||
SendSQL("REPLACE INTO namedqueries " .
|
||||
"(userid, name, query) VALUES " .
|
||||
"($::userid, $qname, " . SqlQuote($value) . ")");
|
||||
}
|
||||
}
|
||||
print "Set-Cookie: $cookiename= ; path=" . Param("cookiepath") .
|
||||
"; expires=Tue, 15-Sep-1998 21:49:00 GMT\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($::FORM{'nukedefaultquery'}) {
|
||||
if ($::userid) {
|
||||
SendSQL("DELETE FROM namedqueries " .
|
||||
"WHERE userid = $::userid AND name = '$::defaultqueryname'");
|
||||
}
|
||||
$::buffer = "";
|
||||
}
|
||||
|
||||
my $userdefaultquery;
|
||||
if ($::userid) {
|
||||
SendSQL("SELECT query FROM namedqueries " .
|
||||
"WHERE userid = $::userid AND name = '$::defaultqueryname'");
|
||||
$userdefaultquery = FetchOneColumn();
|
||||
}
|
||||
|
||||
my %default;
|
||||
|
||||
# We pass the defaults as a hash of references to arrays. For those
|
||||
# Items which are single-valued, the template should only reference [0]
|
||||
# and ignore any multiple values.
|
||||
sub PrefillForm {
|
||||
my ($buf) = (@_);
|
||||
my $foundone = 0;
|
||||
|
||||
# Nothing must be undef, otherwise the template complains.
|
||||
foreach my $name ("bug_status", "resolution", "assigned_to",
|
||||
"rep_platform", "priority", "bug_severity",
|
||||
"product", "reporter", "op_sys",
|
||||
"component", "version", "chfield", "chfieldfrom",
|
||||
"chfieldto", "chfieldvalue", "target_milestone",
|
||||
"email", "emailtype", "emailreporter",
|
||||
"emailassigned_to", "emailcc", "emailqa_contact",
|
||||
"emaillongdesc",
|
||||
"changedin", "votes", "short_desc", "short_desc_type",
|
||||
"long_desc", "long_desc_type", "bug_file_loc",
|
||||
"bug_file_loc_type", "status_whiteboard",
|
||||
"status_whiteboard_type", "bug_id",
|
||||
"bugidtype", "keywords", "keywords_type") {
|
||||
# This is a bit of a hack. The default, empty list has
|
||||
# three entries to accommodate the needs of the email fields -
|
||||
# we use each position to denote the relevant field. Array
|
||||
# position 0 is unused for email fields because the form
|
||||
# parameters historically started at 1.
|
||||
$default{$name} = ["", "", ""];
|
||||
}
|
||||
|
||||
|
||||
# Iterate over the URL parameters
|
||||
foreach my $item (split(/\&/, $buf)) {
|
||||
my @el = split(/=/, $item);
|
||||
my $name = $el[0];
|
||||
my $value;
|
||||
if ($#el > 0) {
|
||||
$value = url_decode($el[1]);
|
||||
} else {
|
||||
$value = "";
|
||||
}
|
||||
|
||||
# If the name begins with field, type, or value, then it is part of
|
||||
# the boolean charts. Because these are built different than the rest
|
||||
# of the form, we don't need to save a default value. We do, however,
|
||||
# need to indicate that we found something so the default query isn't
|
||||
# added in if all we have are boolean chart items.
|
||||
if ($name =~ m/^(?:field|type|value)/) {
|
||||
$foundone = 1;
|
||||
}
|
||||
# If the name ends in a number (which it does for the fields which
|
||||
# are part of the email searching), we use the array
|
||||
# positions to show the defaults for that number field.
|
||||
elsif ($name =~ m/^(.+)(\d)$/ && defined($default{$1})) {
|
||||
$foundone = 1;
|
||||
$default{$1}->[$2] = $value;
|
||||
}
|
||||
# If there's no default yet, we replace the blank string.
|
||||
elsif (defined($default{$name}) && $default{$name}->[0] eq "") {
|
||||
$foundone = 1;
|
||||
$default{$name} = [$value];
|
||||
}
|
||||
# If there's already a default, we push on the new value.
|
||||
elsif (defined($default{$name})) {
|
||||
push (@{$default{$name}}, $value);
|
||||
}
|
||||
}
|
||||
return $foundone;
|
||||
}
|
||||
|
||||
|
||||
if (!PrefillForm($::buffer)) {
|
||||
# Ah-hah, there was no form stuff specified. Do it again with the
|
||||
# default query.
|
||||
if ($userdefaultquery) {
|
||||
PrefillForm($userdefaultquery);
|
||||
} else {
|
||||
PrefillForm(Param("defaultquery"));
|
||||
}
|
||||
}
|
||||
|
||||
if ($default{'chfieldto'}->[0] eq "") {
|
||||
$default{'chfieldto'} = ["Now"];
|
||||
}
|
||||
|
||||
GetVersionTable();
|
||||
|
||||
# if using usebuggroups, then we don't want people to see products they don't
|
||||
# have access to. Remove them from the list.
|
||||
|
||||
my @products = ();
|
||||
my %component_set;
|
||||
my %version_set;
|
||||
my %milestone_set;
|
||||
foreach my $p (@::legal_product) {
|
||||
# If we're using bug groups to restrict entry on products, and
|
||||
# this product has a bug group, and the user is not in that
|
||||
# group, we don't want to include that product in this list.
|
||||
next if (Param("usebuggroups") && GroupExists($p) && !UserInGroup($p));
|
||||
|
||||
# We build up boolean hashes in the "-set" hashes for each of these things
|
||||
# before making a list because there may be duplicates names across products.
|
||||
push @products, $p;
|
||||
if ($::components{$p}) {
|
||||
foreach my $c (@{$::components{$p}}) {
|
||||
$component_set{$c} = 1;
|
||||
}
|
||||
}
|
||||
foreach my $v (@{$::versions{$p}}) {
|
||||
$version_set{$v} = 1;
|
||||
}
|
||||
foreach my $m (@{$::target_milestone{$p}}) {
|
||||
$milestone_set{$m} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
# @products is now all the products we are ever concerned with, as a list
|
||||
# %x_set is now a unique "list" of the relevant components/versions/tms
|
||||
@products = sort { lc($a) cmp lc($b) } @products;
|
||||
|
||||
# Create the component, version and milestone lists.
|
||||
my @components = ();
|
||||
my @versions = ();
|
||||
my @milestones = ();
|
||||
foreach my $c (@::legal_components) {
|
||||
if ($component_set{$c}) {
|
||||
push @components, $c;
|
||||
}
|
||||
}
|
||||
foreach my $v (@::legal_versions) {
|
||||
if ($version_set{$v}) {
|
||||
push @versions, $v;
|
||||
}
|
||||
}
|
||||
foreach my $m (@::legal_target_milestone) {
|
||||
if ($milestone_set{$m}) {
|
||||
push @milestones, $m;
|
||||
}
|
||||
}
|
||||
|
||||
# Sort the component list...
|
||||
my $comps = \%::components;
|
||||
foreach my $p (@products) {
|
||||
my @tmp = sort { lc($a) cmp lc($b) } @{$comps->{$p}};
|
||||
$comps->{$p} = \@tmp;
|
||||
}
|
||||
|
||||
# and the version list...
|
||||
my $vers = \%::versions;
|
||||
foreach my $p (@products) {
|
||||
my @tmp = sort { lc($a) cmp lc($b) } @{$vers->{$p}};
|
||||
$vers->{$p} = \@tmp;
|
||||
}
|
||||
|
||||
# and the milestone list.
|
||||
my $mstones;
|
||||
if (Param('usetargetmilestone')) {
|
||||
$mstones = \%::target_milestone;
|
||||
foreach my $p (@products) {
|
||||
my @tmp = sort { lc($a) cmp lc($b) } @{$mstones->{$p}};
|
||||
$mstones->{$p} = \@tmp;
|
||||
}
|
||||
}
|
||||
|
||||
# "foo" or "foos" is a list of all the possible (or legal) products,
|
||||
# components, versions or target milestones.
|
||||
# "foobyproduct" is a hash, keyed by product, of sorted lists
|
||||
# of the same data.
|
||||
|
||||
$vars->{'product'} = \@products;
|
||||
|
||||
# We use 'component_' because 'component' is a Template Toolkit reserved word.
|
||||
$vars->{'componentsbyproduct'} = $comps;
|
||||
$vars->{'component_'} = \@components;
|
||||
|
||||
$vars->{'versionsbyproduct'} = $vers;
|
||||
$vars->{'version'} = \@versions;
|
||||
|
||||
if (Param('usetargetmilestone')) {
|
||||
$vars->{'milestonesbyproduct'} = $mstones;
|
||||
$vars->{'target_milestone'} = \@milestones;
|
||||
}
|
||||
|
||||
$vars->{'have_keywords'} = scalar(@::legal_keywords);
|
||||
|
||||
push @::legal_resolution, "---"; # Oy, what a hack.
|
||||
shift @::legal_resolution;
|
||||
# Another hack - this array contains "" for some reason. See bug 106589.
|
||||
$vars->{'resolution'} = \@::legal_resolution;
|
||||
|
||||
$vars->{'chfield'} = ["[Bug creation]", @::log_columns];
|
||||
$vars->{'bug_status'} = \@::legal_bug_status;
|
||||
$vars->{'rep_platform'} = \@::legal_platform;
|
||||
$vars->{'op_sys'} = \@::legal_opsys;
|
||||
$vars->{'priority'} = \@::legal_priority;
|
||||
$vars->{'bug_severity'} = \@::legal_severity;
|
||||
$vars->{'userid'} = $::userid;
|
||||
|
||||
# Boolean charts
|
||||
my @fields;
|
||||
push(@fields, { name => "noop", description => "---" });
|
||||
SendSQL("SELECT name, description FROM fielddefs ORDER BY sortkey");
|
||||
while (MoreSQLData()) {
|
||||
my ($name, $description) = FetchSQLData();
|
||||
push(@fields, { name => $name, description => $description });
|
||||
}
|
||||
|
||||
$vars->{'fields'} = \@fields;
|
||||
|
||||
# Creating new charts - if the cmd-add value is there, we define the field
|
||||
# value so the code sees it and creates the chart. It will attempt to select
|
||||
# "xyzzy" as the default, and fail. This is the correct behaviour.
|
||||
foreach my $cmd (grep(/^cmd-/, keys(%::FORM))) {
|
||||
if ($cmd =~ /^cmd-add(\d+)-(\d+)-(\d+)$/) {
|
||||
$::FORM{"field$1-$2-$3"} = "xyzzy";
|
||||
}
|
||||
}
|
||||
|
||||
if (!exists $::FORM{'field0-0-0'}) {
|
||||
$::FORM{'field0-0-0'} = "xyzzy";
|
||||
}
|
||||
|
||||
# Create data structure of boolean chart info. It's an array of arrays of
|
||||
# arrays - with the inner arrays having three members - field, type and
|
||||
# value.
|
||||
my @charts;
|
||||
for (my $chart = 0; $::FORM{"field$chart-0-0"}; $chart++) {
|
||||
my @rows;
|
||||
for (my $row = 0; $::FORM{"field$chart-$row-0"}; $row++) {
|
||||
my @cols;
|
||||
for (my $col = 0; $::FORM{"field$chart-$row-$col"}; $col++) {
|
||||
push(@cols, { field => $::FORM{"field$chart-$row-$col"},
|
||||
type => $::FORM{"type$chart-$row-$col"},
|
||||
value => $::FORM{"value$chart-$row-$col"} });
|
||||
}
|
||||
push(@rows, \@cols);
|
||||
}
|
||||
push(@charts, \@rows);
|
||||
}
|
||||
|
||||
$default{'charts'} = \@charts;
|
||||
|
||||
# Named queries
|
||||
if ($::userid) {
|
||||
my @namedqueries;
|
||||
SendSQL("SELECT name FROM namedqueries " .
|
||||
"WHERE userid = $::userid AND name != '$::defaultqueryname' " .
|
||||
"ORDER BY name");
|
||||
while (MoreSQLData()) {
|
||||
push(@namedqueries, FetchOneColumn());
|
||||
}
|
||||
|
||||
$vars->{'namedqueries'} = \@namedqueries;
|
||||
}
|
||||
|
||||
# Sort order
|
||||
my $deforder;
|
||||
my @orders = ('Bug Number', 'Importance', 'Assignee', 'Last Changed');
|
||||
|
||||
if ($::COOKIE{'LASTORDER'}) {
|
||||
$deforder = "Reuse same sort as last time";
|
||||
unshift(@orders, $deforder);
|
||||
}
|
||||
|
||||
if ($::FORM{'order'}) { $deforder = $::FORM{'order'} }
|
||||
|
||||
$vars->{'userdefaultquery'} = $userdefaultquery;
|
||||
$vars->{'orders'} = \@orders;
|
||||
$default{'querytype'} = $deforder || 'Importance';
|
||||
|
||||
# Add in the defaults.
|
||||
$vars->{'default'} = \%default;
|
||||
|
||||
# Generate and return the UI (HTML page) from the appropriate template.
|
||||
print "Content-type: text/html\n\n";
|
||||
$template->process("search/search.html.tmpl", $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
@@ -1,151 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<title>Bugzilla QuickSearch</title>
|
||||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
|
||||
<p>
|
||||
<small>If you are already familiar with the original
|
||||
<a href="query.cgi">Bugzilla Query Form</a>,
|
||||
you may prefer <a href="quicksearchhack.html">this form</a>.
|
||||
</small>
|
||||
</p>
|
||||
|
||||
<script src="localconfig.js" type="text/javascript"></script>
|
||||
<script src="quicksearch.js" type="text/javascript"></script>
|
||||
|
||||
<h1>Bugzilla QuickSearch</h1>
|
||||
|
||||
<p>
|
||||
Type in one or more words (or word fragments) to search for:
|
||||
</p>
|
||||
|
||||
<form name="f" action="show_bug.cgi" method="get"
|
||||
onsubmit="QuickSearch(f.id.value); return false;">
|
||||
<table>
|
||||
<tr>
|
||||
<td><input type="text" size="40" name="id"></td>
|
||||
<td align="left"><input type="submit" value="Search"></td>
|
||||
<!-- <td><a href="javascript:QuickSearch_Help();">[Help]</a></td> -->
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
document.forms['f'].id.focus();
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<h2>Getting Started</h2>
|
||||
|
||||
<ul>
|
||||
<li> This is <b>case-insensitive</b> search.
|
||||
<ul>
|
||||
<li> <tt>table</tt> , <tt>Table</tt>
|
||||
and <tt>TABLE</tt> are all the same.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li> This is <b>all words as substrings</b> search.<br>
|
||||
Therefore you should <b>use stems</b> to get better results:
|
||||
<ul>
|
||||
<li> Use <tt>localiz</tt> instead of <tt>localize</tt> or
|
||||
<tt>localization</tt>.</li>
|
||||
<li> Use <tt>bookmark</tt> instead of <tt>bookmarks</tt> or
|
||||
<tt>bookmarking</tt>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2><a name="features">Features</a></h2>
|
||||
|
||||
<ul>
|
||||
<li> Boolean operations: ``<tt>-foo</tt>''(NOT), ``<tt>foo bar</tt>''(AND),
|
||||
``<tt>foo|bar</tt>''(OR).
|
||||
<ul>
|
||||
<li> <b>NOT</b>: Use <tt><b>-</b><i>foo</i></tt> to exclude bugs
|
||||
with <tt><i>foo</i></tt> in the summary.</li>
|
||||
<li> <b>AND</b>: Space-separated words are treated as a conjunction.</li>
|
||||
<li> <b>OR</b>: Within a word, "|"-separated parts denote alternatives. </li>
|
||||
<li> Besides "|", a comma can be used to separate alternatives.</li>
|
||||
<li> OR has higher precedence than AND; AND is the top level operation</li>
|
||||
</ul>
|
||||
<i>Example:</i> <tt>url,location bar,field -focus</tt>
|
||||
means
|
||||
(<tt>url</tt> OR <tt>location</tt>) AND (<tt>bar</tt> OR <tt>field</tt>) AND (NOT <tt>focus</tt>)
|
||||
<p>
|
||||
</li>
|
||||
<li>Use <tt>+foo</tt> to search for bugs where the <b>summary</b> contains <tt>foo</tt> as a <b>substring</b>.<br>
|
||||
Use <tt>#foo</tt> to search for bugs where the <b>summary</b> contains the <b>word</b> <tt>foo</tt>
|
||||
<ul>
|
||||
<li> <tt>+brow</tt> does not find all bugs in the <tt>Browser</tt> product</li>
|
||||
<li> <tt>#title</tt> does not find bugs bugs with <tt>titlebar</tt> or <tt>titled</tt> </li>
|
||||
</ul>
|
||||
Phrases with special chars (space, comma, +, -, #, ...) can be <b>quoted</b>:
|
||||
<ul>
|
||||
<li> <tt>"lock icon"</tt> </li>
|
||||
</ul>
|
||||
<p>
|
||||
</li>
|
||||
<li> <b>Open vs. Resolved Bugs</b>:<br>
|
||||
By default, only open (i.e. unresolved) bugs are shown.
|
||||
Use <tt>+DUP</tt> as first word in your query
|
||||
to include duplicate bugs in your search,
|
||||
<tt>FIXED</tt> to search for fixed bugs only,
|
||||
or <tt>ALL</tt> to search all bugs,
|
||||
regardless of status or resolution. Searching for duplicates is
|
||||
recommended if you can't find an open bug directly.
|
||||
<ul>
|
||||
<li> <tt>+DUP,FIXED table border</tt> </li>
|
||||
<li> <tt>ALL mouse wheel</tt> </li>
|
||||
</ul>
|
||||
<p></li>
|
||||
<li> <b>Focus the Search with Products & Components</b>:<br>
|
||||
To search for bugs in product "Foo Bar" only, add
|
||||
<tt>:foo</tt> or <tt>:bar</tt> or both
|
||||
to your query.
|
||||
You can do this with any substring of a
|
||||
<a href="describecomponents.cgi">product or component</a>
|
||||
to focus the search.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>More Tips</h2>
|
||||
|
||||
<ul>
|
||||
<li> You can also use this tool to <b>lookup</b> a bug by its number.
|
||||
<ul>
|
||||
<li> <tt>12345</tt> </li>
|
||||
</ul>
|
||||
</li>
|
||||
<li> A comma-separated list of bug numbers gives you a list of these bugs.
|
||||
<ul>
|
||||
<li> <tt>12345,23456,34567</tt> </li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
By default, the following fields are searched: Summary, Keywords, Product,
|
||||
Component, Status Whiteboard. If a word looks like a part of a URL, that field
|
||||
is included in the search, too.
|
||||
</p>
|
||||
<!--
|
||||
<small>For further details, see
|
||||
<a href="http://bugzilla.mozilla.org/show_bug.cgi?id=61561">Bug 61561</a> and
|
||||
<a href="http://bugzilla.mozilla.org/show_bug.cgi?id=69793">Bug 69793</a>.
|
||||
</small>
|
||||
-->
|
||||
<hr>
|
||||
|
||||
<p>
|
||||
Use the powerful
|
||||
<a href="query.cgi">Bugzilla Query Form</a>
|
||||
for advanced queries.
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,736 +0,0 @@
|
||||
//
|
||||
// This is the main JS file for QuickSearch.
|
||||
//
|
||||
// Derived from:
|
||||
//
|
||||
// * C. Begle's SimpleSearch tool:
|
||||
// http://www.mozilla.org/quality/help/simplesearch.html
|
||||
// http://www.mozilla.org/quality/help/bugreport.js
|
||||
//
|
||||
// * Jesse Ruderman's bugzilla search page:
|
||||
// http://www.cs.hmc.edu/~jruderma/s/bugz.html
|
||||
//
|
||||
// Created by
|
||||
// Andreas Franke <afranke@mathweb.org>
|
||||
//
|
||||
// Contributors:
|
||||
// Stephen Lee <slee@uk.bnsmc.com>
|
||||
|
||||
|
||||
// Use no_result variable to avoid problems with "undefined" on some browsers
|
||||
|
||||
var no_result="---";
|
||||
|
||||
// do_unshift(l, s) is equivalent to l.unshift(s), but some browsers do not
|
||||
// support the built-in function.
|
||||
|
||||
function do_unshift(l, s) {
|
||||
l.length = l.length + 1;
|
||||
for (var i=l.length-1; i>0; i--) {
|
||||
l[i] = l[i-1];
|
||||
}
|
||||
l[0] = s;
|
||||
return l.length;
|
||||
}
|
||||
|
||||
// do_shift(l) is equivalent to l.shift(s), but some browsers do not
|
||||
// support the built-in function.
|
||||
|
||||
function do_shift(l) {
|
||||
var l0=l[0];
|
||||
for (var i=0; i<l.length-1; i++) {
|
||||
l[i] = l[i+1];
|
||||
}
|
||||
l.length = l.length - 1;
|
||||
return l0;
|
||||
}
|
||||
|
||||
function go_to (url) {
|
||||
if ( typeof sidebar != "undefined" && sidebar == 1 ) {
|
||||
load_relative_url(url);
|
||||
} else {
|
||||
document.location.href = url;
|
||||
}
|
||||
}
|
||||
|
||||
function map(l, f) {
|
||||
var l1 = new Array();
|
||||
for (var i=0; i<l.length; i++) {
|
||||
l1[i] = f(l[i]);
|
||||
}
|
||||
return l1;
|
||||
}
|
||||
|
||||
function isPrefix(s1, s2) {
|
||||
return (s1.length <= s2.length) &&
|
||||
(s1 == s2.substring(0,s1.length))
|
||||
}
|
||||
|
||||
function member(s, l) {
|
||||
for (var i=0; i<l.length; i++) {
|
||||
if (l[i] == s) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function add(s, l) {
|
||||
if (! member(s, l)) {
|
||||
do_unshift(l,s);
|
||||
}
|
||||
}
|
||||
|
||||
function addAll(l1, l2) {
|
||||
for (var i=0; i<l1.length; i++) {
|
||||
add(l1[i],l2);
|
||||
}
|
||||
}
|
||||
|
||||
function isSubset (l1, l2) {
|
||||
return (l1.length == 0)
|
||||
|| (member(l1[0],l2) && subset(l1.slice(1),l2));
|
||||
}
|
||||
|
||||
// fields
|
||||
|
||||
var f1 = new Array();
|
||||
var f2 = new Array();
|
||||
|
||||
function add_mapping(from,to) {
|
||||
f1[f1.length] = from;
|
||||
f2[f2.length] = to;
|
||||
}
|
||||
|
||||
// Status, Resolution, Platform, OS, Priority, Severity
|
||||
add_mapping("status", "bug_status");
|
||||
add_mapping("resolution", "resolution"); // no change
|
||||
add_mapping("platform", "rep_platform");
|
||||
add_mapping("os", "op_sys");
|
||||
add_mapping("opsys", "op_sys");
|
||||
add_mapping("priority", "priority"); // no change
|
||||
add_mapping("pri", "priority");
|
||||
add_mapping("severity", "bug_severity");
|
||||
add_mapping("sev", "bug_severity");
|
||||
// People: AssignedTo, Reporter, QA Contact, CC, Added comment (?)
|
||||
add_mapping("owner", "assigned_to");
|
||||
add_mapping("assignee", "assigned_to");
|
||||
add_mapping("assignedto", "assigned_to");
|
||||
add_mapping("reporter", "reporter"); // no change
|
||||
add_mapping("rep", "reporter");
|
||||
add_mapping("qa", "qa_contact");
|
||||
add_mapping("qacontact", "qa_contact");
|
||||
add_mapping("cc", "cc"); // no change
|
||||
// Product, Version, Component, Target Milestone
|
||||
add_mapping("product", "product"); // no change
|
||||
add_mapping("prod", "product");
|
||||
add_mapping("version", "version"); // no change
|
||||
add_mapping("ver", "version");
|
||||
add_mapping("component", "component"); // no change
|
||||
add_mapping("comp", "component");
|
||||
add_mapping("milestone", "target_milestone");
|
||||
add_mapping("target", "target_milestone");
|
||||
add_mapping("targetmilestone", "target_milestone");
|
||||
// Summary, Description, URL, Status whiteboard, Keywords
|
||||
add_mapping("summary", "short_desc");
|
||||
add_mapping("shortdesc", "short_desc");
|
||||
add_mapping("desc", "longdesc");
|
||||
add_mapping("description", "longdesc");
|
||||
//add_mapping("comment", "longdesc"); // ???
|
||||
// reserve "comment" for "added comment" email search?
|
||||
add_mapping("longdesc", "longdesc");
|
||||
add_mapping("url", "bug_file_loc");
|
||||
add_mapping("whiteboard", "status_whiteboard");
|
||||
add_mapping("statuswhiteboard", "status_whiteboard");
|
||||
add_mapping("sw", "status_whiteboard");
|
||||
add_mapping("keywords", "keywords"); // no change
|
||||
add_mapping("kw", "keywords");
|
||||
// Attachments
|
||||
add_mapping("attachment", "attachments.description");
|
||||
add_mapping("attachmentdesc", "attachments.description");
|
||||
add_mapping("attachdesc", "attachments.description");
|
||||
add_mapping("attachmentdata", "attachments.thedata");
|
||||
add_mapping("attachdata", "attachments.thedata");
|
||||
add_mapping("attachmentmimetype", "attachments.mimetype");
|
||||
add_mapping("attachmimetype", "attachments.mimetype");
|
||||
|
||||
// disabled because of bug 30823:
|
||||
// "BugsThisDependsOn" --> "dependson"
|
||||
// "OtherBugsDependingOnThis"--> "blocked"
|
||||
//add_mapping("dependson", "dependson");
|
||||
//add_mapping("blocked", "blocked");
|
||||
|
||||
// Substring search doesn't make much sense for the following fields:
|
||||
// "Attachment is patch" --> "attachments.ispatch"
|
||||
// "Last changed date" --> "delta_ts"
|
||||
// "Days since bug changed" --> "(to_days(now()) - to_days(bugs.delta_ts))"
|
||||
//"groupset"
|
||||
//"everconfirmed"
|
||||
//"bug","bugid","bugno" --> "bug_id"
|
||||
// "votes" --> "votes"
|
||||
// "votes>5", "votes>=5", "votes=>5" works now, see below
|
||||
// "votes:5" is interpreted as "votes>=5"
|
||||
|
||||
function findIndex(array,value) {
|
||||
for (var i=0; i<array.length; i++)
|
||||
if (array[i] == value) return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
function mapField(fieldname) {
|
||||
var i = findIndex(f1,fieldname);
|
||||
if (i >= 0) return f2[i];
|
||||
return no_result;
|
||||
}
|
||||
|
||||
// `keywords' is defined externally
|
||||
|
||||
function is_keyword(s) {
|
||||
return member(s, keywords);
|
||||
}
|
||||
|
||||
// `platforms' is defined externally
|
||||
|
||||
function is_platform(str) {
|
||||
return member (str.toLowerCase(),platforms);
|
||||
}
|
||||
|
||||
// `severities' is defined externally
|
||||
|
||||
function is_severity(str) {
|
||||
return member(str.toLowerCase(),severities);
|
||||
}
|
||||
|
||||
// `product_exceptions' is defined externally
|
||||
|
||||
function match_product(str) {
|
||||
var s = str.toLowerCase();
|
||||
return (s.length > 2) && (! member(s,product_exceptions));
|
||||
}
|
||||
|
||||
// `component_exceptions are defined externally
|
||||
|
||||
function match_component(str) {
|
||||
var s = str.toLowerCase();
|
||||
return (s.length > 2) && (! member(s,component_exceptions));
|
||||
}
|
||||
|
||||
var status_and_resolution = ""; // for pretty debug output only; these vars
|
||||
var charts = ""; // always hold the data from the last query
|
||||
|
||||
// derived from http://www.mozilla.org/quality/help/bugreport.js
|
||||
|
||||
function make_chart(expr, field, type, value) {
|
||||
charts += "<tr>" +
|
||||
"<td><tt>" + expr + "</tt></td>" +
|
||||
"<td><tt>" + field + "</tt></td>" +
|
||||
"<td><tt>" + type + "</tt></td>" +
|
||||
"<td><tt>" + value + "</tt></td>" +
|
||||
"</tr>";
|
||||
return "&field" + expr + "=" + field +
|
||||
"&type" + expr + "=" + type +
|
||||
"&value" + expr + "=" + escape(value).replace(/[+]/g,"%2B");
|
||||
}
|
||||
|
||||
// returns true if at least one of comparelist had the prefix, false otherwise
|
||||
function addPrefixMatches(prefix, comparelist, resultlist) {
|
||||
var foundMatch = false;
|
||||
for (var i=0; i<comparelist.length; i++) {
|
||||
if (isPrefix(prefix,comparelist[i])) {
|
||||
foundMatch = true;
|
||||
add(comparelist[i],resultlist);
|
||||
}
|
||||
}
|
||||
return foundMatch;
|
||||
}
|
||||
|
||||
function prefixesNotFoundError(prefixes,statusValues,resolutionValues) {
|
||||
var txt;
|
||||
if (prefixes.length == 1) {
|
||||
txt = "is not a prefix ";
|
||||
} else {
|
||||
txt = "are not prefixes ";
|
||||
}
|
||||
alert(prefixes + "\n" + txt +
|
||||
"of one of these status or resolution values:\n" +
|
||||
statusValues + "\n" + resolutionValues + "\n");
|
||||
}
|
||||
|
||||
function make_query_URL(url, input, searchLong) {
|
||||
|
||||
status_and_resolution = "";
|
||||
charts = "";
|
||||
|
||||
// declare all variables used in this function
|
||||
|
||||
var searchURL = url; // bugzilla + "buglist.cgi" (or "query.cgi")
|
||||
var abort = false; // global flag, checked upon return
|
||||
|
||||
var i,j,k,l; // index counters used in 'for' loops
|
||||
var parts,input2; // escape "quoted" parts of input
|
||||
|
||||
var word; // array of words
|
||||
// (space-separated parts of input2)
|
||||
var alternative; // array of parts of an element of 'word'
|
||||
// (separated by '|', sometimes by comma)
|
||||
var comma_separated_words; // array of parts of an element of 'alternative'
|
||||
var w; // current element of one of these arrays:
|
||||
// word, alternative, comma_separated_words
|
||||
|
||||
var w0; // first element of 'word'
|
||||
var prefixes; // comma-separated parts of w0
|
||||
// (prefixes of status/resolution values)
|
||||
|
||||
var expr; // used for 'priority' support
|
||||
var n,separator; // used for 'votes' support
|
||||
|
||||
var colon_separated_parts, fields,values,field;
|
||||
// used for generic fields:values notation
|
||||
|
||||
var chart,and,or; // counters used in add_chart
|
||||
var negation; // boolean flag used in add_chart
|
||||
|
||||
// `statuses_open' and `statuses_resolved' are defined externally
|
||||
var statusOpen = statuses_open;
|
||||
var statusResolved = statuses_resolved;
|
||||
var statusAll = statusOpen.concat(statusResolved);
|
||||
|
||||
// `resolutions' is defined externally
|
||||
var bug_status = statusOpen.slice().reverse(); //reverse is just cosmetic
|
||||
var resolution = new Array();
|
||||
|
||||
// escape everything between quotes: "foo bar" --> "foo%20bar"
|
||||
parts = input.split('"');
|
||||
if ((parts.length % 2) != 1) {
|
||||
alert('Unterminated quote');
|
||||
abort = true;
|
||||
return no_result;
|
||||
}
|
||||
for (i=1; i<parts.length; i+=2) {
|
||||
parts[i] = escape(parts[i]);
|
||||
}
|
||||
input2 = parts.join('"');
|
||||
|
||||
// abort if there are still brackets
|
||||
if (input2.match(/[(]|[\)]/)) {
|
||||
alert('Brackets (...) are not supported.\n' +
|
||||
'Use quotes "..." for values that contain special characters.');
|
||||
abort = true;
|
||||
return no_result;
|
||||
}
|
||||
|
||||
// translate " AND "," OR "," NOT " to space,comma,dash
|
||||
input2 = input2.replace(/[\s]+AND[\s]+/g," ");
|
||||
input2 = input2.replace(/[\s]+OR[\s]+/g,"|");
|
||||
input2 = input2.replace(/[\s]+NOT[\s]+/g," -");
|
||||
|
||||
// now split into words at space positions
|
||||
word = input2.split(/[\s]+/);
|
||||
|
||||
// determine bug_status and resolution
|
||||
// the first word may contain relevant info
|
||||
|
||||
// This function matches the given prefixes against the given statuses and
|
||||
// resolutions. Matched statuses are added to bug_status, matched
|
||||
// resolutions are added to resolution. Returns true iff some matches
|
||||
// were found for at least one of the given prefixes.
|
||||
function matchPrefixes(prefixes,statuses,resolutions) {
|
||||
var failedPrefixes = new Array();
|
||||
var foundMatch = false;
|
||||
for (var j=0; j<prefixes.length; j++) {
|
||||
var ok1 = addPrefixMatches(prefixes[j],statuses,bug_status);
|
||||
var ok2 = addPrefixMatches(prefixes[j],resolutions,resolution);
|
||||
if ((! ok1) && (! ok2)) {
|
||||
add(prefixes[j],failedPrefixes);
|
||||
} else {
|
||||
foundMatch = true;
|
||||
}
|
||||
}
|
||||
//report an error if some (but not all) prefixes didn't match anything
|
||||
if (foundMatch && (failedPrefixes.length > 0)) {
|
||||
prefixesNotFoundError(failedPrefixes,statuses,resolutions);
|
||||
abort = true;
|
||||
}
|
||||
return foundMatch;
|
||||
}
|
||||
|
||||
if (word[0] == "ALL") {
|
||||
// special case: search for bugs regardless of status
|
||||
addAll(statusResolved,bug_status);
|
||||
do_shift(word);
|
||||
} else if (word[0] == "OPEN") {
|
||||
// special case: search for open bugs only
|
||||
do_shift(word);
|
||||
} else if (word[0].match("^[+][A-Z]+(,[A-Z]+)*$")) {
|
||||
// e.g. +DUP,FIX
|
||||
w0 = do_shift(word);
|
||||
prefixes = w0.substring(1).split(",");
|
||||
if (! matchPrefixes(prefixes,statusResolved,resolutions)) {
|
||||
do_unshift(word,w0);
|
||||
}
|
||||
} else if (word[0].match("^[A-Z]+(,[A-Z]+)*$")) {
|
||||
// e.g. NEW,ASSI,REOP,FIX
|
||||
bug_status = new Array(); // reset
|
||||
w0 = do_shift(word);
|
||||
prefixes = w0.split(",");
|
||||
if (! matchPrefixes(prefixes,statusAll,resolutions)) {
|
||||
do_unshift(word,w0);
|
||||
bug_status = statusOpen.reverse(); //reset to default bug_status
|
||||
}
|
||||
} else {
|
||||
// default case:
|
||||
// search for unresolved bugs only
|
||||
// uncomment this to include duplicate bugs in the search
|
||||
// add("DUPLICATE",resolution);
|
||||
}
|
||||
if (resolution.length > 0) {
|
||||
resolution = resolution.reverse();
|
||||
do_unshift(resolution,"---");
|
||||
addAll(statusResolved,bug_status);
|
||||
}
|
||||
bug_status = bug_status.reverse();
|
||||
bug_status = map(bug_status,escape);
|
||||
searchURL += "?bug_status=" + bug_status.join("&bug_status=");
|
||||
status_and_resolution += 'Status: <tt>'+bug_status+'</tt>';
|
||||
|
||||
if (resolution.length > 0) {
|
||||
resolution = map(resolution,escape);
|
||||
searchURL += "&resolution=" + resolution.join("&resolution=");
|
||||
status_and_resolution += '<br>'+'Resolution: <tt>'+resolution+'</tt>';
|
||||
}
|
||||
|
||||
// end of bug_status & resolution stuff
|
||||
|
||||
chart = 0;
|
||||
and = 0;
|
||||
or = 0;
|
||||
|
||||
negation = false;
|
||||
|
||||
function negate_comparison_type(type) {
|
||||
switch(type) {
|
||||
case "substring": return "notsubstring";
|
||||
case "anywords": return "nowords";
|
||||
case "regexp": return "notregexp";
|
||||
default:
|
||||
// e.g. "greaterthan"
|
||||
alert("Can't negate comparison type: `" + type + "'");
|
||||
abort = true;
|
||||
return "dummy";
|
||||
}
|
||||
}
|
||||
|
||||
function add_chart(field,type,value) {
|
||||
// undo escaping for value: '"foo%20bar"' --> 'foo bar'
|
||||
var parts = value.split('"');
|
||||
if ((parts.length % 2) != 1) {
|
||||
alert('Internal error: unescaping failure');
|
||||
abort = true;
|
||||
}
|
||||
for (var i=1; i<parts.length; i+=2) {
|
||||
parts[i] = unescape(parts[i]);
|
||||
}
|
||||
var value2 = parts.join('');
|
||||
|
||||
// negate type if negation is set
|
||||
var type2 = type;
|
||||
if (negation) {
|
||||
type2 = negate_comparison_type(type2);
|
||||
}
|
||||
searchURL += make_chart(chart+"-"+and+"-"+or,field,type2,value2);
|
||||
or++;
|
||||
if (negation) {
|
||||
and++;
|
||||
or=0;
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<word.length; i++, chart++) {
|
||||
|
||||
w = word[i];
|
||||
|
||||
negation = false;
|
||||
if (w.charAt(0) == "-") {
|
||||
negation = true;
|
||||
w = w.substring(1);
|
||||
}
|
||||
|
||||
switch (w.charAt(0)) {
|
||||
case "+":
|
||||
alternative = w.substring(1).split(/[|,]/);
|
||||
for (j=0; j<alternative.length; j++)
|
||||
add_chart("short_desc","substring",alternative[j]);
|
||||
break;
|
||||
case "#":
|
||||
alternative = w.substring(1).replace(/[|,]/g," ");
|
||||
add_chart("short_desc","anywords",alternative);
|
||||
if (searchLong)
|
||||
add_chart("longdesc","anywords",alternative);
|
||||
break;
|
||||
case ":":
|
||||
alternative = w.substring(1).split(",");
|
||||
for (j=0; j<alternative.length; j++) {
|
||||
add_chart("product","substring",alternative[j]);
|
||||
add_chart("component","substring",alternative[j]);
|
||||
}
|
||||
break;
|
||||
case "@":
|
||||
alternative = w.substring(1).split(",");
|
||||
for (j=0; j<alternative.length; j++)
|
||||
add_chart("assigned_to","substring",alternative[j]);
|
||||
break;
|
||||
case "[":
|
||||
add_chart("short_desc","substring",w);
|
||||
add_chart("status_whiteboard","substring",w);
|
||||
break;
|
||||
case "!":
|
||||
add_chart("keywords","anywords",w.substring(1));
|
||||
break;
|
||||
default:
|
||||
alternative=w.split("|");
|
||||
for (j=0; j<alternative.length; j++) {
|
||||
|
||||
w=alternative[j];
|
||||
|
||||
// votes:xx ("at least xx votes")
|
||||
if (w.match("^votes[:][0-9]+$")) {
|
||||
n = w.split(/[:]/)[1];
|
||||
add_chart("votes","greaterthan",String(n-1));
|
||||
continue;
|
||||
}
|
||||
// generic field1,field2,field3:value1,value2 notation
|
||||
if (w.match("^[^:]+[:][^:\/][^:]*$")) {
|
||||
colon_separated_parts = w.split(":");
|
||||
fields = colon_separated_parts[0].split(/[,]+/);
|
||||
values = colon_separated_parts[1].split(/[,]+/);
|
||||
for (k=0; k<fields.length; k++) {
|
||||
field = mapField(fields[k]);
|
||||
if (field == no_result) {
|
||||
alert("`"+fields[k]+"'"+
|
||||
" is not a valid field name.");
|
||||
abort = true;
|
||||
return no_result;
|
||||
} else {
|
||||
for (l=0; l<values.length; l++) {
|
||||
add_chart(field,"substring",values[l]);
|
||||
}
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
comma_separated_words=w.split(/[,]+/);
|
||||
for (k=0; k<comma_separated_words.length; k++) {
|
||||
w=comma_separated_words[k];
|
||||
|
||||
// platform
|
||||
if (is_platform(w)) {
|
||||
add_chart("rep_platform","substring",w);
|
||||
continue;
|
||||
}
|
||||
// priority
|
||||
if (w.match("^[pP][1-5](,[pP]?[1-5])*$")) {
|
||||
expr = "["+w.replace(/[p,]/g,"")+"]";
|
||||
add_chart("priority","regexp",expr);
|
||||
continue;
|
||||
}
|
||||
if (w.match("^[pP][1-5]-[1-5]$")) {
|
||||
expr = "["+w.substring(1)+"]";
|
||||
add_chart("priority","regexp",expr);
|
||||
continue;
|
||||
}
|
||||
// severity
|
||||
if (is_severity(w)) {
|
||||
add_chart("bug_severity","substring",w);
|
||||
continue;
|
||||
}
|
||||
// votes>xx
|
||||
if (w.match("^votes>[0-9]+$")) {
|
||||
n = w.split(">")[1];
|
||||
add_chart("votes","greaterthan",n);
|
||||
continue;
|
||||
}
|
||||
// votes>=xx, votes=>xx
|
||||
if (w.match("^votes(>=|=>)[0-9]+$")) {
|
||||
separator = w.match("^votes(>=|=>)[0-9]+$")[1];
|
||||
n = w.split(separator)[1];
|
||||
add_chart("votes","greaterthan",String(n-1));
|
||||
continue;
|
||||
}
|
||||
// really default case
|
||||
if (match_product(w)) {
|
||||
add_chart("product","substring",w);
|
||||
}
|
||||
if (match_component(w)) {
|
||||
add_chart("component","substring",w);
|
||||
}
|
||||
if (is_keyword(w)) {
|
||||
add_chart("keywords","substring",w);
|
||||
if (w.length > 2) {
|
||||
add_chart("short_desc","substring",w);
|
||||
add_chart("status_whiteboard","substring",w);
|
||||
}
|
||||
} else {
|
||||
add_chart("short_desc","substring",w);
|
||||
add_chart("status_whiteboard","substring",w);
|
||||
}
|
||||
if (searchLong)
|
||||
add_chart("longdesc","substring",w);
|
||||
|
||||
// URL field (for IP addrs, host.names, scheme://urls)
|
||||
if (w.match(/[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+/)
|
||||
|| w.match(/^[A-Za-z]+([.][A-Za-z]+)+/)
|
||||
|| w.match(/[:][\/][\/]/)
|
||||
|| w.match(/localhost/)
|
||||
|| w.match(/mailto[:]?/)
|
||||
// || w.match(/[A-Za-z]+[:][0-9]+/) //host:port
|
||||
)
|
||||
add_chart("bug_file_loc","substring",w);
|
||||
}
|
||||
}
|
||||
}
|
||||
and = 0;
|
||||
or = 0;
|
||||
}
|
||||
|
||||
//searchURL += "&cmdtype=doit";
|
||||
|
||||
if (abort == false) {
|
||||
return searchURL;
|
||||
} else {
|
||||
return no_result;
|
||||
}
|
||||
}
|
||||
|
||||
function unique_id () {
|
||||
return (new Date()).getTime();
|
||||
}
|
||||
|
||||
function ShowURL(mode,input) {
|
||||
var searchURL = make_query_URL(bugzilla+"buglist.cgi", input, false);
|
||||
if (searchURL != no_result) {
|
||||
var pieces = searchURL.replace(/[\?]/g,"\n?").replace(/[\&]/g,"\n&");
|
||||
if (mode == "alert") {
|
||||
alert(pieces);
|
||||
} else {
|
||||
var table = "<table border=1>" +
|
||||
"<thead>" +
|
||||
"<tr>" +
|
||||
"<th>Chart-And-Or</th>" +
|
||||
"<th>Field</th>" +
|
||||
"<th>Type</th>" +
|
||||
"<th>Value</th>" +
|
||||
"</tr>" +
|
||||
"</thead>" +
|
||||
"<tbody>" + charts + "</tbody>" +
|
||||
"</table>";
|
||||
var html = '<html>' +
|
||||
'<head>' +
|
||||
'<title>' + input + '</title>' +
|
||||
'</head>' +
|
||||
'<body>' +
|
||||
'<a href="' + searchURL + '">' +
|
||||
'Submit Query' +
|
||||
'</a>' +
|
||||
'<p>' + status_and_resolution +
|
||||
'<p>' + table +
|
||||
'<pre>' +
|
||||
pieces.replace(/[\n]/g,"<br>") +
|
||||
'</pre>' +
|
||||
'</body>' +
|
||||
'</html>';
|
||||
var w = window.open("","preview_"+unique_id());
|
||||
w.document.write(html);
|
||||
w.document.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// new interface:
|
||||
// searchLong is a boolean now (not a checkbox/radiobutton)
|
||||
//
|
||||
function Search(url, input, searchLong) {
|
||||
var inputstring = new String(input);
|
||||
var word = inputstring.split(/[\s]+/);
|
||||
|
||||
// Check for empty input
|
||||
if ( word.length == 1 && word[0] == "" )
|
||||
return;
|
||||
|
||||
// Check for potential Bugzilla-busting intensive queries
|
||||
if ((searchLong!=false) && word.length > 4) {
|
||||
var message = "Searching Descriptions for more than four words " +
|
||||
"will take a very long time indeed. Please choose " +
|
||||
"no more than four keywords for your query.";
|
||||
alert(message);
|
||||
return;
|
||||
}
|
||||
var searchURL = make_query_URL(url, inputstring, searchLong);
|
||||
if (searchURL != no_result) {
|
||||
go_to(searchURL);
|
||||
//window.open(searchURL, "other" );
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// original interface, untested
|
||||
//
|
||||
//function SearchForBugs (input, searchRadio) {
|
||||
// if (searchRadio[0].checked) {
|
||||
// return Search(bugzilla + "buglist.cgi", input, false);
|
||||
// } else {
|
||||
// return Search(bugzilla + "buglist.cgi", input, true);
|
||||
// }
|
||||
//}
|
||||
|
||||
// derived from http://www.cs.hmc.edu/~jruderma/s/bugz.html
|
||||
|
||||
// QuickSearch combines lookup-by-bug-number and search
|
||||
// in a single textbox.
|
||||
//
|
||||
// type nothing:
|
||||
// --> go to bugzilla front page
|
||||
// type a number:
|
||||
// --> go to that bug number
|
||||
// type several numbers, separated by commas:
|
||||
// --> go to a buglist of just those bug numbers
|
||||
// type anything else:
|
||||
// --> search summary, product, component, keywords, status whiteboard
|
||||
// (and URL if it's an IP address, a host.name, or an absolute://URL)
|
||||
|
||||
function QuickSearch (input)
|
||||
{
|
||||
//remove leading and trailing whitespace
|
||||
input = input.replace(/^[\s]+/,"").replace(/[\s]+$/,"");
|
||||
|
||||
if (input == "")
|
||||
{
|
||||
//once this _is_ on http://bugzilla.mozilla.org, it should just return;
|
||||
go_to(bugzilla);
|
||||
}
|
||||
else if (input.match(/^[0-9, ]*$/))
|
||||
{
|
||||
if (input.indexOf(",") == -1) {
|
||||
// only _one_ bug number --> show_bug
|
||||
go_to(bugzilla+"show_bug.cgi?id="+escape(input));
|
||||
} else {
|
||||
// comma-separated bug numbers --> buglist
|
||||
go_to(bugzilla+"buglist.cgi?bug_id="+escape(input)
|
||||
+ "&bugidtype=include&order=bugs.bug_id");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Search(bugzilla+"buglist.cgi",input,false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
function LoadQuery(input) {
|
||||
//remove leading and trailing whitespace
|
||||
input = input.replace(/^[\s]+/,"").replace(/[\s]+$/,"");
|
||||
|
||||
Search(bugzilla+"query.cgi",input,false);
|
||||
return;
|
||||
}
|
||||
|
||||