]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 271913: Do not force the user to comment when adding Hours Worked
authorKent Rogers <kar@cray.com>
Thu, 13 May 2010 06:29:58 +0000 (23:29 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Thu, 13 May 2010 06:29:58 +0000 (23:29 -0700)
r=mkanat, a=mkanat

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

index b9c64da7f02a621e240d297eb84d40543ea7dd63..1b7753eff716eab116fb1c3b2152dceed2cf2144 100644 (file)
@@ -2243,11 +2243,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});
     }
@@ -2257,7 +2253,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 93b954e87699be5a58c4f471b09dfdf959e2f6d8..3012bab5e3dbf31626835db0b958cb23106cfe65 100644 (file)
@@ -94,6 +94,7 @@
 
 
 [% DEFAULT start_at = 0 mode = "show" %]
+[% timetracking_only = (comment_body == '' && comment.work_time != 0) %]
 [% sort_order = user.settings.comment_sort_order.value %]
 
 [%# NOTE: (start_at > 0) means we came here from a midair collision,
 
 [% BLOCK a_comment %]
   [% RETURN IF comment.is_private AND ! user.is_insider %]
+  [% RETURN IF timetracking_only AND !user.in_group(Param('timetrackinggroup')) %]
 
     <div id="c[% count %]" class="bz_comment[% " bz_private" IF comment.is_private %]
                 [% " bz_comment_hilite" IF marks.$count %]