Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
f4b9806c
Commit
f4b9806c
authored
Aug 10, 2014
by
Simon Green
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 897915 - Field lists not sorted alphabetically
r=dkl, a=sgreen
parent
a6cb5aa2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
2 deletions
+26
-2
Template.pm
Bugzilla/Template.pm
+15
-0
011pod.t
t/011pod.t
+1
-0
boolean-charts.html.tmpl
template/en/default/search/boolean-charts.html.tmpl
+9
-1
search-report-select.html.tmpl
template/en/default/search/search-report-select.html.tmpl
+1
-1
No files found.
Bugzilla/Template.pm
View file @
f4b9806c
...
...
@@ -611,6 +611,21 @@ $Template::Stash::LIST_OPS->{ clone } =
return
[
@$list
];
};
# Allow us to sort the list of fields correctly
$
Template::Stash::
LIST_OPS
->
{
sort_by_field_name
}
=
sub
{
sub
field_name
{
if
(
$_
[
0
]
eq
'noop'
)
{
# Sort --- first
return
''
;
}
# Otherwise sort by field_desc or description
return
$_
[
1
]{
$_
[
0
]}
||
$_
[
0
];
}
my
(
$list
,
$field_desc
)
=
@_
;
return
[
sort
{
lc
field_name
(
$a
,
$field_desc
)
cmp
lc
field_name
(
$b
,
$field_desc
)
}
@$list
];
};
# Allow us to still get the scalar if we use the list operation ".0" on it,
# as we often do for defaults in query.cgi and other places.
$
Template::Stash::
SCALAR_OPS
->
{
0
}
=
...
...
t/011pod.t
View file @
f4b9806c
...
...
@@ -32,6 +32,7 @@ use constant SUB_WHITELIST => (
'Bugzilla::FlagType' => qr/^sqlify_criteria$/,
'Bugzilla::JobQueue' => qr/(?:^work_once|work_until_done|subprocess_worker)$/,
'Bugzilla::Search' => qr/^SPECIAL_PARSING$/,
'Bugzilla::Template' => qr/^field_name$/,
);
# These modules do not need to be documented, generally because they
...
...
template/en/default/search/boolean-charts.html.tmpl
View file @
f4b9806c
...
...
@@ -134,7 +134,15 @@
id="f[% cond_num FILTER html %]"
onchange="fix_query_string(this)"
class="custom_search_form_field">
[% FOREACH field = fields %]
[%# Turn the array in to a hash with the name as the key %]
[%
field_hash = {};
FOREACH field IN fields;
field_hash.${field.name} = field;
END;
%]
[% FOREACH field_name = field_hash.keys.sort_by_field_name(field_descs) %]
[% field = field_hash.$field_name %]
<option value="[% field.name FILTER html %]"
[%~ ' selected="selected"' IF field.name == condition.f %]>
[% field_descs.${field.name} || field.description FILTER html %]
...
...
template/en/default/search/search-report-select.html.tmpl
View file @
f4b9806c
...
...
@@ -17,7 +17,7 @@
<select name="[% name FILTER html %]">
<option value=""><none></option>
[% FOREACH field = report_columns.keys.sort %]
[% FOREACH field = report_columns.keys.sort
_by_field_name(field_descs)
%]
[% NEXT IF field == "classification" AND !Param('useclassification') %]
[% NEXT IF field == "target_milestone" AND !Param('usetargetmilestone') %]
[% NEXT IF field == "qa_contact" AND !Param('useqacontact') %]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment