--- loncom/interface/lonpickcourse.pm 2005/04/07 06:56:23 1.27
+++ loncom/interface/lonpickcourse.pm 2005/10/03 23:53:25 1.30
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Pick a course
#
-# $Id: lonpickcourse.pm,v 1.27 2005/04/07 06:56:23 albertel Exp $
+# $Id: lonpickcourse.pm,v 1.30 2005/10/03 23:53:25 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -54,7 +54,8 @@ ENDDOCUMENT
($ENV{'QUERY_STRING'},['domainfilter','descriptfilter',
'sincefilter','form','cnumelement',
'cdomelement','cnameelement','roleelement',
- 'pickedcourse','instcodefilter','ownerfilter']);
+ 'pickedcourse','instcodefilter',
+ 'ownerfilter','coursefilter']);
# domain filter and selection
my $domainfilter=$env{'form.domainfilter'};
$domainfilter=~s/\W//g;
@@ -73,6 +74,18 @@ ENDDOCUMENT
my $ownerfilter=$env{'form.ownerfilter'};
unless ($ownerfilter) { $ownerfilter=''; }
my $listowner=&HTML::Entities::encode($ownerfilter,'<>&"');
+# course ID filter for DCs only
+ my ($courseidtag,$coursefilter);
+ if ($env{'user.adv'} && $domainfilter && exists($env{'user.role.dc./'.
+ $domainfilter.'/'})) {
+ $coursefilter=$env{'form.coursefilter'};
+ unless ($coursefilter) { $coursefilter=''; }
+ my $listcourseid=&HTML::Entities::encode($coursefilter,'<>&"');
+ $courseidtag = &mt('LON-CAPA course ID');
+ $courseidtag .= qq|
+
+ |;
+ }
# last course activity filter and selection
my $sincefilter=$env{'form.sincefilter'};
$sincefilter=~s/[^\d-]//g;
@@ -102,7 +115,18 @@ ENDDOCUMENT
$seclist = join('","',@sections);
}
}
- $r->print(&Apache::loncommon::bodytag("Selecting a Course",undef,$loaditem));
+# if called from rolefilter, setup for multiple course selections.
+ my $multflag = 0;
+ my $jscript;
+ my $title = 'Selecting a course';
+ if ($env{'form.form'} eq 'rolefilter') {
+ $multflag = 1;
+ $title = 'Selecting course(s)';
+ }
+ if ($multflag) {
+ $jscript = &Apache::loncommon::check_uncheck_jscript();
+ }
+ $r->print(&Apache::loncommon::bodytag($title,undef,$loaditem,undef,undef,undef,undef,1));
my %lt=&Apache::lonlocal::texthash(
'cac' => 'Course Activity',
'cde' => 'Course Description',
@@ -131,18 +155,43 @@ ENDDOCUMENT
}
$r->print(<
-function gochoose(cname,cdom,cdesc) {
- $name_code
+function gochoose(cname,cdom,cdesc,multflag,caller) {
var openerForm = "$env{'form.form'}";
- opener.document.$env{'form.form'}.$env{'form.cnumelement'}.value=cname;
- if (openerForm == 'cu' || openerForm == 'rolechoice') {
- opener.document.$env{'form.form'}.$env{'form.cdomelement'}.value=cdom;
+ courseCount = 0;
+ var courses = '';
+ if (multflag) {
+ for (var j=0; j 0) {
+ courses = courses.substr(0,courses.length-2);
+ opener.document.$env{'form.form'}.courselist.value = courses
+ }
}
else {
- var slct=opener.document.$env{'form.form'}.$env{'form.cdomelement'};
- var i;
- for (i=0;i
$submitopener
-