From a50fa41f3089481e26599f8feb7218fb72efc9d2 Mon Sep 17 00:00:00 2001 From: vfilippov Date: Thu, 21 Jul 2011 13:44:45 +0000 Subject: [PATCH] Bug 81185, Bug 70605 - Fix chfield + # html_select(name, { => }, , ( + # [ { id => '; + } } else { - $values ||= [ keys %$valuenames ]; - } - for (@$values) - { - $html .= ''; + for (@$values) + { + $html .= ''; + } } $html .= ''; return $html; diff --git a/query.cgi b/query.cgi index 9dec003cc..50b20d2ab 100755 --- a/query.cgi +++ b/query.cgi @@ -173,7 +173,11 @@ if (!@{$default->{chfieldto}} || $default->{chfieldto}->[0] eq '') } # "where one or more of the following changed:" -$vars->{chfield} = [ map { $_->name } @{ Bugzilla::Search->CHANGEDFROMTO_FIELDS } ]; +$vars->{chfield} = [ + sort { $a->{name} cmp $b->{name} } + map { { id => $_->{name}, name => $_->{description} } } + @{ Bugzilla::Search->CHANGEDFROMTO_FIELDS } +]; # Boolean charts diff --git a/template/en/default/search/boolean-charts.html.tmpl b/template/en/default/search/boolean-charts.html.tmpl index 855876cd1..d46a467e3 100644 --- a/template/en/default/search/boolean-charts.html.tmpl +++ b/template/en/default/search/boolean-charts.html.tmpl @@ -10,7 +10,7 @@ # | -------------------------- | # ------------------------------ # - # If there is single term inside some AND/OR, it is shown without fieldset. + # If there is just a single term inside some AND/OR, it is shown without fieldset. # So, if the whole chart consists of a single term, the form would look like: # # "field type value [OR] [AND] [NOT] [OR]" @@ -59,8 +59,8 @@ [% FOREACH col = row %] [% J = loop.count - 1 %] [% "
" IF J %] - [% html_select("field$C-$I-$J", '', chart_fields, col.field) %] - [%- html_select("type$C-$I-$J", chart_types, lc_messages.operator_descs, col.type) + [% html_select("field$C-$I-$J", col.field, chart_fields) %] + [%- html_select("type$C-$I-$J", col.type, chart_types, lc_messages.operator_descs) %] [% END %] diff --git a/template/en/default/search/form.html.tmpl b/template/en/default/search/form.html.tmpl index 8ba30761a..412345d2d 100644 --- a/template/en/default/search/form.html.tmpl +++ b/template/en/default/search/form.html.tmpl @@ -67,7 +67,7 @@ addListener(window, 'load', function() { : - [% html_select('short_desc_type', text_types, lc_messages.operator_descs, default.short_desc_type.0) %] + [% html_select('short_desc_type', default.short_desc_type.0, text_types, lc_messages.operator_descs) %] @@ -219,7 +219,7 @@ addListener(window, 'load', function() { [% t = field.name _ '_type' %] - [% html_select(t, text_types, lc_messages.operator_descs, default.$t.0) %] + [% html_select(t, default.$t.0, text_types, lc_messages.operator_descs) %] [% keywords_types = ['allwords', 'anywords', 'nowords', 'regexp', 'notregexp'] %] - [% html_select('keywords_type', keywords_types, lc_messages.operator_descs, default.keywords_type.0) %] + [% html_select('keywords_type', default.keywords_type.0, keywords_types, lc_messages.operator_descs) %] - + [% html_select('emailtype' _ n, default.emailtype.$n, [ + { id => "exact", name => "is" }, + { id => "substring", name => "contains" }, + { id => "notequals", name => "is not" }, + { id => "regexp", name => "matches regexp" }, + { id => "notregexp", name => "doesn't match regexp" } + ]) %] @@ -492,8 +487,7 @@ addListener(window, 'load', function() { : - + votes @@ -517,25 +511,12 @@ addListener(window, 'load', function() { and -
(YYYY-MM-DD or relative dates) +
(YYYY-MM-DD or relative dates)
(user login)
:
-
- [% chfields = [] %] - [% FOREACH field = chfield %] - [% chfields.push({value => field, desc => (field_descs.$field || field) }) %] - [% END %] - - -
+
[% html_select('chfield', default.chfield, chfield, '', { multiple => 'multiple' }) %]
and :

- + [% IF userdefaultquery %]