]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Remember the 'changedin' field when memorizing queries.
authorterry%mozilla.org <>
Tue, 11 May 1999 06:12:49 +0000 (06:12 +0000)
committerterry%mozilla.org <>
Tue, 11 May 1999 06:12:49 +0000 (06:12 +0000)
backdoor.cgi
createattachment.cgi
process_bug.cgi
processmail
query.cgi

index 0c4a013be920baf06a424278ab7cf94d0402005f..dd96b63164925a32f32e6446053aa3d9eae687da 100755 (executable)
@@ -160,4 +160,4 @@ foreach my $cc (split(/,/, $::FORM{'cc'})) {
 }
 
 print "Created bugzilla bug $zillaid\n";
-system("./processmail $zillaid < /dev/null > /dev/null 2> /dev/null &");
+system("./processmail $zillaid");
index 80dff3520b823ff3ef3c636a732b325964bf367c..225efc02fc51b15282f632d846d8d1cccf1ccf84 100755 (executable)
@@ -97,16 +97,11 @@ What kind of file is this?
     my $attachid = FetchOneColumn();
     AppendComment($id, $::COOKIE{"Bugzilla_login"},
                   "Created an attachment (id=$attachid)\n$desc\n");
-    print "Your attachment has been created.";
-    system("./processmail $id < /dev/null > /dev/null 2> /dev/null &");
-
 
+    print "<TABLE BORDER=1><TD><H2>Attachment to bug $id created</H2>\n";
+    system("./processmail $id $::COOKIE{'Bugzilla_login'}");
+    print "<TD><A HREF=\"show_bug.cgi?id=$id\">Go Back to BUG# $id</A></TABLE>\n";
 }
 
+navigation_header();
 
-
-print qq{
-<P>
-<a href="show_bug.cgi?id=$id">Go back to bug $id</a><br>
-<a href="query.cgi">Go back to the query page</a><br>
-};
index fc425a199f64948256d24b8b546f47e27e3ab20d..c671a90c2fe10f7530560153f3c54e5c6b6bdd6b 100755 (executable)
@@ -226,13 +226,17 @@ 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";
+            print "Nice try, $::FORM{'who'}.  But it doesn't really make sense to mark a\n";
             print "bug as a duplicate of itself, does it?\n";
             exit;
         }
         AppendComment($::FORM{'dup_id'}, $::FORM{'who'}, "*** Bug $::FORM{'id'} has been marked as a duplicate of this bug. ***");
         $::FORM{'comment'} .= "\n\n*** This bug has been marked as a duplicate of $::FORM{'dup_id'} ***";
-        system("./processmail $::FORM{'dup_id'} < /dev/null > /dev/null 2> /dev/null &");
+
+        print "<TABLE BORDER=1><TD><H2>Notation added to bug $::FORM{'dup_id'}</H2>\n";
+        system("./processmail $::FORM{'dup_id'} $::FORM{'who'}");
+        print "<TD><A HREF=\"show_bug.cgi?id=$::FORM{'dup_id'}\">Go To BUG# $::FORM{'dup_id'}</A></TABLE>\n";
+
         last SWITCH;
     };
     # default
@@ -327,20 +331,19 @@ foreach my $id (@idlist) {
         }
     }
     
-    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";
-
+    print "<TABLE BORDER=1><TD><H2>Changes to bug $id submitted</H2>\n";
     SendSQL("unlock tables");
-
-    system("./processmail $id < /dev/null > /dev/null 2> /dev/null &");
+    system("./processmail $id $::FORM{'who'}");
+    print "<TD><A HREF=\"show_bug.cgi?id=$id\">Back To BUG# $id</A></TABLE>\n";
 }
 
 if (defined $::next_bug) {
+    print("<P>The next bug in your list is:\n");
     $::FORM{'id'} = $::next_bug;
     print "<HR>\n";
 
     navigation_header();
     do "bug_form.pl";
 } else {
-    print "<BR><A HREF=\"query.cgi\">Back To Query Page</A>\n";
+    navigation_header();
 }
index 3da6448e170ef3b3e32017153790a8152ac6b3f6..0191fe78b5502e1e8dbfc4055d51248b9cae8800 100755 (executable)
@@ -19,9 +19,6 @@
 # 
 # Contributor(s): Terry Weissman <terry@mozilla.org>
 
-
-# To recreate the shadow database,  run "processmail regenerate" .
-
 use diagnostics;
 use strict;
 
@@ -32,6 +29,8 @@ $| = 1;
 umask(0);
 
 $::lockcount = 0;
+my $regenerate = 0;
+my $nametoexclude = "";
 
 sub Lock {
     if ($::lockcount <= 0) {
@@ -182,7 +181,7 @@ sub fixaddresses {
     my @result;
     my %seen;
     foreach my $i (@$list) {
-        if ($i ne "" && !defined $::nomail{$i} && !defined $seen{$i}) {
+        if ($i ne $nametoexclude && $i ne "" && !defined $::nomail{$i} && !defined $seen{$i}) {
             push @result, $i;
             $seen{$i} = 1;
         }
@@ -200,40 +199,8 @@ sub Log {
     Unlock();
 }
     
-
-ConnectToDatabase();
-
-
-Lock();
-
-# foreach i [split [read_file -nonewline "okmail"] "\n"] {
-#     set okmail($i) 1
-# }
-
-
-
-if (open(FID, "<data/nomail")) {
-    while (<FID>) {
-        $::nomail{trim($_)} = 1;
-    }
-    close FID;
-}
-
-
-my $regenerate = 0;
-
-if ($ARGV[0] eq "regenerate") {
-    $regenerate = 1;
-    shift @ARGV;
-    SendSQL("select bug_id from bugs order by bug_id");
-    my @row;
-    while (@row = FetchSQLData()) {
-        push @ARGV, $row[0];
-    }
-    print "$#ARGV bugs to be regenerated.\n";
-}
-
-foreach my $i (@ARGV) {
+sub ProcessOneBug {
+    my $i = $_[0];
     my $old = "shadow/$i";
     my $new = "shadow/$i.tmp.$$";
     my $diffs = "shadow/$i.diffs.$$";
@@ -257,7 +224,7 @@ foreach my $i (@ARGV) {
         my $tolist = fixaddresses([$::bug{'assigned_to'}, $::bug{'reporter'},
                                    $::bug{'qa_contact'}]);
         my $cclist = fixaddresses($::bug{'cclist'});
-        my $logstr = "Bug $i changed";
+        my $logstr = "Bug $i $verb";
         if ($tolist ne "" || $cclist ne "") {
             my %substs;
 
@@ -275,11 +242,12 @@ foreach my $i (@ARGV) {
             my $msg = PerformSubsts(Param("changedmail"), \%substs);
 
             if (!$regenerate) {
-                open(SENDMAIL, "|/usr/lib/sendmail -t") ||
+                open(SENDMAIL, "|/usr/sbin/sendmail -t") ||
                     die "Can't open sendmail";
                 print SENDMAIL $msg;
                 close SENDMAIL;
-                $logstr = "$logstr; mail sent to $tolist $cclist";
+                $logstr = "$logstr; mail sent to $tolist, $cclist";
+               print "<B>Email sent to:</B> $tolist $cclist <B>Excluding:</B> $nametoexclude\n";
             }
         }
         unlink($diffs);
@@ -292,4 +260,43 @@ foreach my $i (@ARGV) {
     }
 }
 
+# Code starts here
+
+ConnectToDatabase();
+Lock();
+
+if (open(FID, "<data/nomail")) {
+    while (<FID>) {
+        $::nomail{trim($_)} = 1;
+    }
+    close FID;
+}
+
+if (($#ARGV < 0) || ($#ARGV > 1)) {
+    print "Usage error: processmail {bugid} {nametoexclude}\nOr: processmail regenerate\n";
+    exit;
+}
+
+# To recreate the shadow database,  run "processmail regenerate" .
+if ($ARGV[0] eq "regenerate") {
+    $regenerate = 1;
+    shift @ARGV;
+    SendSQL("select bug_id from bugs order by bug_id");
+    my @regenerate_list;
+    while (my @row = FetchSQLData()) {
+        push @regenerate_list, $row[0];
+    }
+    foreach my $i (@regenerate_list) {
+        ProcessOneBug($i);
+    }
+    print("\n");
+    exit;
+}
+
+if ($#ARGV == 1) {
+    $nametoexclude = $ARGV[1];
+}
+
+ProcessOneBug($ARGV[0]);
+
 exit;
index 48deffed9a6c64ea32f2ff7d0deda67788514596..102f655f278d0724cb2f69995666447b29582b1c 100755 (executable)
--- a/query.cgi
+++ b/query.cgi
@@ -67,7 +67,8 @@ foreach my $name ("bug_status", "resolution", "assigned_to", "rep_platform",
                   "email1", "emailtype1", "emailreporter1",
                   "emailassigned_to1", "emailcc1", "emailqa_contact1",
                   "email2", "emailtype2", "emailreporter2",
-                  "emailassigned_to2", "emailcc2", "emailqa_contact2") {
+                  "emailassigned_to2", "emailcc2", "emailqa_contact2",
+                  "changedin") {
     $default{$name} = "";
     $type{$name} = 0;
 }