]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 519142: Replace IF/ELSE statements about bug_status/resolution with just a displa...
authormkanat%bugzilla.org <>
Wed, 18 Nov 2009 07:04:57 +0000 (07:04 +0000)
committermkanat%bugzilla.org <>
Wed, 18 Nov 2009 07:04:57 +0000 (07:04 +0000)
Patch by Vitaly Fedrushkov <vitaly.fedrushkov@gmail.com> r=mkanat, a=mkanat

23 files changed:
template/en/default/admin/params/common.html.tmpl
template/en/default/admin/workflow/comment.html.tmpl
template/en/default/admin/workflow/edit.html.tmpl
template/en/default/bug/activity/table.html.tmpl
template/en/default/bug/create/create.html.tmpl
template/en/default/bug/show-multiple.html.tmpl
template/en/default/global/code-error.html.tmpl
template/en/default/global/field-descs.none.tmpl
template/en/default/list/edit-multiple.html.tmpl
template/en/default/list/list.atom.tmpl
template/en/default/list/list.html.tmpl
template/en/default/list/table.html.tmpl
template/en/default/pages/bug-writing.html.tmpl
template/en/default/pages/fields.html.tmpl
template/en/default/reports/duplicates-table.html.tmpl
template/en/default/reports/report-bar.png.tmpl
template/en/default/reports/report-line.png.tmpl
template/en/default/reports/report-pie.png.tmpl
template/en/default/reports/report-table.csv.tmpl
template/en/default/reports/report-table.html.tmpl
template/en/default/search/form.html.tmpl
template/en/default/whine/mail.html.tmpl
template/en/default/whine/mail.txt.tmpl

index c23c2ca9a5078fe4ef9bd5bcaeb5a512e9072801..5b0d004295956aa5fd719f9947b0ce68bd88a143 100644 (file)
@@ -22,6 +22,8 @@
   # panel: hash representing the current panel.
   #%]
 
+[% PROCESS "global/field-descs.none.tmpl" %]
+
 [% sortlist_separator = '---' %]
 
 <dl>
           [% FOREACH item = param.choices %]
             <option value="[% item FILTER html %]"
                     [% " selected=\"selected\"" IF item == Param(param.name) %]>
-              [% item FILTER html %]
+              [% IF param.name == "defaultseverity" %]
+                [% display_value("bug_severity", item) FILTER html %]
+              [% ELSIF param.name == "defaultplatform" %]
+                [% display_value("rep_platform", item) FILTER html %]
+              [% ELSIF param.name == "defaultopsys" %]
+                [% display_value("op_sys", item) FILTER html %]
+              [% ELSIF param.name == "duplicate_or_move_bug_status" %]
+                [% display_value("bug_status", item) FILTER html %]
+              [% ELSE %]
+                [% item FILTER html %]
+              [% END %]
             </option>
           [% END %]
         </select>
index 2fa78f00353f182103533d4c9fbc3245bbdaafb2..a7a6a74c23b5096648ff8be7117e70dc97248e86 100644 (file)
@@ -49,7 +49,7 @@
     <th>&nbsp;</th>
     [% FOREACH status = statuses %]
       <th class="col-header[% status.is_open ? " open-status" : " closed-status" %]">
-        [% status.name FILTER html %]
+        [% display_value("bug_status", status.name) FILTER html %]
       </th>
     [% END %]
   </tr>
@@ -59,7 +59,7 @@
   [% FOREACH status = p.merge(statuses) %]
     <tr class="highlight">
       <th align="right" class="[% status.is_open ? "open-status" : "closed-status" %]">
-        [% status.name FILTER html %]
+        [% display_value("bug_status", status.name) FILTER html %]
       </th>
 
       [% FOREACH new_status = statuses %]
index 787937989f13b5c5dde70803c6de6526e2d947c7..406c08a210034806ca29766788f1b8bcb9fbea0f 100644 (file)
@@ -54,7 +54,7 @@
     <th>&nbsp;</th>
     [% FOREACH status = statuses %]
       <th class="col-header[% status.is_open ? " open-status" : " closed-status" %]">
-        [% status.name FILTER html %]
+        [% display_value("bug_status", status.name) FILTER html %]
       </th>
     [% END %]
   </tr>
@@ -64,7 +64,7 @@
   [% FOREACH status = p.merge(statuses) %]
     <tr class="highlight">
       <th align="right" class="[% status.is_open ? "open-status" : "closed-status" %]">
-        [% status.name FILTER html %]
+        [% display_value("bug_status", status.name) FILTER html %]
       </th>
 
       [% FOREACH new_status = statuses %]
@@ -89,7 +89,7 @@
 <p>
   When [% terms.abug %] is marked as a duplicate of another one or is moved
   to another installation, the [% terms.bug %] status is automatically set to
-  <b>[% Param("duplicate_or_move_bug_status") FILTER html %]</b>. All transitions to
+  <b>[% display_value("bug_status", Param("duplicate_or_move_bug_status")) FILTER html %]</b>. All transitions to
   this [% terms.bug %] status must then be valid (this is the reason why you cannot edit
   them above).<br>
   Note: you can change this setting by visiting the
index a467fe5f2cd9f71c93fae9d3fba055afe5144a3e..ae9dbcb80dc887a07713be8a5d2af480272006a5 100644 (file)
                       change.fieldname == 'remaining_time' ||
                       change.fieldname == 'work_time' %]
                   [% PROCESS formattimeunit time_unit=change.removed %]
-                [% ELSIF change.fieldname == 'bug_status' %]
-                  [% display_value("bug_status", change.removed) FILTER html %]
-                [% ELSIF change.fieldname == 'resolution' %]
-                  [% display_value("resolution", change.removed) FILTER html %]
                 [% ELSIF change.fieldname == 'blocked' ||
                          change.fieldname == 'dependson' %]
                   [% change.removed FILTER bug_list_link FILTER none %]
                 [% ELSE %]
-                  [% change.removed FILTER email FILTER html %]
+                  [% display_value(change.fieldname, change.removed) FILTER email FILTER html %]
                 [% END %]
               [% ELSE %]
                 &nbsp;
                       change.fieldname == 'remaining_time' ||
                       change.fieldname == 'work_time' %]
                   [% PROCESS formattimeunit time_unit=change.added %]
-                [% ELSIF change.fieldname == 'bug_status' %]
-                  [% display_value("bug_status", change.added) FILTER html %]
-                [% ELSIF change.fieldname == 'resolution' %]
-                  [% display_value("resolution", change.added) FILTER html %]
                 [% ELSIF change.fieldname == 'blocked' ||
                          change.fieldname == 'dependson' %]
                   [% change.added FILTER bug_list_link FILTER none %]
                 [% ELSE %]
-                  [% change.added FILTER email FILTER html %]
+                  [% display_value(change.fieldname, change.added) FILTER email FILTER html %]
                 [% END %]
               [% ELSE %]
                 &nbsp;
index 3572ec372414167a7255c66065494bc472ab540d..f466f77048df701cffddc4c8d5df7dcd454476d5 100644 (file)
@@ -664,11 +664,8 @@ TUI_hide_default('expert_fields');
     [%- FOREACH x = ${sel.name} %]
       <option value="[% x FILTER html %]"
         [% " selected=\"selected\"" IF x == default.${sel.name} %]>
-        [% IF sel.name == "bug_status" %]
-          [% display_value("bug_status", x) FILTER html %]
-        [% ELSE %]
-          [% x FILTER html %]
-        [% END %]</option>
+        [% display_value(sel.name, x) FILTER html %]
+      </option>
     [% END %]
     </select>
 
index b6507b964ae59f380b66338484683ed22c4362fe..177bea14f0c66ce6dddf864f2b65cbbfcfdc8616 100644 (file)
     <tr>
       <th>[% field_descs.bug_severity FILTER html %]:</th>
       <td class="bz_[% bug.bug_severity FILTER css_class_quote -%]">
-        [% bug.bug_severity FILTER html %]
+        [% display_value("bug_severity", bug.bug_severity) FILTER html %]
       </td>
 
       [% PROCESS rightcell %]
 [% BLOCK row %]
   <tr>
     <th>[% field_descs.${cell} FILTER html %]:</th>
-    <td[% " colspan=3" IF fullrow %]>[% bug.${cell} FILTER html %]</td>
+    <td[% " colspan=3" IF fullrow %]>[% display_value(cell, bug.${cell}) FILTER html %]</td>
     [% PROCESS rightcell IF !fullrow %]
   </tr>
   [% fullrow = 0 %]
         </td>
     [% ELSIF name != "" %]
       <th class="rightcell">[% field_descs.${name} FILTER html %]:</th>
-      <td>[% bug.${name} FILTER html %]</td>
+      <td>[% display_value(name, bug.${name}) FILTER html %]</td>
     [% ELSE %]
       <td>&nbsp;</td>
       <td>&nbsp;</td>
index 64bd41af3a9c1353eb1c67180946c1c3034d421a..f35c1ec93fdebaa9dfa83684f6bdc56741c2a927 100644 (file)
     A valid quipid is needed.
 
   [% ELSIF error == "no_manual_moved" %]
-    You cannot set the resolution of [% terms.abug %] to MOVED without
+    You cannot set the resolution of [% terms.abug %] to display_value("resolution", "MOVED") FILTER html %] without
     moving the [% terms.bug %].
 
   [% ELSIF error == "no_open_bug_status" %]
index 278800594627cf8227d02efd6097baf47c7d5768..5012769ca0b74145ac6c35ae41370484beda95f0 100644 (file)
   },
 
   "resolution" => {
+    ""        => "---",
     # "FIXED" => "NO LONGER AN ISSUE",
     # "MOVED" => "BYE-BYE",
   },
index 528d1bd68ef6a7dc7229631467cece1ab6476df0..11f3491f28064cac1d0bf704815f19f79503cea0 100644 (file)
     </option>
     [% FOREACH menuitem = menuitems %]
       [% IF property %][% menuitem = menuitem.$property %][% END %]
-      <option value="[% menuitem FILTER html %]">[% menuitem FILTER html %]</option>
+      <option value="[% menuitem FILTER html %]">[% display_value(menuname, menuitem) FILTER html %]</option>
     [% END %]
   </select>
 [% END %]
index 5086a044c66fa286f932f41a903a927ada0c87b8..3c504f9c9b16fb2b12f16bac18eccb309a0b989f 100644 (file)
@@ -23,7 +23,7 @@
   # This is a template for generating an Atom representation of a buglist. 
   #%]
 
-[% PROCESS global/variables.none.tmpl %]
+[% PROCESS "global/field-descs.none.tmpl" %]
 
 [% DEFAULT title = "$terms.Bugzilla $terms.Bugs" %]
 
         <td>[% bug.reporter_realname FILTER html %]</td>
       </tr><tr class="bz_feed_bug_status">
         <td>[% columns.bug_status.title FILTER html %]</td>
-        <td>[% bug.bug_status FILTER html %]</td>
+        <td>[% display_value("bug_status", bug.bug_status) FILTER html %]</td>
       </tr><tr class="bz_feed_resolution">
         <td>[% columns.resolution.title FILTER html %] </td>
-        <td>[% bug.resolution FILTER html %]</td>
+        <td>[% display_value("resolution", bug.resolution) FILTER html %]</td>
       </tr><tr class="bz_feed_priority">
         <td>[% columns.priority.title FILTER html %]</td>
-        <td>[% bug.priority FILTER html %]</td>
+        <td>[% display_value("priority", bug.priority) FILTER html %]</td>
       </tr><tr class="bz_feed_severity">
         <td>[% columns.bug_severity.title FILTER html %] </td>
-        <td>[% bug.bug_severity FILTER html %]</td>
+        <td>[% display_value("bug_severity", bug.bug_severity) FILTER html %]</td>
       [% IF Param("usetargetmilestone") %]
       </tr><tr class="bz_feed_target_milestone">
         <td>[% columns.target_milestone.title FILTER html %]</td>
index 6d7f805855a2fce29f6a049effded382a878f79d..1e9a9e998a26781b1a701bbca1e34cf17bf7e63a 100644 (file)
     [% IF shown_types.contains(desc_item.type) || debug %]
       ([% search_descs.${desc_item.type} FILTER html %])
     [% END %]
-    [% IF desc_item.field == 'bug_status' %]
-      [% FOREACH status IN desc_item.value.split(',') %]
-        [%+ display_value("bug_status", status) FILTER html %][% ',' UNLESS loop.last %]
-      [% END %]
-    [% ELSIF desc_item.field == 'resolution' %]
-      [% FOREACH resolution IN desc_item.value.split(',') %]
-        [%+ display_value("resolution", resolution) FILTER html %][% ',' UNLESS loop.last %]
-      [% END %]
-    [% ELSE %]
-      [%+ desc_item.value FILTER html %]
+    [% FOREACH val IN desc_item.value.split(',') %]
+      [%+ display_value(desc_item.field, val) FILTER html %][% ',' UNLESS loop.last %]
     [% END %]
     [% IF debug %]
       (<code>[% desc_item.term FILTER html %]</code>)
index 6ca90b921ba26a4b493a2c6afa85ae06254cbecc..f6a871e199cddf2800a636815549bbd13292f73c 100644 (file)
     [% FOREACH column = displaycolumns %]
     <td [% 'style="white-space: nowrap"' IF NOT abbrev.$column.wrap %]>
       [% IF abbrev.$column.maxlength %]
-        <span title="
-          [%- IF column == 'bug_status' %]
-            [%- display_value("bug_status", bug.$column) FILTER html %]
-          [% ELSIF column == 'resolution' %]
-            [%- display_value("resolution", bug.$column) FILTER html %]
-          [% ELSE %]
-            [%- bug.$column FILTER html %]
-          [% END %]">
+        <span title="[%- display_value(column, bug.$column) FILTER html %]">
       [% END %]
       [% IF abbrev.$column.format_value %] 
         [%- bug.$column FILTER format(abbrev.$column.format_value) FILTER html -%] 
                column == 'remaining_time' ||
                column == 'estimated_time' %]
         [% PROCESS formattimeunit time_unit=bug.$column %] 
-      [% ELSIF column == 'bug_status' %]
-        [%- display_value("bug_status", bug.$column).truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html %]
-      [% ELSIF column == 'resolution' %]
-        [%- display_value("resolution", bug.$column).truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html %]
-
       [%# Display the login name of the user if their real name is empty. %]
       [% ELSIF column.match('_realname$') && bug.$column == '' %]
         [% SET login_column = column.remove('_realname$') %]
                                         abbrev.$column.ellipsis) FILTER html %]
 
       [% ELSE %]
-        [%- bug.$column.truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html -%]
+        [%- display_value(column, bug.$column).truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html -%]
       [% END %]
       [% IF abbrev.$column.maxlength %]
         </span>
index 035876bb13fce331a9bf3a747e4435c8498ec6c3..ec997be0a43e83d465618b29aeffbe20d8e32f57 100644 (file)
@@ -78,8 +78,8 @@ no-one else appears to have reported it, then:</p>
           it?
     (e.g. Linux, Windows XP, Mac OS X.)<br>
     If you know the [% terms.bug %] happens on more than one type of 
-    operating system, choose "All"
-    If your OS isn't listed, choose Other.</p>
+    operating system, choose <em>[% display_value("op_sys", "All") FILTER html %]</em>
+    If your OS isn't listed, choose <em>[% display_value("op_sys", "Other") FILTER html %]</em>.</p>
 
     <p><b>Summary:</b> How would you describe the [% terms.bug %], in 
     approximately 60 or fewer characters?<br>
index 9e938bbcb0e4016a2424f7df74b4450349473237..5be28cab702f4cd280ba36a3fa7afc9aa80f15c2 100644 (file)
@@ -19,7 +19,6 @@
   #                 Gervase Markham <gerv@gerv.net>
   #%]
 
-[% PROCESS global/variables.none.tmpl %]
 [% PROCESS "global/field-descs.none.tmpl" %]
 [% INCLUDE global/header.html.tmpl title = "A $terms.Bug's Life Cycle" %]
 
@@ -221,46 +220,46 @@ This field describes the impact of [% terms.abug %].
 
 <table>
   <tr>
-    <th>Blocker</th>
+    <th>[% display_value("bug_severity", "blocker") FILTER html %]</th>
 
     <td>Blocks development and/or testing work</td>
   </tr>
 
   <tr>
-    <th>Critical</th>
+    <th>[% display_value("bug_severity", "critical") FILTER html %]</th>
 
     <td>crashes, loss of data, severe memory leak</td>
   </tr>
 
   <tr>
-    <th>Major</th>
+    <th>[% display_value("bug_severity", "major") FILTER html %]</th>
 
     <td>major loss of function</td>
   </tr>
 
   <tr>
-    <th>Normal</th>
+    <th>[% display_value("bug_severity", "normal") FILTER html %]</th>
 
     <td>regular issue, some loss of functionality under specific circumstances</td>
   </tr>
 
 
   <tr>
-    <th>Minor</th>
+    <th>[% display_value("bug_severity", "minor") FILTER html %]</th>
 
     <td>minor loss of function, or other problem where easy
     workaround is present</td>
   </tr>
 
   <tr>
-    <th>Trivial</th>
+    <th>[% display_value("bug_severity", "trivial") FILTER html %]</th>
 
     <td>cosmetic problem like misspelled words or misaligned
     text</td>
   </tr>
 
   <tr>
-    <th>Enhancement</th>
+    <th>[% display_value("bug_severity", "enhancement") FILTER html %]</th>
 
     <td>Request for enhancement</td>
 </table>
@@ -270,23 +269,25 @@ This is the hardware platform against which the [% terms.bug %] was
 reported. Legal platforms include: 
 
 <ul>
-  <li>All (happens on all platforms; cross-platform [% terms.bug %])</li>
+  <li>[% display_value("rep_platform", "All") FILTER html %] (happens on all platforms; cross-platform [% terms.bug %])</li>
 
-  <li>Macintosh</li>
+  <li>[% display_value("rep_platform", "Macintosh") FILTER html %]</li>
 
-  <li>PC</li>
+  <li>[% display_value("rep_platform", "PC") FILTER html %]</li>
 </ul>
-<b>Note:</b> When searching, selecting the option "All" does not 
+<b>Note:</b> When searching, selecting the option 
+<em>[% display_value("rep_platform", "All") FILTER html %]</em> does not 
 select [% terms.bugs %]
 assigned against any platform. It merely selects [% terms.bugs %] that are
-marked as occurring on all platforms, i.e. are designated "All". 
+marked as occurring on all platforms, i.e. are designated 
+<em>[% display_value("rep_platform", "All") FILTER html %]</em>. 
 
 <h2><a name="op_sys">Operating System</a></h2>
 This is the operating system against which the [% terms.bug %] was
 reported. Legal operating systems include: 
 
 <ul>
-  <li>All (happens on all operating systems; cross-platform
+  <li>[% display_value("op_sys", "All") FILTER html %] (happens on all operating systems; cross-platform
   [% terms.bug %])</li>
 
   <li>Windows</li>
index f651a7fd43cc4c5f3241f9e3622508e2b79d6e2d..8950f340ab6eeb9b9ae872d7ef7e3f3de13a9b4d 100644 (file)
           <td><center>[% bug.delta %]</center></td>
 
           <td>[% bug.component FILTER html %]</td>
-          <td><center>[% bug.bug_severity FILTER html %]</center></td>
-          <td><center>[% bug.op_sys FILTER html %]</center></td>
-          <td><center>[% bug.target_milestone FILTER html %]</center></td>
+          <td><center>[% display_value("bug_severity",     bug.bug_severity    ) FILTER html %]</center></td>
+          <td><center>[% display_value("op_sys",           bug.op_sys          ) FILTER html %]</center></td>
+          <td><center>[% display_value("target_milestone", bug.target_milestone) FILTER html %]</center></td>
           <td>[% bug.short_desc FILTER html %]</td>
         </tr>
       [% END %]
index cb9fab24f27322f08a99d5c46fba02830ea582b6..649fba42616cf93aed886e76630d12f591e6fdef 100644 (file)
 
 [% col_field_disp = field_descs.$col_field || col_field %]
 
-[% IF col_field == 'bug_status' %]
-  [% FOR i IN [ 0 .. data.0.0.max ] %]
-    [% data.0.0.$i = display_value("bug_status", data.0.0.$i) %]
-  [% END %]
+[% FOR i IN [ 0 .. data.0.0.max ] %]
+  [% data.0.0.$i = display_value(col_field, data.0.0.$i) %]
 [% END %]
 
-[% IF col_field == 'resolution' %]
-  [% FOR i IN [ 0 .. data.0.0.max ] %]
-    [% data.0.0.$i = display_value("resolution", data.0.0.$i) %]
-  [% END %]
-[% END %]
-
-[% IF row_field == 'bug_status' %]
-  [% FOR i IN [ 0 .. row_names.max ] %]
-    [% row_names.$i = display_value("bug_status", row_names.$i) %]
-  [% END %]
-[% END %]
-
-[% IF row_field == 'resolution' %]
-  [% FOR i IN [ 0 .. row_names.max ] %]
-    [% row_names.$i = display_value("resolution", row_names.$i) %]
-  [% END %]
+[% FOR i IN [ 0 .. row_names.max ] %]
+  [% row_names.$i = display_value(row_field, row_names.$i) %]
 [% END %]
 
 [% FILTER null;
index fc8b418af6657b6875342d08ea93b41b16816723..0edc0fee7692a77f6275182fd5ad20e2d102f34f 100644 (file)
 
 [% col_field_disp = field_descs.$col_field || col_field %]
 
-[% IF col_field == 'bug_status' %]
-  [% FOR i IN [ 0 .. data.0.0.max ] %]
-    [% data.0.0.$i = display_value("bug_status", data.0.0.$i) %]
-  [% END %]
+[% FOR i IN [ 0 .. data.0.0.max ] %]
+  [% data.0.0.$i = display_value(col_field, data.0.0.$i) %]
 [% END %]
 
-[% IF col_field == 'resolution' %]
-  [% FOR i IN [ 0 .. data.0.0.max ] %]
-    [% data.0.0.$i = display_value("resolution", data.0.0.$i) %]
-  [% END %]
-[% END %]
-
-[% IF row_field == 'bug_status' %]
-  [% FOR i IN [ 0 .. row_names.max ] %]
-    [% row_names.$i = display_value("bug_status", row_names.$i) %]
-  [% END %]
-[% END %]
-
-[% IF row_field == 'resolution' %]
-  [% FOR i IN [ 0 .. row_names.max ] %]
-    [% row_names.$i = display_value("resolution", row_names.$i) %]
-  [% END %]
+[% FOR i IN [ 0 .. row_names.max ] %]
+  [% row_names.$i = display_value(row_field, row_names.$i) %]
 [% END %]
 
 [% IF cumulate %]
index 05a359032b78ffb7dd835d063be89d3d42e88d67..27f5525dd4d3cb23de86e1ad70c1cc7380464717 100644 (file)
 
 [% col_field_disp = field_descs.$col_field || col_field %]
 
-[% IF col_field == 'bug_status' %]
-  [% FOR i IN [ 0 .. data.0.0.max ] %]
-    [% data.0.0.$i = display_value("bug_status", data.0.0.$i) %]
-  [% END %]
-[% END %]
-
-[% IF col_field == 'resolution' %]
-  [% FOR i IN [ 0 .. data.0.0.max ] %]
-    [% data.0.0.$i = display_value("resolution", data.0.0.$i) %]
-  [% END %]
+[% FOR i IN [ 0 .. data.0.0.max ] %]
+  [% data.0.0.$i = display_value(col_field, data.0.0.$i) %]
 [% END %]
 
 [% FILTER null;
index 3694b9b35c13d11b47877d5edaa7c65d51acee25..4d8b50a859bc827bfda57b12ac5893900cc403d3 100644 (file)
 [% END %]
 
 [% BLOCK value_display %]
-  [% SET disp_value = value %]
-  [% IF field == 'bug_status' %]
-    [% SET disp_value = display_value("bug_status", value) %]
-  [% ELSIF field == 'resolution' %]
-    [% SET disp_value = display_value("resolution", value) %]
-  [% ELSIF field == 'assigned_to' OR field == 'reporter'
+  [% SET disp_value = display_value(field, value) %]
+  [% IF field == 'assigned_to' OR field == 'reporter'
            OR field == 'qa_contact'
   %]
     [% disp_value = value FILTER email %]
index 6c0abe4d303b5d31d13e810c5c56a21680d82d8b..76b80f893ec5b2c00c1e4137cd6c021e87073cc1 100644 (file)
 </table>
 
 [% BLOCK value_display %]
-  [% SET disp_value = value %]
-  [% IF field == 'bug_status' %]
-    [% SET disp_value = display_value("bug_status", value) %]
-  [% ELSIF field == 'resolution' %]
-    [% SET disp_value = display_value("resolution", value) %]
-  [% ELSIF field == 'assigned_to' OR field == 'reporter'
+  [% SET disp_value = display_value(field, value) %]
+  [% IF field == 'assigned_to' OR field == 'reporter'
            OR field == 'qa_contact'
   %]
     [% disp_value = value FILTER email %]
index c52f5dcc56a0848fac25141f430782e78370ab4f..07ab43c702ee858a845c49e50dc2419fe308da1e 100644 (file)
@@ -617,19 +617,11 @@ function doOnSelectProduct(selectmode) {
         [%# This only applies for Resolution really %]
           <option value="[% value.name OR '---' FILTER html %]"
             [% " selected" IF lsearch(default.${sel.name}, value.name) != -1 %]>
-            [% IF sel.name == "bug_status" %]
-              [% display_value("bug_status", value.name) FILTER html %]
-            [% ELSIF sel.name == "resolution" %]
-              [%# Again, resolution has that odd empty value. Replace it with '---' %]
-              [% display_value("resolution", value.name) OR '---' FILTER html %]
-            [% ELSE %]
-              [% value.name FILTER html %]
-            [% END %]
-          </option>
+            [% display_value(sel.name, value.name) FILTER html %]
         [% ELSE %]
           <option value="[% value OR '---' FILTER html %]"
             [% " selected" IF lsearch(default.${sel.name}, value) != -1 %]>
-              [% value FILTER html %]
+            [% display_value(sel.name, value) FILTER html %]
           </option>
         [% END %]
       [% END %]
index d25bcd4ddbf64e4dd6c0b9f75ae4f8d2e1e04d5a..cd432514f98b9de984b28934e14f9933604394f1 100644 (file)
@@ -78,9 +78,9 @@
       <tr>
         <td align="left"><a href="[%+ urlbase FILTER html %]show_bug.cgi?id=
             [%- bug.bug_id %]">[% bug.bug_id %]</a></td>
-        <td align="left">[% bug.bug_severity FILTER html %]</td>
-        <td align="left">[% bug.priority FILTER html %]</td>
-        <td align="left">[% bug.rep_platform FILTER html %]</td>
+        <td align="left">[% display_value("bug_severity", bug.bug_severity) FILTER html %]</td>
+        <td align="left">[% display_value("priority", bug.priority) FILTER html %]</td>
+        <td align="left">[% display_value("rep_platform", bug.rep_platform) FILTER html %]</td>
         <td align="left">[% bug.$assignee_login_string FILTER html %]</td>
         <td align="left">[% display_value("bug_status", bug.bug_status) FILTER html %]</td>
         <td align="left">[% display_value("resolution", bug.resolution) FILTER html %]</td>
index 6df8d4346dc67e5733499111f4afc31002e4ab88..41508130275080efb10c4cc2eab84a8865fe683d 100644 (file)
@@ -53,9 +53,9 @@
  [% FOREACH bug=query.bugs %]
   [% terms.Bug +%] [%+ bug.bug_id %]:
   [%+ urlbase %]show_bug.cgi?id=[% bug.bug_id +%]
-  Priority: [%+ bug.priority -%]
-  Severity: [%+ bug.bug_severity -%]
-  Platform: [%+ bug.rep_platform %]
+  Priority: [%+ display_value("priority", bug.priority) -%]
+  Severity: [%+ display_value("bug_severity", bug.bug_severity) -%]
+  Platform: [%+ display_value("rep_platform", bug.rep_platform) %]
   Assignee: [%+ bug.$assignee_login_string %]
     Status: [%+ display_value("bug_status", bug.bug_status) %]
             [%- IF bug.resolution -%] Resolution: [% display_value("resolution", bug.resolution) -%]