diff --git a/mozilla/webtools/bugzilla/CHANGES b/mozilla/webtools/bugzilla/CHANGES index fabe02e1e3e..1c52d8071e2 100644 --- a/mozilla/webtools/bugzilla/CHANGES +++ b/mozilla/webtools/bugzilla/CHANGES @@ -11,6 +11,20 @@ will tell you what has been changed in the last week. +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: diff --git a/mozilla/webtools/bugzilla/bug_form.pl b/mozilla/webtools/bugzilla/bug_form.pl index 0031514239c..595d5808eab 100644 --- a/mozilla/webtools/bugzilla/bug_form.pl +++ b/mozilla/webtools/bugzilla/bug_form.pl @@ -37,6 +37,9 @@ select reporter, bug_file_loc, short_desc, + target_milestone, + qa_contact, + status_whiteboard, date_format(creation_ts,'Y-m-d') from bugs where bug_id = $::FORM{'id'}"; @@ -49,7 +52,8 @@ if (@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", "creation_ts") { + "bug_file_loc", "short_desc", "target_milestone", + "qa_contact", "status_whiteboard", "creation_ts") { $bug{$field} = shift @row; if (!defined $bug{$field}) { $bug{$field} = ""; @@ -139,8 +143,38 @@ print " Assigned To: - $bug{'assigned_to'} - + $bug{'assigned_to'}"; + +if (Param("usetargetmilestone")) { + if ($bug{'target_milestone'} eq "") { + $bug{'target_milestone'} = " "; + } + print " +Target Milestone: +"; +} + +print " +"; + +if (Param("useqacontact")) { + my $name = $bug{'qa_contact'} > 0 ? DBID_to_name($bug{'qa_contact'}) : ""; + print " + + QA Contact: + + "; +} + + +print " + $URL @@ -150,7 +184,21 @@ print " - + "; + +if (Param("usestatuswhiteboard")) { + print " + + Status Whiteboard: + + "; +} + + +print "
Additional Comments: @@ -239,3 +287,5 @@ print " navigation_header(); print "\n"; + +1; diff --git a/mozilla/webtools/bugzilla/buglist.cgi b/mozilla/webtools/bugzilla/buglist.cgi index a224d40e84e..2df231ececa 100755 --- a/mozilla/webtools/bugzilla/buglist.cgi +++ b/mozilla/webtools/bugzilla/buglist.cgi @@ -48,7 +48,8 @@ use vars @::legal_platform, @::legal_severity, @::legal_priority, @::default_column_list, - @::legal_resolution_no_dup; + @::legal_resolution_no_dup, + @::legal_target_milestone; @@ -151,16 +152,20 @@ DefCol("platform", "substring(bugs.rep_platform, 1, 3)", "Plt", "bugs.rep_platform"); DefCol("owner", "assign.login_name", "Owner", "assign.login_name"); DefCol("reporter", "report.login_name", "Reporter", "report.login_name"); +DefCol("qa_contact", "qacont.login_name", "QAContact", "qacont.login_name"); DefCol("status", "substring(bugs.bug_status,1,4)", "State", "bugs.bug_status"); DefCol("resolution", "substring(bugs.resolution,1,4)", "Result", "bugs.resolution"); DefCol("summary", "substring(bugs.short_desc, 1, 60)", "Summary", "", 1); DefCol("summaryfull", "bugs.short_desc", "Summary", "", 1); +DefCol("status_whiteboard", "bugs.status_whiteboard", "StatusSummary", "", 1); DefCol("component", "substring(bugs.component, 1, 8)", "Comp", "bugs.component"); DefCol("product", "substring(bugs.product, 1, 8)", "Product", "bugs.product"); DefCol("version", "substring(bugs.version, 1, 5)", "Vers", "bugs.version"); DefCol("os", "substring(bugs.op_sys, 1, 4)", "OS", "bugs.op_sys"); +DefCol("target_milestone", "bugs.target_milestone", "TargetM", + "bugs.target_milestone"); my @collist; if (defined $::COOKIE{'COLUMNLIST'}) { @@ -199,7 +204,8 @@ bugs.bug_status"; $query .= " from bugs, profiles assign, - profiles report, + profiles report + left join profiles qacont on bugs.qa_contact = qacont.userid, versions projector where bugs.assigned_to = assign.userid and bugs.reporter = report.userid @@ -221,7 +227,8 @@ if (defined $::FORM{'sql'}) { } else { my @legal_fields = ("bug_id", "product", "version", "rep_platform", "op_sys", "bug_status", "resolution", "priority", "bug_severity", - "assigned_to", "reporter", "component"); + "assigned_to", "reporter", "component", + "target_milestone"); foreach my $field (keys %::FORM) { my $or = ""; @@ -272,7 +279,7 @@ foreach my $id ("1", "2") { my $foundone = 0; my $lead= "and (\n"; - foreach my $field ("assigned_to", "reporter", "cc") { + foreach my $field ("assigned_to", "reporter", "cc", "qa_contact") { my $doit = $::FORM{"email$field$id"}; if (!$doit) { next; @@ -283,6 +290,8 @@ foreach my $id ("1", "2") { $table = "assign"; } elsif ($field eq "reporter") { $table = "report"; + } elsif ($field eq "qa_contact") { + $table = "qacont"; } else { $table = "ccname"; } @@ -586,7 +595,29 @@ document.write(\" Severity: - +"; + + if (Param("usetargetmilestone")) { + my $tfm_popup = make_options(\@::legal_target_milestone, + $::dontchange); + print " + + Target milestone: + + "; + } + + if (Param("useqacontact")) { + print " + +QA Contact: + +"; + } + + + print " diff --git a/mozilla/webtools/bugzilla/colchange.cgi b/mozilla/webtools/bugzilla/colchange.cgi index bd3b23d6f44..33d2dfe7057 100755 --- a/mozilla/webtools/bugzilla/colchange.cgi +++ b/mozilla/webtools/bugzilla/colchange.cgi @@ -31,8 +31,20 @@ print "Content-type: text/html\n"; my @masterlist = ("opendate", "changeddate", "severity", "priority", "platform", "owner", "reporter", "status", "resolution", - "component", "product", "version", "project", "os", - "summary", "summaryfull"); + "component", "product", "version", "project", "os"); + +if (Param("usetargetmilestone")) { + push(@masterlist, "target_milestone"); +} +if (Param("useqacontact")) { + push(@masterlist, "qa_contact"); +} +if (Param("usestatuswhiteboard")) { + push(@masterlist, "status_whiteboard"); +} + + +push(@masterlist, ("summary", "summaryfull")); my @collist; diff --git a/mozilla/webtools/bugzilla/defparams.pl b/mozilla/webtools/bugzilla/defparams.pl index 97ef398df31..cfb41fbae01 100644 --- a/mozilla/webtools/bugzilla/defparams.pl +++ b/mozilla/webtools/bugzilla/defparams.pl @@ -30,6 +30,9 @@ 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"; + } } } mkdir("data", 0777); @@ -37,7 +40,7 @@ sub WriteParams { my $tmpname = "data/params.$$"; open(FID, ">$tmpname") || die "Can't create $tmpname"; my $v = $::param{'version'}; - undef $::param{'version'}; # Don't write the version number out to + delete $::param{'version'}; # Don't write the version number out to # the params file. print FID GenerateCode('%::param'); $::param{'version'} = $v; @@ -82,6 +85,7 @@ sub check_numeric { # 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) +# i -- An integer. # defenum -- This param defines an enum that defines a column in one of # the database tables. The name of the parameter is of the form # "tablename.columnname". @@ -239,4 +243,30 @@ DefParam("defaultquery", "t", "bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&product=Mozilla&order=%22Importance%22"); +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("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); + + + + 1; + diff --git a/mozilla/webtools/bugzilla/doeditparams.cgi b/mozilla/webtools/bugzilla/doeditparams.cgi index e43fd73ce56..dd6214982cc 100755 --- a/mozilla/webtools/bugzilla/doeditparams.cgi +++ b/mozilla/webtools/bugzilla/doeditparams.cgi @@ -69,6 +69,8 @@ foreach my $i (@::param_list) { WriteParams(); +unlink "data/versioncache"; + print "OK, done.

\n"; print "Edit the params some more.

\n"; print "Go back to the query page.\n"; diff --git a/mozilla/webtools/bugzilla/editparams.cgi b/mozilla/webtools/bugzilla/editparams.cgi index f926c0ae978..75c7500d78a 100755 --- a/mozilla/webtools/bugzilla/editparams.cgi +++ b/mozilla/webtools/bugzilla/editparams.cgi @@ -61,7 +61,7 @@ foreach my $i (@::param_list) { SWITCH: for ($::param_type{$i}) { /^t$/ && do { print "\n'; + value_quote($value) . "\">\n"; last SWITCH; }; /^l$/ && do { diff --git a/mozilla/webtools/bugzilla/globals.pl b/mozilla/webtools/bugzilla/globals.pl index 3c8bf252a3d..b924831b88d 100644 --- a/mozilla/webtools/bugzilla/globals.pl +++ b/mozilla/webtools/bugzilla/globals.pl @@ -25,6 +25,7 @@ use strict; use Mysql; use Date::Format; # For time2str(). +# use Carp; # for confess # Contains the version string for the current running Bugzilla. $::param{'version'} = '2.1'; @@ -286,6 +287,14 @@ sub GenerateVersionTable { } print FID GenerateCode('%::proddesc'); + if (Param("usetargetmilestone")) { + my $last = Param("nummilestones"); + my $i; + for ($i=1 ; $i<=$last ; $i++) { + push(@::legal_target_milestone, "M$i"); + } + print FID GenerateCode('@::legal_target_milestone'); + } print FID "1;\n"; close FID; rename $tmpname, "data/versioncache" || die "Can't rename $tmpname to versioncache"; @@ -452,6 +461,9 @@ sub SplitEnumType { sub SqlQuote { my ($str) = (@_); +# if (!defined $str) { +# confess("Undefined passed to SqlQuote"); +# } $str =~ s/([\\\'])/\\$1/g; $str =~ s/\0/\\0/g; return "'$str'"; diff --git a/mozilla/webtools/bugzilla/long_list.cgi b/mozilla/webtools/bugzilla/long_list.cgi index 1fb019496e4..18f3c0e27f4 100755 --- a/mozilla/webtools/bugzilla/long_list.cgi +++ b/mozilla/webtools/bugzilla/long_list.cgi @@ -46,7 +46,10 @@ select report.login_name, bugs.component, bugs.bug_file_loc, - bugs.short_desc + bugs.short_desc, + bugs.target_milestone, + bugs.qa_contact, + bugs.status_whiteboard from bugs,profiles assign,profiles report where assign.userid = bugs.assigned_to and report.userid = bugs.reporter and "; @@ -60,7 +63,8 @@ foreach my $bug (split(/:/, $::FORM{'buglist'})) { if (@row = FetchSQLData()) { my ($id, $product, $version, $platform, $opsys, $status, $severity, $priority, $resolution, $assigned, $reporter, $component, $url, - $shortdesc) = (@row); + $shortdesc, $target_milestone, $qa_contact, + $status_whiteboard) = (@row); print "\n"; print "\n"; print "
" . @@ -77,10 +81,24 @@ foreach my $bug (split(/:/, $::FORM{'buglist'})) { print "
\n"; print "
Resolution: $resolutionAssigned To: $assigned\n"; print "Reported By: $reporter\n"; + if (Param("useqacontact")) { + my $name = ""; + if ($qa_contact > 0) { + $name = DBID_to_name($qa_contact); + } + print "QA Contact: $name\n"; + } print "
Component: $component\n"; + if (Param("usetargetmilestone")) { + print "Target milestone:$target_milestone\n"; + } print "
URL: " . html_quote($url) . "\n"; - print "
Summary            : " . html_quote($shortdesc) . "\n"; - print "
Description        :\n
\n"; + print "Summary: " . html_quote($shortdesc) . "\n"; + if (Param("usestatuswhiteboard")) { + print "Status Whiteboard:" . + html_quote($status_whiteboard) . "\n"; + } + print "Description:\n\n"; print "

" . html_quote(GetLongDescription($bug)) . "
\n"; print "
\n"; } diff --git a/mozilla/webtools/bugzilla/makebugtable.sh b/mozilla/webtools/bugzilla/makebugtable.sh index e9ac8b14004..f0be77687f6 100755 --- a/mozilla/webtools/bugzilla/makebugtable.sh +++ b/mozilla/webtools/bugzilla/makebugtable.sh @@ -46,7 +46,9 @@ version varchar(16) not null, area enum("BUILD", "CODE", "CONTENT", "DOC", "PERFORMANCE", "TEST", "UI", "i18n", "l10n") not null, component varchar(50) not null, resolution enum("", "FIXED", "INVALID", "WONTFIX", "LATER", "REMIND", "DUPLICATE", "WORKSFORME") not null, - +target_milestone varchar(20) not null, +qa_contact mediumint not null, +status_whiteboard mediumtext not null, index (assigned_to), index (delta_ts), @@ -59,7 +61,9 @@ index (reporter), index (version), index (area), index (component), -index (resolution) +index (resolution), +index (target_milestone), +index (qa_contact) ); diff --git a/mozilla/webtools/bugzilla/process_bug.cgi b/mozilla/webtools/bugzilla/process_bug.cgi index b602448d041..3fa61a851db 100755 --- a/mozilla/webtools/bugzilla/process_bug.cgi +++ b/mozilla/webtools/bugzilla/process_bug.cgi @@ -122,16 +122,29 @@ sub ChangeResolution { foreach my $field ("rep_platform", "priority", "bug_severity", "url", "summary", "component", "bug_file_loc", "short_desc", - "product", "version", "component", "op_sys") { + "product", "version", "component", "op_sys", + "target_milestone", "status_whiteboard") { if (defined $::FORM{$field}) { if ($::FORM{$field} ne $::dontchange) { DoComma(); - $::query .= "$field = " . SqlQuote($::FORM{$field}); + $::query .= "$field = " . SqlQuote(trim($::FORM{$field})); } } } +if (defined $::FORM{'qa_contact'}) { + my $name = trim($::FORM{'qa_contact'}); + if ($name ne $dontchange) { + my $id = 0; + if ($name ne "") { + $id = DBNameToIdAndCheck($name); + } + DoComma(); + $::query .= "qa_contact = $id"; + } +} + ConnectToDatabase(); diff --git a/mozilla/webtools/bugzilla/query.cgi b/mozilla/webtools/bugzilla/query.cgi index 6d4c731aa0b..6e8305975ed 100755 --- a/mozilla/webtools/bugzilla/query.cgi +++ b/mozilla/webtools/bugzilla/query.cgi @@ -36,6 +36,7 @@ use vars @::legal_resolution, @::legal_components, @::legal_versions, @::legal_severity, + @::legal_target_milestone, %::FORM; @@ -60,9 +61,9 @@ foreach my $name ("bug_status", "resolution", "assigned_to", "rep_platform", "priority", "bug_severity", "product", "reporter", "op_sys", "component", "version", "email1", "emailtype1", "emailreporter1", - "emailassigned_to1", "emailcc1", + "emailassigned_to1", "emailcc1", "emailqa_contact1", "email2", "emailtype2", "emailreporter2", - "emailassigned_to2", "emailcc2") { + "emailassigned_to2", "emailcc2", "emailqa_contact2") { $default{$name} = ""; $type{$name} = 0; } @@ -124,6 +125,20 @@ sub GenerateEmailInput { } } + my $qapart = ""; + if (Param("useqacontact")) { + my $qacontact = + ($default{"emailqa_contact$id"} eq "1") ? "checked" : ""; + $qapart = qq| + + + +QA Contact + + +|; + } + return qq| - +$qapart + - +"; + +if (Param("usestatuswhiteboard")) { + print " + + + + + +"; +} + +print "
@@ -146,7 +161,7 @@ sub GenerateEmailInput { Reporter
(Will match any of the selected fields) @@ -241,9 +256,16 @@ $emailinput2

- - - + + + +"; + +if (Param("usetargetmilestone")) { + print ""; +} + +print " @@ -263,8 +285,18 @@ $emailinput2

- +"; +if (Param("usetargetmilestone")) { + print " +

"; +} + +print "
Program:Version:Component:Program:Version:Component:Target Milestone:
+ +
@@ -281,11 +313,24 @@ $emailinput2

Substring Regexp
URL: Substring Regexp
Status whiteboard:SubstringRegexp

diff --git a/mozilla/webtools/bugzilla/show_bug.cgi b/mozilla/webtools/bugzilla/show_bug.cgi index 98829e356c7..75a3bb8e34a 100755 --- a/mozilla/webtools/bugzilla/show_bug.cgi +++ b/mozilla/webtools/bugzilla/show_bug.cgi @@ -46,4 +46,5 @@ navigation_header(); print "


\n"; -do "bug_form.pl"; +$! = 0; +do "bug_form.pl" || die "Error doing bug_form.pl: $!";