--- loncom/interface/lonsearchcat.pm 2001/03/19 16:45:38 1.41 +++ loncom/interface/lonsearchcat.pm 2001/03/20 12:21:56 1.43 @@ -2,6 +2,8 @@ # Search Catalog # # 03/08/2001 Scott Harrison +# Scott Harrison: 03/12/2001, 03/13/2001, 03/14/2001, 03/15/2001, 03/19/2001 +# Scott Harrison: 03/20/2001 # # Functions # @@ -18,14 +20,22 @@ # for a calendar date # selectbox(title,name,value,%HASH=options) : returns HTML formatted string for # a selection box field -# advancedsearch() : +# advancedsearch(server reference, environment reference) : perform a complex +# multi-field logical query # filled(field) : determines whether a given field has been filled -# basicsearch() : -# output_blank_field_error() : outputs a message saying that more fields need -# to be filled in -# output_results() : outputs results from search -# build_SQL_query() : builds a SQL query string from a logical expression -# with AND/OR keywords +# basicsearch(server reference, environment reference) : perform a simple +# single-field logical query +# output_blank_field_error(server reference) : outputs a message saying that +# more fields need to be filled in +# output_results(output mode, +# server reference, +# environment reference, +# reply list reference) : outputs results from search +# build_SQL_query(field name, logic) : builds a SQL query string from a +# logical expression with AND/OR keywords +# recursive_SQL_query_build(field name, reverse notation expression) : +# builds a SQL query string from a reverse notation expression +# logical expression with AND/OR keywords package Apache::lonsearchcat; @@ -464,7 +474,7 @@ sub advancedsearch { $query="select * from metadata where concat(title) like '\%$ENV{'form.title'}\%'"; my $reply=&Apache::lonnet::metadata_query($query); - &output_results($r,$envhash,$reply); + &output_results('Advanced',$r,$envhash,$reply); return OK; } @@ -495,7 +505,7 @@ sub basicsearch { $query="select * from metadata where concat($concatarg) like '\%$ENV{'form.basicexp'}\%'"; my $reply=&Apache::lonnet::metadata_query($query); - &output_results($r,$envhash,$reply); + &output_results('Basic',$r,$envhash,$reply); return OK; } @@ -545,7 +555,7 @@ RESULTS # ----------------------------- format and output results based on a reply list sub output_results { - my ($r,$envhash,@replylist)=@_; + my ($mode,$r,$envhash,@replylist)=@_; my %ENV=%{$envhash}; foreach my $reply (@replylist) { @@ -660,9 +670,20 @@ onClick='self.close();'> $persistent