summaryrefslogtreecommitdiffstats
path: root/template/en/default
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-07-07 20:16:51 +0200
committermkanat%bugzilla.org <>2009-07-07 20:16:51 +0200
commit89b15c8ff86238276de3428c379e46f7c04b6516 (patch)
tree43783cd8539a794b58ebe5b86dbfa7e43eaf143c /template/en/default
parent6a51c4c39e8ced6f808d5517d52c041d9305c2c0 (diff)
downloadbugzilla-89b15c8ff86238276de3428c379e46f7c04b6516.tar.gz
bugzilla-89b15c8ff86238276de3428c379e46f7c04b6516.tar.xz
Bug 491467: Make Search.pm and buglist.cgi consistently take column ids for the "fields" and "order" arguments, to prevent problems with using SQL fragments in the order and columnlist.
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=wicked, a=mkanat
Diffstat (limited to 'template/en/default')
-rw-r--r--template/en/default/list/table.html.tmpl28
1 files changed, 14 insertions, 14 deletions
diff --git a/template/en/default/list/table.html.tmpl b/template/en/default/list/table.html.tmpl
index ed1f3de3f..10a50b33f 100644
--- a/template/en/default/list/table.html.tmpl
+++ b/template/en/default/list/table.html.tmpl
@@ -87,11 +87,11 @@
[% END %]
<th colspan="[% splitheader ? 2 : 1 %]" class="first-child">
[% desc = '' %]
- [% IF (om = order.match("^bugs\.bug_id( desc)?")) %]
- [% desc = ' desc' IF NOT om.0 %]
+ [% IF (om = order.match("^bug_id( DESC)?")) %]
+ [% desc = ' DESC' IF NOT om.0 %]
[% END %]
<a href="buglist.cgi?
- [% urlquerypart FILTER html %]&amp;order=bugs.bug_id[% desc FILTER url_quote %]
+ [% urlquerypart FILTER html %]&amp;order=bug_id[% desc FILTER url_quote %]
[%-#%]&amp;query_based_on=
[% defaultsavename OR searchname FILTER url_quote %]">ID</a>
</th>
@@ -130,20 +130,13 @@
[% BLOCK columnheader %]
<th colspan="[% splitheader ? 2 : 1 %]">
- [% IF column.name.match('\s+AS\s+') %]
- [%# For aliased columns, use their ID for sorting. %]
- [% column.sortalias = id %]
- [% ELSE %]
- [%# Other columns may sort on their name directly. %]
- [% column.sortalias = column.name %]
- [% END %]
[% desc = '' %]
- [% IF (om = order.match("$column.sortalias( desc)?")) %]
- [% desc = ' desc' IF NOT om.0 %]
+ [% IF (om = order.match("$id( DESC)?")) %]
+ [% desc = ' DESC' IF NOT om.0 %]
[% END %]
- [% order = order.remove("$column.sortalias( desc)?,?") %]
+ [% order = order.remove("$id( DESC)?,?") %]
<a href="buglist.cgi?[% urlquerypart FILTER html %]&amp;order=
- [% column.sortalias FILTER url_quote %][% desc FILTER url_quote %]
+ [% id FILTER url_quote %][% desc FILTER url_quote %]
[% ",$order" FILTER url_quote IF order %]
[%-#%]&amp;query_based_on=
[% defaultsavename OR searchname FILTER url_quote %]">
@@ -204,6 +197,13 @@
[%- get_status(bug.$column).truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html %]
[% ELSIF column == 'resolution' %]
[%- get_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$') %]
+ [% bug.${login_column}.truncate(abbrev.$column.maxlength,
+ abbrev.$column.ellipsis) FILTER html %]
+
[% ELSE %]
[%- bug.$column.truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html -%]
[% END %]