_bug_numbers_only($searchstring);
}
else {
+ _handle_alias($searchstring);
+
# Retain backslashes and quotes, to know which strings are quoted,
# and which ones are not.
my @words = _parse_line('\s+', 1, $searchstring);
}
}
+sub _handle_alias {
+ my $searchstring = shift;
+ if ($searchstring =~ /^([^,\s]+)$/) {
+ my $alias = $1;
+
+ # We use this direct SQL because we want quicksearch to be VERY fast.
+ my $bug_id
+ = Bugzilla->dbh->selectrow_array(q{SELECT bug_id FROM bugs WHERE alias = ?},
+ undef, $alias);
+
+ # If the user cannot see the bug or if we are using a webservice,
+ # do not resolve its alias.
+ if ($bug_id && Bugzilla->user->can_see_bug($bug_id) && !i_am_webservice()) {
+ $alias = url_quote($alias);
+ print Bugzilla->cgi->redirect(
+ -uri => Bugzilla->localconfig->{urlbase} . "show_bug.cgi?id=$alias");
+ exit;
+ }
+ }
+}
+
sub _handle_status_and_resolution {
my $word = shift;
my $legal_statuses = get_legal_field_values('bug_status');
<p>This is an overview of how to effectively use search in [% terms.Bugzilla %].
For more general information about [% terms.Bugzilla %] usage, including the jargon and
shorthand that the Mozilla commmunity uses in [% terms.bug %] discussions, please look at
- <a href="https://wiki.mozilla.org/Introduction_to_B[% %]ugzilla">Introduction to
+ <a href="https://wiki.mozilla.org/Introduction_to_B[% %]ugzilla">Introduction to
[% terms.Bugzilla %]</a> page on <a href="https://wiki.mozilla.org/">Wiki.m.o</a>.</p>
<h2 id="basics">The Basics</h2>
and [% field_descs.longdesc FILTER html %] fields for your word or words.</li>
<li>Typing just a <strong>number</strong> in the search box will take
- you directly to the [% terms.bug %] with that ID.</li>
+ you directly to the [% terms.bug %] with that ID.
+ [% IF Param('usebugaliases') %]
+ Also, just typing the <strong>alias</strong> of [% terms.abug %]
+ will take you to that [% terms.bug %].
+ [% END %]
+ </li>
<li>Adding more terms <strong>narrows down</strong> the search, it does not
expand it. (In other words, [% terms.Bugzilla %] searches for