--- loncom/interface/lonsearchcat.pm 2003/06/17 15:53:56 1.181 +++ loncom/interface/lonsearchcat.pm 2003/09/22 00:48:32 1.186 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.181 2003/06/17 15:53:56 matthew Exp $ +# $Id: lonsearchcat.pm,v 1.186 2003/09/22 00:48:32 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -82,6 +82,7 @@ use Text::Query; use GDBM_File; use Apache::loncommon(); use Apache::lonmysql(); +use Apache::lonlocal; # ---------------------------------------- variables used throughout the module @@ -186,7 +187,7 @@ sub handler { # This button is different for the RAT compared to # normal invocation. # - $r->content_type('text/html'); + &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; return OK if $r->header_only; ## @@ -557,7 +558,7 @@ ENDDOCUMENT ' '; my $relatedcheckbox = &simplecheckbox('related',$ENV{'form.related'}); my $domain = $r->dir_config('lonDefDomain'); - my $domaincheckbox = &simplecheckbox('domains',$domain,'checked'); + my $domaincheckbox = &simplecheckbox('domains',$domain); $scrout.=<'. @@ -1529,7 +1538,9 @@ sub parse_basic_search { $pretty_search_string .= ' '.$pretty_domains_string; } $pretty_search_string .= "
\n"; - return ('SELECT * FROM metadata WHERE '.$query,$pretty_search_string, + my $final_query = 'SELECT * FROM metadata WHERE '.$query; +# &Apache::lonnet::logthis($final_query); + return ($final_query,$pretty_search_string, $libraries_to_query); } @@ -2163,22 +2174,23 @@ END if (@Servers_to_contact) { # Contact one server my $server = shift(@Servers_to_contact); + &update_status($r,'contacting '.$server); my $reply=&Apache::lonnet::metadata_query($query,$customquery, $customshow,[$server]); ($server) = keys(%$reply); $Server_status{$server} = $reply->{$server}; - &update_status($r,'contacting '.$server); } else { # wait a sec. to give time for files to be written # This sleep statement is here instead of outside the else # block because we do not want to pause if we have servers # left to contact. + if (scalar (keys(%Server_status))) { + &update_status($r, + 'waiting on '.(join(' ',keys(%Server_status)))); + } sleep(1); } # - if (scalar (keys(%Server_status))) { - &update_status($r,'waiting on '.(join(' ',keys(%Server_status)))); - } # # Loop through the servers we have contacted but do not # have results from yet, looking for results. @@ -2731,10 +2743,19 @@ SCRIPT $result.=<