[Rt-commit] r2632 - in rtfm/branches/2.1-TESTING/html/RTFM: Article Elements

tla at bestpractical.com tla at bestpractical.com
Fri Apr 15 16:52:53 EDT 2005


Author: tla
Date: Fri Apr 15 16:52:52 2005
New Revision: 2632

Modified:
   rtfm/branches/2.1-TESTING/html/RTFM/Article/Search.html
   rtfm/branches/2.1-TESTING/html/RTFM/Elements/GotoArticle
Log:
GotoArticle now searches on name, id, and summary.  The search on "any custom
field" has been manually verified to work.


Modified: rtfm/branches/2.1-TESTING/html/RTFM/Article/Search.html
==============================================================================
--- rtfm/branches/2.1-TESTING/html/RTFM/Article/Search.html	(original)
+++ rtfm/branches/2.1-TESTING/html/RTFM/Article/Search.html	Fri Apr 15 16:52:52 2005
@@ -30,6 +30,28 @@
 my @results;
 my $articles = RT::FM::ArticleCollection->new( $session{'CurrentUser'} );
 
+# {{{ Quicksearch logic
+
+# If it is a number, load the article with that ID.  Otherwise, search
+# on name and summary.
+if ($ARGS{'q'} =~ /^(\d+)$/) {
+    $m->comp("/RTFM/Article/Display.html", id => $1);
+    return;
+} elsif ($ARGS{'q'}) {
+    $articles->Limit( FIELD => 'Name',
+		      SUBCLAUSE => 'NameOrSummary',
+		      OPERATOR => 'LIKE',
+		      ENTRYAGGREGATOR => 'OR',
+		      VALUE => $ARGS{'q'} );
+    $articles->Limit( FIELD => 'Summary',
+		      SUBCLAUSE => 'NameOrSummary',
+		      OPERATOR => 'LIKE',
+		      ENTRYAGGREGATOR => 'OR',
+		      VALUE => $ARGS{'q'} );
+}
+
+# }}}
+
 # {{{ Saved search logic
 
 my $search;

Modified: rtfm/branches/2.1-TESTING/html/RTFM/Elements/GotoArticle
==============================================================================
--- rtfm/branches/2.1-TESTING/html/RTFM/Elements/GotoArticle	(original)
+++ rtfm/branches/2.1-TESTING/html/RTFM/Elements/GotoArticle	Fri Apr 15 16:52:52 2005
@@ -18,7 +18,7 @@
 
 <FORM ACTION="<%$RT::WebPath%>/RTFM/Article/Search.html">
 <input type="hidden" name="HideOptions" value="1">
-<input size="12" name="Summary~" accesskey="0">
+<input size="12" name="q" accesskey="0">
 % if ($class or $topic) {
 <input type="hidden" name="ExpandTopics" value="1">
 <select name="Topics">


More information about the Rt-commit mailing list