version 1.82, 2001/03/27 13:25:41
|
version 1.86, 2001/03/27 19:57:53
|
Line 560 sub advancedsearch {
|
Line 560 sub advancedsearch {
|
$customquery=&build_custommetadata_query('custommetadata', |
$customquery=&build_custommetadata_query('custommetadata', |
$ENV{'form.custommetadata'}); |
$ENV{'form.custommetadata'}); |
} |
} |
|
my $customshow=''; |
|
if ($ENV{'form.customshow'}) { |
|
$customshow=$ENV{'form.customshow'}; |
|
$customshow=~s/[^\w\s]//g; |
|
my @fields=split(/\s+/,$customshow); |
|
$customshow=join(" ",@fields); |
|
} |
if (@queries) { |
if (@queries) { |
$query=join(" AND ",@queries); |
$query=join(" AND ",@queries); |
$query="select * from metadata where $query"; |
$query="select * from metadata where $query"; |
my $reply=''; |
my $reply=''; |
unless ($customquery) { |
unless ($customquery or $customshow) { |
$reply=&Apache::lonnet::metadata_query($query); |
$reply=&Apache::lonnet::metadata_query($query); |
} |
} |
else { |
else { |
$reply=&Apache::lonnet::metadata_query($query,$customquery); |
$reply=&Apache::lonnet::metadata_query($query, |
|
$customquery,$customshow); |
} |
} |
&output_results('Advanced',$r,$envhash,$customquery,$reply); |
&output_results('Advanced',$r,$envhash,$customquery,$reply); |
} |
} |
else { |
elsif ($customquery) { |
&output_results('Advanced',$r,$envhash,$query); |
my $reply=''; |
|
$reply=&Apache::lonnet::metadata_query('', |
|
$customquery,$customshow); |
|
&output_results('Advanced',$r,$envhash,$customquery,$reply); |
} |
} |
|
$r->print('system error'); # just in case.. hrrmm.. |
return OK; |
return OK; |
} |
} |
|
|
Line 696 sub output_results {
|
Line 708 sub output_results {
|
foreach my $result (@results) { |
foreach my $result (@results) { |
next if $result=~/^custom\=/; |
next if $result=~/^custom\=/; |
chomp $result; |
chomp $result; |
|
next unless $result; |
my @fields=map |
my @fields=map |
{&Apache::lonnet::unescape($_)} |
{&Apache::lonnet::unescape($_)} |
(split(/\,/,$result)); |
(split(/\,/,$result)); |