summaryrefslogtreecommitdiffstats
path: root/process_bug.cgi
diff options
context:
space:
mode:
authorjocuri%softhome.net <>2004-08-03 15:23:25 +0200
committerjocuri%softhome.net <>2004-08-03 15:23:25 +0200
commit50e28bb8a4d457bf63f477b44df06adb22a71b59 (patch)
tree942dcfe2bf23fc77378e55e76f928c95ba7cf337 /process_bug.cgi
parent9de124643f35ac4b94b6974d9ee6b5af9e8b2bb6 (diff)
downloadbugzilla-50e28bb8a4d457bf63f477b44df06adb22a71b59.tar.gz
bugzilla-50e28bb8a4d457bf63f477b44df06adb22a71b59.tar.xz
Patch for bug 253604: When commit a bug, validate timetracking before user match; patch by Tiago R. Mello <tiago@async.com.br>; r=kiko, a=justdave.
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-xprocess_bug.cgi12
1 files changed, 10 insertions, 2 deletions
diff --git a/process_bug.cgi b/process_bug.cgi
index cdbb69ecf..b5d641f77 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -90,6 +90,16 @@ if (defined $::FORM{'id'}) {
# Make sure there are bugs to process.
scalar(@idlist) || ThrowUserError("no_bugs_chosen");
+# Validate all timetracking fields
+foreach my $field ("estimated_time", "work_time", "remaining_time") {
+ if (defined $::FORM{$field}) {
+ my $er_time = trim($::FORM{$field});
+ if ($er_time ne $::FORM{'dontchange'}) {
+ Bugzilla::Bug::ValidateTime($er_time, $field);
+ }
+ }
+}
+
# do a match on the fields if applicable
# The order of these function calls is important, as both Flag::validate
@@ -772,7 +782,6 @@ if (UserInGroup(Param('timetrackinggroup'))) {
if (defined $::FORM{$field}) {
my $er_time = trim($::FORM{$field});
if ($er_time ne $::FORM{'dontchange'}) {
- Bugzilla::Bug::ValidateTime($er_time, $field);
DoComma();
$::query .= "$field = " . SqlQuote($er_time);
}
@@ -1283,7 +1292,6 @@ foreach my $id (@idlist) {
if (!defined $::FORM{'comment'} || $::FORM{'comment'} =~ /^\s*$/) {
ThrowUserError('comment_required', undef, "abort");
}
- Bugzilla::Bug::ValidateTime($work_time, 'work_time');
# AppendComment (called below) can in theory raise an error,
# but because we've already validated work_time here it's
# safe to log the entry before adding the comment.