]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 580490 - Quicksearch should optionally not search comments
authorDavid Lawrence <dlawrence@mozilla.com>
Fri, 18 Feb 2011 18:13:59 +0000 (13:13 -0500)
committerDavid Lawrence <dlawrence@mozilla.com>
Fri, 18 Feb 2011 18:13:59 +0000 (13:13 -0500)
r/a=mkanat

Bugzilla/Install.pm
Bugzilla/Search/Quicksearch.pm
template/en/default/global/setting-descs.none.tmpl

index 6fbaa0b751fdd385e70d2e3cb1da2f1edc433fa4..808a5069843e6e185c866fa267471345b2603d01 100644 (file)
@@ -88,6 +88,8 @@ sub SETTINGS {
                               default => 'before_comments' },
     # 2008-08-27 LpSolit@gmail.com -- Bug 182238
     timezone           => { subclass => 'Timezone', default => 'local' },
+    # 2011-02-07 dkl@mozilla.com -- Bug 580490
+    quicksearch_fulltext => { options => ['on', 'off'], default => 'on' },
     }
 };
 
index 340421bbb7ef404e97b7e1fa0ed18ddf1011b215..25850a378b08fe7abce27b45287b6f3dab3fc5a5 100644 (file)
@@ -128,7 +128,7 @@ use constant COMPONENT_EXCEPTIONS => (
 );
 
 # Quicksearch-wide globals for boolean charts.
-our ($chart, $and, $or);
+our ($chart, $and, $or, $fulltext);
 
 sub quicksearch {
     my ($searchstring) = (@_);
@@ -142,6 +142,8 @@ sub quicksearch {
     $searchstring =~ s/(^[\s,]+|[\s,]+$)//g;
     ThrowUserError('buglist_parameters_required') unless ($searchstring);
 
+    $fulltext = Bugzilla->user->settings->{'quicksearch_fulltext'}->{'value'} eq 'on' ? 1 : 0;
+
     if ($searchstring =~ m/^[0-9,\s]*$/) {
         _bug_numbers_only($searchstring);
     }
@@ -317,7 +319,7 @@ sub _handle_special_first_chars {
 
     if ($firstChar eq '#') {
         addChart('short_desc', 'substring', $baseWord, $negate);
-        addChart('content', 'matches', _matches_phrase($baseWord), $negate);
+        addChart('content', 'matches', _matches_phrase($baseWord), $negate) if $fulltext;
         return 1;
     }
     if ($firstChar eq ':') {
@@ -489,7 +491,7 @@ sub _default_quicksearch_word {
     addChart('alias', 'substring', $word, $negate);
     addChart('short_desc', 'substring', $word, $negate);
     addChart('status_whiteboard', 'substring', $word, $negate);
-    addChart('content', 'matches', _matches_phrase($word), $negate);
+    addChart('content', 'matches', _matches_phrase($word), $negate) if $fulltext;
 }
 
 sub _handle_urls {
index e96e3169d29333e3ea81bbc9ffd900a10c866f2f..54683b3603348f3e5bf57abe582578b92983e5bf 100644 (file)
@@ -48,6 +48,7 @@
    "after_comments"                   => "After other comments",
    "timezone"                         => "Timezone used to display dates and times",
    "local"                            => "Same as the server",
+   "quicksearch_fulltext"             => "Include comments when performing quick searches (slower)",
                    } 
 %]