]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 344513: Make plain-text custom fields functional on all pages except enter_bug.cgi
authormkanat%bugzilla.org <>
Tue, 18 Jul 2006 02:57:35 +0000 (02:57 +0000)
committermkanat%bugzilla.org <>
Tue, 18 Jul 2006 02:57:35 +0000 (02:57 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=myk

buglist.cgi
colchange.cgi
skins/standard/show_bug.css [new file with mode: 0644]
template/en/default/bug/edit.html.tmpl
template/en/default/bug/field.html.tmpl
template/en/default/bug/show-multiple.html.tmpl
template/en/default/bug/show.html.tmpl
template/en/default/global/field-descs.none.tmpl
template/en/default/list/edit-multiple.html.tmpl

index c16e70a69fcc42c537ccc6f4091c3a030b27d629..882a2977758695676ccfbb7235fe383bc6186bb3 100755 (executable)
@@ -625,6 +625,10 @@ DefineColumn("percentage_complete",
 DefineColumn("relevance"         , "relevance"                  , "Relevance"        );
 DefineColumn("deadline"          , $dbh->sql_date_format('bugs.deadline', '%Y-%m-%d') . " AS deadline", "Deadline");
 
+foreach my $field (Bugzilla->get_fields({ custom => 1, obsolete => 0})) {
+    DefineColumn($field->name, 'bugs.' . $field->name, $field->description);
+}
+
 ################################################################################
 # Display Column Determination
 ################################################################################
index 3f06ca533e94e6e48b0a16438945a1f7f5e459cc..1ff65b73ba9cb86ca1eacf0d7158d9a277fc3f68 100755 (executable)
@@ -20,6 +20,7 @@
 #
 # Contributor(s): Terry Weissman <terry@mozilla.org>
 #                 Gervase Markham <gerv@gerv.net>
+#                 Max Kanat-Alexander <mkanat@bugzilla.org>
 
 use strict;
 
@@ -77,6 +78,8 @@ if (UserInGroup(Bugzilla->params->{"timetrackinggroup"})) {
 
 push(@masterlist, ("short_desc", "short_short_desc"));
 
+push(@masterlist, Bugzilla->custom_field_names);
+
 $vars->{'masterlist'} = \@masterlist;
 
 my @collist;
diff --git a/skins/standard/show_bug.css b/skins/standard/show_bug.css
new file mode 100644 (file)
index 0000000..012d3b5
--- /dev/null
@@ -0,0 +1,18 @@
+/* The contents of this file are subject to the Mozilla Public
+  * License Version 1.1 (the "License"); you may not use this file
+  * except in compliance with the License. You may obtain a copy of
+  * the License at http://www.mozilla.org/MPL/
+  *
+  * Software distributed under the License is distributed on an "AS
+  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+  * implied. See the License for the specific language governing
+  * rights and limitations under the License.
+  *
+  * The Original Code is the Bugzilla Bug Tracking System.
+  *
+  * Contributor(s): Max Kanat-Alexander <mkanat@bugzilla.org>
+  */
+
+.field_label {
+    text-align: right;
+}
index dc80079d525122a08ed5166d8c5985925474b021..83bb5fb51cc3f95fdd863063e50f33b4ccb1ad33 100644 (file)
@@ -18,6 +18,7 @@
   #
   # Contributor(s): Gervase Markham <gerv@gerv.net>
   #                 Vaskin Kissoyan <vkissoyan@yahoo.com>
+  #                 Max Kanat-Alexander <mkanat@bugzilla.org>
   #%]
 
 [% PROCESS global/variables.none.tmpl %]
 [% USE Bugzilla %]
 <table>
   [% FOREACH field = Bugzilla.get_fields({ obsolete => 0, custom => 1 }) %]
-    [% PROCESS bug/field.html.tmpl value=bug.${field.name} %]
+    <tr>
+      [% PROCESS bug/field.html.tmpl value=bug.${field.name} editable=1 %]
+    </tr>
   [% END %]
 </table>
 
index cbde9cf2783af025cf2a0289bac313021f230e23..9c45b3e57ead074aaf2d13c7286e21fd9ef13291 100644 (file)
   # Rights Reserved.
   #
   # Contributor(s): Myk Melez <myk@mozilla.org>
+  #                 Max Kanat-Alexander <mkanat@bugzilla.org>
   #%]
 
-<tr>
+[%# INTERFACE:
+  #   field: a Bugzilla::Field object
+  #   value: The value of the field for this bug.
+  #   editable: Whether the field should be displayed as an editable
+  #             <input> or as just the plain text of its value.
+  #%]
+
+<th class="field_label">
+  [% IF editable %]
+    <label for="[% field.name FILTER html %]">
+  [% END %]
+    [% field_descs.${field.name} FILTER html %]:
+  [% '</label>' IF editable %]
+</th>
+
+<td class="field_value">
+[% IF editable %]
   [% SWITCH field.type %]
-  [% CASE constants.FIELD_TYPE_FREETEXT %]
-    <th align="right">
-      <label for="[% field.name FILTER html %]">
-        [% field.description FILTER html %]:
-      </label>
-    </th>
-    <td>
-      <input name="[% field.name FILTER html %]"
-             value="[% value FILTER html %]"
-             size="60">
-    </td>
+    [% CASE constants.FIELD_TYPE_FREETEXT %]
+        <input name="[% field.name FILTER html %]"
+               value="[% value FILTER html %]"
+               size="60">
   [% END %]
-</tr>
+[% ELSE %]
+  [% value FILTER html %]
+[% END %]
+</td>
index 22bc3db69943f999ca8a19e7282716847720c7ed..c76e07699ac1d4737038f122440989153d3956f9 100644 (file)
@@ -20,6 +20,7 @@
   #                 Gervase Markham <gerv@gerv.net>
   #                 Toms Baugis <toms@myrealbox.com>
   #                 Olav Vitters <olav@bkor.dhs.org>
+  #                 Max Kanat-Alexander <mkanat@bugzilla.org>
   #%]
 
 [% PROCESS "global/field-descs.none.tmpl" %]
       [% PROCESS row cell = "status_whiteboard" fullrow = 1 %]
     [% END %]
 
+    [% USE Bugzilla %]
+    [% field_counter = 0 %]
+    [% FOREACH field = Bugzilla.get_fields({ obsolete => 0, custom => 1 }) %]
+        [% field_counter = field_counter + 1 %]
+        [%# Odd-numbered fields get an opening <tr> %]
+        [% '<tr>' IF field_counter % 2 %]
+        [% PROCESS bug/field.html.tmpl value=bug.${field.name} editable=0 %]
+        [%# Even-numbered fields get a closing <tr> %]
+        [% '</tr>' IF !(field_counter % 2) %]
+    [% END %]
+    [%# And we have to finish the row if we ended on an odd number. %]
+    [% '<th></th><td></td></tr>' IF field_counter % 2 %]
+
     [% IF (bug.dependson.size || bug.blocked.size) %]
       [% PROCESS dependencies name = "dependson" %]
       [% PROCESS dependencies name = "blocked"  %]
index 99fd466600c167f7b4f7e0dcac7349edad41df06..eb7457a7cebad050323cee3f5e5d94eee1f4caee 100644 (file)
@@ -19,6 +19,7 @@
   # Contributor(s): Gervase Markham <gerv@gerv.net>
   #                 Vaskin Kissoyan <vkissoyan@yahoo.com>
   #                 Bradley Baetz <bbaetz@student.usyd.edu.au>
+  #                 Max Kanat-Alexander <mkanat@bugzilla.org>
   #%]
 
 [% PROCESS global/variables.none.tmpl %]
@@ -39,6 +40,7 @@
                    "bz_component_$bug.component",
                    "bz_bug_$bug.bug_id"
                   ]
+    style_urls = ['skins/standard/show_bug.css']
   %]
 [% END %]
 
index 7a27251212ad2899c38ee88681eb05a0357db7a1..ba6f675e4db40270c50c51b709dec9e4169b3950 100644 (file)
                    "votes"                => "Votes",
                    "work_time"            => "Hours Worked"} %]
 
+[%# Also include any custom fields or fields which don't have a
+    Description here, by copying their Description from the
+    database. If you want to override this for your language
+    or your installation, just use a hook. %]
+
+[% USE Bugzilla %]
+[% FOREACH field = Bugzilla.get_fields() %]
+  [% SET field_descs.${field.name} = field.description 
+     IF !field_descs.${field_name}.exists %]
+[% END %]
+
 [% status_descs = { "UNCONFIRMED" => "UNCONFIRMED",
                     "NEW"         => "NEW",
                     "ASSIGNED"    => "ASSIGNED",
index 92a083a68196ab5029d1a3c502d7c6113464445c..958a95cf82890a9006f46a54f7fd1f4fb2a18856 100644 (file)
@@ -17,6 +17,7 @@
   # Rights Reserved.
   #
   # Contributor(s): Myk Melez <myk@mozilla.org>
+  #                 Max Kanat-Alexander <mkanat@bugzilla.org>
   #%]
 
 [% PROCESS global/variables.none.tmpl %]
     </tr>
   [% END %]
 
+  [% USE Bugzilla %]
+  [% FOREACH field = Bugzilla.get_fields({ obsolete => 0, custom => 1 }) %]
+    <tr>
+      [% PROCESS bug/field.html.tmpl value=dontchange editable=1 %]
+    </tr>
+  [% END %]
+
 </table>
 
 <b><label for="comment">Additional Comments:</label></b><br>