Commit f3254c63 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 335790: Field names in search form lists should be ordered alphabetically -…

Bug 335790: Field names in search form lists should be ordered alphabetically - Patch by Toms Baugis <toms.baugis@gmail.com> r=wicked a=myk
parent ff51ae68
...@@ -282,6 +282,7 @@ $vars->{'bug_severity'} = \@::legal_severity; ...@@ -282,6 +282,7 @@ $vars->{'bug_severity'} = \@::legal_severity;
my @fields; my @fields;
push(@fields, { name => "noop", description => "---" }); push(@fields, { name => "noop", description => "---" });
push(@fields, $dbh->bz_get_field_defs()); push(@fields, $dbh->bz_get_field_defs());
@fields = sort {lc($a->{'description'}) cmp lc($b->{'description'})} @fields;
$vars->{'fields'} = \@fields; $vars->{'fields'} = \@fields;
# Creating new charts - if the cmd-add value is there, we define the field # Creating new charts - if the cmd-add value is there, we define the field
......
...@@ -589,11 +589,17 @@ function doOnSelectProduct(selectmode) { ...@@ -589,11 +589,17 @@ function doOnSelectProduct(selectmode) {
<label for="chfield">where one or more of the following changed</label>: <label for="chfield">where one or more of the following changed</label>:
</dt> </dt>
<dd> <dd>
<select name="chfield" id="chfield" multiple="multiple" size="4"> [%# Create array, so we can sort it by description #%]
[% chfields = [] %]
[% FOREACH field = chfield %] [% FOREACH field = chfield %]
<option value="[% field FILTER html %]" [% chfields.push({value => field, desc => (field_descs.$field || field) }) %]
[% " selected" IF lsearch(default.chfield, field) != -1 %]> [% END %]
[% (field_descs.$field || field) FILTER html %]</option>
<select name="chfield" id="chfield" multiple="multiple" size="4">
[% FOREACH field = chfields.sort('desc') %]
<option value="[% field.value FILTER html %]"
[% " selected" IF lsearch(default.chfield, field.value) != -1 %]>
[% field.desc FILTER html %]</option>
[% END %] [% END %]
</select> </select>
</dd> </dd>
......
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