]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 482584: Add a parameter to hide the "See Also" field
authormkanat%bugzilla.org <>
Fri, 17 Apr 2009 22:30:30 +0000 (22:30 +0000)
committermkanat%bugzilla.org <>
Fri, 17 Apr 2009 22:30:30 +0000 (22:30 +0000)
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, r=dkl, a=LpSolit

Bugzilla/Config/BugFields.pm
template/en/default/admin/params/bugfields.html.tmpl
template/en/default/bug/edit.html.tmpl
template/en/default/bug/field.html.tmpl
template/en/default/pages/fields.html.tmpl

index b0375ad504e775ddc071b059a8d18e391563e551..c7f7f6e5acecef62ac8f70a7cc49bfa4ae111a2c 100644 (file)
@@ -83,6 +83,12 @@ sub get_param_list {
    default => 0
   },
 
+  {
+   name => 'use_see_also',
+   type => 'b',
+   default => 1
+  },
+
   {
    name => 'defaultpriority',
    type => 's',
index e0625b480929d4fec5fe5be633bd1158b4788b44..794f925b7853c93958ed13fc470e2d1cc7887fb8 100644 (file)
   usebugaliases => "Do you wish to use $terms.bug aliases, which allow you to assign " _
                    "$terms.bugs an easy-to-remember name by which you can refer to them?",
 
+  use_see_also => 
+    "Do you wish to use the See Also field? It allows you refer to"
+    _ " $terms.bugs in other installations. Even if you disable this field,"
+    _ " $terms.bug relationships (URLs) already set on $terms.bugs will"
+    _ " still appear and can be removed.",
+
   defaultpriority => "This is the priority that newly entered $terms.bugs are set to.",
 
   defaultseverity => "This is the severity that newly entered $terms.bugs are set to.",
@@ -57,4 +63,4 @@
                   "You can leave this empty: " _
                   "$terms.Bugzilla will then use the operating system that the browser " _
                   "reports to be running on as the default." }
-%]
\ No newline at end of file
+%]
index c59771eab47f90701c7952da947932f71918975a..de89f1b8e7bd48ae65cb3050e645d50ebbb055a4 100644 (file)
 [%# Block for See Also                                                       #%]
 [%############################################################################%]
 [% BLOCK section_see_also %]
-  <tr>
-    [% INCLUDE bug/field.html.tmpl 
-         field    = bug_fields.see_also
-         value    = bug.see_also
-         editable = bug.check_can_change_field('see_also', 0, 1)
-    %]
-  </tr>
+  [% IF Param('use_see_also') || bug.see_also.size %]
+    <tr>
+      [% INCLUDE bug/field.html.tmpl 
+           field    = bug_fields.see_also
+           value    = bug.see_also
+           editable = bug.check_can_change_field('see_also', 0, 1)
+      %]
+    </tr>
+  [% END %]
 [% END %]
 
 [%############################################################################%]
index bdfdd099ee446f12887c2947be9ec3f6dfab22d4..7a514e8887e9aa608e2d1a7efb155dde5ad0afe6 100644 (file)
        [% FOREACH url = value %]
          <li>
            <a href="[% url FILTER html %]">[% url FILTER html %]</a>
-           <label><input type="checkbox" value="[% url FILTER html %]"
-                         name="remove_[% field.name FILTER html %]">
-             Remove</label>
+           [% IF editable %]
+             <label><input type="checkbox" value="[% url FILTER html %]"
+                           name="remove_[% field.name FILTER html %]">
+               Remove</label>
+           [% END %]
          </li>
        [% END %]
        [% '</ul>' IF value.size %]
 
-       <label for="[% field.name FILTER html %]">
-         <strong>Add [% terms.Bug %] URLs:</strong>
-       </label><br>
-       <input type="text" id="[% field.name FILTER html %]" 
-              class="text_input" name="[% field.name FILTER html %]" size="40">
+       [% IF editable && Param('use_see_also') %]
+         <label for="[% field.name FILTER html %]">
+           <strong>Add [% terms.Bug %] URLs:</strong>
+         </label><br>
+         <input type="text" id="[% field.name FILTER html %]" size="40"
+                class="text_input" name="[% field.name FILTER html %]">
+       [% END %]
   [% END %]
 [% ELSIF field.type == constants.FIELD_TYPE_TEXTAREA %]
   <div class="uneditable_textarea">[% value FILTER wrap_comment(60)
index f5458de37a20dd36ba675523b29cc69fbdbc3f56..0125a55e987c32a882ddf7bd2f48d5f27b75ac5d 100644 (file)
@@ -315,16 +315,18 @@ When searching for [% terms.bugs %] that have been resolved or
 verified, remember to set the status field appropriately. 
 </p>
 
-<h2><a name="see_also"></a>See Also</h2>
-
-<p>This allows you to refer to [% terms.bugs %] in other installations.
-  You can enter a URL to a [%+ terms.bug %] in the "Add [% terms.Bug %] URLs"
-  field to note that that [% terms.bug %] is related to this one. You can
-  enter multiple URLs at once by separating them with a comma.</p>
-
-<p>You should normally use this field to refer to [% terms.bugs %] in 
-  <em>other</em> installations. For [% terms.bugs %] in this 
-  installation, it is better to use the "Depends On" and "Blocks"
-  fields.</p>
+[% IF Param("use_see_also") %]
+  <h2><a name="see_also"></a>See Also</h2>
+
+  <p>This allows you to refer to [% terms.bugs %] in other installations.
+    You can enter a URL to a [%+ terms.bug %] in the "Add [% terms.Bug %] URLs"
+    field to note that that [% terms.bug %] is related to this one. You can
+    enter multiple URLs at once by separating them with a comma.</p>
+
+  <p>You should normally use this field to refer to [% terms.bugs %] in 
+    <em>other</em> installations. For [% terms.bugs %] in this 
+    installation, it is better to use the "Depends On" and "Blocks"
+    fields.</p>
+[% END %]
 
 [% INCLUDE global/footer.html.tmpl %]