version 1.256, 2006/03/15 20:56:16
|
version 1.257, 2006/03/19 21:54:41
|
Line 116 sub handler {
|
Line 116 sub handler {
|
my $diropendb; # The full path to the (temporary) search database file. |
my $diropendb; # The full path to the (temporary) search database file. |
# This is set and used in &handler() and is also used in |
# This is set and used in &handler() and is also used in |
# &output_results(). |
# &output_results(). |
my $bodytag; # LON-CAPA standard body tag, gotten from |
|
# &Apache::lonnet::bodytag. |
|
# No title, no table, just a <body> tag. |
|
|
|
my $loaderror=&Apache::lonnet::overloaderror($r); |
my $loaderror=&Apache::lonnet::overloaderror($r); |
if ($loaderror) { return $loaderror; } |
if ($loaderror) { return $loaderror; } |
Line 165 sub handler {
|
Line 162 sub handler {
|
($env{'form.launch'} eq '1')) { |
($env{'form.launch'} eq '1')) { |
$env{'form.persistent_db_id'} = time; |
$env{'form.persistent_db_id'} = time; |
} |
} |
$bodytag=&Apache::loncommon::bodytag(undef,undef,undef,1); |
|
my $persistent_db_file = "/home/httpd/perl/tmp/". |
my $persistent_db_file = "/home/httpd/perl/tmp/". |
&Apache::lonnet::escape($domain). |
&Apache::lonnet::escape($domain). |
'_'.&Apache::lonnet::escape($env{'user.name'}). |
'_'.&Apache::lonnet::escape($env{'user.name'}). |
Line 2065 a link to change the search query.
|
Line 2062 a link to change the search query.
|
###################################################################### |
###################################################################### |
sub print_sort_form { |
sub print_sort_form { |
my ($r,$pretty_query_string) = @_; |
my ($r,$pretty_query_string) = @_; |
my $bodytag=&Apache::loncommon::bodytag(undef,undef,undef,1). |
|
&Apache::lonhtmlcommon::breadcrumbs |
|
(undef,'Searching','Searching',undef,undef, |
|
$env{'form.catalogmode'} ne 'groupsearch'); |
|
|
|
## |
## |
my %SortableFields=&Apache::lonlocal::texthash( |
my %SortableFields=&Apache::lonlocal::texthash( |
Line 2101 sub print_sort_form {
|
Line 2094 sub print_sort_form {
|
&Apache::lonnet::logthis(&Apache::lonmysql::get_error()); |
&Apache::lonnet::logthis(&Apache::lonmysql::get_error()); |
return; |
return; |
} |
} |
my $result; |
my $js =<<END; |
my $html = &Apache::lonxml::xmlbegin(); |
<script type="text/javascript"> |
my $head = &Apache::lonxml::headtag('Results'); |
|
my $end_head = &Apache::loncommon::endheadtag(); |
|
$result.=<<END; |
|
$html |
|
$head |
|
<script> |
|
function change_sort() { |
function change_sort() { |
var newloc = "/adm/searchcat?phase=results"; |
var newloc = "/adm/searchcat?phase=results"; |
newloc += "&persistent_db_id=$env{'form.persistent_db_id'}"; |
newloc += "&persistent_db_id=$env{'form.persistent_db_id'}"; |
Line 2117 $head
|
Line 2104 $head
|
parent.resultsframe.location= newloc; |
parent.resultsframe.location= newloc; |
} |
} |
</script> |
</script> |
$end_head |
END |
$bodytag |
|
<form name="statusform" action="" method="post"> |
my $head = &Apache::loncommon::start_page('Results',$js, |
|
{'only_body' => 1}); |
|
my $breadcrumbs= |
|
&Apache::lonhtmlcommon::breadcrumbs |
|
(undef,'Searching','Searching',undef,undef, |
|
$env{'form.catalogmode'} ne 'groupsearch'); |
|
|
|
my $result = <<END; |
|
$start_page |
|
$breadcrumbs |
|
<form name="statusform" action="" method="POST"> |
<input type="hidden" name="Queue" value="" /> |
<input type="hidden" name="Queue" value="" /> |
END |
END |
|
|
Line 2335 results into MySQL.
|
Line 2332 results into MySQL.
|
###################################################################### |
###################################################################### |
sub run_search { |
sub run_search { |
my ($r,$query,$customquery,$customshow,$serverlist,$pretty_string) = @_; |
my ($r,$query,$customquery,$customshow,$serverlist,$pretty_string) = @_; |
my $bodytag=&Apache::loncommon::bodytag(undef,undef,undef,1); |
|
$bodytag.=&Apache::lonhtmlcommon::breadcrumbs |
|
(undef,'Searching','Searching',undef,undef, |
|
$env{'form.catalogmode'} ne 'groupsearch'); |
|
my $connection = $r->connection; |
my $connection = $r->connection; |
# |
# |
# Print run_search header |
# Print run_search header |
# |
# |
my $html = &Apache::lonxml::xmlbegin(); |
my $head = &Apache::loncommon::start_page('Search Status',undef, |
my $head = &Apache::loncommon::head('Search Status'); |
{'only_body' => 1}); |
|
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs |
|
(undef,'Searching','Searching',undef,undef, |
|
$env{'form.catalogmode'} ne 'groupsearch'); |
$r->print(<<END); |
$r->print(<<END); |
$html |
$start_page |
$head |
$breadcrumbs |
$bodytag |
|
<form name="statusform" action="" method="post"> |
<form name="statusform" action="" method="post"> |
<input type="hidden" name="Queue" value="" /> |
<input type="hidden" name="Queue" value="" /> |
END |
END |
Line 2998 the name of the input field to put the t
|
Line 2994 the name of the input field to put the t
|
###################################################################### |
###################################################################### |
sub search_results_header { |
sub search_results_header { |
my ($importbutton,$closebutton) = @_; |
my ($importbutton,$closebutton) = @_; |
my $result = |
|
&Apache::lonxml::xmlbegin(). |
|
&Apache::loncommon::headtag(); |
|
|
|
|
my $js; |
# output beginning of search page |
# output beginning of search page |
# conditional output of script functions dependent on the mode in |
# conditional output of script functions dependent on the mode in |
# which the search was invoked |
# which the search was invoked |
if ($env{'form.catalogmode'} eq 'interactive'){ |
if ($env{'form.catalogmode'} eq 'interactive'){ |
if (! exists($env{'form.mode'}) || $env{'form.mode'} ne 'edit') { |
if (! exists($env{'form.mode'}) || $env{'form.mode'} ne 'edit') { |
$result.=<<SCRIPT; |
$js.=<<SCRIPT; |
<script type="text/javascript"> |
<script type="text/javascript"> |
function select_data(title,url) { |
function select_data(title,url) { |
changeTitle(title); |
changeTitle(title); |
Line 3046 function changeTitle(val) {
|
Line 3040 function changeTitle(val) {
|
END |
END |
} |
} |
|
|
$result.=<<SCRIPT; |
$js.=<<SCRIPT; |
<script type="text/javascript"> |
<script type="text/javascript"> |
function select_data(title,url) { |
function select_data(title,url) { |
changeURL(url); |
changeURL(url); |
Line 3066 function changeURL(val) {
|
Line 3060 function changeURL(val) {
|
SCRIPT |
SCRIPT |
} |
} |
} |
} |
$result.=<<SCRIPT if $env{'form.catalogmode'} eq 'groupsearch'; |
$js.=<<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.length != "undefined" && |
if (document.forms.results.returnvalues.length != "undefined" && |
Line 3092 SCRIPT
|
Line 3086 SCRIPT
|
</script> |
</script> |
SCRIPT |
SCRIPT |
|
|
my $end_head = &Apache::loncommon::endheadtag(); |
my $start_page = &Apache::loncommon::start_page(undef,$js, |
my $bodytag = &Apache::loncommon::bodytag(undef,undef,undef,1); |
{'only_body' =>1}); |
$result.=<<END; |
$result.=<<END; |
$end_head |
$start_page |
$bodytag |
|
<form name="results" method="post" action="/adm/searchcat" > |
<form name="results" method="post" action="/adm/searchcat" > |
<input type="hidden" name="Queue" value="" /> |
<input type="hidden" name="Queue" value="" /> |
$importbutton |
$importbutton |
Line 3107 END
|
Line 3100 END
|
###################################################################### |
###################################################################### |
###################################################################### |
###################################################################### |
sub search_status_header { |
sub search_status_header { |
my $bodytag = &Apache::loncommon::bodytag(undef,undef,undef,1); |
my $start_page = &Apache::loncommon::start_page('Search Status',undef, |
my $html = &Apache::lonxml::xmlbegin(); |
{'only_body' => 1}); |
my $head = &Apache::loncommon::head('Search Status'); |
|
return <<ENDSTATUS; |
return <<ENDSTATUS; |
$html |
$start_page |
$head |
|
$bodytag |
|
<h3>Search Status</h3> |
<h3>Search Status</h3> |
Sending search request to LON-CAPA servers.<br /> |
Sending search request to LON-CAPA servers.<br /> |
ENDSTATUS |
ENDSTATUS |
Line 3621 $parms is extra information to include i
|
Line 3611 $parms is extra information to include i
|
###################################################################### |
###################################################################### |
sub output_blank_field_error { |
sub output_blank_field_error { |
my ($r,$closebutton,$parms,$hidden_fields)=@_; |
my ($r,$closebutton,$parms,$hidden_fields)=@_; |
my $bodytag=&Apache::loncommon::bodytag('Search'); |
|
my $errormsg = &mt('You did not fill in enough information for the search to be started. You need to fill in relevant fields on the search page in order for a query to be processed.'); |
my $errormsg = &mt('You did not fill in enough information for the search to be started. You need to fill in relevant fields on the search page in order for a query to be processed.'); |
my $revise = &mt('Revise Search Request'); |
my $revise = &mt('Revise Search Request'); |
my $heading = &mt('Unactionable Search Queary'); |
my $heading = &mt('Unactionable Search Queary'); |