]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 830333: Make the comment box hidden if bug_check_can_change_field reports the...
authorHugo Seabrook <hugo.seabrook@gmail.com>
Fri, 15 Feb 2013 06:04:00 +0000 (14:04 +0800)
committerByron Jones <bjones@mozilla.com>
Fri, 15 Feb 2013 06:04:00 +0000 (14:04 +0800)
r=glob, a=LpSolit

template/en/default/bug/comments.html.tmpl
template/en/default/bug/edit.html.tmpl

index 62beb61ea19f1778ba13675218f9b39745c83448..d2de3521c9367b34eced707099df1efe07886999 100644 (file)
 
         [% IF mode == "edit" %]
           <span class="bz_comment_actions">
-            [<a class="bz_reply_link" href="#add_comment"
-              [% IF user.settings.quote_replies.value != 'off' %]
-                onclick="replyToComment('[% count %]', '[% comment.id %]', '[% comment.author.name || comment.author.nick FILTER html FILTER js %]'); return false;"
-              [% END %]
-            >reply</a>]
+            [% IF bug.check_can_change_field('longdesc', 0, 1) %]
+              [<a class="bz_reply_link" href="#add_comment"
+                [% IF user.settings.quote_replies.value != 'off' %]
+                  onclick="replyToComment('[% count %]', '[% comment.id %]', '[% comment.author.name || comment.author.nick FILTER html FILTER js %]'); return false;"
+                [% END %]
+              >reply</a>]
+            [% END %]
             <script type="text/javascript"><!--
               addCollapseLink([% count %], 'Toggle comment display'); // -->
             </script>
           </span>
         [% END %]
 
-        [% IF mode == "edit" && user.is_insider %]
+        [% IF mode == "edit" && user.is_insider && bug.check_can_change_field('longdesc', 0, 1) %]
           <div class="bz_private_checkbox">
             <input type="hidden" value="1"
                    name="defined_isprivate_[% comment.id %]">
index 3ca5ab4a50bb6d6d54ef13e85c62c65ae39e4d79..c48b17c0845c5c6494798285cfaaee9586e10bdd 100644 (file)
       <label for="comment" accesskey="c"><b>Additional 
         <u>C</u>omments</b></label>:
 
-      [% IF user.is_insider %]
+      [% IF user.is_insider && bug.check_can_change_field('longdesc', 0, 1) %]
         <input type="checkbox" name="comment_is_private" value="1"
                id="newcommentprivacy"
                onClick="updateCommentTagControl(this, 'comment')">
 
       <!-- This table keeps the submit button aligned with the box. -->
       <table><tr><td>
-        [% INCLUDE global/textarea.html.tmpl
-                   name      = 'comment'
-                   id        = 'comment'
-                   minrows   = 10
-                   maxrows   = 25
-                   cols      = constants.COMMENT_COLS
-        %]
-        [% Hook.process("after_comment_textarea", 'bug/edit.html.tmpl') %]
+        [% IF bug.check_can_change_field('longdesc', 0, 1) %]
+          [% INCLUDE global/textarea.html.tmpl
+                     name      = 'comment'
+                     id        = 'comment'
+                     minrows   = 10
+                     maxrows   = 25
+                     cols      = constants.COMMENT_COLS
+          %]
+          [% Hook.process("after_comment_textarea", 'bug/edit.html.tmpl') %]
+        [% ELSE %]
+          You are not allowed to make an additional comment on this [% terms.bug %].
+        [% END %]
         <br>
         [% PROCESS commit_button id=""%]