|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
Adding Custom Field drop downs to Advanced Search PageHi,
I've added several custom fields to Bugzilla, and I'd like them to appear in the 'Advanced Search' page, as searchable fields. I know that users can currently use the 'Boolean Charts' feature to search these fields, but this is inconvenient because: 1. Most users don't find this way of searching intuitive to use. 2. Even though they can search the fields, a list of available values is not displayed for them to select from. Is there a way to add these fields to the search as dropdowns? Thanks in advance, Dan |
|
|
RE: Adding Custom Field drop downs to Advanced Search Pagedsal wrote:
> I've added several custom fields to Bugzilla, and I'd like them to > appear in the 'Advanced Search' page, as searchable fields. I know > that users can currently use the 'Boolean Charts' feature to search > these fields, but this is inconvenient because: Work in being, targetted for Bugzilla 4.0, to enable that functionality. This is being handled by bug 342113. For code to do it yourself in 3.0, check out bug 398557, and add that in. Links: https://bugzilla.mozilla.org/show_bug.cgi?id=342113 https://bugzilla.mozilla.org/show_bug.cgi?id=398557 tosh _______________________________________________ support-bugzilla mailing list support-bugzilla@... https://lists.mozilla.org/listinfo/support-bugzilla PLEASE put support-bugzilla@... in the To: field when you reply. |
|
|
RE: Adding Custom Field drop downs to Advanced Search PageRegarding https://bugzilla.mozilla.org/show_bug.cgi?id=398557, I believe there is code missing from the examples. The addition to PrefillForm is missing the @cf_select definition. This leads to an internal error. Unfortunately, I can't figure out what the syntax is to add to PrefillForm. Any suggestions?
My code bombs here: [% PROCESS cf_select sel = { field_obj => field, size => 7 } %]
|
|
|
|
|
|
Re: Adding Custom Field drop downs to Advanced Search PageNot sure how I missed that, I guess I needed an extra set of eyes. Thanks.
For reference and for anyone else that needs searching of custom fields, here is the aggregated code that I ended up adding (note, only custom fields I have are drop down boxes. Additional code is required for free text or select fields. See bug referenced above for additional details): In template/en/custom/search/form.html.tmpl: [%############################################################################%] [%# Block for Custom SELECT fields #%] [%############################################################################%] [% BLOCK cf_select %] <td align="left"> <select name="[% sel.field_obj.name %]" id="[% sel.field_obj.name %]" multiple="multiple" size="[% sel.size %]"> [% FOREACH name = sel.field_obj.legal_values %] <option value="[% name FILTER html %]"> [% name FILTER html %] </option> [% END %] </select> </td> [% END %] <hr> [%# *** Custom Drop-down Fields *** %] <table> <tr> [% USE Bugzilla %] [% cf_fields = Bugzilla.get_fields({ obsolete => 0, custom => 1, type =>constants.FIELD_TYPE_SINGLE_SELECT }) %] [% IF cf_fields %] [% count = 0 %] [% FOREACH field = cf_fields %] [% count = count + 1 %] <td> <table> <tr> <th align="left"> <label for="[% field.name FILTER html %]" accesskey="a">[%field_descs.${field.name} %]</label>: </th> </tr> <tr valign="top"> [% PROCESS cf_select sel = { field_obj => field, size => 7 } %] </tr> </table> </td> [% "</tr><tr>" IF (count % 5) == 0 %] [% END %] [% END %] </tr> </table> <hr> In PrefillForm() in /var/www/html/bugzilla/query.cgi: my @cf_fields = Bugzilla::get_fields({ custom => 1, obsolete => 0 }); foreach my $field (@cf_fields) { $default{$field->name} = []; }
|
|
|
|
|
|
Re: Adding Custom Field drop downs to Advanced Search Pagedoes anybody know how to get this working in Bugzilla 3.4.1?
I can get my custom field list to appear on the Search page with its values, but when I make a selection from that list, it's not included in the search. |
| Free embeddable forum powered by Nabble | Forum Help |