diff options
author | terry%netscape.com <> | 1998-11-17 04:43:49 +0100 |
---|---|---|
committer | terry%netscape.com <> | 1998-11-17 04:43:49 +0100 |
commit | 0ca30382be83fccfc4e352096c87c56bbf8a673c (patch) | |
tree | 36342c8de0050b5bed4b67b29a14eb97e78c5e28 /process_bug.cgi | |
parent | 1cf02cc7c177a691ae9980f928ae30efb84a8c99 (diff) | |
download | bugzilla-0ca30382be83fccfc4e352096c87c56bbf8a673c.tar.gz bugzilla-0ca30382be83fccfc4e352096c87c56bbf8a673c.tar.xz |
Patch by Andrew Anderson <andrew@redhat.com>. Many minor bugfixes and cleanup.
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-x | process_bug.cgi | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/process_bug.cgi b/process_bug.cgi index 6755ce91c..785ba1b29 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -37,7 +37,7 @@ print "Content-type: text/html\n\n"; GetVersionTable(); if ($::FORM{'product'} ne $::dontchange) { - my $prod = $::FORM{'product'}; + my $prod = url_decode($::FORM{'product'}); my $vok = lsearch($::versions{$prod}, $::FORM{'version'}) >= 0; my $cok = lsearch($::components{$prod}, $::FORM{'component'}) >= 0; if (!$vok || !$cok) { @@ -49,26 +49,26 @@ if ($::FORM{'product'} ne $::dontchange) { print "<form>\n"; print "<table>\n"; print "<tr>\n"; - print "<td align=right><b>Product:</b></td>\n"; + print "<td align=\"right\"><b>Product:</b></td>\n"; print "<td>$prod</td>\n"; print "</tr><tr>\n"; - print "<td align=right><b>Version:</b></td>\n"; + print "<td align=\"right\"><b>Version:</b></td>\n"; print "<td>" . Version_element($::FORM{'version'}, $prod) . "</td>\n"; print "</tr><tr>\n"; - print "<td align=right><b>Component:</b></td>\n"; + print "<td align=\"right\"><b>Component:</b></td>\n"; print "<td>" . Component_element($::FORM{'component'}, $prod) . "</td>\n"; print "</tr>\n"; print "</table>\n"; foreach my $i (keys %::FORM) { if ($i ne 'version' && $i ne 'component') { - print "<input type=hidden name=$i value=\"" . + print "<input type=\"hidden\" name=\"$i\" value=\"" . value_quote($::FORM{$i}) . "\">\n"; } } - print "<input type=submit value=Commit>\n"; + print "<input type=\"submit\" value=\"Commit\">\n"; print "</form>\n"; print "</hr>\n"; - print "<a href=query.cgi>Cancel all this and go back to the query page.</a>\n"; + print "<A HREF=\"query.cgi\">Cancel all this and go back to the query page.</A>\n"; exit; } } @@ -89,11 +89,6 @@ if (!defined $::FORM{'who'}) { $::FORM{'who'} = $::COOKIE{'Bugzilla_login'}; } -print "<TITLE>Update Bug " . join(" ", @idlist) . "</TITLE>\n"; -if (defined $::FORM{'id'}) { - navigation_header(); -} -print "<HR>\n"; $::query = "update bugs\nset"; $::comma = ""; umask(0); @@ -119,6 +114,7 @@ sub ChangeResolution { } } +ConnectToDatabase(); foreach my $field ("rep_platform", "priority", "bug_severity", "url", "summary", "component", "bug_file_loc", "short_desc", @@ -126,15 +122,11 @@ foreach my $field ("rep_platform", "priority", "bug_severity", "url", if (defined $::FORM{$field}) { if ($::FORM{$field} ne $::dontchange) { DoComma(); - $::query .= "$field = " . SqlQuote($::FORM{$field}); + $::query .= "$field = " . SqlQuote(url_decode($::FORM{$field})); } } } - - -ConnectToDatabase(); - SWITCH: for ($::FORM{'knob'}) { /^none$/ && do { last SWITCH; @@ -177,6 +169,7 @@ SWITCH: for ($::FORM{'knob'}) { }; /^reopen$/ && do { ChangeStatus('REOPENED'); + ChangeResolution(''); last SWITCH; }; /^verify$/ && do { @@ -197,7 +190,8 @@ SWITCH: for ($::FORM{'knob'}) { exit; } if ($::FORM{'dup_id'} == $::FORM{'id'}) { - print "Nice try. But it doesn't really make sense to mark a\n"; + PutHeader("Nice try."); + print "But it doesn't really make sense to mark a\n"; print "bug as a duplicate of itself, does it?\n"; exit; } @@ -213,6 +207,7 @@ SWITCH: for ($::FORM{'knob'}) { if ($#idlist < 0) { + PutHeader("Nothing to modify"); print "You apparently didn't choose any bugs to modify.\n"; print "<p>Click <b>Back</b> and try again.\n"; exit; @@ -231,7 +226,7 @@ my $basequery = $::query; sub SnapShotBug { my ($id) = (@_); SendSQL("select " . join(',', @::log_columns) . - " from bugs where bug_id = $id"); + " from bugs where bug_id = '" . $id . "'"); return FetchSQLData(); } @@ -240,7 +235,7 @@ foreach my $id (@idlist) { SendSQL("lock tables bugs write, bugs_activity write, cc write, profiles write"); my @oldvalues = SnapShotBug($id); - my $query = "$basequery\nwhere bug_id = $id"; + my $query = "$basequery\nwhere bug_id = '" . $id . "'"; # print "<PRE>$query</PRE>\n"; @@ -261,7 +256,7 @@ foreach my $id (@idlist) { } } - SendSQL("delete from cc where bug_id = $id"); + SendSQL("delete from cc where bug_id = '" . $id . "'"); foreach my $ccid (keys %ccids) { SendSQL("insert into cc (bug_id, who) values ($id, $ccid)"); } @@ -276,7 +271,8 @@ foreach my $id (@idlist) { if ($old ne $new) { if (!defined $whoid) { $whoid = DBNameToIdAndCheck($::FORM{'who'}); - SendSQL("select delta_ts from bugs where bug_id = $id"); + $query = "select delta_ts from bugs where bug_id = '" . $id . "'"; + SendSQL($query); $timestamp = FetchOneColumn(); } if ($col eq 'assigned_to') { @@ -287,13 +283,21 @@ foreach my $id (@idlist) { $old = SqlQuote($old); $new = SqlQuote($new); my $q = "insert into bugs_activity (bug_id,who,when,field,oldvalue,newvalue) values ($id,$whoid,$timestamp,$col,$old,$new)"; - # puts "<pre>$q</pre>" + # print "<pre>$q</pre>"; SendSQL($q); } } - print "<TABLE BORDER=1><TD><H1>Changes Submitted</H1>\n"; - print "<TD><A HREF=\"show_bug.cgi?id=$id\">Back To BUG# $id</A></TABLE>\n"; + + PutHeader("Changes submitted for bug $::FORM{'id'}", + "Changes Submitted", $::FORM{'id'}); + if (defined $::FORM{'id'}) { + navigation_header(); + } + print "<HR>\n<P>\n"; + print "<A HREF=\"show_bug.cgi?id=$id\">Back To BUG# $id</A>\n"; + print "<BR><A HREF=\"query.cgi\">Back To Query Page</A>\n"; + print "<BR><A HREF=\"enter_bug.cgi\">Enter a new bug</A>\n"; SendSQL("unlock tables"); |