summaryrefslogtreecommitdiffstats
path: root/globals.pl
diff options
context:
space:
mode:
authorterry%mozilla.org <>2000-01-22 13:24:39 +0100
committerterry%mozilla.org <>2000-01-22 13:24:39 +0100
commit6dcda41d4c40a5617757a3b0ec9bbaeebfde6b55 (patch)
treee2b74fd808d5610777a93047ef4a09e07070ac46 /globals.pl
parent77613d1fc5ca11bca00d1e530d3d1847c9ba24d3 (diff)
downloadbugzilla-6dcda41d4c40a5617757a3b0ec9bbaeebfde6b55.tar.gz
bugzilla-6dcda41d4c40a5617757a3b0ec9bbaeebfde6b55.tar.xz
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.
Diffstat (limited to 'globals.pl')
-rw-r--r--globals.pl44
1 files changed, 36 insertions, 8 deletions
diff --git a/globals.pl b/globals.pl
index 009b8b235..8d921f04d 100644
--- a/globals.pl
+++ b/globals.pl
@@ -119,6 +119,22 @@ sub AppendComment {
SendSQL("UPDATE bugs SET delta_ts = now() WHERE bug_id = $bugid");
}
+sub GetFieldID {
+ my ($f) = (@_);
+ SendSQL("SELECT fieldid FROM fielddefs WHERE name = " . SqlQuote($f));
+ my $fieldid = FetchOneColumn();
+ if (!$fieldid) {
+ my $q = SqlQuote($f);
+ SendSQL("REPLACE INTO fielddefs (name, description) VALUES ($q, $q)");
+ SendSQL("SELECT LAST_INSERT_ID()");
+ $fieldid = FetchOneColumn();
+ }
+ return $fieldid;
+}
+
+
+
+
sub lsearch {
my ($list,$item) = (@_);
my $count = 0;
@@ -282,7 +298,7 @@ sub GenerateVersionTable {
my $cols = LearnAboutColumns("bugs");
@::log_columns = @{$cols->{"-list-"}};
- foreach my $i ("bug_id", "creation_ts", "delta_ts", "long_desc") {
+ foreach my $i ("bug_id", "creation_ts", "delta_ts", "lastdiffed") {
my $w = lsearch(\@::log_columns, $i);
if ($w >= 0) {
splice(@::log_columns, $w, 1);
@@ -463,15 +479,27 @@ sub DBNameToIdAndCheck {
}
sub GetLongDescription {
- my ($id) = (@_);
+ my ($id, $start, $end) = (@_);
my $result = "";
- SendSQL("SELECT profiles.login_name, longdescs.bug_when, " .
- " longdescs.thetext " .
- "FROM longdescs, profiles " .
- "WHERE profiles.userid = longdescs.who " .
- " AND longdescs.bug_id = $id " .
- "ORDER BY longdescs.bug_when");
my $count = 0;
+ my ($query) = ("SELECT profiles.login_name, longdescs.bug_when, " .
+ " longdescs.thetext " .
+ "FROM longdescs, profiles " .
+ "WHERE profiles.userid = longdescs.who " .
+ " AND longdescs.bug_id = $id ");
+
+ if ($start && $start =~ /[1-9]/) {
+ # If the start is all zeros, then don't do this (because we want to
+ # not emit a leading "Addition Comments" line in that case.)
+ $query .= "AND longdescs.bug_when > '$start'";
+ $count = 1;
+ }
+ if ($end) {
+ $query .= "AND longdescs.bug_when <= '$end'";
+ }
+
+ $query .= "ORDER BY longdescs.bug_when";
+ SendSQL($query);
while (MoreSQLData()) {
my ($who, $when, $text) = (FetchSQLData());
if ($count) {