Commit dbd6f8f6 authored by Simon Green's avatar Simon Green

Bug 1020821 - Product drop down orders classifications alphabetically

r=gkl, a=glob
parent a9081c21
......@@ -17,6 +17,7 @@ use Bugzilla::Hook;
use Bugzilla::Install::Requirements;
use Bugzilla::Install::Util qw(install_string template_include_path
include_languages);
use Bugzilla::Classification;
use Bugzilla::Keyword;
use Bugzilla::Util;
use Bugzilla::Error;
......@@ -1018,6 +1019,11 @@ sub create {
'css_files' => \&css_files,
yui_resolve_deps => \&yui_resolve_deps,
# All classifications (sorted by sortkey, name)
'all_classifications' => sub {
return [map { $_->name } Bugzilla::Classification->get_all()];
},
# Whether or not keywords are enabled, in this Bugzilla.
'use_keywords' => sub { return Bugzilla::Keyword->any_exist; },
......
......@@ -63,8 +63,10 @@
[% END %]
[% END %]
[% END %]
[% FOREACH c = classifications.keys.sort %]
<optgroup label="[% c FILTER html %]">
[% FOREACH c = all_classifications %]
[% NEXT UNLESS classifications.${c}.size %]
<optgroup label="[% c FILTER html %]">
[% FOREACH p = classifications.$c %]
<option value="[% p.$valueattribute FILTER html %]"
[% " selected" IF (cgi.param(name) == p.name) || (value.contains(p.name)) %]>
......
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