version 1.34, 2001/03/15 20:11:18
|
version 1.40, 2001/03/15 21:51:21
|
Line 428 sub advancedsearch {
|
Line 428 sub advancedsearch {
|
for my $field ('title','author','subject','keywords','url','version', |
for my $field ('title','author','subject','keywords','url','version', |
'notes','abstract','mime','language','owner', |
'notes','abstract','mime','language','owner', |
'custommetadata') { |
'custommetadata') { |
if (&filled($ENV{'form.basicexp'})) { |
if (&filled($ENV{"form.$field"})) { |
$fillflag++; |
$fillflag++; |
} |
} |
} |
} |
Line 438 sub advancedsearch {
|
Line 438 sub advancedsearch {
|
return OK; |
return OK; |
} |
} |
|
|
$r->print(<<END); |
my $query=''; |
Advanced searching is not yet implemented. |
# my $concatarg=join('," ",', |
END |
# ('title', 'author', 'subject', 'notes', 'abstract')); |
|
|
|
$query="select * from metadata where concat(title) like '\%$ENV{'form.title'}\%'"; |
|
my $reply=&Apache::lonnet::metadata_query($query); |
|
|
|
&output_results($r,$envhash,$reply); |
return OK; |
return OK; |
} |
} |
|
|
Line 465 sub basicsearch {
|
Line 470 sub basicsearch {
|
return OK; |
return OK; |
} |
} |
|
|
my $query=$ENV{'form.basicexp'}; |
my $query=''; |
my $concatarg=join('," ",', |
my $concatarg=join('," ",', |
('title', 'author', 'subject', 'notes', 'abstract')); |
('title', 'author', 'subject', 'notes', 'abstract')); |
|
|
$query="select * from metadata where concat($concatarg) like '\%$ENV{'form.basicexp'}\%'"; |
$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,$concatarg,$reply); |
&output_results($r,$envhash,$reply); |
return OK; |
return OK; |
} |
} |
|
|
Line 521 RESULTS
|
Line 526 RESULTS
|
|
|
# ----------------------------- format and output results based on a reply list |
# ----------------------------- format and output results based on a reply list |
sub output_results { |
sub output_results { |
my ($r,$envhash,$testval,@replylist)=@_; |
my ($r,$envhash,@replylist)=@_; |
my %ENV=%{$envhash}; |
my %ENV=%{$envhash}; |
foreach my $reply (@replylist) { |
foreach my $reply (@replylist) { |
|
|
Line 628 SCRIPT
|
Line 633 SCRIPT
|
<body bgcolor="#ffffff"> |
<body bgcolor="#ffffff"> |
<img align=right src=/adm/lonIcons/lonlogos.gif> |
<img align=right src=/adm/lonIcons/lonlogos.gif> |
<h1>Search Catalog</h1> |
<h1>Search Catalog</h1> |
$testval |
|
<form method="post" action="/adm/searchcat"> |
<form method="post" action="/adm/searchcat"> |
<input type='button' value='Revise search request' |
<input type='button' value='Revise search request' |
onClick='this.form.submit();'> |
onClick='this.form.submit();'> |