next if !defined($vars->{'mform'}->{$field});
# Skip it if this is a --do_not_change-- field
- next if $dontchange eq $vars->{'form'}->{$field};
+ next if $dontchange && $dontchange eq $vars->{'form'}->{$field};
# We need to move the query to $raw_field, where it will be split up,
# modified by the search, and put back into $::FORM and $::MFORM
ValidateComment($::FORM{'comment'});
+$::FORM{'dontchange'} = '' unless exists $::FORM{'dontchange'};
+
# If the bug(s) being modified have dependencies, validate them
# and rebuild the list with the validated values. This is important
# because there are situations where validation changes the value
SendSQL("select now()");
$timestamp = FetchOneColumn();
- if ($::FORM{'work_time'} > 99999.99) {
- ThrowUserError("value_out_of_range", {field => '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'},
- $whoid, $timestamp);
- $bug_changed = 1;
+ if (UserInGroup(Param('timetrackinggroup'))) {
+ if ($::FORM{'work_time'} > 99999.99) {
+ ThrowUserError("value_out_of_range", {field => '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'},
+ $whoid, $timestamp);
+ $bug_changed = 1;
+ }
}
}
}