Fix report column sorting

3col
Vitaliy Filippov 2015-07-10 17:53:06 +03:00
parent 84a118b055
commit fa514cfe14
3 changed files with 3 additions and 2 deletions

View File

@ -793,6 +793,7 @@ sub REPORT_COLUMNS
{
my $type = $field->value_type;
$columns->{$field->name} = {
id => $field->name,
name => $type->DB_TABLE.'.'.$type->NAME_FIELD,
title => $field->description,
joins => [

View File

@ -178,7 +178,7 @@ $vars->{chfield} = [
# Fields for reports
$vars->{report_columns} = [
sort { $a->{title} cmp $b->{title} }
sort { $a->{sortkey} <=> $b->{sortkey} || $a->{title} cmp $b->{title} }
values %{Bugzilla::Search::REPORT_COLUMNS()}
];

View File

@ -28,7 +28,7 @@
<select name="[% name FILTER html %]">
<option value="">&lt;none&gt;</option>
[% FOREACH field = report_columns %]
<option value="[% field.id FILTER html %]"
<option value="[% field.id FILTER html %]"
[% " selected" IF default.$name.0 == field.id %]>
[%# FIXME Take field descriptions from Bugzilla->messages->field_descs to field.description %]
[% field_descs.$field || field.title || field.id FILTER html %]</option>