version 1.24, 2006/03/23 22:32:10
|
version 1.26, 2006/07/11 02:28:22
|
Line 35 use Apache::lonlocal;
|
Line 35 use Apache::lonlocal;
|
use Apache::londropadd; |
use Apache::londropadd; |
use LONCAPA::Enrollment; |
use LONCAPA::Enrollment; |
use lib '/home/httpd/lib/perl'; |
use lib '/home/httpd/lib/perl'; |
|
use LONCAPA; |
|
|
sub print_course_selection_page { |
sub print_course_selection_page { |
my ($r,$tasklongref) = @_; |
my ($r,$tasklongref) = @_; |
Line 50 sub print_course_selection_page {
|
Line 51 sub print_course_selection_page {
|
); |
); |
|
|
# Determine the courses |
# Determine the courses |
my %courseIDs = &Apache::lonnet::courseiddump($dom,'.',1,'.','.','.'); |
my %courseIDs = &Apache::lonnet::courseiddump($dom,'.',1,'.','.','.',undef,undef,'.'); |
&print_header($r,$tasklongref); |
&print_header($r,$tasklongref); |
$r->print(<<ENDBLOCK); |
$r->print(<<ENDBLOCK); |
<form action="/adm/modifycourse" method="post" name="cmod"> |
<form action="/adm/modifycourse" method="post" name="cmod"> |
Line 101 ENDBLOCK
|
Line 102 ENDBLOCK
|
if ($item =~ m/^($dom)_(\w+)$/) { |
if ($item =~ m/^($dom)_(\w+)$/) { |
$crs = $2; |
$crs = $2; |
if ($courseIDs{$item} =~ /^([^:]*):([^:]*):([^:]*)/) { |
if ($courseIDs{$item} =~ /^([^:]*):([^:]*):([^:]*)/) { |
$description = &Apache::lonnet::unescape($1); |
$description = &unescape($1); |
$owner = &Apache::lonnet::unescape($3); |
$owner = &unescape($3); |
|
if (($owner ne '') && ($owner !~ /^([^:]+):([^:]+)$/)) { |
|
$owner = $owner.':'.$dom; |
|
} |
} elsif ($courseIDs{$item} =~ /^([^:]*):([^:]*)$/) { |
} elsif ($courseIDs{$item} =~ /^([^:]*):([^:]*)$/) { |
$description = &Apache::lonnet::unescape($1); |
$description = &unescape($1); |
} else { |
} else { |
$description = &Apache::lonnet::unescape($courseIDs{$item}); |
$description = &unescape($courseIDs{$item}); |
} |
} |
# Get course owner |
# Get course owner |
if ($owner eq '') { |
if ($owner eq '') { |
Line 116 ENDBLOCK
|
Line 120 ENDBLOCK
|
} |
} |
} |
} |
unless ($owner eq '') { |
unless ($owner eq '') { |
$ownername = &Apache::loncommon::plainname($owner,$dom); |
my ($owneruname,$ownerdom); |
|
if ($owner =~ /^([^:]+):([^:]+)$/) { |
|
$owneruname = $1; |
|
$ownerdom = $2; |
|
} else { |
|
$owneruname = $owner; |
|
$ownerdom = $dom; |
|
} |
|
$ownername = &Apache::loncommon::plainname($owneruname, |
|
$ownerdom); |
} |
} |
$r->print("<option value=\"$crs\">$showcode -- $description ---------- $ownername"); |
$r->print("<option value=\"$crs\">$showcode -- $description ---------- $ownername"); |
} |
} |
Line 165 sub print_course_modification_page {
|
Line 178 sub print_course_modification_page {
|
'noen' => "No end date", |
'noen' => "No end date", |
'ownr' => "Owner", |
'ownr' => "Owner", |
'name' => "Name", |
'name' => "Name", |
'unme' => "Username", |
'unme' => "Username:Domain", |
'stus' => "Status", |
'stus' => "Status", |
'aecs' => "Automated Enrollment Course Settings", |
'aecs' => "Automated Enrollment Course Settings", |
'cose' => "Course settings for LON-CAPA courses that control automated student enrollment based on classlist data available from your institution's student information system fall into two groups: (a) settings that can be modified by a Course Coordinator using the ", |
'cose' => "Course settings for LON-CAPA courses that control automated student enrollment based on classlist data available from your institution's student information system fall into two groups: (a) settings that can be modified by a Course Coordinator using the ", |
Line 213 all settings except course code, course
|
Line 226 all settings except course code, course
|
} elsif ($type eq "sectionums") { |
} elsif ($type eq "sectionums") { |
$enrollvar{$type} = $settings{$item}; |
$enrollvar{$type} = $settings{$item}; |
$enrollvar{$type} =~ s/,/, /g; |
$enrollvar{$type} =~ s/,/, /g; |
} elsif ($type eq "courseowner" || $type eq "authtype" |
} elsif ($type eq "authtype" |
|| $type eq "autharg" || $type eq "coursecode" |
|| $type eq "autharg" || $type eq "coursecode" |
|| $type eq "crosslistings") { |
|| $type eq "crosslistings") { |
$enrollvar{$type} = $settings{$item}; |
$enrollvar{$type} = $settings{$item}; |
|
} elsif ($type eq 'courseowner') { |
|
if ($settings{$item} =~ /^[^:]+:[^:]+$/) { |
|
$enrollvar{$type} = $settings{$item}; |
|
} else { |
|
if ($settings{$item} ne '') { |
|
$enrollvar{$type} = $settings{$item}.':'.$dom; |
|
} |
|
} |
} |
} |
} elsif ($item =~ m/^default_enrollment_(start|end)_date$/) { |
} elsif ($item =~ m/^default_enrollment_(start|end)_date$/) { |
my $type = $1; |
my $type = $1; |
Line 235 all settings except course code, course
|
Line 256 all settings except course code, course
|
my %cc_status = (); |
my %cc_status = (); |
my %pname = (); |
my %pname = (); |
my $active_cc; |
my $active_cc; |
foreach (@coursepersonnel) { |
foreach my $person (@coursepersonnel) { |
my @roleinfo = split/:/,$_; |
my ($role,$user) = split(/:/,$person,2); |
if ( ($roleinfo[0] eq 'cc') && ($roleinfo[2] eq $dom) ) { |
$user =~ s/:$//; |
unless (grep/^$roleinfo[1]$/,@local_ccs) { |
if (($role eq 'cc') && ($user ne '')) { |
$active_cc = &Apache::loncommon::check_user_status($roleinfo[2],$roleinfo[1],$dom,$course,'cc'); |
if (!grep(/^\Q$user\E$/,@local_ccs)) { |
|
my ($ccname,$ccdom) = split(/:/,$user); |
|
$active_cc = |
|
&Apache::loncommon::check_user_status($ccdom,$ccname,$dom, |
|
$course,'cc'); |
if ($active_cc eq 'active') { |
if ($active_cc eq 'active') { |
push @local_ccs, $roleinfo[1]; |
push(@local_ccs,$user); |
$pname{$roleinfo[1]} = &Apache::loncommon::plainname($roleinfo[1],$roleinfo[2]); |
$pname{$user} = &Apache::loncommon::plainname($ccname,$ccdom); |
$cc_status{$roleinfo[1]} = $lt{'actv'}; |
$cc_status{$user} = $lt{'actv'}; |
} |
} |
} |
} |
} |
} |
} |
} |
unless ( (grep/^$enrollvar{'courseowner'}$/,@local_ccs) || ($enrollvar{'courseowner'} eq '') ) { |
if ( (!grep(/^$enrollvar{'courseowner'}$/,@local_ccs)) && |
push @local_ccs, $enrollvar{'courseowner'}; |
($enrollvar{'courseowner'} ne '') ) { |
$pname{$enrollvar{'courseowner'}} = &Apache::loncommon::plainname($enrollvar{'courseowner'},$dom); |
my ($owneruname,$ownerdom) = split(/:/,$enrollvar{'courseowner'}); |
$active_cc = &Apache::loncommon::check_user_status($dom,$enrollvar{'coursecode'},$dom,$course,'cc'); |
push(@local_ccs,$enrollvar{'courseowner'}); |
|
$pname{$enrollvar{'courseowner'}} = |
|
&Apache::loncommon::plainname($owneruname,$ownerdom); |
|
$active_cc = &Apache::loncommon::check_user_status($ownerdom,$owneruname, |
|
$dom,$course,'cc'); |
if ($active_cc eq 'active') { |
if ($active_cc eq 'active') { |
$cc_status{$enrollvar{'courseowner'}} = $lt{'actv'}; |
$cc_status{$enrollvar{'courseowner'}} = $lt{'actv'}; |
} else { |
} else { |
Line 349 all settings except course code, course
|
Line 378 all settings except course code, course
|
my $colflag = $i%2; |
my $colflag = $i%2; |
$ownertable .= "<tr bgcolor=\"$bgcolors[$colflag]\" align=\"left\">"; |
$ownertable .= "<tr bgcolor=\"$bgcolors[$colflag]\" align=\"left\">"; |
if ($local_ccs[$i] eq $enrollvar{'courseowner'}) { |
if ($local_ccs[$i] eq $enrollvar{'courseowner'}) { |
$ownertable .= "<td><input type=\"radio\" name=\"courseowner\" value=\"$local_ccs[$i]\" checked=\"true\"/></td>"; |
$ownertable .= "<td><input type=\"radio\" name=\"courseowner\" value=\"$local_ccs[$i]\" checked=\"checked\" /></td>"; |
} else { |
} else { |
$ownertable .= "<td><input type=\"radio\" name=\"courseowner\" value=\"$local_ccs[$i]\" /></td>"; |
$ownertable .= "<td><input type=\"radio\" name=\"courseowner\" value=\"$local_ccs[$i]\" /></td>"; |
} |
} |
Line 534 sub modify_course {
|
Line 563 sub modify_course {
|
} |
} |
} |
} |
if ($changeowner == 1 || $changecode == 1) { |
if ($changeowner == 1 || $changecode == 1) { |
my $courseid_entry = &Apache::lonnet::escape($dom.'_'.$crs).'='.&Apache::lonnet::escape($description).':'.&Apache::lonnet::escape($env{'form.coursecode'}).':'.&Apache::lonnet::escape($env{'form.courseowner'}); |
my $courseid_entry = &escape($dom.'_'.$crs).'='.&escape($description).':'.&escape($env{'form.coursecode'}).':'.&escape($env{'form.courseowner'}); |
&Apache::lonnet::courseidput($dom,$courseid_entry,&Apache::lonnet::homeserver($crs,$dom)); |
&Apache::lonnet::courseidput($dom,$courseid_entry,&Apache::lonnet::homeserver($crs,$dom)); |
} |
} |
|
|
Line 704 sub print_footer {
|
Line 733 sub print_footer {
|
|
|
sub check_course { |
sub check_course { |
my ($dom,$course) = @_; |
my ($dom,$course) = @_; |
my %courseIDs = &Apache::lonnet::courseiddump($dom,'.',1,'.','.','.'); |
my %courseIDs = &Apache::lonnet::courseiddump($dom,'.',1,'.','.','.',undef,undef,'.'); |
foreach my $key (sort keys %courseIDs) { |
foreach my $key (sort keys %courseIDs) { |
if ($key =~ m/^($dom)_(\w+)$/) { |
if ($key =~ m/^($dom)_(\w+)$/) { |
if ($2 eq $course) { |
if ($2 eq $course) { |
Line 740 sub handler {
|
Line 769 sub handler {
|
'default_enrollment_start_date' => 'Date of first student access', |
'default_enrollment_start_date' => 'Date of first student access', |
'default_enrollment_end_date' => 'Date of last student access', |
'default_enrollment_end_date' => 'Date of last student access', |
'coursecode' => 'Official course code', |
'coursecode' => 'Official course code', |
'courseowner' => "Username of course owner (\@$dom)", |
'courseowner' => "Username:domain of course owner", |
'notifylist' => 'Course Coordinators to be notified of enrollment changes', |
'notifylist' => 'Course Coordinators to be notified of enrollment changes', |
'sectionnums' => 'Course section number(:groupID)', |
'sectionnums' => 'Course section number(:groupID)', |
'crosslistings' => 'Crosslisted class(:groupID)', |
'crosslistings' => 'Crosslisted class(:groupID)', |