--- loncom/interface/lonsearchcat.pm 2002/09/16 12:52:33 1.156
+++ loncom/interface/lonsearchcat.pm 2002/11/03 19:03:29 1.160
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Search Catalog
#
-# $Id: lonsearchcat.pm,v 1.156 2002/09/16 12:52:33 matthew Exp $
+# $Id: lonsearchcat.pm,v 1.160 2002/11/03 19:03:29 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -171,6 +171,10 @@ string that holds portions of the screen
sub handler {
my $r = shift;
#
+
+ my $loaderror=&Apache::lonnet::overloaderror($r);
+ if ($loaderror) { return $loaderror; }
+
my $closebutton; # button that closes the search window
# This button is different for the RAT compared to
# normal invocation.
@@ -187,7 +191,8 @@ sub handler {
##
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
['catalogmode','launch','acts','mode','form','element','pause',
- 'phase','persistent_db_id','table','start','show']);
+ 'phase','persistent_db_id','table','start','show',
+ 'cleargroupsort']);
##
## The following is a trick - we wait a few seconds if asked to so
## the daemon running the search can get ahead of the daemon
@@ -238,11 +243,13 @@ 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')) {
+ if (($ENV{'form.cleargroupsort'} eq '1') ||
+ (($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;
+ delete($ENV{'form.cleargroupsort'});
} else {
# This is a stupid error to give to the user.
# It really tells them nothing.
@@ -432,7 +439,9 @@ ENDDOCUMENT
' ';
my $checkbox = &simplecheckbox('related',$ENV{'form.related'});
$scrout.=<Advanced Search
+Advanced Search
$checkbox use related words
\n";
- my $prefix=&catalogmode_output($Fields{'title'},$Fields{'url'});
+ my $prefix=&catalogmode_output($Fields{'title'},$Fields{'url'},
+ $Fields{'id'},$checkbox_num++);
# Render the result into html
$output.= &$viewfunction($prefix,%Fields);
# Print them out as they come in.
@@ -2249,22 +2271,18 @@ sub display_results {
=pod
-=item &catalogmode_output($title,$url)
+=item &catalogmode_output($title,$url,$fnum,$checkbox_num)
Returns html needed for the various catalog modes. Gets inputs from
-$ENV{'form.catalogmode'}. Stores data in %groupsearch_db and $fnum
-(local variable).
+$ENV{'form.catalogmode'}. Stores data in %groupsearch_db.
=cut
######################################################################
######################################################################
-{
-my $fnum = 0;
-
sub catalogmode_output {
my $output = '';
- my ($title,$url) = @_;
+ my ($title,$url,$fnum,$checkbox_num) = @_;
if ($ENV{'form.catalogmode'} eq 'interactive') {
$title=~ s/\'/\\\'/g;
if ($ENV{'form.catalogmode'} eq 'interactive') {
@@ -2280,15 +2298,12 @@ END
$output.=<