summaryrefslogtreecommitdiffstats
path: root/post_bug.cgi
diff options
context:
space:
mode:
authorbugreport%peshkin.net <>2002-10-13 13:26:02 +0200
committerbugreport%peshkin.net <>2002-10-13 13:26:02 +0200
commitfd742d6fc8849328749866dbff2936d43abcc7d1 (patch)
tree1e4d7646a4589bcf44adceb452b38924286f7af1 /post_bug.cgi
parentf61593bee73b37fc12caabbb2958b6515d688420 (diff)
downloadbugzilla-fd742d6fc8849328749866dbff2936d43abcc7d1.tar.gz
bugzilla-fd742d6fc8849328749866dbff2936d43abcc7d1.tar.xz
Bug 24789 [E|A|R] Add Estimated, Actual, Remaining Time Fields
patch by jeff.hedlund@matrixsi.com 2xr=joel,justdave
Diffstat (limited to 'post_bug.cgi')
-rwxr-xr-xpost_bug.cgi21
1 files changed, 19 insertions, 2 deletions
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 = ();