From fd742d6fc8849328749866dbff2936d43abcc7d1 Mon Sep 17 00:00:00 2001 From: "bugreport%peshkin.net" <> Date: Sun, 13 Oct 2002 11:26:02 +0000 Subject: Bug 24789 [E|A|R] Add Estimated, Actual, Remaining Time Fields patch by jeff.hedlund@matrixsi.com 2xr=joel,justdave --- post_bug.cgi | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'post_bug.cgi') diff --git a/post_bug.cgi b/post_bug.cgi index c07d07d99..d519a484c 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -233,7 +233,8 @@ if ($::FORM{'keywords'} && UserInGroup("editbugs")) { # Build up SQL string to add bug. my $sql = "INSERT INTO bugs " . - "(" . join(",", @used_fields) . ", reporter, creation_ts) " . + "(" . join(",", @used_fields) . ", reporter, creation_ts, " . + "estimated_time, remaining_time) " . "VALUES ("; foreach my $field (@used_fields) { @@ -246,7 +247,23 @@ $comment = trim($comment); # OK except for the fact that it causes e-mail to be suppressed. $comment = $comment ? $comment : " "; -$sql .= "$::userid, now() )"; +$sql .= "$::userid, now(), "; + +# Time Tracking +if (UserInGroup(Param("timetrackinggroup")) && + defined $::FORM{'estimated_time'}) { + + my $est_time = $::FORM{'estimated_time'}; + if ($est_time =~ /^(?:\d+(?:\.\d*)?|\.\d+)$/) { + $sql .= SqlQuote($est_time) . "," . SqlQuote($est_time); + } else { + $vars->{'field'} = "estimated_time"; + ThrowUserError("need_positive_number"); + } +} else { + $sql .= "0, 0"; +} +$sql .= ")"; # Groups my @groupstoadd = (); -- cgit v1.2.3-24-g4f1b