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 --- process_bug.cgi | 51 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 6 deletions(-) (limited to 'process_bug.cgi') diff --git a/process_bug.cgi b/process_bug.cgi index f529f13ea..439587178 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -703,6 +703,25 @@ if (defined $::FORM{'qa_contact'}) { } } +# jeff.hedlund@matrixsi.com time tracking data processing: +foreach my $field ("estimated_time", "remaining_time") { + + if (defined $::FORM{$field}) { + my $er_time = trim($::FORM{$field}); + if ($er_time ne $::FORM{'dontchange'}) { + if ($er_time > 99999.99) { + ThrowUserError("value_out_of_range", {variable => $field}); + } + if ($er_time =~ /^(?:\d+(?:\.\d*)?|\.\d+)$/) { + DoComma(); + $::query .= "$field = " . SqlQuote($er_time); + } else { + $vars->{'field'} = $field; + ThrowUserError("need_positive_number"); + } + } + } +} # If the user is submitting changes from show_bug.cgi for a single bug, # and that bug is restricted to a group, process the checkboxes that @@ -808,6 +827,12 @@ SWITCH: for ($::FORM{'knob'}) { last SWITCH; }; /^resolve$/ && CheckonComment( "resolve" ) && do { + if (UserInGroup(Param('timetrackinggroup'))) { + if (defined $::FORM{'remaining_time'} && + $::FORM{'remaining_time'} > 0) { + ThrowUserError("resolving_remaining_time"); + } + } # Check here, because its the only place we require the resolution CheckFormField(\%::FORM, 'resolution', \@::settable_resolution); ChangeStatus('RESOLVED'); @@ -1170,6 +1195,26 @@ foreach my $id (@idlist) { } } + SendSQL("select now()"); + $timestamp = FetchOneColumn(); + + if ($::FORM{'work_time'} > 99999.99) { + ThrowUserError("value_out_of_range", {variable => 'work_time'}); + } + if (defined $::FORM{'comment'} || defined $::FORM{'work_time'}) { + if ($::FORM{'work_time'} != 0 && + (!defined $::FORM{'comment'} || $::FORM{'comment'} =~ /^\s*$/)) { + + ThrowUserError('comment_required'); + } else { + AppendComment($id, $::COOKIE{'Bugzilla_login'}, $::FORM{'comment'}, + $::FORM{'commentprivacy'}, $timestamp, $::FORM{'work_time'}); + if ($::FORM{'work_time'} != 0) { + LogActivityEntry($id, "work_time", "", $::FORM{'work_time'}); + } + } + } + if (@::legal_keywords) { # There are three kinds of "keywordsaction": makeexact, add, delete. # For makeexact, we delete everything, and then add our things. @@ -1229,17 +1274,11 @@ foreach my $id (@idlist) { SendSQL("DELETE FROM bug_group_map WHERE bug_id = $id AND group_id = $grouptodel"); } - SendSQL("select now()"); - $timestamp = FetchOneColumn(); my $groupDelNames = join(',', @groupDelNames); my $groupAddNames = join(',', @groupAddNames); LogActivityEntry($id, "bug_group", $groupDelNames, $groupAddNames); - if (defined $::FORM{'comment'}) { - AppendComment($id, $::COOKIE{'Bugzilla_login'}, $::FORM{'comment'}, - $::FORM{'commentprivacy'}, $timestamp); - } my $removedCcString = ""; if (defined $::FORM{newcc} || defined $::FORM{removecc} || defined $::FORM{masscc}) { -- cgit v1.2.3-24-g4f1b