]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 271913: Don't force the user to comment when adding Hours Worked
authorKent Rogers <kar@cray.com>
Wed, 26 May 2010 01:45:33 +0000 (18:45 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Wed, 26 May 2010 01:45:33 +0000 (18:45 -0700)
r=mkanat, a=mkanat

Bugzilla/Bug.pm
template/en/default/bug/comments.html.tmpl

index fb4972782af4e383c55a11bc4247c3e768816823..008155800d585b8a11fc8ed630255fb457e4a252 100644 (file)
@@ -2407,11 +2407,7 @@ sub add_comment {
     $comment = $self->_check_comment($comment);
 
     $params ||= {};
-    if (exists $params->{work_time}) {
-        $params->{work_time} = $self->_check_work_time($params->{work_time});
-        ThrowUserError('comment_required')
-            if $comment eq '' && $params->{work_time} != 0;
-    }
+    $params->{work_time} = $self->_check_work_time($params->{work_time});
     if (exists $params->{type}) {
         $params->{type} = $self->_check_comment_type($params->{type});
     }
@@ -2421,7 +2417,7 @@ sub add_comment {
     }
     # XXX We really should check extra_data, too.
 
-    if ($comment eq '' && !($params->{type} || $params->{work_time})) {
+    if ($comment eq '' && !($params->{type} || abs($params->{work_time}))) {
         return;
     }
 
index 2f42bbcb716956a31182f3456c2143bc4c400798..af6cc2191117d83c8ae23b4cba7bce3d6f9400fd 100644 (file)
@@ -89,6 +89,7 @@
 
 [% BLOCK a_comment %]
   [% RETURN IF comment.is_private AND ! user.is_insider %]
+  [% RETURN IF comment.body == '' AND comment.work_time != 0 AND !user.is_timetracker %]
 
     <div id="c[% count %]" class="bz_comment[% " bz_private" IF comment.is_private %]
                 [% " bz_comment_hilite" IF marks.$count %]