[LON-CAPA-cvs] cvs: loncom /interface lonsearchcat.pm
matthew
lon-capa-cvs@mail.lon-capa.org
Mon, 16 Jun 2003 19:18:00 -0000
matthew Mon Jun 16 15:18:00 2003 EDT
Modified files:
/loncom/interface lonsearchcat.pm
Log:
Minor cleanups and an attempt at addressing 1503 by updating the
status line prior to doing network calls.
Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.177 loncom/interface/lonsearchcat.pm:1.178
--- loncom/interface/lonsearchcat.pm:1.177 Fri Jun 13 20:15:01 2003
+++ loncom/interface/lonsearchcat.pm Mon Jun 16 15:18:00 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Search Catalog
#
-# $Id: lonsearchcat.pm,v 1.177 2003/06/14 00:15:01 albertel Exp $
+# $Id: lonsearchcat.pm,v 1.178 2003/06/16 19:18:00 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1498,13 +1498,13 @@
}
# Build SQL query string based on form page
my $query='';
- my $concatarg=join('," ",',
+ my $concatarg=join(',',
('title', 'author', 'subject', 'notes', 'abstract',
'keywords'));
$concatarg='title' if $ENV{'form.titleonly'};
- $query=&build_SQL_query('concat('.$concatarg.')',$search_string);
+ $query=&build_SQL_query('concat_ws(" ",'.$concatarg.')',$search_string);
$pretty_search_string .= "<br />\n";
- return 'select * from metadata where '.$query,$pretty_search_string;
+ return 'SELECT * FROM metadata WHERE '.$query,$pretty_search_string;
}
@@ -1621,9 +1621,9 @@
my ($key,$value)=($1,$2);
my $replacement='';
if ($key eq 'literal') {
- $replacement="($dkey like \"\%$value\%\")";
- } elsif ($key eq 'not') {
- $value=~s/like/not like/;
+ $replacement="($dkey LIKE \"\%$value\%\")";
+ } elsif (lc($key) eq 'not') {
+ $value=~s/LIKE/NOT LIKE/;
# $replacement="($dkey not like $value)";
$replacement="$value";
} elsif ($key eq 'and') {
@@ -2130,6 +2130,7 @@
my $time_remaining = $max_time - (time - $starttime) ;
my $last_time = $time_remaining;
&update_seconds($r,$time_remaining);
+ &update_status($r,'contacting '.$Servers_to_contact[0]);
while (($time_remaining > 0) &&
((@Servers_to_contact) || keys(%Server_status))) {
# Send out a search request if it needs to be done.