version 1.181, 2003/06/17 15:53:56
|
version 1.186, 2003/09/22 00:48:32
|
Line 82 use Text::Query;
|
Line 82 use Text::Query;
|
use GDBM_File; |
use GDBM_File; |
use Apache::loncommon(); |
use Apache::loncommon(); |
use Apache::lonmysql(); |
use Apache::lonmysql(); |
|
use Apache::lonlocal; |
|
|
# ---------------------------------------- variables used throughout the module |
# ---------------------------------------- variables used throughout the module |
|
|
Line 186 sub handler {
|
Line 187 sub handler {
|
# This button is different for the RAT compared to |
# This button is different for the RAT compared to |
# normal invocation. |
# normal invocation. |
# |
# |
$r->content_type('text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
return OK if $r->header_only; |
return OK if $r->header_only; |
## |
## |
Line 557 ENDDOCUMENT
|
Line 558 ENDDOCUMENT
|
' '; |
' '; |
my $relatedcheckbox = &simplecheckbox('related',$ENV{'form.related'}); |
my $relatedcheckbox = &simplecheckbox('related',$ENV{'form.related'}); |
my $domain = $r->dir_config('lonDefDomain'); |
my $domain = $r->dir_config('lonDefDomain'); |
my $domaincheckbox = &simplecheckbox('domains',$domain,'checked'); |
my $domaincheckbox = &simplecheckbox('domains',$domain); |
$scrout.=<<END; |
$scrout.=<<END; |
</td><td><a |
</td><td><a |
href="/adm/searchcat?phase=disp_adv&catalogmode=$ENV{'form.catalogmode'}&launch=$ENV{'form.launch'}" |
href="/adm/searchcat?phase=disp_adv&catalogmode=$ENV{'form.catalogmode'}&launch=$ENV{'form.launch'}" |
Line 852 sub get_persistent_form_data {
|
Line 853 sub get_persistent_form_data {
|
# Loop through the keys, looking for 'form.' |
# Loop through the keys, looking for 'form.' |
foreach my $name (keys(%persistent_db)) { |
foreach my $name (keys(%persistent_db)) { |
next if ($name !~ /^form./); |
next if ($name !~ /^form./); |
|
# Kludgification begins! |
|
if ($name eq 'form.domains' && |
|
$ENV{'form.searchmode'} eq 'basic' && |
|
$ENV{'form.phase'} ne 'disp_basic') { |
|
next; |
|
} |
|
# End kludge (hopefully) |
next if (exists($ENV{$name})); |
next if (exists($ENV{$name})); |
my @values = map { |
my @values = map { |
&Apache::lonnet::unescape($_); |
&Apache::lonnet::unescape($_); |
Line 1222 sub selectbox {
|
Line 1230 sub selectbox {
|
my ($title,$name,$default,$anyvalue,$anytag,$functionref,@idlist)=@_; |
my ($title,$name,$default,$anyvalue,$anytag,$functionref,@idlist)=@_; |
if (! defined($functionref)) { $functionref = sub { $_[0]}; } |
if (! defined($functionref)) { $functionref = sub { $_[0]}; } |
my $selout=''; |
my $selout=''; |
|
$title=&mt($title); |
if (defined($title)) { |
if (defined($title)) { |
my $uctitle=uc($title); |
my $uctitle=uc($title); |
$selout="\n".'<p><font color="#800000" face="helvetica">'. |
$selout="\n".'<p><font color="#800000" face="helvetica">'. |
Line 1529 sub parse_basic_search {
|
Line 1538 sub parse_basic_search {
|
$pretty_search_string .= ' '.$pretty_domains_string; |
$pretty_search_string .= ' '.$pretty_domains_string; |
} |
} |
$pretty_search_string .= "<br />\n"; |
$pretty_search_string .= "<br />\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); |
$libraries_to_query); |
} |
} |
|
|
Line 2163 END
|
Line 2174 END
|
if (@Servers_to_contact) { |
if (@Servers_to_contact) { |
# Contact one server |
# Contact one server |
my $server = shift(@Servers_to_contact); |
my $server = shift(@Servers_to_contact); |
|
&update_status($r,'contacting '.$server); |
my $reply=&Apache::lonnet::metadata_query($query,$customquery, |
my $reply=&Apache::lonnet::metadata_query($query,$customquery, |
$customshow,[$server]); |
$customshow,[$server]); |
($server) = keys(%$reply); |
($server) = keys(%$reply); |
$Server_status{$server} = $reply->{$server}; |
$Server_status{$server} = $reply->{$server}; |
&update_status($r,'contacting '.$server); |
|
} else { |
} else { |
# wait a sec. to give time for files to be written |
# wait a sec. to give time for files to be written |
# This sleep statement is here instead of outside the else |
# This sleep statement is here instead of outside the else |
# block because we do not want to pause if we have servers |
# block because we do not want to pause if we have servers |
# left to contact. |
# left to contact. |
|
if (scalar (keys(%Server_status))) { |
|
&update_status($r, |
|
'waiting on '.(join(' ',keys(%Server_status)))); |
|
} |
sleep(1); |
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 |
# Loop through the servers we have contacted but do not |
# have results from yet, looking for results. |
# have results from yet, looking for results. |
Line 2731 SCRIPT
|
Line 2743 SCRIPT
|
$result.=<<SCRIPT if $ENV{'form.catalogmode'} eq 'groupsearch'; |
$result.=<<SCRIPT if $ENV{'form.catalogmode'} eq 'groupsearch'; |
<script type="text/javascript"> |
<script type="text/javascript"> |
function queue(checkbox_num,val) { |
function queue(checkbox_num,val) { |
if (document.forms.results.returnvalues[checkbox_num].checked) { |
if (document.forms.results.returnvalues.length != "undefined" && |
parent.statusframe.document.forms.statusform.elements.Queue.value +='1a'+val+'b'; |
typeof(document.forms.results.returnvalues.length) == "number") { |
|
if (document.forms.results.returnvalues[checkbox_num].checked) { |
|
parent.statusframe.document.forms.statusform.elements.Queue.value +='1a'+val+'b'; |
|
} else { |
|
parent.statusframe.document.forms.statusform.elements.Queue.value +='0a'+val+'b'; |
|
} |
} else { |
} else { |
parent.statusframe.document.forms.statusform.elements.Queue.value +='0a'+val+'b'; |
if (document.forms.results.returnvalues.checked) { |
|
parent.statusframe.document.forms.statusform.elements.Queue.value +='1a'+val+'b'; |
|
} else { |
|
parent.statusframe.document.forms.statusform.elements.Queue.value +='0a'+val+'b'; |
|
} |
} |
} |
} |
} |
function select_group() { |
function select_group() { |