Commit a44e1524 authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 519142: Replace IF/ELSE statements about bug_status/resolution with just a…

Bug 519142: Replace IF/ELSE statements about bug_status/resolution with just a display_value call, and use display_value in more places to translate field values. Patch by Vitaly Fedrushkov <vitaly.fedrushkov@gmail.com> r=mkanat, a=mkanat
parent bc19f61c
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
# panel: hash representing the current panel. # panel: hash representing the current panel.
#%] #%]
[% PROCESS "global/field-descs.none.tmpl" %]
[% sortlist_separator = '---' %] [% sortlist_separator = '---' %]
<dl> <dl>
...@@ -115,7 +117,17 @@ ...@@ -115,7 +117,17 @@
[% FOREACH item = param.choices %] [% FOREACH item = param.choices %]
<option value="[% item FILTER html %]" <option value="[% item FILTER html %]"
[% " selected=\"selected\"" IF item == Param(param.name) %]> [% " 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> </option>
[% END %] [% END %]
</select> </select>
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<th>&nbsp;</th> <th>&nbsp;</th>
[% FOREACH status = statuses %] [% FOREACH status = statuses %]
<th class="col-header[% status.is_open ? " open-status" : " closed-status" %]"> <th class="col-header[% status.is_open ? " open-status" : " closed-status" %]">
[% status.name FILTER html %] [% display_value("bug_status", status.name) FILTER html %]
</th> </th>
[% END %] [% END %]
</tr> </tr>
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
[% FOREACH status = p.merge(statuses) %] [% FOREACH status = p.merge(statuses) %]
<tr class="highlight"> <tr class="highlight">
<th align="right" class="[% status.is_open ? "open-status" : "closed-status" %]"> <th align="right" class="[% status.is_open ? "open-status" : "closed-status" %]">
[% status.name FILTER html %] [% display_value("bug_status", status.name) FILTER html %]
</th> </th>
[% FOREACH new_status = statuses %] [% FOREACH new_status = statuses %]
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<th>&nbsp;</th> <th>&nbsp;</th>
[% FOREACH status = statuses %] [% FOREACH status = statuses %]
<th class="col-header[% status.is_open ? " open-status" : " closed-status" %]"> <th class="col-header[% status.is_open ? " open-status" : " closed-status" %]">
[% status.name FILTER html %] [% display_value("bug_status", status.name) FILTER html %]
</th> </th>
[% END %] [% END %]
</tr> </tr>
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
[% FOREACH status = p.merge(statuses) %] [% FOREACH status = p.merge(statuses) %]
<tr class="highlight"> <tr class="highlight">
<th align="right" class="[% status.is_open ? "open-status" : "closed-status" %]"> <th align="right" class="[% status.is_open ? "open-status" : "closed-status" %]">
[% status.name FILTER html %] [% display_value("bug_status", status.name) FILTER html %]
</th> </th>
[% FOREACH new_status = statuses %] [% FOREACH new_status = statuses %]
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
<p> <p>
When [% terms.abug %] is marked as a duplicate of another one or is moved 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 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 this [% terms.bug %] status must then be valid (this is the reason why you cannot edit
them above).<br> them above).<br>
Note: you can change this setting by visiting the Note: you can change this setting by visiting the
......
...@@ -80,15 +80,11 @@ ...@@ -80,15 +80,11 @@
change.fieldname == 'remaining_time' || change.fieldname == 'remaining_time' ||
change.fieldname == 'work_time' %] change.fieldname == 'work_time' %]
[% PROCESS formattimeunit time_unit=change.removed %] [% 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' || [% ELSIF change.fieldname == 'blocked' ||
change.fieldname == 'dependson' %] change.fieldname == 'dependson' %]
[% change.removed FILTER bug_list_link FILTER none %] [% change.removed FILTER bug_list_link FILTER none %]
[% ELSE %] [% ELSE %]
[% change.removed FILTER email FILTER html %] [% display_value(change.fieldname, change.removed) FILTER email FILTER html %]
[% END %] [% END %]
[% ELSE %] [% ELSE %]
&nbsp; &nbsp;
...@@ -100,15 +96,11 @@ ...@@ -100,15 +96,11 @@
change.fieldname == 'remaining_time' || change.fieldname == 'remaining_time' ||
change.fieldname == 'work_time' %] change.fieldname == 'work_time' %]
[% PROCESS formattimeunit time_unit=change.added %] [% 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' || [% ELSIF change.fieldname == 'blocked' ||
change.fieldname == 'dependson' %] change.fieldname == 'dependson' %]
[% change.added FILTER bug_list_link FILTER none %] [% change.added FILTER bug_list_link FILTER none %]
[% ELSE %] [% ELSE %]
[% change.added FILTER email FILTER html %] [% display_value(change.fieldname, change.added) FILTER email FILTER html %]
[% END %] [% END %]
[% ELSE %] [% ELSE %]
&nbsp; &nbsp;
......
...@@ -664,11 +664,8 @@ TUI_hide_default('expert_fields'); ...@@ -664,11 +664,8 @@ TUI_hide_default('expert_fields');
[%- FOREACH x = ${sel.name} %] [%- FOREACH x = ${sel.name} %]
<option value="[% x FILTER html %]" <option value="[% x FILTER html %]"
[% " selected=\"selected\"" IF x == default.${sel.name} %]> [% " selected=\"selected\"" IF x == default.${sel.name} %]>
[% IF sel.name == "bug_status" %] [% display_value(sel.name, x) FILTER html %]
[% display_value("bug_status", x) FILTER html %] </option>
[% ELSE %]
[% x FILTER html %]
[% END %]</option>
[% END %] [% END %]
</select> </select>
......
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
<tr> <tr>
<th>[% field_descs.bug_severity FILTER html %]:</th> <th>[% field_descs.bug_severity FILTER html %]:</th>
<td class="bz_[% bug.bug_severity FILTER css_class_quote -%]"> <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> </td>
[% PROCESS rightcell %] [% PROCESS rightcell %]
...@@ -301,7 +301,7 @@ ...@@ -301,7 +301,7 @@
[% BLOCK row %] [% BLOCK row %]
<tr> <tr>
<th>[% field_descs.${cell} FILTER html %]:</th> <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 %] [% PROCESS rightcell IF !fullrow %]
</tr> </tr>
[% fullrow = 0 %] [% fullrow = 0 %]
...@@ -357,7 +357,7 @@ ...@@ -357,7 +357,7 @@
</td> </td>
[% ELSIF name != "" %] [% ELSIF name != "" %]
<th class="rightcell">[% field_descs.${name} FILTER html %]:</th> <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 %] [% ELSE %]
<td>&nbsp;</td> <td>&nbsp;</td>
<td>&nbsp;</td> <td>&nbsp;</td>
......
...@@ -327,7 +327,7 @@ ...@@ -327,7 +327,7 @@
A valid quipid is needed. A valid quipid is needed.
[% ELSIF error == "no_manual_moved" %] [% 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 %]. moving the [% terms.bug %].
[% ELSIF error == "no_open_bug_status" %] [% ELSIF error == "no_open_bug_status" %]
......
...@@ -146,6 +146,7 @@ ...@@ -146,6 +146,7 @@
}, },
"resolution" => { "resolution" => {
"" => "---",
# "FIXED" => "NO LONGER AN ISSUE", # "FIXED" => "NO LONGER AN ISSUE",
# "MOVED" => "BYE-BYE", # "MOVED" => "BYE-BYE",
}, },
......
...@@ -368,7 +368,7 @@ ...@@ -368,7 +368,7 @@
</option> </option>
[% FOREACH menuitem = menuitems %] [% FOREACH menuitem = menuitems %]
[% IF property %][% menuitem = menuitem.$property %][% END %] [% 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 %] [% END %]
</select> </select>
[% END %] [% END %]
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
# This is a template for generating an Atom representation of a buglist. # 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" %] [% DEFAULT title = "$terms.Bugzilla $terms.Bugs" %]
...@@ -71,16 +71,16 @@ ...@@ -71,16 +71,16 @@
<td>[% bug.reporter_realname FILTER html %]</td> <td>[% bug.reporter_realname FILTER html %]</td>
</tr><tr class="bz_feed_bug_status"> </tr><tr class="bz_feed_bug_status">
<td>[% columns.bug_status.title FILTER html %]</td> <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"> </tr><tr class="bz_feed_resolution">
<td>[% columns.resolution.title FILTER html %] </td> <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"> </tr><tr class="bz_feed_priority">
<td>[% columns.priority.title FILTER html %]</td> <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"> </tr><tr class="bz_feed_severity">
<td>[% columns.bug_severity.title FILTER html %] </td> <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") %] [% IF Param("usetargetmilestone") %]
</tr><tr class="bz_feed_target_milestone"> </tr><tr class="bz_feed_target_milestone">
<td>[% columns.target_milestone.title FILTER html %]</td> <td>[% columns.target_milestone.title FILTER html %]</td>
......
...@@ -91,16 +91,8 @@ ...@@ -91,16 +91,8 @@
[% IF shown_types.contains(desc_item.type) || debug %] [% IF shown_types.contains(desc_item.type) || debug %]
([% search_descs.${desc_item.type} FILTER html %]) ([% search_descs.${desc_item.type} FILTER html %])
[% END %] [% END %]
[% IF desc_item.field == 'bug_status' %] [% FOREACH val IN desc_item.value.split(',') %]
[% FOREACH status IN desc_item.value.split(',') %] [%+ display_value(desc_item.field, val) FILTER html %][% ',' UNLESS loop.last %]
[%+ 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 %]
[% END %] [% END %]
[% IF debug %] [% IF debug %]
(<code>[% desc_item.term FILTER html %]</code>) (<code>[% desc_item.term FILTER html %]</code>)
......
...@@ -201,14 +201,7 @@ ...@@ -201,14 +201,7 @@
[% FOREACH column = displaycolumns %] [% FOREACH column = displaycolumns %]
<td [% 'style="white-space: nowrap"' IF NOT abbrev.$column.wrap %]> <td [% 'style="white-space: nowrap"' IF NOT abbrev.$column.wrap %]>
[% IF abbrev.$column.maxlength %] [% IF abbrev.$column.maxlength %]
<span title=" <span title="[%- display_value(column, bug.$column) FILTER html %]">
[%- 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 %]">
[% END %] [% END %]
[% IF abbrev.$column.format_value %] [% IF abbrev.$column.format_value %]
[%- bug.$column FILTER format(abbrev.$column.format_value) FILTER html -%] [%- bug.$column FILTER format(abbrev.$column.format_value) FILTER html -%]
...@@ -216,11 +209,6 @@ ...@@ -216,11 +209,6 @@
column == 'remaining_time' || column == 'remaining_time' ||
column == 'estimated_time' %] column == 'estimated_time' %]
[% PROCESS formattimeunit time_unit=bug.$column %] [% 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. %] [%# Display the login name of the user if their real name is empty. %]
[% ELSIF column.match('_realname$') && bug.$column == '' %] [% ELSIF column.match('_realname$') && bug.$column == '' %]
[% SET login_column = column.remove('_realname$') %] [% SET login_column = column.remove('_realname$') %]
...@@ -228,7 +216,7 @@ ...@@ -228,7 +216,7 @@
abbrev.$column.ellipsis) FILTER html %] abbrev.$column.ellipsis) FILTER html %]
[% ELSE %] [% 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 %] [% END %]
[% IF abbrev.$column.maxlength %] [% IF abbrev.$column.maxlength %]
</span> </span>
......
...@@ -78,8 +78,8 @@ no-one else appears to have reported it, then:</p> ...@@ -78,8 +78,8 @@ no-one else appears to have reported it, then:</p>
it? it?
(e.g. Linux, Windows XP, Mac OS X.)<br> (e.g. Linux, Windows XP, Mac OS X.)<br>
If you know the [% terms.bug %] happens on more than one type of If you know the [% terms.bug %] happens on more than one type of
operating system, choose "All". operating system, choose <em>[% display_value("op_sys", "All") FILTER html %]</em>.
If your OS isn't listed, choose Other.</p> 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 <p><b>Summary:</b> How would you describe the [% terms.bug %], in
approximately 60 or fewer characters?<br> approximately 60 or fewer characters?<br>
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
# Gervase Markham <gerv@gerv.net> # Gervase Markham <gerv@gerv.net>
#%] #%]
[% PROCESS global/variables.none.tmpl %]
[% PROCESS "global/field-descs.none.tmpl" %] [% PROCESS "global/field-descs.none.tmpl" %]
[% INCLUDE global/header.html.tmpl title = "A $terms.Bug's Life Cycle" %] [% INCLUDE global/header.html.tmpl title = "A $terms.Bug's Life Cycle" %]
...@@ -221,46 +220,46 @@ This field describes the impact of [% terms.abug %]. ...@@ -221,46 +220,46 @@ This field describes the impact of [% terms.abug %].
<table> <table>
<tr> <tr>
<th>Blocker</th> <th>[% display_value("bug_severity", "blocker") FILTER html %]</th>
<td>Blocks development and/or testing work</td> <td>Blocks development and/or testing work</td>
</tr> </tr>
<tr> <tr>
<th>Critical</th> <th>[% display_value("bug_severity", "critical") FILTER html %]</th>
<td>crashes, loss of data, severe memory leak</td> <td>crashes, loss of data, severe memory leak</td>
</tr> </tr>
<tr> <tr>
<th>Major</th> <th>[% display_value("bug_severity", "major") FILTER html %]</th>
<td>major loss of function</td> <td>major loss of function</td>
</tr> </tr>
<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> <td>regular issue, some loss of functionality under specific circumstances</td>
</tr> </tr>
<tr> <tr>
<th>Minor</th> <th>[% display_value("bug_severity", "minor") FILTER html %]</th>
<td>minor loss of function, or other problem where easy <td>minor loss of function, or other problem where easy
workaround is present</td> workaround is present</td>
</tr> </tr>
<tr> <tr>
<th>Trivial</th> <th>[% display_value("bug_severity", "trivial") FILTER html %]</th>
<td>cosmetic problem like misspelled words or misaligned <td>cosmetic problem like misspelled words or misaligned
text</td> text</td>
</tr> </tr>
<tr> <tr>
<th>Enhancement</th> <th>[% display_value("bug_severity", "enhancement") FILTER html %]</th>
<td>Request for enhancement</td> <td>Request for enhancement</td>
</table> </table>
...@@ -270,23 +269,25 @@ This is the hardware platform against which the [% terms.bug %] was ...@@ -270,23 +269,25 @@ This is the hardware platform against which the [% terms.bug %] was
reported. Legal platforms include: reported. Legal platforms include:
<ul> <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> </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 %] select [% terms.bugs %]
assigned against any platform. It merely selects [% terms.bugs %] that are 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> <h2><a name="op_sys">Operating System</a></h2>
This is the operating system against which the [% terms.bug %] was This is the operating system against which the [% terms.bug %] was
reported. Legal operating systems include: reported. Legal operating systems include:
<ul> <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> [% terms.bug %])</li>
<li>Windows</li> <li>Windows</li>
......
...@@ -127,9 +127,9 @@ ...@@ -127,9 +127,9 @@
<td><center>[% bug.delta %]</center></td> <td><center>[% bug.delta %]</center></td>
<td>[% bug.component FILTER html %]</td> <td>[% bug.component FILTER html %]</td>
<td><center>[% bug.bug_severity FILTER html %]</center></td> <td><center>[% display_value("bug_severity", bug.bug_severity ) FILTER html %]</center></td>
<td><center>[% bug.op_sys FILTER html %]</center></td> <td><center>[% display_value("op_sys", bug.op_sys ) FILTER html %]</center></td>
<td><center>[% bug.target_milestone FILTER html %]</center></td> <td><center>[% display_value("target_milestone", bug.target_milestone) FILTER html %]</center></td>
<td>[% bug.short_desc FILTER html %]</td> <td>[% bug.short_desc FILTER html %]</td>
</tr> </tr>
[% END %] [% END %]
......
...@@ -26,28 +26,12 @@ ...@@ -26,28 +26,12 @@
[% col_field_disp = field_descs.$col_field || col_field %] [% col_field_disp = field_descs.$col_field || col_field %]
[% IF col_field == 'bug_status' %] [% FOR i IN [ 0 .. data.0.0.max ] %]
[% FOR i IN [ 0 .. data.0.0.max ] %] [% data.0.0.$i = display_value(col_field, data.0.0.$i) %]
[% data.0.0.$i = display_value("bug_status", data.0.0.$i) %]
[% END %]
[% END %] [% END %]
[% IF col_field == 'resolution' %] [% FOR i IN [ 0 .. row_names.max ] %]
[% FOR i IN [ 0 .. data.0.0.max ] %] [% row_names.$i = display_value(row_field, row_names.$i) %]
[% 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 %]
[% END %] [% END %]
[% FILTER null; [% FILTER null;
......
...@@ -26,28 +26,12 @@ ...@@ -26,28 +26,12 @@
[% col_field_disp = field_descs.$col_field || col_field %] [% col_field_disp = field_descs.$col_field || col_field %]
[% IF col_field == 'bug_status' %] [% FOR i IN [ 0 .. data.0.0.max ] %]
[% FOR i IN [ 0 .. data.0.0.max ] %] [% data.0.0.$i = display_value(col_field, data.0.0.$i) %]
[% data.0.0.$i = display_value("bug_status", data.0.0.$i) %]
[% END %]
[% END %] [% END %]
[% IF col_field == 'resolution' %] [% FOR i IN [ 0 .. row_names.max ] %]
[% FOR i IN [ 0 .. data.0.0.max ] %] [% row_names.$i = display_value(row_field, row_names.$i) %]
[% 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 %]
[% END %] [% END %]
[% IF cumulate %] [% IF cumulate %]
......
...@@ -22,16 +22,8 @@ ...@@ -22,16 +22,8 @@
[% col_field_disp = field_descs.$col_field || col_field %] [% col_field_disp = field_descs.$col_field || col_field %]
[% IF col_field == 'bug_status' %] [% FOR i IN [ 0 .. data.0.0.max ] %]
[% FOR i IN [ 0 .. data.0.0.max ] %] [% data.0.0.$i = display_value(col_field, data.0.0.$i) %]
[% 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 %]
[% END %] [% END %]
[% FILTER null; [% FILTER null;
......
...@@ -67,12 +67,8 @@ ...@@ -67,12 +67,8 @@
[% END %] [% END %]
[% BLOCK value_display %] [% BLOCK value_display %]
[% SET disp_value = value %] [% SET disp_value = display_value(field, value) %]
[% IF field == 'bug_status' %] [% IF field == 'assigned_to' OR field == 'reporter'
[% 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'
OR field == 'qa_contact' OR field == 'qa_contact'
%] %]
[% disp_value = value FILTER email %] [% disp_value = value FILTER email %]
......
...@@ -154,12 +154,8 @@ ...@@ -154,12 +154,8 @@
</table> </table>
[% BLOCK value_display %] [% BLOCK value_display %]
[% SET disp_value = value %] [% SET disp_value = display_value(field, value) %]
[% IF field == 'bug_status' %] [% IF field == 'assigned_to' OR field == 'reporter'
[% 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'
OR field == 'qa_contact' OR field == 'qa_contact'
%] %]
[% disp_value = value FILTER email %] [% disp_value = value FILTER email %]
......
...@@ -617,19 +617,11 @@ function doOnSelectProduct(selectmode) { ...@@ -617,19 +617,11 @@ function doOnSelectProduct(selectmode) {
[%# This only applies for Resolution really %] [%# This only applies for Resolution really %]
<option value="[% value.name OR '---' FILTER html %]" <option value="[% value.name OR '---' FILTER html %]"
[% " selected" IF lsearch(default.${sel.name}, value.name) != -1 %]> [% " selected" IF lsearch(default.${sel.name}, value.name) != -1 %]>
[% IF sel.name == "bug_status" %] [% display_value(sel.name, value.name) FILTER html %]
[% 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>
[% ELSE %] [% ELSE %]
<option value="[% value OR '---' FILTER html %]" <option value="[% value OR '---' FILTER html %]"
[% " selected" IF lsearch(default.${sel.name}, value) != -1 %]> [% " selected" IF lsearch(default.${sel.name}, value) != -1 %]>
[% value FILTER html %] [% display_value(sel.name, value) FILTER html %]
</option> </option>
[% END %] [% END %]
[% END %] [% END %]
......
...@@ -78,9 +78,9 @@ ...@@ -78,9 +78,9 @@
<tr> <tr>
<td align="left"><a href="[%+ urlbase FILTER html %]show_bug.cgi?id= <td align="left"><a href="[%+ urlbase FILTER html %]show_bug.cgi?id=
[%- bug.bug_id %]">[% bug.bug_id %]</a></td> [%- bug.bug_id %]">[% bug.bug_id %]</a></td>
<td align="left">[% bug.bug_severity FILTER html %]</td> <td align="left">[% display_value("bug_severity", bug.bug_severity) FILTER html %]</td>
<td align="left">[% bug.priority FILTER html %]</td> <td align="left">[% display_value("priority", bug.priority) FILTER html %]</td>
<td align="left">[% bug.rep_platform 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">[% 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("bug_status", bug.bug_status) FILTER html %]</td>
<td align="left">[% display_value("resolution", bug.resolution) FILTER html %]</td> <td align="left">[% display_value("resolution", bug.resolution) FILTER html %]</td>
......
...@@ -53,9 +53,9 @@ ...@@ -53,9 +53,9 @@
[% FOREACH bug=query.bugs %] [% FOREACH bug=query.bugs %]
[% terms.Bug +%] [%+ bug.bug_id %]: [% terms.Bug +%] [%+ bug.bug_id %]:
[%+ urlbase %]show_bug.cgi?id=[% bug.bug_id +%] [%+ urlbase %]show_bug.cgi?id=[% bug.bug_id +%]
Priority: [%+ bug.priority -%] Priority: [%+ display_value("priority", bug.priority) -%]
Severity: [%+ bug.bug_severity -%] Severity: [%+ display_value("bug_severity", bug.bug_severity) -%]
Platform: [%+ bug.rep_platform %] Platform: [%+ display_value("rep_platform", bug.rep_platform) %]
Assignee: [%+ bug.$assignee_login_string %] Assignee: [%+ bug.$assignee_login_string %]
Status: [%+ display_value("bug_status", bug.bug_status) %] Status: [%+ display_value("bug_status", bug.bug_status) %]
[%- IF bug.resolution -%] Resolution: [% display_value("resolution", bug.resolution) -%] [%- IF bug.resolution -%] Resolution: [% display_value("resolution", bug.resolution) -%]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment