From 0ca30382be83fccfc4e352096c87c56bbf8a673c Mon Sep 17 00:00:00 2001 From: "terry%netscape.com" <> Date: Tue, 17 Nov 1998 03:43:49 +0000 Subject: Patch by Andrew Anderson . Many minor bugfixes and cleanup. --- process_bug.cgi | 54 +++++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 25 deletions(-) (limited to 'process_bug.cgi') 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 "
\n"; print "\n"; print "\n"; - print "\n"; + print "\n"; print "\n"; print "\n"; - print "\n"; + print "\n"; print "\n"; print "\n"; - print "\n"; + print "\n"; print "\n"; print "\n"; print "
Product:Product:$prod
Version:Version:" . Version_element($::FORM{'version'}, $prod) . "
Component:Component:" . Component_element($::FORM{'component'}, $prod) . "
\n"; foreach my $i (keys %::FORM) { if ($i ne 'version' && $i ne 'component') { - print "\n"; } } - print "\n"; + print "\n"; print "
\n"; print "\n"; - print "Cancel all this and go back to the query page.\n"; + print "Cancel all this and go back to the query page.\n"; exit; } } @@ -89,11 +89,6 @@ if (!defined $::FORM{'who'}) { $::FORM{'who'} = $::COOKIE{'Bugzilla_login'}; } -print "Update Bug " . join(" ", @idlist) . "\n"; -if (defined $::FORM{'id'}) { - navigation_header(); -} -print "
\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 "

Click Back 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 "

$query
\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 "
$q
" + # print "
$q
"; SendSQL($q); } } - print "

Changes Submitted

\n"; - print "
Back To BUG# $id
\n"; + + PutHeader("Changes submitted for bug $::FORM{'id'}", + "Changes Submitted", $::FORM{'id'}); + if (defined $::FORM{'id'}) { + navigation_header(); + } + print "
\n

\n"; + print "Back To BUG# $id\n"; + print "
Back To Query Page\n"; + print "
Enter a new bug\n"; SendSQL("unlock tables"); -- cgit v1.2.3-24-g4f1b