]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 335790: Field names in search form lists should be ordered alphabetically - Patch...
authorlpsolit%gmail.com <>
Tue, 30 May 2006 02:15:56 +0000 (02:15 +0000)
committerlpsolit%gmail.com <>
Tue, 30 May 2006 02:15:56 +0000 (02:15 +0000)
query.cgi
template/en/default/search/form.html.tmpl

index 8afb327e93276ffd9e5d91cc38fb14827a792fa8..daae265d72500f470b62a585878dd2d7a0e0ec36 100755 (executable)
--- a/query.cgi
+++ b/query.cgi
@@ -282,6 +282,7 @@ $vars->{'bug_severity'} = \@::legal_severity;
 my @fields;
 push(@fields, { name => "noop", description => "---" });
 push(@fields, $dbh->bz_get_field_defs());
+@fields = sort {lc($a->{'description'}) cmp lc($b->{'description'})} @fields;
 $vars->{'fields'} = \@fields;
 
 # Creating new charts - if the cmd-add value is there, we define the field
index c3b4d8bcb65ccae892a95a4cc3309336f658e268..879625d02c2f453862bd6fb9af4fae661e73e09a 100644 (file)
@@ -589,11 +589,17 @@ function doOnSelectProduct(selectmode) {
     <label for="chfield">where one or more of the following changed</label>:
   </dt>
   <dd>
-    <select name="chfield" id="chfield" multiple="multiple" size="4">
+    [%# Create array, so we can sort it by description #%]
+    [% chfields = [] %]
     [% FOREACH field = chfield %]
-      <option value="[% field FILTER html %]"
-        [% " selected" IF lsearch(default.chfield, field) != -1 %]>
-        [% (field_descs.$field || field) FILTER html %]</option>
+      [% chfields.push({value => field, desc => (field_descs.$field || field) }) %]
+    [% END %]
+
+    <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 %]
     </select>
   </dd>