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. --- globals.pl | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) (limited to 'globals.pl') 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) { -- cgit v1.2.3-24-g4f1b