--- loncom/interface/lonsearchcat.pm 2002/08/21 17:18:08 1.154 +++ loncom/interface/lonsearchcat.pm 2002/09/16 12:52:33 1.156 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.154 2002/08/21 17:18:08 www Exp $ +# $Id: lonsearchcat.pm,v 1.156 2002/09/16 12:52:33 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -115,6 +115,11 @@ that produces it. Adding a new view typ adding a line to the definition of this hash and making sure the function takes the proper parameters. +=item $bodytag + +LON-CAPA standard body tag, gotten from &Apache::lonnet::bodytag. +No title, no table, just a tag. + =back =cut @@ -136,6 +141,8 @@ my %Views = ("Detailed Citation View" => "Compact View" => \&compact_view); my %persistent_db; my $hidden_fields; +my $bodytag; + ###################################################################### ###################################################################### @@ -171,6 +178,10 @@ sub handler { $r->content_type('text/html'); $r->send_http_header; return OK if $r->header_only; + ## + ## Prevent caching of the search interface window. Hopefully this means + ## we will get the launch=1 passed in a little more. + &Apache::loncommon::no_cache($r); ## ## Pick up form fields passed in the links. ## @@ -201,6 +212,7 @@ sub handler { ($ENV{'form.launch'} eq '1')) { $ENV{'form.persistent_db_id'} = time; } + $bodytag=&Apache::loncommon::bodytag(undef,undef,undef,1); my $persistent_db_file = "/home/httpd/perl/tmp/". &Apache::lonnet::escape($domain). '_'.&Apache::lonnet::escape($ENV{'user.name'}). @@ -213,7 +225,7 @@ sub handler { $r->print(< LON-CAPA Search Error - +$bodytag We were unable to retrieve data describing your search. This is a serious error and has been logged. Please alert your LON-CAPA administrator. @@ -226,15 +238,16 @@ END ## Clear out old values from groupsearch database ## untie %groupsearch_db if (tied(%groupsearch_db)); - if ($ENV{'form.launch'} eq '1' && - ($ENV{'form.catalogmode'} eq 'groupsearch') && - ($ENV{'form.phase'} eq 'results')) { + if (($ENV{'form.launch'} eq '1') && + ($ENV{'form.catalogmode'} eq 'groupsearch')) { if (tie(%groupsearch_db,'GDBM_File',$diropendb,&GDBM_WRCREAT(),0640)) { &start_fresh_session(); untie %groupsearch_db; } else { - $r->print('Unable to tie hash to db '. - 'file'); + # This is a stupid error to give to the user. + # It really tells them nothing. + $r->print(''.$bodytag. + 'Unable to tie hash to db file'); return OK; } } @@ -329,7 +342,7 @@ END if (! defined(&create_results_table())) { $r->print(<Search Error - +$bodytag Unable to create table in which to store search results. The search has been aborted. @@ -341,7 +354,7 @@ END if (! &make_form_data_persistent($r,$persistent_db_file)) { $r->print(<Search Error - +$bodytag Unable to properly store search information. The search has been aborted. @@ -1667,7 +1680,7 @@ sub print_sort_form { Results - +$bodytag
END @@ -1885,7 +1898,7 @@ sub run_search { $r->print(< Search Status - +$bodytag END @@ -2539,6 +2552,7 @@ SCRIPT SCRIPT $result.=< +$bodytag $importbutton @@ -2551,7 +2565,7 @@ END sub search_status_header { return <Search Status - +$bodytag

Search Status

Sending search request to LON-CAPA servers.
ENDSTATUS @@ -2823,7 +2837,7 @@ sub output_blank_field_error { BEGINNING $r->print(< - +$bodytag

Search Catalog

@@ -2870,7 +2884,7 @@ sub output_date_error { The LearningOnline Network with CAPA - +$bodytag

Search Catalog