version 1.73, 2001/03/22 14:16:21
|
version 1.76, 2001/03/22 14:58:58
|
Line 544 sub advancedsearch {
|
Line 544 sub advancedsearch {
|
elsif ($datequery) { |
elsif ($datequery) { |
push @queries,$datequery; |
push @queries,$datequery; |
} |
} |
my $customquery; |
my $customquery=''; |
if ($ENV{'form.custommetadata'}) { |
if ($ENV{'form.custommetadata'}) { |
$customquery=&build_custommetadata_query('custommetadata', |
$customquery=&build_custommetadata_query('custommetadata', |
$ENV{'form.custommetadata'}); |
$ENV{'form.custommetadata'}); |
Line 552 sub advancedsearch {
|
Line 552 sub advancedsearch {
|
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=&Apache::lonnet::metadata_query($query); |
my $reply=''; |
|
unless ($customquery) { |
|
$reply=&Apache::lonnet::metadata_query($query); |
|
} |
|
else { |
|
$reply=&Apache::lonnet::metadata_query($query,$customquery); |
|
} |
&output_results('Advanced',$r,$envhash,$customquery,$reply); |
&output_results('Advanced',$r,$envhash,$customquery,$reply); |
} |
} |
else { |
else { |
Line 793 sub build_custommetadata_query {
|
Line 799 sub build_custommetadata_query {
|
$q->prepare($logic_statement); |
$q->prepare($logic_statement); |
my $matchexp=${$q}{'-parse'}{'-build'}{'matchstring'}; |
my $matchexp=${$q}{'-parse'}{'-build'}{'matchstring'}; |
# quick fix to change literal into xml tag-matching |
# quick fix to change literal into xml tag-matching |
|
# will eventually have to write a separate builder module |
my $oldmatchexp=$matchexp; |
my $oldmatchexp=$matchexp; |
$matchexp=~s/\(\?[\:\=]([^\)]*)\\\=([^\)]*)\)/\(\?\:\\\<$1\\\>\[\^\\\<\]\*$2\[\^\\\<\]\*\\\<\\\/$1\\\>)/g; |
$matchexp=~s/(\w+)\\\=(\w+)/\\\<$1\\\>\[\^\\\<\]\*$2\[\^\\\<\]\*\\\<\\\/$1\\\>/g; |
return $matchexp; |
return $matchexp; |
} |
} |
|
|