--- loncom/interface/lonsearchcat.pm 2002/06/25 15:08:59 1.129
+++ loncom/interface/lonsearchcat.pm 2002/07/08 14:52:19 1.138
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Search Catalog
#
-# $Id: lonsearchcat.pm,v 1.129 2002/06/25 15:08:59 matthew Exp $
+# $Id: lonsearchcat.pm,v 1.138 2002/07/08 14:52:19 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -107,7 +107,7 @@ button that closes the search window
=item $importbutton
-button to take the selecte results and go to group sorting
+button to take the select results and go to group sorting
=item %hash
@@ -212,25 +212,36 @@ END
onClick='javascript:select_group()'>
END
}
- $hidden .= <
-
-
-
-END
+ $hidden .= &make_persistent({ "form.mode" => $ENV{'form.mode'},
+ "form.form" => $ENV{'form.form'},
+ "form.element" => $ENV{'form.element'},
+ "form.date" => 2 });
##
## What are we doing?
##
- if ($ENV{'form.basicsubmit'} eq 'SEARCH') {
- # Perform basic search and give results
- return &basicsearch($r,\%ENV,$hidden);
- } elsif ($ENV{'form.advancedsubmit'} eq 'SEARCH') {
- # Perform advanced search and give results
- return &advancedsearch($r,\%ENV,$hidden);
+ my $searchtype;
+ $searchtype = 'Basic' if ($ENV{'form.basicsubmit'} eq 'SEARCH');
+ $searchtype = 'Advanced' if ($ENV{'form.advancedsubmit'} eq 'SEARCH');
+ if ($searchtype) {
+ my ($query,$customquery,$customshow,$libraries) =
+ (undef,undef,undef,undef);
+ if ($searchtype eq 'Basic') {
+ $query = &parse_basic_search($r);
+ } elsif ($ENV{'form.advancedsubmit'} eq 'SEARCH') {
+ ($query,$customquery,$customshow,$libraries)
+ = &parse_advanced_search($r);
+ return OK if (! defined($query));
+ }
+ # Send query statements over the network to be processed by
+ # either the SQL database or a recursive scheme of 'grep'-like
+ # actions (for custom metadata).
+ $r->rflush();
+ my $reply=&Apache::lonnet::metadata_query($query,$customquery,
+ $customshow,$libraries);
+ &output_results($searchtype,$r,$reply,$hidden);
} elsif ($ENV{'form.reqinterface'} eq 'advanced') {
# Output the advanced interface
$r->print(&advanced_search_form($closebutton,$hidden));
- return OK;
} else {
# Output normal search interface
$r->print(&basic_search_form($closebutton,$hidden));
@@ -273,7 +284,7 @@ sub basic_search_form{
$hidden
Basic Search
-Enter terms or quoted phrases separated by AND, OR, or NOT
+Enter terms or phrases separated by AND, OR, or NOT
then press SEARCH below.
@@ -290,15 +301,14 @@ ENDDOCUMENT
$closebutton
-
-
@@ -328,15 +338,6 @@ sub advanced_search_form{
$closebutton
-
-
-
-
-
-
-
-
END
@@ -356,28 +357,31 @@ END
Advanced Catalog Search
-Enter terms or quoted phrases separated by search operators
+Enter terms or phrases separated by search operators
such as AND, OR, or NOT.
+