You need to sign in or sign up before continuing.
Commit e237b7e7 authored by Gervase Markham's avatar Gervase Markham Committed by Gervase Markham

Allow extensions to alter quicksearch terms and search format. r=mkanat.

parent 2a5c9e0c
...@@ -1136,6 +1136,21 @@ Params: ...@@ -1136,6 +1136,21 @@ Params:
=back =back
=head2 quicksearch_map
This hook allows you to alter the Quicksearch syntax to include e.g. special
searches for custom fields you have.
Params:
=over
=item C<map> - a hash where the key is the name you want to use in
Quicksearch, and the value is the name from the C<fielddefs> table that you
want it to map to. You can modify existing mappings or add new ones.
=back
=head2 sanitycheck_check =head2 sanitycheck_check
This hook allows for extra sanity checks to be added, for use by This hook allows for extra sanity checks to be added, for use by
......
...@@ -101,6 +101,8 @@ sub FIELD_MAP { ...@@ -101,6 +101,8 @@ sub FIELD_MAP {
status_whiteboard status_whiteboard
cclist_accessible reporter_accessible)}; cclist_accessible reporter_accessible)};
Bugzilla::Hook::process('quicksearch_map', {'map' => \%full_map} );
$cache->{quicksearch_fields} = \%full_map; $cache->{quicksearch_fields} = \%full_map;
return $cache->{quicksearch_fields}; return $cache->{quicksearch_fields};
......
...@@ -649,6 +649,14 @@ sub product_end_of_create { ...@@ -649,6 +649,14 @@ sub product_end_of_create {
} }
} }
sub quicksearch_map {
my ($self, $args) = @_;
my $map = $args->{'map'};
# This demonstrates adding a shorter alias for a long custom field name.
$map->{'impact'} = $map->{'cf_long_field_name_for_impact_field'};
}
sub sanitycheck_check { sub sanitycheck_check {
my ($self, $args) = @_; my ($self, $args) = @_;
......
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