]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Added three new fields (which appear in the UI only if params are
authorterry%netscape.com <>
Thu, 28 Jan 1999 05:17:06 +0000 (05:17 +0000)
committerterry%netscape.com <>
Thu, 28 Jan 1999 05:17:06 +0000 (05:17 +0000)
turned on): target_milestone, qa_contact, and status_whiteboard.

13 files changed:
CHANGES
bug_form.pl
buglist.cgi
colchange.cgi
defparams.pl
doeditparams.cgi
editparams.cgi
globals.pl
long_list.cgi
makebugtable.sh
process_bug.cgi
query.cgi
show_bug.cgi

diff --git a/CHANGES b/CHANGES
index fabe02e1e3e858e635352e9b4193b3509216167c..1c52d8071e2ad176a264dfef74196820f0244b9d 100644 (file)
--- a/CHANGES
+++ b/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:
 
index 0031514239c9cdb32de368313f296fb090cdc920..595d5808eabfb310efe42cb20ccc6693aa3f3f1a 100644 (file)
@@ -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 "
   </TR><TR>
     <TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#assigned_to\">Assigned&nbsp;To:
         </A></B></TD>
-      <TD>$bug{'assigned_to'}</TD>
-  </TR><TR>
+      <TD>$bug{'assigned_to'}</TD>";
+
+if (Param("usetargetmilestone")) {
+    if ($bug{'target_milestone'} eq "") {
+        $bug{'target_milestone'} = " ";
+    }
+    print "
+<TD ALIGN=RIGHT><B>Target Milestone:</B></TD>
+<TD><SELECT NAME=target_milestone>" .
+    make_options(\@::legal_target_milestone,
+                 $bug{'target_milestone'}) .
+                     "</SELECT></TD>";
+}
+
+print "
+</TR>";
+
+if (Param("useqacontact")) {
+    my $name = $bug{'qa_contact'} > 0 ? DBID_to_name($bug{'qa_contact'}) : "";
+    print "
+  <TR>
+    <TD ALIGN=\"RIGHT\"><B>QA Contact:</B>
+    <TD COLSPAN=6>
+      <INPUT NAME=qa_contact VALUE=\"" .
+    value_quote($name) .
+    "\" SIZE=60></
+  </TR>";
+}
+
+
+print "
+  <TR>
     <TD ALIGN=\"RIGHT\">$URL
     <TD COLSPAN=6>
       <INPUT NAME=bug_file_loc VALUE=\"$bug{'bug_file_loc'}\" SIZE=60></TD>
@@ -150,7 +184,21 @@ print "
       <INPUT NAME=short_desc VALUE=\"" .
     value_quote($bug{'short_desc'}) .
     "\" SIZE=60></TD>
-  </TR>
+  </TR>";
+
+if (Param("usestatuswhiteboard")) {
+    print "
+  <TR>
+    <TD ALIGN=\"RIGHT\"><B>Status Whiteboard:</B>
+    <TD COLSPAN=6>
+      <INPUT NAME=status_whiteboard VALUE=\"" .
+    value_quote($bug{'status_whiteboard'}) .
+    "\" SIZE=60></
+  </TR>";
+}
+
+
+print "
 </TABLE>
 <br>
 <B>Additional Comments:</B>
@@ -239,3 +287,5 @@ print "
 navigation_header();
 
 print "</BODY>\n";
+
+1;
index a224d40e84eb16a58525b69b816a9aebf1939e3d..2df231ececa788c7339d5b0979c5c7fc8493b484 100755 (executable)
@@ -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(\" <input type=button value=\\\"Uncheck All\\\" onclick=\\\"SetCh
     <TD><SELECT NAME=component>$component_popup</SELECT></TD>
     <TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#severity\">Severity:</A></B></TD>
     <TD><SELECT NAME=bug_severity>$sev_popup</SELECT></TD>
-</TR>
+</TR>";
+
+    if (Param("usetargetmilestone")) {
+        my $tfm_popup = make_options(\@::legal_target_milestone,
+                                     $::dontchange);
+        print "
+    <TR>
+    <TD ALIGN=RIGHT><B>Target milestone:</B></TD>
+    <TD><SELECT NAME=target_milestone>$tfm_popup</SELECT></TD>
+    </TR>";
+    }
+
+    if (Param("useqacontact")) {
+        print "
+<TR>
+<TD><B>QA Contact:</B></TD>
+<TD COLSPAN=3><INPUT NAME=qa_contact SIZE=32 VALUE=\"" .
+            value_quote($::dontchange) . "\"></TD>
+</TR>";
+    }
+        
+
+    print "
 </TABLE>
 
 <INPUT NAME=multiupdate value=Y TYPE=hidden>
index bd3b23d6f44f097b8fc09ac17f637cd0592f58f4..33d2dfe7057285361e9d9f40347858a95cf4c6d6 100755 (executable)
@@ -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;
index 97ef398df31aed70ba7434fcba6831ee19b1c296..cfb41fbae0144ada048f0f8724c25fec23c09dee 100644 (file)
@@ -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;
+
index e43fd73ce569e68235f23f28acdd1a2432f1899e..dd6214982cc098261864ec8c0520ce7275aff3a2 100755 (executable)
@@ -69,6 +69,8 @@ foreach my $i (@::param_list) {
 
 WriteParams();
 
+unlink "data/versioncache";
+
 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";
index f926c0ae97849d874a01a89351ccee75f6865004..75c7500d78a98852e019aeeee73c865ae318bd86 100755 (executable)
@@ -61,7 +61,7 @@ foreach my $i (@::param_list) {
     SWITCH: for ($::param_type{$i}) {
        /^t$/ && do {
             print "<input size=80 name=$i value=\"" .
-                value_quote($value) . '">\n';
+                value_quote($value) . "\">\n";
             last SWITCH;
        };
        /^l$/ && do {
index 3c8bf252a3d09cf54e61160781d2440fd4ce2d83..b924831b88d7616f1d70f92e14b072625370f364 100644 (file)
@@ -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'";
index 1fb019496e42a3c5861053ff44874eb8cd4e625d..18f3c0e27f4c79f8374d8499d31fb84b2e14e3e2 100755 (executable)
@@ -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 "<IMG SRC=\"1x1.gif\" WIDTH=1 HEIGHT=80 ALIGN=LEFT>\n";
         print "<TABLE WIDTH=100%>\n";
         print "<TD COLSPAN=4><TR><DIV ALIGN=CENTER><B><FONT =\"+3\">" .
@@ -77,10 +81,24 @@ foreach my $bug (split(/:/, $::FORM{'buglist'})) {
         print "<TR><TD><B>Resolution:</B> $resolution</TD>\n";
         print "<TD><B>Assigned To:</B> $assigned\n";
         print "<TD><B>Reported By:</B> $reporter\n";
+        if (Param("useqacontact")) {
+            my $name = "";
+            if ($qa_contact > 0) {
+                $name = DBID_to_name($qa_contact);
+            }
+            print "<TD><B>QA Contact:</B> $name\n";
+        }
         print "<TR><TD><B>Component:</B> $component\n";
+        if (Param("usetargetmilestone")) {
+            print "<TD><B>Target milestone:</B>$target_milestone\n";
+        }
         print "<TR><TD COLSPAN=6><B>URL:</B> " . html_quote($url) . "\n";
-        print "<TR><TD COLSPAN=6><B>Summary&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</B> " . html_quote($shortdesc) . "\n";
-        print "<TR><TD><B>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</B>\n</TABLE>\n";
+        print "<TR><TD COLSPAN=6><B>Summary:</B> " . html_quote($shortdesc) . "\n";
+        if (Param("usestatuswhiteboard")) {
+            print "<TR><TD COLSPAN=6><B>Status Whiteboard:" .
+                html_quote($status_whiteboard) . "\n";
+        }
+        print "<TR><TD><B>Description:</B>\n</TABLE>\n";
         print "<PRE>" . html_quote(GetLongDescription($bug)) . "</PRE>\n";
         print "<HR>\n";
     }
index e9ac8b14004a67f7a97f2d82a81e8bb05b5875cf..f0be77687f6d5e6ef9256f76964c49203cfa402b 100755 (executable)
@@ -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)
 
 );
 
index b602448d0419336585fdc93ca9115ff98e53281d..3fa61a851db8f6954806e602139d5327965c094d 100755 (executable)
@@ -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();
 
index 6d4c731aa0b0cb76a5674b783dc1d488c23d3721..6e8305975ed4d4572c82263f95290d7cdade69bf 100755 (executable)
--- a/query.cgi
+++ b/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|
+<tr>
+<td></td>
+<td>
+<input type="checkbox" name="emailqa_contact$id" value=1 $qacontact>QA Contact
+</td>
+</tr>
+|;
+    }
+
     return qq|
 <table border=1 cellspacing=0 cellpadding=0>
 <tr><td>
@@ -146,7 +161,7 @@ sub GenerateEmailInput {
 <td>
 <input type="checkbox" name="emailreporter$id" value=1 $reporter>Reporter
 </td>
-</tr>
+</tr>$qapart
 <tr>
 <td align=right>(Will match any of the selected fields)</td>
 <td>
@@ -241,9 +256,16 @@ $emailinput2<p>
 
 <table>
 <tr>
-<TH ALIGN=LEFT>Program:</th>
-<TH ALIGN=LEFT>Version:</th>
-<TH ALIGN=LEFT>Component:</th>
+<TH ALIGN=LEFT VALIGN=BOTTOM>Program:</th>
+<TH ALIGN=LEFT VALIGN=BOTTOM>Version:</th>
+<TH ALIGN=LEFT VALIGN=BOTTOM>Component:</th>
+";
+
+if (Param("usetargetmilestone")) {
+    print "<TH ALIGN=LEFT VALIGN=BOTTOM>Target Milestone:</th>";
+}
+
+print "
 </tr>
 <tr>
 
@@ -263,8 +285,18 @@ $emailinput2<p>
 <SELECT NAME=\"component\" MULTIPLE SIZE=5>
 @{[make_options(\@::legal_components, $default{'component'}, $type{'component'})]}
 </SELECT>
-</td>
+</td>";
 
+if (Param("usetargetmilestone")) {
+    print "
+<td align=left valign=top>
+<SELECT NAME=\"target_milestone\" MULTIPLE SIZE=5>
+@{[make_options(\@::legal_target_milestone, $default{'component'}, $type{'component'})]}
+</SELECT>
+</td>";
+}
+
+print "
 </tr>
 </table>
 
@@ -281,11 +313,24 @@ $emailinput2<p>
 <td><input type=radio name=long_desc_type value=substr checked>Substring</td>
 <td><input type=radio name=long_desc_type value=regexp>Regexp</td>
 </tr>
+<tr>
 <td align=right>URL:</td>
 <td><input name=bug_file_loc size=30></td>
 <td><input type=radio name=bug_file_loc_type value=substr checked>Substring</td>
 <td><input type=radio name=bug_file_loc_type value=regexp>Regexp</td>
-</tr>
+</tr>";
+
+if (Param("usestatuswhiteboard")) {
+    print "
+<tr>
+<td align=right>Status whiteboard:</td>
+<td><input name=status_whiteboard size=30></td>
+<td><input type=radio name=status_whiteboard_type value=substr checked>Substring</td>
+<td><input type=radio name=status_whiteboard_type value=regexp>Regexp</td>
+</tr>";
+}
+
+print "
 </table>
 <p>
 
index 98829e356c741d7725e17eba7a64737250321336..75a3bb8e34ae2b95eedcd5289b6e7bdff32dd8d7 100755 (executable)
@@ -46,4 +46,5 @@ navigation_header();
 
 print "<HR>\n";
 
-do "bug_form.pl";
+$! = 0;
+do "bug_form.pl" || die "Error doing bug_form.pl: $!";