From 6dcda41d4c40a5617757a3b0ec9bbaeebfde6b55 Mon Sep 17 00:00:00 2001 From: "terry%mozilla.org" <> Date: Sat, 22 Jan 2000 12:24:39 +0000 Subject: Added a new table fielddefs that records information about the different fields we keep an activity log on. The bugs_activity table now has a pointer into that table instead of recording the name directly. Set up a new, highly experimental email-notification scheme. To turn it on, the maintainer has to turn on the "New email tech" param, and then individual users have to turn on the "New email tech" preference. --- process_bug.cgi | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'process_bug.cgi') diff --git a/process_bug.cgi b/process_bug.cgi index 027579cee..e61fb39b2 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -464,7 +464,10 @@ sub LogDependencyActivity { my ($i, $oldstr, $target, $me) = (@_); my $newstr = SnapShotDeps($i, $target, $me); if ($oldstr ne $newstr) { - SendSQL("insert into bugs_activity (bug_id,who,bug_when,field,oldvalue,newvalue) values ($i,$whoid,$timestamp,'$target','$oldstr','$newstr')"); + my $fieldid = GetFieldID($target); + SendSQL("INSERT INTO bugs_activity " . + "(bug_id,who,bug_when,fieldid,oldvalue,newvalue) VALUES " . + "($i,$whoid,$timestamp,$fieldid,'$oldstr','$newstr')"); return 1; } return 0; @@ -476,7 +479,7 @@ sub LogDependencyActivity { # foreach my $id (@idlist) { my %dependencychanged; - SendSQL("lock tables bugs write, bugs_activity write, cc write, profiles write, dependencies write, votes write, keywords write, longdescs write, keyworddefs read"); + SendSQL("lock tables bugs write, bugs_activity write, cc write, profiles write, dependencies write, votes write, keywords write, longdescs write, fielddefs write, keyworddefs read"); my @oldvalues = SnapShotBug($id); if (defined $::FORM{'delta_ts'} && $::FORM{'delta_ts'} ne $delta_ts) { @@ -628,6 +631,15 @@ The changes made were: foreach my $ccid (keys %ccids) { SendSQL("insert into cc (bug_id, who) values ($id, $ccid)"); } + my $newcclist = ShowCcList($id); + if ($newcclist ne $origcclist) { + my $col = GetFieldID('cc'); + my $origq = SqlQuote($origcclist); + my $newq = SqlQuote($newcclist); + SendSQL("INSERT INTO bugs_activity " . + "(bug_id,who,bug_when,fieldid,oldvalue,newvalue) VALUES " . + "($id,$whoid,'$timestamp',$col,$origq,$newq)"); + } } @@ -713,10 +725,10 @@ The changes made were: RemoveVotes($id, "This bug has been moved to a different product"); } - $col = SqlQuote($col); + $col = GetFieldID($col); $old = SqlQuote($old); $new = SqlQuote($new); - my $q = "insert into bugs_activity (bug_id,who,bug_when,field,oldvalue,newvalue) values ($id,$whoid,'$timestamp',$col,$old,$new)"; + my $q = "insert into bugs_activity (bug_id,who,bug_when,fieldid,oldvalue,newvalue) values ($id,$whoid,'$timestamp',$col,$old,$new)"; # puts "
$q
" SendSQL($q); } -- cgit v1.2.3-24-g4f1b