--- loncom/interface/lonpickcourse.pm 2003/03/26 00:26:16 1.1
+++ loncom/interface/lonpickcourse.pm 2003/03/28 01:53:55 1.7
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Pick a course
#
-# $Id: lonpickcourse.pm,v 1.1 2003/03/26 00:26:16 www Exp $
+# $Id: lonpickcourse.pm,v 1.7 2003/03/28 01:53:55 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -47,21 +47,33 @@ sub handler {
The LearningOnline Network with CAPA
ENDDOCUMENT
-
-# Is this even in a course?
-
+# Get parameters from query string
&Apache::loncommon::get_unprocessed_cgi
($ENV{'QUERY_STRING'},['domainfilter','descriptfilter',
'sincefilter','form','cnumelement','cdomelement']);
+# domain filter and selection
my $domainfilter=$ENV{'form.domainfilter'};
$domainfilter=~s/\W//g;
- unless ($domainfilter) { $domainfilter='.'; }
+ unless ($domainfilter) { $domainfilter=''; }
+ my $domainselectform=&Apache::loncommon::select_dom_form($domainfilter,
+ 'domainfilter',1);
+# description filter
my $descriptfilter=$ENV{'form.descriptfilter'};
- $descriptfilter=~s/\W//g;
- unless ($descriptfilter) { $descriptfilter='.'; }
+ $descriptfilter=~s/[^\w\s]//g;
+ unless ($descriptfilter) { $descriptfilter=''; }
+
+# last course activity filter and selection
my $sincefilter=$ENV{'form.sincefilter'};
- $sincefilter=~s/\D//g;
- unless ($sincefilter) { $sincefilter=0; }
+ $sincefilter=~s/[^\d-]//g;
+ unless ($sincefilter) { $sincefilter=-1; }
+ my $sincefilterform=&Apache::loncommon::select_form($sincefilter,
+ 'sincefilter',('-1'=>'',
+ '86400' => 'today',
+ '604800' => 'last week',
+ '2592000' => 'last month',
+ '7776000' => 'last three months',
+ '15552000' => 'last six months',
+ '31104000' => 'last year'));
$r->print(&Apache::loncommon::bodytag("Selecting a Course"));
$r->print(<
+
+
ENDSCRIPT
-
+# ---------------------------------------------------------------- Get the data
+ if ($ENV{'form.gosearch'}) {
+ $r->print('Searching ...
');
+ $r->rflush();
+ unless ($descriptfilter) { $descriptfilter='.'; }
+ my $timefilter=($sincefilter==-1?1:time-$sincefilter);
+ my %courses=
+ &Apache::lonnet::courseiddump
+ ($domainfilter,$descriptfilter,$timefilter);
+ $r->print('');
+ }
$r->print('