version 1.28, 2001/03/15 19:34:37
|
version 1.33, 2001/03/15 19:53:24
|
Line 424 sub advancedsearch {
|
Line 424 sub advancedsearch {
|
my ($r,$envhash)=@_; |
my ($r,$envhash)=@_; |
my %ENV=%{$envhash}; |
my %ENV=%{$envhash}; |
|
|
|
my $fillflag=0; |
|
for my $field ('title','author','subject','keywords','url','version', |
|
'notes','abstract','mime','language','owner', |
|
'custommetadata') { |
|
if (&filled($ENV{'form.basicexp'})) { |
|
$fillflag++; |
|
} |
|
} |
|
|
|
unless ($fillflag) { |
|
&output_blank_field_error($r); |
|
return OK; |
|
} |
|
|
$r->print(<<END); |
$r->print(<<END); |
Advanced searching is not yet implemented. |
Advanced searching is not yet implemented. |
END |
END |
Line 432 END
|
Line 446 END
|
|
|
# ---------------------------------------------------- see if a field is filled |
# ---------------------------------------------------- see if a field is filled |
sub filled { |
sub filled { |
if (/\S/) { |
my ($field)=@_; |
|
if ($field=~/\S/) { |
return 1; |
return 1; |
} |
} |
else { |
else { |
Line 451 sub basicsearch {
|
Line 466 sub basicsearch {
|
} |
} |
|
|
my $query=$ENV{'form.basicexp'}; |
my $query=$ENV{'form.basicexp'}; |
$query="select * from metadata where concat(title,\" \",author) like '\%$ENV{'form.basicexp'}\%'"; |
my $concatarg=join('," ",', |
|
('title', 'author', 'subject', 'notes', 'abstract')); |
|
|
|
$query="select * from metadata where concat($concatarg) like '\%$ENV{'form.basicexp'}\%'"; |
my $reply=&Apache::lonnet::metadata_query($query); |
my $reply=&Apache::lonnet::metadata_query($query); |
&output_results($r,$envhash,$reply); |
&output_results($r,$envhash,$reply); |
return OK; |
return OK; |