summaryrefslogtreecommitdiffstats
path: root/globals.pl
diff options
context:
space:
mode:
authormyk%mozilla.org <>2002-09-29 03:42:23 +0200
committermyk%mozilla.org <>2002-09-29 03:42:23 +0200
commit91b171e7584920d03abb9c45e779c84f3dee975c (patch)
treefc59becfe02d1a4dc84e5f3501f0139effcf1c7a /globals.pl
parent90975fe914d066726d06f53abe8696399b13a61a (diff)
downloadbugzilla-91b171e7584920d03abb9c45e779c84f3dee975c.tar.gz
bugzilla-91b171e7584920d03abb9c45e779c84f3dee975c.tar.xz
Fix for bug 98801: Implementation of the request tracker, a set of enhancements to attachment statuses.
r=gerv,bbaetz
Diffstat (limited to 'globals.pl')
-rw-r--r--globals.pl12
1 files changed, 8 insertions, 4 deletions
diff --git a/globals.pl b/globals.pl
index a6a751562..9a625a842 100644
--- a/globals.pl
+++ b/globals.pl
@@ -300,7 +300,12 @@ sub FetchOneColumn {
"status", "resolution", "summary");
sub AppendComment {
- my ($bugid,$who,$comment,$isprivate) = (@_);
+ my ($bugid, $who, $comment, $isprivate, $timestamp) = @_;
+
+ # Use the date/time we were given if possible (allowing calling code
+ # to synchronize the comment's timestamp with those of other records).
+ $timestamp = ($timestamp ? SqlQuote($timestamp) : "NOW()");
+
$comment =~ s/\r\n/\n/g; # Get rid of windows-style line endings.
$comment =~ s/\r/\n/g; # Get rid of mac-style line endings.
if ($comment =~ /^\s*$/) { # Nothin' but whitespace.
@@ -310,7 +315,7 @@ sub AppendComment {
my $whoid = DBNameToIdAndCheck($who);
my $privacyval = $isprivate ? 1 : 0 ;
SendSQL("INSERT INTO longdescs (bug_id, who, bug_when, thetext, isprivate) " .
- "VALUES($bugid, $whoid, now(), " . SqlQuote($comment) . ", " .
+ "VALUES($bugid, $whoid, $timestamp, " . SqlQuote($comment) . ", " .
$privacyval . ")");
SendSQL("UPDATE bugs SET delta_ts = now() WHERE bug_id = $bugid");
@@ -902,8 +907,7 @@ sub get_product_name {
sub get_component_id {
my ($prod_id, $comp) = @_;
- die "non-numeric prod_id '$prod_id' passed to get_component_id"
- unless ($prod_id =~ /^\d+$/);
+ return undef unless ($prod_id =~ /^\d+$/);
PushGlobalSQLState();
SendSQL("SELECT id FROM components " .
"WHERE product_id = $prod_id AND name = " . SqlQuote($comp));