--- loncom/interface/lonsearchcat.pm 2001/03/15 18:52:17 1.21 +++ loncom/interface/lonsearchcat.pm 2001/03/15 19:16:42 1.22 @@ -424,6 +424,10 @@ sub advancedsearch { my ($r,$envhash)=@_; my %ENV=%{$envhash}; + return <<(END); +Advanced searching is not yet implemented. +END + } # --------------------------------------------------- Performing a basic search @@ -431,6 +435,8 @@ sub basicsearch { my ($r,$envhash)=@_; my %ENV=%{$envhash}; + &output_blank_field_error($r) unless length($ENV{'form.basicexp'}); + my $query=$ENV{'form.basicexp'}; $query="select * from metadata where concat(title,\" \",author) like '\%$ENV{'form.basicexp'}\%'"; my $reply=&Apache::lonnet::metadata_query($query); @@ -438,6 +444,50 @@ sub basicsearch { return OK; } +sub output_blank_field_error { + my ($r)=@_; + # make query information persistent to allow for subsequent revision + my $persistent=''; + map { + if (/^form\./ && !/submit/) { + my $name=$_; + my $key=$name; + $name=~s/^form\.//; + $persistent.=< +END + } + } (keys %ENV); + + $r->print(< + +The LearningOnline Network with CAPA +BEGINNING + $r->print(< + + +

Search Catalog

+
+$persistent + + +
+

Helpful Message

+

+Incorrect search query due to blank entry fields. +You need to fill in the relevant +fields on the search page in order for a query to be +processed. +

+ + +RESULTS +} + # ----------------------------- format and output results based on a reply list sub output_results { my ($r,$envhash,@replylist)=@_;